import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.argeo.ArgeoException;
-import org.argeo.ArgeoMonitor;
-import org.argeo.eclipse.ui.EclipseArgeoMonitor;
+import org.argeo.cms.ui.workbench.util.PrivilegedJob;
+import org.argeo.eclipse.ui.EclipseJcrMonitor;
+import org.argeo.jcr.JcrMonitor;
import org.argeo.jcr.JcrUtils;
+import org.argeo.node.security.Keyring;
import org.argeo.slc.SlcConstants;
+import org.argeo.slc.SlcException;
import org.argeo.slc.client.ui.dist.DistPlugin;
-import org.argeo.slc.client.ui.dist.PrivilegedJob;
import org.argeo.slc.client.ui.dist.utils.CommandHelpers;
import org.argeo.slc.repo.RepoUtils;
-import org.argeo.util.security.Keyring;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.swt.widgets.Display;
import org.eclipse.ui.handlers.HandlerUtil;
-/**
- * Create a copy of the chosen workspace in a remote repository.
- */
+/** Create a copy of the chosen workspace in a remote repository */
public class CopyWorkspace extends AbstractHandler {
private static final Log log = LogFactory.getLog(CopyWorkspace.class);
- public final static String ID = DistPlugin.ID + ".copyWorkspace";
+ public final static String ID = DistPlugin.PLUGIN_ID + ".copyWorkspace";
public final static String DEFAULT_LABEL = "Duplicate...";
public final static ImageDescriptor DEFAULT_ICON = DistPlugin
.getImageDescriptor("icons/addItem.gif");
public final static String PARAM_SOURCE_WORKSPACE_NAME = "srcWkspName";
public final static String PARAM_TARGET_REPO_PATH = "targetRepoPath";
-
+
// DEPENDENCY INJECTION
private RepositoryFactory repositoryFactory;
private Keyring keyring;
this.targetWkspName = targetWkspName;
this.display = display;
}
-
+
@Override
protected IStatus doRun(IProgressMonitor progressMonitor) {
long begin = System.currentTimeMillis();
- ArgeoMonitor monitor = new EclipseArgeoMonitor(progressMonitor);
+ JcrMonitor monitor = new EclipseJcrMonitor(progressMonitor);
monitor.beginTask("Copy workspace", -1);
monitor.subTask("Copying nodes");
-
+
Session nodeSession = null;
Session srcSession = null;
Session newSession = null;
monitor.worked(1);
} catch (RepositoryException re) {
- throw new ArgeoException(
+ throw new SlcException(
"Unexpected error while creating the new workspace.",
re);
} finally {
return Status.OK_STATUS;
}
-
}
/* DEPENDENCY INJECTION */