From: Bruno Sinou Date: Wed, 30 Nov 2016 16:01:29 +0000 (+0000) Subject: Adapt RCP bundle to latest conventions X-Git-Tag: argeo-slc-2.1.7~14 X-Git-Url: http://git.argeo.org/?a=commitdiff_plain;h=465645defedd08dcdf1cc066c5bdc2e14dc9da9b;hp=20e621664ea52a1a3720cd488dfc1be7bace0a54;p=gpl%2Fargeo-slc.git Adapt RCP bundle to latest conventions git-svn-id: https://svn.argeo.org/slc/trunk@9341 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc --- diff --git a/legacy/plugins/org.argeo.slc.client.rcp/.classpath b/legacy/plugins/org.argeo.slc.client.rcp/.classpath deleted file mode 100644 index 57ffbb6c8..000000000 --- a/legacy/plugins/org.argeo.slc.client.rcp/.classpath +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - diff --git a/legacy/plugins/org.argeo.slc.client.rcp/.project b/legacy/plugins/org.argeo.slc.client.rcp/.project deleted file mode 100644 index 75fcdba86..000000000 --- a/legacy/plugins/org.argeo.slc.client.rcp/.project +++ /dev/null @@ -1,28 +0,0 @@ - - - org.argeo.slc.client.rcp - - - - - - org.eclipse.jdt.core.javabuilder - - - - - org.eclipse.pde.ManifestBuilder - - - - - org.eclipse.pde.SchemaBuilder - - - - - - org.eclipse.pde.PluginNature - org.eclipse.jdt.core.javanature - - diff --git a/legacy/plugins/org.argeo.slc.client.rcp/.settings/org.eclipse.jdt.core.prefs b/legacy/plugins/org.argeo.slc.client.rcp/.settings/org.eclipse.jdt.core.prefs deleted file mode 100644 index 5eb7b030a..000000000 --- a/legacy/plugins/org.argeo.slc.client.rcp/.settings/org.eclipse.jdt.core.prefs +++ /dev/null @@ -1,8 +0,0 @@ -#Wed Aug 04 16:32:22 CEST 2010 -eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 -org.eclipse.jdt.core.compiler.compliance=1.5 -org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.source=1.5 diff --git a/legacy/plugins/org.argeo.slc.client.rcp/META-INF/spring/commands.xml b/legacy/plugins/org.argeo.slc.client.rcp/META-INF/spring/commands.xml deleted file mode 100644 index 7bd302c86..000000000 --- a/legacy/plugins/org.argeo.slc.client.rcp/META-INF/spring/commands.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - - - - - - - - - - - \ No newline at end of file diff --git a/legacy/plugins/org.argeo.slc.client.rcp/META-INF/spring/osgi.xml b/legacy/plugins/org.argeo.slc.client.rcp/META-INF/spring/osgi.xml deleted file mode 100644 index 55a940f7f..000000000 --- a/legacy/plugins/org.argeo.slc.client.rcp/META-INF/spring/osgi.xml +++ /dev/null @@ -1,18 +0,0 @@ - - - - SLC UI RCP - - - - - - \ No newline at end of file diff --git a/legacy/plugins/org.argeo.slc.client.rcp/build.properties b/legacy/plugins/org.argeo.slc.client.rcp/build.properties deleted file mode 100644 index a971175f5..000000000 --- a/legacy/plugins/org.argeo.slc.client.rcp/build.properties +++ /dev/null @@ -1,8 +0,0 @@ -source.. = src/main/java -output.. = target/classes -bin.includes = plugin.xml,\ - META-INF/,\ - .,\ - icons/,\ - splash.bmp,\ - plugin_customization.ini diff --git a/legacy/plugins/org.argeo.slc.client.rcp/icons/argeo-icon-256.png b/legacy/plugins/org.argeo.slc.client.rcp/icons/argeo-icon-256.png deleted file mode 100644 index a9af08836..000000000 Binary files a/legacy/plugins/org.argeo.slc.client.rcp/icons/argeo-icon-256.png and /dev/null differ diff --git a/legacy/plugins/org.argeo.slc.client.rcp/icons/argeo-trayIcon-256.png b/legacy/plugins/org.argeo.slc.client.rcp/icons/argeo-trayIcon-256.png deleted file mode 100644 index da20cf485..000000000 Binary files a/legacy/plugins/org.argeo.slc.client.rcp/icons/argeo-trayIcon-256.png and /dev/null differ diff --git a/legacy/plugins/org.argeo.slc.client.rcp/plugin.xml b/legacy/plugins/org.argeo.slc.client.rcp/plugin.xml deleted file mode 100644 index 73bfa838e..000000000 --- a/legacy/plugins/org.argeo.slc.client.rcp/plugin.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/legacy/plugins/org.argeo.slc.client.rcp/plugin_customization.ini b/legacy/plugins/org.argeo.slc.client.rcp/plugin_customization.ini deleted file mode 100644 index ed3f69f32..000000000 --- a/legacy/plugins/org.argeo.slc.client.rcp/plugin_customization.ini +++ /dev/null @@ -1,5 +0,0 @@ -org.eclipse.ui/DOCK_PERSPECTIVE_BAR=topRight -org.eclipse.ui/SHOW_TEXT_ON_PERSPECTIVE_BAR=false -org.eclipse.ui/PERSPECTIVE_BAR_SIZE=100 -org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=true -org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP = false diff --git a/legacy/plugins/org.argeo.slc.client.rcp/pom.xml b/legacy/plugins/org.argeo.slc.client.rcp/pom.xml deleted file mode 100644 index c16dd009d..000000000 --- a/legacy/plugins/org.argeo.slc.client.rcp/pom.xml +++ /dev/null @@ -1,78 +0,0 @@ - - 4.0.0 - - org.argeo.slc - plugins - 2.1.1-SNAPSHOT - .. - - org.argeo.slc.client.rcp - SLC Client RCP - jar - - - - org.apache.felix - maven-bundle-plugin - - - org.argeo.slc.client.rcp.SlcRcpPlugin - - org.eclipse.ui, - org.eclipse.core.runtime - - - org.argeo.eclipse.spring, - org.argeo.slc.repo.core, - javax.jcr.nodetype, - *, - - - - - - - - - - org.argeo.slc - org.argeo.slc.repo - 2.1.1-SNAPSHOT - - - - - org.argeo.slc - org.argeo.slc.node.jackrabbit - 2.1.1-SNAPSHOT - - - org.argeo.slc - org.argeo.slc.agent - 2.1.1-SNAPSHOT - - - - org.argeo.commons.security - org.argeo.security.dao.jackrabbit - ${version.argeo-commons} - - - org.argeo.commons.server - org.argeo.node.repo.jackrabbit - ${version.argeo-commons} - - - - - org.argeo.commons.base - org.argeo.eclipse.dep.rcp - ${version.argeo-commons} - - - org.argeo.commons.security - org.argeo.security.ui.rcp - ${version.argeo-commons} - - - diff --git a/legacy/plugins/org.argeo.slc.client.rcp/splash.bmp b/legacy/plugins/org.argeo.slc.client.rcp/splash.bmp deleted file mode 100644 index ee502f309..000000000 Binary files a/legacy/plugins/org.argeo.slc.client.rcp/splash.bmp and /dev/null differ diff --git a/legacy/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcRcpPlugin.java b/legacy/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcRcpPlugin.java deleted file mode 100644 index 816e7c020..000000000 --- a/legacy/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcRcpPlugin.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (C) 2007-2012 Argeo GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.argeo.slc.client.rcp; - -import org.eclipse.jface.resource.ImageDescriptor; -import org.eclipse.jface.resource.ImageRegistry; -import org.eclipse.ui.plugin.AbstractUIPlugin; -import org.osgi.framework.BundleContext; - -/** - * The activator class controls the plug-in life cycle - */ -public class SlcRcpPlugin extends AbstractUIPlugin { - public static final String PLUGIN_ID = "org.argeo.slc.client.rcp"; - private static SlcRcpPlugin plugin; - - public void start(BundleContext context) throws Exception { - super.start(context); - plugin = this; - } - - public void stop(BundleContext context) throws Exception { - plugin = null; - super.stop(context); - } - - public static SlcRcpPlugin getDefault() { - return plugin; - } - - @Override - protected void initializeImageRegistry(ImageRegistry reg) { - // TODO make it configurable - reg.put("argeoTrayIcon", - getImageDescriptor("icons/argeo-trayIcon-256.png")); - } - - public static ImageDescriptor getImageDescriptor(String path) { - return imageDescriptorFromPlugin(PLUGIN_ID, path); - } -} diff --git a/legacy/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureClientApplication.java b/legacy/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureClientApplication.java deleted file mode 100644 index 97d40c260..000000000 --- a/legacy/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureClientApplication.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (C) 2007-2012 Argeo GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.argeo.slc.client.rcp; - -import org.argeo.security.ui.rcp.SecureRcp; -import org.eclipse.jface.window.Window; -import org.eclipse.jface.window.Window.IExceptionHandler; -import org.eclipse.ui.application.WorkbenchAdvisor; - -/** - * This class controls all aspects of the application's execution - */ -public class SlcSecureClientApplication extends SecureRcp { - - @Override - protected WorkbenchAdvisor createWorkbenchAdvisor(String username) { - Window.setExceptionHandler(new IExceptionHandler() { - - public void handleException(Throwable t) { - System.err.println("Unexpected SLC UI exception: " + t); - - } - }); - - return new SlcSecureWorkbenchAdvisor(username); - } - -} diff --git a/legacy/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureWorkbenchAdvisor.java b/legacy/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureWorkbenchAdvisor.java deleted file mode 100644 index 785197d16..000000000 --- a/legacy/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureWorkbenchAdvisor.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (C) 2007-2012 Argeo GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.argeo.slc.client.rcp; - -import org.argeo.security.ui.rcp.SecureWorkbenchAdvisor; -import org.eclipse.ui.application.IWorkbenchWindowConfigurer; -import org.eclipse.ui.application.WorkbenchWindowAdvisor; - -/** - * Custom {@link SecureWorkbenchAdvisor} in order to create a - * {@link SlcSecureWorkbenchWindowAdvisor}. - */ -public class SlcSecureWorkbenchAdvisor extends SecureWorkbenchAdvisor { - public SlcSecureWorkbenchAdvisor(String username) { - super(username); - } - - public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor( - IWorkbenchWindowConfigurer configurer) { - return new SlcSecureWorkbenchWindowAdvisor(configurer, getUsername()); - } -} diff --git a/legacy/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureWorkbenchWindowAdvisor.java b/legacy/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureWorkbenchWindowAdvisor.java deleted file mode 100644 index 7eecc9e94..000000000 --- a/legacy/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/rcp/SlcSecureWorkbenchWindowAdvisor.java +++ /dev/null @@ -1,161 +0,0 @@ -/* - * Copyright (C) 2007-2012 Argeo GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.argeo.slc.client.rcp; - -import org.argeo.security.ui.rcp.SecureWorkbenchWindowAdvisor; -import org.eclipse.swt.SWT; -import org.eclipse.swt.dnd.DropTargetAdapter; -import org.eclipse.swt.dnd.DropTargetEvent; -import org.eclipse.swt.graphics.Image; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Menu; -import org.eclipse.swt.widgets.MenuItem; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.swt.widgets.Tray; -import org.eclipse.swt.widgets.TrayItem; -import org.eclipse.ui.IWorkbenchWindow; -import org.eclipse.ui.application.IWorkbenchWindowConfigurer; -import org.eclipse.ui.part.EditorInputTransfer; - -/** - * Custom {@link SecureWorkbenchWindowAdvisor} which can add a tray. TODO: to - * be factorized in Argeo Commons and made more generic. - */ -public class SlcSecureWorkbenchWindowAdvisor extends - SecureWorkbenchWindowAdvisor { - public final static String IN_TRAY_PROPERTY = "org.argeo.slc.ui.inTray"; - - private TrayItem trayItem; - - public SlcSecureWorkbenchWindowAdvisor( - IWorkbenchWindowConfigurer configurer, String username) { - super(configurer, username); - } - - public void postWindowOpen() { - String inTray = System.getProperty(IN_TRAY_PROPERTY); - if (inTray != null && inTray.equals("true")) { - initTray(); - } - } - - @Override - public void preWindowOpen() { - getWindowConfigurer().addEditorAreaTransfer( - EditorInputTransfer.getInstance()); - getWindowConfigurer().configureEditorAreaDropListener( - new DropTargetAdapter() { - - @Override - public void dragEnter(DropTargetEvent event) { - System.out.println("DROP enter!!! " + event); - } - - @Override - public void dragLeave(DropTargetEvent event) { - System.out.println("DROP leave!!! " + event); - } - - public void drop(DropTargetEvent event) { - System.out.println("DROP drop!!! " + event); - - } - - @Override - public void dropAccept(DropTargetEvent event) { - System.out.println("DROP accept!!! " + event); - super.dropAccept(event); - } - - }); - super.preWindowOpen(); - } - - @Override - public boolean preWindowShellClose() { - // hide but do not dispose if tray is supported - if (trayItem != null) { - getWindowConfigurer().getWindow().getShell().setVisible(false); - return false; - } else - return true; - } - - /** Init tray support */ - protected void initTray() { - IWorkbenchWindow window = getWindowConfigurer().getWindow(); - Shell shell = window.getShell(); - final Tray tray = shell.getDisplay().getSystemTray(); - trayItem = new TrayItem(tray, SWT.NONE); - if (trayItem == null) - return; - - // image - Image trayImage = SlcRcpPlugin.getDefault().getImageRegistry() - .get("argeoTrayIcon"); - trayItem.setImage(trayImage); - trayItem.setToolTipText("Argeo SLC"); - - // add pop-menu - // TODO: contribute more commands - trayItem.addListener(SWT.MenuDetect, new Listener() { - public void handleEvent(Event event) { - IWorkbenchWindow window = getWindowConfigurer().getWindow(); - Menu menu = new Menu(window.getShell(), SWT.POP_UP); - MenuItem exit = new MenuItem(menu, SWT.NONE); - exit.setText("Exit"); - exit.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event event) { - getWindowConfigurer().getWorkbenchConfigurer() - .getWorkbench().close(); - } - }); - menu.setVisible(true); - } - }); - - // add behavior when clicked upon - trayItem.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event event) { - Shell shell = getWindowConfigurer().getWindow().getShell(); - if (shell.isVisible()) { - if (shell.getMinimized()) - shell.setMinimized(false); - else { - shell.setVisible(false); - shell.setMinimized(true); - } - } else { - shell.setVisible(true); - shell.setActive(); - shell.setFocus(); - shell.setMinimized(false); - } - } - }); - - // start hidden - // shell.setVisible(false); - } - - @Override - public void dispose() { - if (trayItem != null) - trayItem.dispose(); - } - -} diff --git a/legacy/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/ui/specific/OpenJcrFile.java b/legacy/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/ui/specific/OpenJcrFile.java deleted file mode 100644 index 5c73a60bd..000000000 --- a/legacy/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/ui/specific/OpenJcrFile.java +++ /dev/null @@ -1,150 +0,0 @@ -/* - * Copyright (C) 2007-2012 Argeo GmbH - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.argeo.slc.client.ui.specific; - -import java.awt.Desktop; -import java.io.File; -import java.io.FileOutputStream; -import java.io.IOException; -import java.io.InputStream; -import java.io.OutputStream; - -import javax.jcr.Node; -import javax.jcr.Property; -import javax.jcr.RepositoryException; -import javax.jcr.Session; -import javax.jcr.nodetype.NodeType; - -import org.apache.commons.io.IOUtils; -import org.argeo.jcr.JcrUtils; -import org.argeo.slc.SlcException; -import org.argeo.slc.repo.RepoService; -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; - -/** - * RCP specific command handler to open a file retrieved from a local or distant - * JCR Repository. - */ -public class OpenJcrFile extends AbstractHandler { - // private final static Log log = LogFactory.getLog(OpenJcrFile.class); - - // Here is the trick that enable single sourcing: the ID is determined at - // runtime so use (new OpenJcrFileCmdId()).getCmdId() instead of the usual - // public final String ID = SlcRcpPlugin.PLUGIN_ID + ".openJcrFile"; - - public final static String PARAM_REPO_NODE_PATH = "param.repoNodePath"; - public final static String PARAM_REPO_URI = "param.repoUri"; - public final static String PARAM_WORKSPACE_NAME = "param.workspaceName"; - public final static String PARAM_FILE_PATH = "param.filePath"; - - /* DEPENDENCY INJECTION */ - private RepoService repoService; - - public Object execute(ExecutionEvent event) throws ExecutionException { - - String repoNodePath = event.getParameter(PARAM_REPO_NODE_PATH); - String repoUri = event.getParameter(PARAM_REPO_URI); - String wkspName = event.getParameter(PARAM_WORKSPACE_NAME); - String filePath = event.getParameter(PARAM_FILE_PATH); - - // TODO sanity check - if (filePath == null || "".equals(filePath.trim())) - return null; - retrieveAndOpen(repoNodePath, repoUri, wkspName, filePath); - - return null; - } - - protected void retrieveAndOpen(String repoNodePath, String repoUri, - String wkspName, String filePath) { - Session businessSession = null; - try { - businessSession = repoService.getRemoteSession(repoNodePath, - repoUri, wkspName); - Node result = businessSession.getNode(filePath); - - boolean isValid = true; - Node child = null; - if (!result.isNodeType(NodeType.NT_FILE)) - isValid = false; - else { - child = result.getNode(Property.JCR_CONTENT); - if (!(child.isNodeType(NodeType.NT_RESOURCE) || child - .hasProperty(Property.JCR_DATA))) - isValid = false; - } - - if (!isValid) - return; - - InputStream fis = null; - String prefix = "", extension = ""; - String fileName = JcrUtils.lastPathElement(filePath); - int ind = fileName.lastIndexOf('.'); - if (ind > 0) { - prefix = fileName.substring(0, ind); - extension = fileName.substring(ind); - } - try { - - fis = (InputStream) child.getProperty(Property.JCR_DATA) - .getBinary().getStream(); - File file = createTmpFile(prefix, extension, fis); - Desktop desktop = null; - if (Desktop.isDesktopSupported()) { - desktop = Desktop.getDesktop(); - } - desktop.open(file); - } catch (Exception e) { - throw new SlcException( - "Stream error while opening file " + filePath - + " from repo " + repoUri == null ? repoNodePath - : repoUri, e); - } finally { - IOUtils.closeQuietly(fis); - } - } catch (RepositoryException e) { - throw new SlcException("Unexpected error while " - + "getting repoNode info for repoNode at path " - + repoNodePath, e); - } finally { - JcrUtils.logoutQuietly(businessSession); - } - } - - private File createTmpFile(String prefix, String suffix, InputStream is) { - File tmpFile = null; - OutputStream os = null; - try { - tmpFile = File.createTempFile(prefix, suffix); - os = new FileOutputStream(tmpFile); - IOUtils.copy(is, os); - } catch (IOException e) { - throw new SlcException("Cannot open file " + prefix + "." + suffix, - e); - } finally { - IOUtils.closeQuietly(os); - } - return tmpFile; - } - - /* DEPENDENCY INJECTION */ - public void setRepoService(RepoService repoService) { - this.repoService = repoService; - } -} \ No newline at end of file diff --git a/legacy/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/ui/specific/OpenJcrFileCmdId.java b/legacy/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/ui/specific/OpenJcrFileCmdId.java deleted file mode 100644 index fb0ad74f9..000000000 --- a/legacy/plugins/org.argeo.slc.client.rcp/src/main/java/org/argeo/slc/client/ui/specific/OpenJcrFileCmdId.java +++ /dev/null @@ -1,17 +0,0 @@ -package org.argeo.slc.client.ui.specific; - -import org.argeo.slc.client.rcp.SlcRcpPlugin; - -/** - * Workaround a single sourcing problem: - * - * final static variable are imported at compilation time (we build against RCP) - * and we still must have a different ID (the prefix must be the PLUGIN ID) for - * RAP and RCP in order to be able to inject beans in the corresponding commands - */ -public class OpenJcrFileCmdId { - - public String getCmdId() { - return SlcRcpPlugin.PLUGIN_ID + ".openJcrFile"; - } -} diff --git a/legacy/plugins/pom.xml b/legacy/plugins/pom.xml deleted file mode 100644 index 4dc3fe380..000000000 --- a/legacy/plugins/pom.xml +++ /dev/null @@ -1,43 +0,0 @@ - - 4.0.0 - - org.argeo.slc - argeo-slc - 2.1.1-SNAPSHOT - .. - - plugins - SLC Eclipse Plugins - pom - - org.argeo.slc.client.rcp - org.argeo.slc.client.rap - org.argeo.slc.client.ui - org.argeo.slc.client.ui.dist - - - - - org.apache.felix - maven-bundle-plugin - - - ${project.artifactId};singleton:=true - lazy - - - - - org.apache.maven.plugins - maven-source-plugin - - - - plugin.xml - META-INF/MANIFEST.MF - - - - - - diff --git a/org.argeo.slc.client.rcp/.classpath b/org.argeo.slc.client.rcp/.classpath new file mode 100644 index 000000000..6e7c599fe --- /dev/null +++ b/org.argeo.slc.client.rcp/.classpath @@ -0,0 +1,7 @@ + + + + + + + diff --git a/org.argeo.slc.client.rcp/.project b/org.argeo.slc.client.rcp/.project new file mode 100644 index 000000000..75fcdba86 --- /dev/null +++ b/org.argeo.slc.client.rcp/.project @@ -0,0 +1,28 @@ + + + org.argeo.slc.client.rcp + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.pde.ManifestBuilder + + + + + org.eclipse.pde.SchemaBuilder + + + + + + org.eclipse.pde.PluginNature + org.eclipse.jdt.core.javanature + + diff --git a/org.argeo.slc.client.rcp/.settings/org.eclipse.jdt.core.prefs b/org.argeo.slc.client.rcp/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 000000000..5eb7b030a --- /dev/null +++ b/org.argeo.slc.client.rcp/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +#Wed Aug 04 16:32:22 CEST 2010 +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5 +org.eclipse.jdt.core.compiler.compliance=1.5 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.source=1.5 diff --git a/org.argeo.slc.client.rcp/META-INF/spring/commands.xml b/org.argeo.slc.client.rcp/META-INF/spring/commands.xml new file mode 100644 index 000000000..7bd302c86 --- /dev/null +++ b/org.argeo.slc.client.rcp/META-INF/spring/commands.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/org.argeo.slc.client.rcp/META-INF/spring/osgi.xml b/org.argeo.slc.client.rcp/META-INF/spring/osgi.xml new file mode 100644 index 000000000..55a940f7f --- /dev/null +++ b/org.argeo.slc.client.rcp/META-INF/spring/osgi.xml @@ -0,0 +1,18 @@ + + + + SLC UI RCP + + + + + + \ No newline at end of file diff --git a/org.argeo.slc.client.rcp/bnd.bnd b/org.argeo.slc.client.rcp/bnd.bnd new file mode 100644 index 000000000..b1d059bf2 --- /dev/null +++ b/org.argeo.slc.client.rcp/bnd.bnd @@ -0,0 +1,12 @@ +Bundle-SymbolicName: org.argeo.slc.client.rcp;singleton=true +Bundle-ActivationPolicy: lazy +Bundle-Activator: org.argeo.slc.client.rcp.SlcRcpPlugin +Require-Bundle: org.eclipse.ui,\ +org.eclipse.core.runtime + +Import-Package: javax.jcr.nodetype,\ +org.argeo.eclipse.spring,\ +org.argeo.slc.repo.core,\ +org.argeo.cms.util,\ +* + \ No newline at end of file diff --git a/org.argeo.slc.client.rcp/build.properties b/org.argeo.slc.client.rcp/build.properties new file mode 100644 index 000000000..8b65761d0 --- /dev/null +++ b/org.argeo.slc.client.rcp/build.properties @@ -0,0 +1,8 @@ +source.. = src/ +output.. = bin/ +bin.includes = plugin.xml,\ + META-INF/,\ + .,\ + icons/,\ + splash.bmp,\ + plugin_customization.ini diff --git a/org.argeo.slc.client.rcp/icons/argeo-icon-256.png b/org.argeo.slc.client.rcp/icons/argeo-icon-256.png new file mode 100644 index 000000000..a9af08836 Binary files /dev/null and b/org.argeo.slc.client.rcp/icons/argeo-icon-256.png differ diff --git a/org.argeo.slc.client.rcp/icons/argeo-trayIcon-256.png b/org.argeo.slc.client.rcp/icons/argeo-trayIcon-256.png new file mode 100644 index 000000000..da20cf485 Binary files /dev/null and b/org.argeo.slc.client.rcp/icons/argeo-trayIcon-256.png differ diff --git a/org.argeo.slc.client.rcp/plugin.xml b/org.argeo.slc.client.rcp/plugin.xml new file mode 100644 index 000000000..73bfa838e --- /dev/null +++ b/org.argeo.slc.client.rcp/plugin.xml @@ -0,0 +1,69 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/org.argeo.slc.client.rcp/plugin_customization.ini b/org.argeo.slc.client.rcp/plugin_customization.ini new file mode 100644 index 000000000..ed3f69f32 --- /dev/null +++ b/org.argeo.slc.client.rcp/plugin_customization.ini @@ -0,0 +1,5 @@ +org.eclipse.ui/DOCK_PERSPECTIVE_BAR=topRight +org.eclipse.ui/SHOW_TEXT_ON_PERSPECTIVE_BAR=false +org.eclipse.ui/PERSPECTIVE_BAR_SIZE=100 +org.eclipse.ui/SHOW_TRADITIONAL_STYLE_TABS=true +org.eclipse.ui/SHOW_PROGRESS_ON_STARTUP = false diff --git a/org.argeo.slc.client.rcp/pom.xml b/org.argeo.slc.client.rcp/pom.xml new file mode 100644 index 000000000..da389c21f --- /dev/null +++ b/org.argeo.slc.client.rcp/pom.xml @@ -0,0 +1,50 @@ + + 4.0.0 + + org.argeo.slc + argeo-slc + 2.1.6-SNAPSHOT + .. + + org.argeo.slc.client.rcp + SLC Client RCP + jar + + + + + + + + + + + + + + + + + + + + + + + + + + + org.argeo.slc + org.argeo.slc.repo + 2.1.6-SNAPSHOT + + + + org.argeo.commons.rcp + org.argeo.cms.ui.workbench.rcp + ${version.argeo-rcp} + + + diff --git a/org.argeo.slc.client.rcp/splash.bmp b/org.argeo.slc.client.rcp/splash.bmp new file mode 100644 index 000000000..ee502f309 Binary files /dev/null and b/org.argeo.slc.client.rcp/splash.bmp differ diff --git a/org.argeo.slc.client.rcp/src/org/argeo/slc/client/rcp/SlcRcpPlugin.java b/org.argeo.slc.client.rcp/src/org/argeo/slc/client/rcp/SlcRcpPlugin.java new file mode 100644 index 000000000..816e7c020 --- /dev/null +++ b/org.argeo.slc.client.rcp/src/org/argeo/slc/client/rcp/SlcRcpPlugin.java @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2007-2012 Argeo GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.argeo.slc.client.rcp; + +import org.eclipse.jface.resource.ImageDescriptor; +import org.eclipse.jface.resource.ImageRegistry; +import org.eclipse.ui.plugin.AbstractUIPlugin; +import org.osgi.framework.BundleContext; + +/** + * The activator class controls the plug-in life cycle + */ +public class SlcRcpPlugin extends AbstractUIPlugin { + public static final String PLUGIN_ID = "org.argeo.slc.client.rcp"; + private static SlcRcpPlugin plugin; + + public void start(BundleContext context) throws Exception { + super.start(context); + plugin = this; + } + + public void stop(BundleContext context) throws Exception { + plugin = null; + super.stop(context); + } + + public static SlcRcpPlugin getDefault() { + return plugin; + } + + @Override + protected void initializeImageRegistry(ImageRegistry reg) { + // TODO make it configurable + reg.put("argeoTrayIcon", + getImageDescriptor("icons/argeo-trayIcon-256.png")); + } + + public static ImageDescriptor getImageDescriptor(String path) { + return imageDescriptorFromPlugin(PLUGIN_ID, path); + } +} diff --git a/org.argeo.slc.client.rcp/src/org/argeo/slc/client/rcp/SlcSecureClientApplication.java b/org.argeo.slc.client.rcp/src/org/argeo/slc/client/rcp/SlcSecureClientApplication.java new file mode 100644 index 000000000..97d40c260 --- /dev/null +++ b/org.argeo.slc.client.rcp/src/org/argeo/slc/client/rcp/SlcSecureClientApplication.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2007-2012 Argeo GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.argeo.slc.client.rcp; + +import org.argeo.security.ui.rcp.SecureRcp; +import org.eclipse.jface.window.Window; +import org.eclipse.jface.window.Window.IExceptionHandler; +import org.eclipse.ui.application.WorkbenchAdvisor; + +/** + * This class controls all aspects of the application's execution + */ +public class SlcSecureClientApplication extends SecureRcp { + + @Override + protected WorkbenchAdvisor createWorkbenchAdvisor(String username) { + Window.setExceptionHandler(new IExceptionHandler() { + + public void handleException(Throwable t) { + System.err.println("Unexpected SLC UI exception: " + t); + + } + }); + + return new SlcSecureWorkbenchAdvisor(username); + } + +} diff --git a/org.argeo.slc.client.rcp/src/org/argeo/slc/client/rcp/SlcSecureWorkbenchAdvisor.java b/org.argeo.slc.client.rcp/src/org/argeo/slc/client/rcp/SlcSecureWorkbenchAdvisor.java new file mode 100644 index 000000000..785197d16 --- /dev/null +++ b/org.argeo.slc.client.rcp/src/org/argeo/slc/client/rcp/SlcSecureWorkbenchAdvisor.java @@ -0,0 +1,35 @@ +/* + * Copyright (C) 2007-2012 Argeo GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.argeo.slc.client.rcp; + +import org.argeo.security.ui.rcp.SecureWorkbenchAdvisor; +import org.eclipse.ui.application.IWorkbenchWindowConfigurer; +import org.eclipse.ui.application.WorkbenchWindowAdvisor; + +/** + * Custom {@link SecureWorkbenchAdvisor} in order to create a + * {@link SlcSecureWorkbenchWindowAdvisor}. + */ +public class SlcSecureWorkbenchAdvisor extends SecureWorkbenchAdvisor { + public SlcSecureWorkbenchAdvisor(String username) { + super(username); + } + + public WorkbenchWindowAdvisor createWorkbenchWindowAdvisor( + IWorkbenchWindowConfigurer configurer) { + return new SlcSecureWorkbenchWindowAdvisor(configurer, getUsername()); + } +} diff --git a/org.argeo.slc.client.rcp/src/org/argeo/slc/client/rcp/SlcSecureWorkbenchWindowAdvisor.java b/org.argeo.slc.client.rcp/src/org/argeo/slc/client/rcp/SlcSecureWorkbenchWindowAdvisor.java new file mode 100644 index 000000000..7eecc9e94 --- /dev/null +++ b/org.argeo.slc.client.rcp/src/org/argeo/slc/client/rcp/SlcSecureWorkbenchWindowAdvisor.java @@ -0,0 +1,161 @@ +/* + * Copyright (C) 2007-2012 Argeo GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.argeo.slc.client.rcp; + +import org.argeo.security.ui.rcp.SecureWorkbenchWindowAdvisor; +import org.eclipse.swt.SWT; +import org.eclipse.swt.dnd.DropTargetAdapter; +import org.eclipse.swt.dnd.DropTargetEvent; +import org.eclipse.swt.graphics.Image; +import org.eclipse.swt.widgets.Event; +import org.eclipse.swt.widgets.Listener; +import org.eclipse.swt.widgets.Menu; +import org.eclipse.swt.widgets.MenuItem; +import org.eclipse.swt.widgets.Shell; +import org.eclipse.swt.widgets.Tray; +import org.eclipse.swt.widgets.TrayItem; +import org.eclipse.ui.IWorkbenchWindow; +import org.eclipse.ui.application.IWorkbenchWindowConfigurer; +import org.eclipse.ui.part.EditorInputTransfer; + +/** + * Custom {@link SecureWorkbenchWindowAdvisor} which can add a tray. TODO: to + * be factorized in Argeo Commons and made more generic. + */ +public class SlcSecureWorkbenchWindowAdvisor extends + SecureWorkbenchWindowAdvisor { + public final static String IN_TRAY_PROPERTY = "org.argeo.slc.ui.inTray"; + + private TrayItem trayItem; + + public SlcSecureWorkbenchWindowAdvisor( + IWorkbenchWindowConfigurer configurer, String username) { + super(configurer, username); + } + + public void postWindowOpen() { + String inTray = System.getProperty(IN_TRAY_PROPERTY); + if (inTray != null && inTray.equals("true")) { + initTray(); + } + } + + @Override + public void preWindowOpen() { + getWindowConfigurer().addEditorAreaTransfer( + EditorInputTransfer.getInstance()); + getWindowConfigurer().configureEditorAreaDropListener( + new DropTargetAdapter() { + + @Override + public void dragEnter(DropTargetEvent event) { + System.out.println("DROP enter!!! " + event); + } + + @Override + public void dragLeave(DropTargetEvent event) { + System.out.println("DROP leave!!! " + event); + } + + public void drop(DropTargetEvent event) { + System.out.println("DROP drop!!! " + event); + + } + + @Override + public void dropAccept(DropTargetEvent event) { + System.out.println("DROP accept!!! " + event); + super.dropAccept(event); + } + + }); + super.preWindowOpen(); + } + + @Override + public boolean preWindowShellClose() { + // hide but do not dispose if tray is supported + if (trayItem != null) { + getWindowConfigurer().getWindow().getShell().setVisible(false); + return false; + } else + return true; + } + + /** Init tray support */ + protected void initTray() { + IWorkbenchWindow window = getWindowConfigurer().getWindow(); + Shell shell = window.getShell(); + final Tray tray = shell.getDisplay().getSystemTray(); + trayItem = new TrayItem(tray, SWT.NONE); + if (trayItem == null) + return; + + // image + Image trayImage = SlcRcpPlugin.getDefault().getImageRegistry() + .get("argeoTrayIcon"); + trayItem.setImage(trayImage); + trayItem.setToolTipText("Argeo SLC"); + + // add pop-menu + // TODO: contribute more commands + trayItem.addListener(SWT.MenuDetect, new Listener() { + public void handleEvent(Event event) { + IWorkbenchWindow window = getWindowConfigurer().getWindow(); + Menu menu = new Menu(window.getShell(), SWT.POP_UP); + MenuItem exit = new MenuItem(menu, SWT.NONE); + exit.setText("Exit"); + exit.addListener(SWT.Selection, new Listener() { + public void handleEvent(Event event) { + getWindowConfigurer().getWorkbenchConfigurer() + .getWorkbench().close(); + } + }); + menu.setVisible(true); + } + }); + + // add behavior when clicked upon + trayItem.addListener(SWT.Selection, new Listener() { + public void handleEvent(Event event) { + Shell shell = getWindowConfigurer().getWindow().getShell(); + if (shell.isVisible()) { + if (shell.getMinimized()) + shell.setMinimized(false); + else { + shell.setVisible(false); + shell.setMinimized(true); + } + } else { + shell.setVisible(true); + shell.setActive(); + shell.setFocus(); + shell.setMinimized(false); + } + } + }); + + // start hidden + // shell.setVisible(false); + } + + @Override + public void dispose() { + if (trayItem != null) + trayItem.dispose(); + } + +} diff --git a/org.argeo.slc.client.rcp/src/org/argeo/slc/client/ui/specific/OpenJcrFile.java b/org.argeo.slc.client.rcp/src/org/argeo/slc/client/ui/specific/OpenJcrFile.java new file mode 100644 index 000000000..5c73a60bd --- /dev/null +++ b/org.argeo.slc.client.rcp/src/org/argeo/slc/client/ui/specific/OpenJcrFile.java @@ -0,0 +1,150 @@ +/* + * Copyright (C) 2007-2012 Argeo GmbH + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package org.argeo.slc.client.ui.specific; + +import java.awt.Desktop; +import java.io.File; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStream; +import java.io.OutputStream; + +import javax.jcr.Node; +import javax.jcr.Property; +import javax.jcr.RepositoryException; +import javax.jcr.Session; +import javax.jcr.nodetype.NodeType; + +import org.apache.commons.io.IOUtils; +import org.argeo.jcr.JcrUtils; +import org.argeo.slc.SlcException; +import org.argeo.slc.repo.RepoService; +import org.eclipse.core.commands.AbstractHandler; +import org.eclipse.core.commands.ExecutionEvent; +import org.eclipse.core.commands.ExecutionException; + +/** + * RCP specific command handler to open a file retrieved from a local or distant + * JCR Repository. + */ +public class OpenJcrFile extends AbstractHandler { + // private final static Log log = LogFactory.getLog(OpenJcrFile.class); + + // Here is the trick that enable single sourcing: the ID is determined at + // runtime so use (new OpenJcrFileCmdId()).getCmdId() instead of the usual + // public final String ID = SlcRcpPlugin.PLUGIN_ID + ".openJcrFile"; + + public final static String PARAM_REPO_NODE_PATH = "param.repoNodePath"; + public final static String PARAM_REPO_URI = "param.repoUri"; + public final static String PARAM_WORKSPACE_NAME = "param.workspaceName"; + public final static String PARAM_FILE_PATH = "param.filePath"; + + /* DEPENDENCY INJECTION */ + private RepoService repoService; + + public Object execute(ExecutionEvent event) throws ExecutionException { + + String repoNodePath = event.getParameter(PARAM_REPO_NODE_PATH); + String repoUri = event.getParameter(PARAM_REPO_URI); + String wkspName = event.getParameter(PARAM_WORKSPACE_NAME); + String filePath = event.getParameter(PARAM_FILE_PATH); + + // TODO sanity check + if (filePath == null || "".equals(filePath.trim())) + return null; + retrieveAndOpen(repoNodePath, repoUri, wkspName, filePath); + + return null; + } + + protected void retrieveAndOpen(String repoNodePath, String repoUri, + String wkspName, String filePath) { + Session businessSession = null; + try { + businessSession = repoService.getRemoteSession(repoNodePath, + repoUri, wkspName); + Node result = businessSession.getNode(filePath); + + boolean isValid = true; + Node child = null; + if (!result.isNodeType(NodeType.NT_FILE)) + isValid = false; + else { + child = result.getNode(Property.JCR_CONTENT); + if (!(child.isNodeType(NodeType.NT_RESOURCE) || child + .hasProperty(Property.JCR_DATA))) + isValid = false; + } + + if (!isValid) + return; + + InputStream fis = null; + String prefix = "", extension = ""; + String fileName = JcrUtils.lastPathElement(filePath); + int ind = fileName.lastIndexOf('.'); + if (ind > 0) { + prefix = fileName.substring(0, ind); + extension = fileName.substring(ind); + } + try { + + fis = (InputStream) child.getProperty(Property.JCR_DATA) + .getBinary().getStream(); + File file = createTmpFile(prefix, extension, fis); + Desktop desktop = null; + if (Desktop.isDesktopSupported()) { + desktop = Desktop.getDesktop(); + } + desktop.open(file); + } catch (Exception e) { + throw new SlcException( + "Stream error while opening file " + filePath + + " from repo " + repoUri == null ? repoNodePath + : repoUri, e); + } finally { + IOUtils.closeQuietly(fis); + } + } catch (RepositoryException e) { + throw new SlcException("Unexpected error while " + + "getting repoNode info for repoNode at path " + + repoNodePath, e); + } finally { + JcrUtils.logoutQuietly(businessSession); + } + } + + private File createTmpFile(String prefix, String suffix, InputStream is) { + File tmpFile = null; + OutputStream os = null; + try { + tmpFile = File.createTempFile(prefix, suffix); + os = new FileOutputStream(tmpFile); + IOUtils.copy(is, os); + } catch (IOException e) { + throw new SlcException("Cannot open file " + prefix + "." + suffix, + e); + } finally { + IOUtils.closeQuietly(os); + } + return tmpFile; + } + + /* DEPENDENCY INJECTION */ + public void setRepoService(RepoService repoService) { + this.repoService = repoService; + } +} \ No newline at end of file diff --git a/org.argeo.slc.client.rcp/src/org/argeo/slc/client/ui/specific/OpenJcrFileCmdId.java b/org.argeo.slc.client.rcp/src/org/argeo/slc/client/ui/specific/OpenJcrFileCmdId.java new file mode 100644 index 000000000..fb0ad74f9 --- /dev/null +++ b/org.argeo.slc.client.rcp/src/org/argeo/slc/client/ui/specific/OpenJcrFileCmdId.java @@ -0,0 +1,17 @@ +package org.argeo.slc.client.ui.specific; + +import org.argeo.slc.client.rcp.SlcRcpPlugin; + +/** + * Workaround a single sourcing problem: + * + * final static variable are imported at compilation time (we build against RCP) + * and we still must have a different ID (the prefix must be the PLUGIN ID) for + * RAP and RCP in order to be able to inject beans in the corresponding commands + */ +public class OpenJcrFileCmdId { + + public String getCmdId() { + return SlcRcpPlugin.PLUGIN_ID + ".openJcrFile"; + } +} diff --git a/pom.xml b/pom.xml index 43b715d2f..0d22a4c4a 100644 --- a/pom.xml +++ b/pom.xml @@ -13,6 +13,7 @@ 2.1 2015-02-12 + 2.1.12-SNAPSHOT 2.1.6-SNAPSHOT @@ -33,6 +34,7 @@ org.argeo.slc.client.ui org.argeo.slc.client.ui.dist org.argeo.slc.client.rap + org.argeo.slc.client.rcp lib dep @@ -126,6 +128,16 @@ limitations under the License. warn + + argeo-rcp + http://forge.argeo.org/data/public/java/argeo-rcp-2.1 + + true + daily + warn + + + central