]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - server/plugins/org.argeo.jcr.ui.explorer/plugin.xml
Add dep folder
[lgpl/argeo-commons.git] / server / plugins / org.argeo.jcr.ui.explorer / plugin.xml
index 933aad083ebf7951a75bcdaf3626a7fa4bed1adc..67b87515f68d5ec3cf2975ea2ffefbcd001705d3 100644 (file)
@@ -8,7 +8,7 @@
             class="org.argeo.jcr.ui.explorer.JcrExplorerPerspective"
             icon="icons/nodes.gif"
             id="org.argeo.jcr.ui.explorer.perspective"
-            name="JCR Explorer">
+            name="Data Explorer">
       </perspective>
    </extension>
    <!-- Views --> 
                                name="Node path">
                        </commandParameter>
                </command>    
+       <command
+                       defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
+                       id="org.argeo.jcr.ui.explorer.getNodeSize"
+                       name="Get node size">
+               </command>    
+       <command
+                       defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
+                       id="org.argeo.jcr.ui.explorer.addRemoteRepository"
+                       name="Add remote JCR repository">
+                       <commandParameter
+                               id="org.argeo.jcr.ui.explorer.repositoryUri"
+                               name="Repository URI">
+                       </commandParameter>
+               </command>    
+       <command
+                       defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
+                       id="org.argeo.jcr.ui.explorer.removeRemoteRepository"
+                       name="Remove remote JCR repository">
+               </command>    
+         <command
+               defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
+               id="org.argeo.jcr.ui.explorer.addFolderNode"
+               name="Create a new folder">
+         </command>
+         <command
+               defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
+               id="org.argeo.jcr.ui.explorer.addPrivileges"
+               name="Add Privileges">
+         </command>
          <command
                defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
-               id="org.argeo.jcr.ui.explorer.addFileFolder"
-               name="Add file folder...">
+               id="org.argeo.jcr.ui.explorer.createWorkspace"
+               name="Create a new workspace">
          </command>
          <command
                defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
          </command>
          <command
                defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
-               id="org.argeo.jcr.ui.explorer.deleteNode"
-               name="Delete node">
+               id="org.argeo.jcr.ui.explorer.deleteNodes"
+               name="Delete nodes">
          </command>
          <command
                defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
                id="org.argeo.jcr.ui.explorer.importFileSystem"
                name="Import files...">
          </command>
-         <command
+        <!-- <command
                defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
                id="org.argeo.jcr.ui.explorer.openFile"
                name="Open current file">
          </command>
+         -->
+         <command
+               defaultHandler="org.argeo.jcr.ui.explorer.commands.DumpNode"
+               id="org.argeo.jcr.ui.explorer.dumpNode"
+               name="Dump Current Selected Node">
+         </command>
+         <command
+            defaultHandler="org.argeo.jcr.ui.explorer.commands.SortChildNodes"
+            id="org.argeo.jcr.ui.explorer.sortChildNodes"
+            name="Sort node tree">
+            <!-- FIXME: default value does not work -->
+            <state 
+                               id="org.argeo.jcr.ui.explorer.sortChildNodes.toggleState" 
+                               class="org.eclipse.ui.handlers.RegistryToggleState:true" >
+                               <!-- <class class="org.eclipse.jface.commands.ToggleState"> 
+                                       <parameter
+                                               name="default"
+                                       value="true" />
+                               </class> -->
+                       </state>
+     </command>
     </extension>
+
+    <!-- Menus --> 
        <extension point="org.eclipse.ui.menus">
+               <!-- Browser view specific menu --> 
                <menuContribution
-                locationURI="menu:org.argeo.jcr.ui.explorer.browserView">
-                <command
-                      commandId="org.argeo.jcr.ui.explorer.openGenericJcrQueryEditor"
-                      icon="icons/query.png"
-                      style="push">
-                </command>
-          </menuContribution>
-  <menuContribution
-        locationURI="popup:org.argeo.jcr.ui.explorer.browserView">
-     <command
-           commandId="org.argeo.jcr.ui.explorer.refresh"
-           icon="icons/refresh.png"
-           style="push">
-     </command>
-     <command
-           commandId="org.argeo.jcr.ui.explorer.addFileFolder"
-           icon="icons/add.gif"
-           style="push">
-     </command>
-     <command
-           commandId="org.argeo.jcr.ui.explorer.deleteNode"
-           icon="icons/remove.gif"
-           style="push">
-     </command>
-     <command
-           commandId="org.argeo.jcr.ui.explorer.importFileSystem"
-           icon="icons/import_fs.png"
-           style="push"
-           tooltip="Import files from the files sytem to the repository">
-     </command>
-  </menuContribution>
+                       locationURI="menu:org.argeo.jcr.ui.explorer.browserView">
+            <!-- See bug 149 --> 
+            <!-- <command
+               commandId="org.argeo.jcr.ui.explorer.openGenericJcrQueryEditor"
+                icon="icons/query.png"
+                style="push">
+            </command> --> 
+            <command
+               commandId="org.argeo.jcr.ui.explorer.addRemoteRepository"
+                icon="icons/addRepo.gif"
+                style="push">
+            </command>
+             <command
+               commandId="org.argeo.jcr.ui.explorer.sortChildNodes"
+                icon="icons/sort.gif"
+                style="toggle"
+                label="Sort child nodes"
+                tooltip="Warning: stopping to sort children nodes might enhance overall performances">
+            </command>
+               </menuContribution>
+               <!-- Browser view popup context menu --> 
+               <menuContribution
+                       locationURI="popup:org.argeo.jcr.ui.explorer.browserView">
+                       <command
+                               commandId="org.argeo.jcr.ui.explorer.refresh"
+                               icon="icons/refresh.png"
+                               style="push">
+                       </command>
+                       <command
+                        commandId="org.argeo.jcr.ui.explorer.addFolderNode"
+                        icon="icons/addFolder.gif"
+                        label="Add Folder"
+                        style="push">
+                               <visibleWhen>
+                                       <iterate>
+                                     <and>
+                                        <or>
+                                           <instanceof
+                                                 value="org.argeo.jcr.ui.explorer.model.SingleJcrNodeElem">
+                                           </instanceof>
+                                           <instanceof
+                                                 value="org.argeo.jcr.ui.explorer.model.WorkspaceElem">
+                                           </instanceof>
+                                        </or>
+                               <with variable="activeMenuSelection"><count value="1"/></with>
+                                     </and>
+                                       </iterate>
+                               </visibleWhen>
+                       </command>
+                       <command
+                        commandId="org.argeo.jcr.ui.explorer.addPrivileges"
+                        icon="icons/addPrivileges.png"
+                        label="Add Privileges"
+                        style="push">
+                               <visibleWhen>
+                                       <iterate>
+                                     <and>
+                                        <or>
+                                           <instanceof
+                                                 value="org.argeo.jcr.ui.explorer.model.SingleJcrNodeElem">
+                                           </instanceof>
+                                           <instanceof
+                                                 value="org.argeo.jcr.ui.explorer.model.WorkspaceElem">
+                                           </instanceof>
+                                        </or>
+                               <with variable="activeMenuSelection"><count value="1"/></with>
+                                     </and>
+                                       </iterate>
+                               </visibleWhen>
+                       </command>
+                       <command
+                        commandId="org.argeo.jcr.ui.explorer.createWorkspace"
+                        icon="icons/addWorkspace.png"
+                        label="Create Workspace"
+                        style="push">
+                               <visibleWhen>
+                                       <iterate>
+                                       <and>
+                                               <or>
+                                               <instanceof
+                                                       value="org.argeo.jcr.ui.explorer.model.RepositoryElem">
+                                               </instanceof>
+                                               </or>
+                                       <with variable="activeMenuSelection"><count value="1"/></with>
+                                               </and>
+                                       </iterate>
+                               </visibleWhen>
+                       </command>
+                       <command
+                               commandId="org.argeo.jcr.ui.explorer.deleteNodes"
+                               icon="icons/remove.gif"
+                               label="Delete Nodes"
+                               style="push">
+                               <visibleWhen>
+                                       <iterate>
+                                               <or>
+                                                       <instanceof
+                                                               value="org.argeo.jcr.ui.explorer.model.SingleJcrNodeElem" />
+                                                       <instanceof
+                                                               value="org.argeo.jcr.ui.explorer.model.WorkspaceElem" />
+                                               </or>
+                                       </iterate>
+                               </visibleWhen>
+                       </command>
+                       <command
+                               commandId="org.argeo.jcr.ui.explorer.importFileSystem"
+                               icon="icons/import_fs.png"
+                               style="push"
+                               tooltip="Import files from the files sytem">
+                               <visibleWhen>
+                                       <iterate>
+                                               <and>
+                                                       <or>
+                                                               <instanceof
+                                                                       value="org.argeo.jcr.ui.explorer.model.SingleJcrNodeElem" />
+                                                               <instanceof
+                                               value="org.argeo.jcr.ui.explorer.model.WorkspaceElem" />
+                                       </or>
+                                       <with variable="activeMenuSelection"><count value="1"/></with>
+                                               </and>
+                                       </iterate>
+                               </visibleWhen>
+                       </command>
+                       <command
+                               commandId="org.argeo.jcr.ui.explorer.addRemoteRepository"
+                               icon="icons/addRepo.gif"
+                               style="push">
+                                       <visibleWhen>
+                                               <iterate> 
+                                                       <or>
+                                                               <instanceof
+                                               value="org.argeo.jcr.ui.explorer.model.RepositoriesElem" />
+                                                               <instanceof
+                                                                       value="org.argeo.jcr.ui.explorer.model.RepositoryElem" />
+                                                       </or> 
+                                               </iterate>
+                                       </visibleWhen>
+                       </command>
+                       <command
+                               commandId="org.argeo.jcr.ui.explorer.removeRemoteRepository"
+                               icon="icons/remove.gif"
+                               style="push">
+                               <visibleWhen>
+                                       <iterate> 
+                                               <or>
+                                                       <instanceof
+                                                               value="org.argeo.jcr.ui.explorer.model.RemoteRepositoryElem" />
+                                               </or> 
+                               </iterate>
+                               </visibleWhen>
+                       </command>
+                       <command
+                               commandId="org.argeo.jcr.ui.explorer.getNodeSize"
+                               icon="icons/getSize.gif"
+                               style="push">
+                                       <visibleWhen>
+                                               <iterate>
+                                                       <or>
+                                                               <instanceof
+                                                                       value="org.argeo.jcr.ui.explorer.model.SingleJcrNodeElem" />
+                                                               <instanceof
+                                                                       value="org.argeo.jcr.ui.explorer.model.WorkspaceElem" />
+                                       </or>
+                                       </iterate>
+                                       </visibleWhen>
+                       </command>
+                       <command
+                        commandId="org.argeo.jcr.ui.explorer.dumpNode"
+                        icon="icons/dumpNode.gif"
+                        label="Dump Node"
+                        style="push">
+                               <visibleWhen>
+                                       <iterate>
+                                     <and>
+                                               <instanceof value="org.argeo.jcr.ui.explorer.model.SingleJcrNodeElem"></instanceof>
+                               <with variable="activeMenuSelection"><count value="1"/></with>
+                                     </and>
+                                       </iterate>
+                               </visibleWhen>
+                       </command>
+                       
+               </menuContribution>
        </extension>
-  <extension
-           point="org.eclipse.ui.activities">
-        <activity
-              description="Only for admins"
-              id="org.argeo.jcr.ui.explorer.adminActivity"
-              name="Admin">
-                 <enabledWhen>
-                   <with variable="roles">
-                     <iterate ifEmpty="false" operator="or">
-                       <equals value="ROLE_ADMIN" />
-                     </iterate>
-                   </with>
-                 </enabledWhen>
-        </activity>
-        <!-- TODO: find a way to exclude evrything -->
+
+       <!-- Reduce visibility of JCR Explorer perspective to users that are in ROLE_ADMIN -->  
+       <extension
+       point="org.eclipse.ui.activities">
+               <activity
+                       description="Only for admins"
+                       id="org.argeo.jcr.ui.explorer.adminActivity"
+            name="Jcr Technical Admin">
+                       <enabledWhen>
+                               <with variable="roles">
+                                       <iterate ifEmpty="false" operator="or">
+                                               <equals value="ROLE_ADMIN" />
+                                       </iterate>
+                               </with>
+                       </enabledWhen>
+               </activity>
         <activityPatternBinding
-              activityId="org.argeo.jcr.ui.explorer.adminActivity"
-              isEqualityPattern="true"
-              pattern="org.argeo.jcr.ui.explorer/org.argeo.jcr.ui.explorer.perspective">
-        </activityPatternBinding>
-     </extension>
-</plugin>
+                       activityId="org.argeo.jcr.ui.explorer.adminActivity"
+                       isEqualityPattern="true"
+                       pattern="org.argeo.jcr.ui.explorer/org.argeo.jcr.ui.explorer.perspective">
+               </activityPatternBinding>
+       </extension>
+
+       <!-- Core expression definition 
+       <extension
+         point="org.eclipse.core.expressions.definitions">
+      <definition
+            id="expression.onlyOneItemSelected">
+         <with
+               variable="activeMenuSelection">
+            <count
+                  value="1">
+            </count>
+         </with>
+      </definition>
+   </extension>
+       --> 
+</plugin>
\ No newline at end of file