Add JCR explorer
authorMathieu Baudier <mbaudier@argeo.org>
Thu, 24 Feb 2011 08:34:19 +0000 (08:34 +0000)
committerMathieu Baudier <mbaudier@argeo.org>
Thu, 24 Feb 2011 08:34:19 +0000 (08:34 +0000)
git-svn-id: https://svn.argeo.org/commons/trunk@4181 4cfe0d0a-d680-48aa-b62c-e0a02a3f76cc

14 files changed:
eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/.classpath [new file with mode: 0644]
eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/.project [new file with mode: 0644]
eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/.settings/org.eclipse.jdt.core.prefs [new file with mode: 0644]
eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/META-INF/MANIFEST.MF [new file with mode: 0644]
eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/META-INF/spring/commands.xml [new file with mode: 0644]
eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/META-INF/spring/editors.xml [new file with mode: 0644]
eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/META-INF/spring/jcr.xml [new file with mode: 0644]
eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/META-INF/spring/osgi.xml [new file with mode: 0644]
eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/META-INF/spring/views.xml [new file with mode: 0644]
eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/build.properties [new file with mode: 0644]
eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/icons/nodes.gif [new file with mode: 0644]
eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/plugin.xml [new file with mode: 0644]
eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/src/main/java/org/argeo/eclipse/ui/jcr/explorer/JcrExplorerActivator.java [new file with mode: 0644]
eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/src/main/java/org/argeo/eclipse/ui/jcr/explorer/JcrExplorerPerspective.java [new file with mode: 0644]

diff --git a/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/.classpath b/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/.classpath
new file mode 100644 (file)
index 0000000..92f19d2
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+       <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+       <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+       <classpathentry kind="src" path="src/main/java"/>
+       <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/.project b/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/.project
new file mode 100644 (file)
index 0000000..52ceb32
--- /dev/null
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+       <name>org.argeo.eclipse.ui.jcr.explorer</name>
+       <comment></comment>
+       <projects>
+       </projects>
+       <buildSpec>
+               <buildCommand>
+                       <name>org.eclipse.jdt.core.javabuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.ManifestBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+               <buildCommand>
+                       <name>org.eclipse.pde.SchemaBuilder</name>
+                       <arguments>
+                       </arguments>
+               </buildCommand>
+       </buildSpec>
+       <natures>
+               <nature>org.eclipse.pde.PluginNature</nature>
+               <nature>org.eclipse.jdt.core.javanature</nature>
+       </natures>
+</projectDescription>
diff --git a/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/.settings/org.eclipse.jdt.core.prefs b/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/.settings/org.eclipse.jdt.core.prefs
new file mode 100644 (file)
index 0000000..992c5d7
--- /dev/null
@@ -0,0 +1,8 @@
+#Thu Feb 24 08:49:06 CET 2011
+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/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/META-INF/MANIFEST.MF b/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/META-INF/MANIFEST.MF
new file mode 100644 (file)
index 0000000..9f54df0
--- /dev/null
@@ -0,0 +1,17 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: JCR Explorer
+Bundle-SymbolicName: org.argeo.eclipse.ui.jcr.explorer;singleton:=true
+Bundle-Version: 1.0.0.qualifier
+Bundle-Activator: org.argeo.eclipse.ui.jcr.explorer.JcrExplorerActivator
+Bundle-Vendor: Argeo
+Require-Bundle: org.eclipse.ui;resolution:=optional,
+ org.eclipse.core.runtime
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-ActivationPolicy: lazy
+Import-Package: javax.jcr;version="2.0.0",
+ org.argeo.eclipse.spring,
+ org.argeo.eclipse.ui.jcr.commands,
+ org.argeo.eclipse.ui.jcr.editors,
+ org.argeo.eclipse.ui.jcr.views,
+ org.argeo.jcr
diff --git a/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/META-INF/spring/commands.xml b/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/META-INF/spring/commands.xml
new file mode 100644 (file)
index 0000000..325951d
--- /dev/null
@@ -0,0 +1,13 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+       <bean id="openGenericJcrQueryEditor"
+               class="org.argeo.eclipse.ui.jcr.commands.OpenGenericJcrQueryEditor"
+               scope="prototype">
+               <property name="editorId"
+                       value="org.argeo.slc.client.ui.dist.genericJcrQueryEditor" />
+       </bean>
+</beans>
diff --git a/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/META-INF/spring/editors.xml b/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/META-INF/spring/editors.xml
new file mode 100644 (file)
index 0000000..8ddc5bf
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
+       xmlns:p="http://www.springframework.org/schema/p"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
+
+       <bean id="genericJcrQueryEditor"
+               class="org.argeo.eclipse.ui.jcr.editors.GenericJcrQueryEditor" scope="prototype">
+               <property name="session" ref="jcrSession" />
+       </bean>
+</beans>
diff --git a/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/META-INF/spring/jcr.xml b/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/META-INF/spring/jcr.xml
new file mode 100644 (file)
index 0000000..2701948
--- /dev/null
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util"
+       xmlns:p="http://www.springframework.org/schema/p"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
+        http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-2.5.xsd">
+
+       <bean id="repositoryRegister" class="org.argeo.jcr.DefaultRepositoryRegister">
+       </bean>
+</beans>
diff --git a/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/META-INF/spring/osgi.xml b/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/META-INF/spring/osgi.xml
new file mode 100644 (file)
index 0000000..0e87da8
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<beans:beans xmlns="http://www.springframework.org/schema/osgi"\r
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:beans="http://www.springframework.org/schema/beans"\r
+       xmlns:osgi="http://www.springframework.org/schema/osgi"\r
+       xsi:schemaLocation="http://www.springframework.org/schema/osgi  \r
+       http://www.springframework.org/schema/osgi/spring-osgi-1.1.xsd\r
+       http://www.springframework.org/schema/beans   \r
+       http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"\r
+       osgi:default-timeout="30000">\r
+\r
+       <set id="repositories" interface="javax.jcr.Repository">\r
+               <listener ref="repositoryRegister" bind-method="register"\r
+                       unbind-method="unregister" />\r
+       </set>\r
+</beans:beans>
\ No newline at end of file
diff --git a/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/META-INF/spring/views.xml b/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/META-INF/spring/views.xml
new file mode 100644 (file)
index 0000000..eed1f48
--- /dev/null
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:p="http://www.springframework.org/schema/p"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+        http://www.springframework.org/schema/beans/spring-beans.xsd">
+
+       <!-- Views -->
+       <bean id="browserView" class="org.argeo.eclipse.ui.jcr.views.GenericJcrBrowser"
+               scope="prototype">
+               <property name="repositoryRegister" ref="repositoryRegister" />
+       </bean>
+</beans>
diff --git a/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/build.properties b/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/build.properties
new file mode 100644 (file)
index 0000000..5fc538b
--- /dev/null
@@ -0,0 +1,4 @@
+source.. = src/main/java/
+output.. = target/classes/
+bin.includes = META-INF/,\
+               .
diff --git a/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/icons/nodes.gif b/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/icons/nodes.gif
new file mode 100644 (file)
index 0000000..bba3dbc
Binary files /dev/null and b/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/icons/nodes.gif differ
diff --git a/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/plugin.xml b/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/plugin.xml
new file mode 100644 (file)
index 0000000..8b3957c
--- /dev/null
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<?eclipse version="3.4"?>
+<plugin>
+   <extension
+         point="org.eclipse.ui.perspectiveExtensions">
+      <perspectiveExtension
+            targetID="jcrExplorerPerspective">
+         <view
+               relative="upperLeft"
+               relationship="stack"
+               id="browserView">
+         </view>
+      </perspectiveExtension>
+   </extension>
+   <extension
+         point="org.eclipse.ui.perspectives">
+      <perspective
+            class="org.argeo.eclipse.ui.jcr.explorer.JcrExplorerPerspective"
+            icon="icons/nodes.gif"
+            id="jcrExplorerPerspective"
+            name="JCR Explorer">
+      </perspective>
+   </extension>
+   <extension
+         point="org.eclipse.ui.views">
+          <view
+                class="org.argeo.eclipse.spring.SpringExtensionFactory"
+                id="browserView"
+                name="Browser">
+          </view>
+   </extension>
+   <extension
+           point="org.eclipse.ui.editors">
+            <editor
+                 class="org.argeo.eclipse.spring.SpringExtensionFactory"
+              id="genericJcrQueryEditor"
+              name="JCR Query"
+              icon="icons/nodes.gif"
+              default="false">
+        </editor>
+     </extension>
+       <extension
+         point="org.eclipse.ui.commands">
+               <command
+            defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
+            id="openGenericJcrQueryEditor"
+            name="OpenGenericJcrQueryEditor ">
+       </command>
+    </extension>
+       <extension
+         id="menu:org.eclipse.ui.main.menu"
+         point="org.eclipse.ui.menus">
+        <!-- Queries --> 
+               <menuContribution
+                allPopups="false"
+                locationURI="menu:org.eclipse.ui.main.menu?after=edit">
+               <menu label="Queries"
+              mnemonic="Queries"
+              id="queryMenu">
+                <command
+                      commandId="openGenericJcrQueryEditor"
+                      disabledIcon="icons/saveDisabled.gif"
+                      icon="icons/results.gif"
+                      label="JCR Query"
+                      style="push"
+                      tooltip="Open JCR query editor">
+                </command>
+             </menu>
+          </menuContribution>
+       </extension>
+</plugin>
diff --git a/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/src/main/java/org/argeo/eclipse/ui/jcr/explorer/JcrExplorerActivator.java b/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/src/main/java/org/argeo/eclipse/ui/jcr/explorer/JcrExplorerActivator.java
new file mode 100644 (file)
index 0000000..9a00a70
--- /dev/null
@@ -0,0 +1,50 @@
+package org.argeo.eclipse.ui.jcr.explorer;
+
+import org.eclipse.ui.plugin.AbstractUIPlugin;
+import org.osgi.framework.BundleContext;
+
+/**
+ * The activator class controls the plug-in life cycle
+ */
+public class JcrExplorerActivator extends AbstractUIPlugin {
+
+       // The plug-in ID
+       public static final String PLUGIN_ID = "org.argeo.eclipse.ui.jcr.explorer"; //$NON-NLS-1$
+
+       // The shared instance
+       private static JcrExplorerActivator plugin;
+       
+       /**
+        * The constructor
+        */
+       public JcrExplorerActivator() {
+       }
+
+       /*
+        * (non-Javadoc)
+        * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext)
+        */
+       public void start(BundleContext context) throws Exception {
+               super.start(context);
+               plugin = this;
+       }
+
+       /*
+        * (non-Javadoc)
+        * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext)
+        */
+       public void stop(BundleContext context) throws Exception {
+               plugin = null;
+               super.stop(context);
+       }
+
+       /**
+        * Returns the shared instance
+        *
+        * @return the shared instance
+        */
+       public static JcrExplorerActivator getDefault() {
+               return plugin;
+       }
+
+}
diff --git a/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/src/main/java/org/argeo/eclipse/ui/jcr/explorer/JcrExplorerPerspective.java b/eclipse/plugins/org.argeo.eclipse.ui.jcr.explorer/src/main/java/org/argeo/eclipse/ui/jcr/explorer/JcrExplorerPerspective.java
new file mode 100644 (file)
index 0000000..cdce20e
--- /dev/null
@@ -0,0 +1,17 @@
+package org.argeo.eclipse.ui.jcr.explorer;
+
+import org.eclipse.ui.IFolderLayout;
+import org.eclipse.ui.IPageLayout;
+import org.eclipse.ui.IPerspectiveFactory;
+
+public class JcrExplorerPerspective implements IPerspectiveFactory {
+
+       public void createInitialLayout(IPageLayout layout) {
+               layout.setEditorAreaVisible(true);
+
+               IFolderLayout main = layout.createFolder("upperLeft", IPageLayout.LEFT,
+                               0.5f, layout.getEditorArea());
+
+       }
+
+}