<property name="keyring" ref="keyring" />
</bean>
<property name="keyring" ref="keyring" />
</bean>
+ <!-- ADVANCED -->
+ <bean id="runInOsgi" class="org.argeo.slc.client.ui.dist.commands.RunInOsgi"
+ scope="prototype">
+ <property name="repository" ref="javaRepository" />
+ </bean>
+
+
<!-- LEGACY -->
<bean id="org.argeo.slc.client.ui.dist.openGenericJcrQueryEditor"
class="org.argeo.eclipse.ui.jcr.commands.OpenGenericJcrQueryEditor"
<!-- LEGACY -->
<bean id="org.argeo.slc.client.ui.dist.openGenericJcrQueryEditor"
class="org.argeo.eclipse.ui.jcr.commands.OpenGenericJcrQueryEditor"
value="org.argeo.slc.client.ui.dist.genericJcrQueryEditor" />
</bean>
value="org.argeo.slc.client.ui.dist.genericJcrQueryEditor" />
</bean>
- <bean id="runInOSGi" class="org.argeo.slc.client.ui.dist.commands.RunInOsgi"
- scope="prototype">
- <property name="repository" ref="javaRepository" />
- <property name="workspace" value="org.argeo.tp-1.4.x" />
- </bean>
-
<bean id="refreshDistributionsView"
class="org.argeo.slc.client.ui.dist.commands.RefreshDistributionsView"
scope="prototype">
<bean id="refreshDistributionsView"
class="org.argeo.slc.client.ui.dist.commands.RefreshDistributionsView"
scope="prototype">
name="Advanced">
</command>
<command
name="Advanced">
</command>
<command
- id="org.argeo.slc.client.ui.dist.runInOSGi"
+ id="org.argeo.slc.client.ui.dist.runInOsgi"
defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
name="Run in OSGi">
<commandParameter
defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
name="Run in OSGi">
<commandParameter
name="Workspace Name">
</commandParameter>
</command>
name="Workspace Name">
</commandParameter>
</command>
label="Refresh"
tooltip="Force the full refresh of the distribution tree (close all open connections)">
</command>
label="Refresh"
tooltip="Force the full refresh of the distribution tree (close all open connections)">
</command>
commandId="org.argeo.slc.client.ui.dist.runInOSGi"
icon="icons/showSize.gif"
label="Run in OSGi"
tooltip="Run in a spearate OSGi runtime">
</command>
commandId="org.argeo.slc.client.ui.dist.runInOSGi"
icon="icons/showSize.gif"
label="Run in OSGi"
tooltip="Run in a spearate OSGi runtime">
</command>
</menuContribution>
<!-- Anonymous distribution view toolbar -->
<menuContribution
</menuContribution>
<!-- Anonymous distribution view toolbar -->
<menuContribution
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
import org.eclipse.core.commands.AbstractHandler;
import org.eclipse.core.commands.ExecutionEvent;
import org.eclipse.core.commands.ExecutionException;
+import org.eclipse.jface.resource.ImageDescriptor;
import org.osgi.framework.Bundle;
/** <b>UNDER DEVELOPMENT</b>. Download and prepare an OSGi runtime */
public class RunInOsgi extends AbstractHandler implements SlcNames {
private final static Log log = LogFactory.getLog(RunInOsgi.class);
import org.osgi.framework.Bundle;
/** <b>UNDER DEVELOPMENT</b>. Download and prepare an OSGi runtime */
public class RunInOsgi extends AbstractHandler implements SlcNames {
private final static Log log = LogFactory.getLog(RunInOsgi.class);
+ public final static String ID = DistPlugin.ID + ".runInOsgi";
+ public final static String DEFAULT_LABEL = "Run in OSGi";
+ public final static ImageDescriptor DEFAULT_ICON = DistPlugin
+ .getImageDescriptor("icons/runInOsgi.gif");
+
+ public final static String PARAM_WORKSPACE_NAME = "workspaceName";
+
+ /* DEPENDENCY INJECTION */
private Repository repository;
private Repository repository;
- private String workspace;
public Object execute(ExecutionEvent event) throws ExecutionException {
public Object execute(ExecutionEvent event) throws ExecutionException {
+ String workspace = event.getParameter(PARAM_WORKSPACE_NAME);
+
InputStream jarStream = null;
OutputStream out = null;
Writer writer = null;
InputStream jarStream = null;
OutputStream out = null;
Writer writer = null;
public void setRepository(Repository repository) {
this.repository = repository;
}
public void setRepository(Repository repository) {
this.repository = repository;
}
-
- public void setWorkspace(String workspace) {
- this.workspace = workspace;
- }
-
import org.argeo.slc.client.ui.dist.commands.PublishWorkspace;
import org.argeo.slc.client.ui.dist.commands.RefreshDistributionsView;
import org.argeo.slc.client.ui.dist.commands.RegisterRepository;
import org.argeo.slc.client.ui.dist.commands.PublishWorkspace;
import org.argeo.slc.client.ui.dist.commands.RefreshDistributionsView;
import org.argeo.slc.client.ui.dist.commands.RegisterRepository;
+import org.argeo.slc.client.ui.dist.commands.RunInOsgi;
import org.argeo.slc.client.ui.dist.commands.UnregisterRemoteRepo;
import org.argeo.slc.client.ui.dist.controllers.DistTreeComparator;
import org.argeo.slc.client.ui.dist.controllers.DistTreeComparer;
import org.argeo.slc.client.ui.dist.commands.UnregisterRemoteRepo;
import org.argeo.slc.client.ui.dist.controllers.DistTreeComparator;
import org.argeo.slc.client.ui.dist.controllers.DistTreeComparer;
// String targetRepoUri = null;
// Build conditions depending on element type
boolean isDistribElem = false, isRepoElem = false, isDistribGroupElem = false;
// String targetRepoUri = null;
// Build conditions depending on element type
boolean isDistribElem = false, isRepoElem = false, isDistribGroupElem = false;
- boolean isHomeRepo = false, isReadOnly = true;
+ boolean isLocal = false, isReadOnly = true;
isDistribElem = true;
isReadOnly = de.isReadOnly();
workspaceName = de.getWorkspaceName();
isDistribElem = true;
isReadOnly = de.isReadOnly();
workspaceName = de.getWorkspaceName();
} else if (firstElement instanceof RepoElem) {
re = (RepoElem) firstElement;
isRepoElem = true;
} else if (firstElement instanceof RepoElem) {
re = (RepoElem) firstElement;
isRepoElem = true;
- isHomeRepo = re.inHome();
isReadOnly = re.isReadOnly();
} else if (firstElement instanceof WkspGroupElem) {
WkspGroupElem wge = (WkspGroupElem) firstElement;
isReadOnly = re.isReadOnly();
} else if (firstElement instanceof WkspGroupElem) {
WkspGroupElem wge = (WkspGroupElem) firstElement;
UnregisterRemoteRepo.ID,
UnregisterRemoteRepo.DEFAULT_LABEL,
UnregisterRemoteRepo.DEFAULT_ICON, isRepoElem
UnregisterRemoteRepo.ID,
UnregisterRemoteRepo.DEFAULT_LABEL,
UnregisterRemoteRepo.DEFAULT_ICON, isRepoElem
- && !isHomeRepo && singleElement, params);
+ && !isLocal && singleElement, params);
// Fetch repository
params = new HashMap<String, String>();
params.put(Fetch.PARAM_TARGET_REPO_PATH, targetRepoPath);
CommandUtils.refreshParametrizedCommand(menuManager, window,
Fetch.ID, Fetch.DEFAULT_LABEL, Fetch.DEFAULT_ICON,
// Fetch repository
params = new HashMap<String, String>();
params.put(Fetch.PARAM_TARGET_REPO_PATH, targetRepoPath);
CommandUtils.refreshParametrizedCommand(menuManager, window,
Fetch.ID, Fetch.DEFAULT_LABEL, Fetch.DEFAULT_ICON,
- isRepoElem && isHomeRepo && singleElement
+ isRepoElem && isLocal && singleElement
&& !isReadOnly, params);
// Normalize workspace
&& !isReadOnly, params);
// Normalize workspace
NormalizeDistribution.DEFAULT_ICON, isDistribElem
&& singleElement && !isReadOnly, params);
NormalizeDistribution.DEFAULT_ICON, isDistribElem
&& singleElement && !isReadOnly, params);
+ // Run in OSGi
+ params = new HashMap<String, String>();
+ params.put(RunInOsgi.PARAM_WORKSPACE_NAME, workspaceName);
+ CommandUtils.refreshParametrizedCommand(submenu, window,
+ RunInOsgi.ID, RunInOsgi.DEFAULT_LABEL,
+ RunInOsgi.DEFAULT_ICON, isDistribElem && singleElement
+ && isLocal, params);
+
if (submenu.getSize() > 0)
menuManager.add(submenu);
if (submenu.getSize() > 0)
menuManager.add(submenu);