]> git.argeo.org Git - lgpl/argeo-commons.git/blobdiff - server/plugins/org.argeo.jcr.ui.explorer/plugin.xml
Improve secure logging
[lgpl/argeo-commons.git] / server / plugins / org.argeo.jcr.ui.explorer / plugin.xml
index 933aad083ebf7951a75bcdaf3626a7fa4bed1adc..09dffb8a9379647aed275545f8cb384f46b696c4 100644 (file)
                                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.addFileFolder"
-               name="Add file folder...">
+               id="org.argeo.jcr.ui.explorer.addFolderNode"
+               name="Create the new folder">
          </command>
          <command
                defaultHandler="org.argeo.eclipse.spring.SpringCommandHandler"
@@ -68,8 +82,8 @@
          </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.openFile"
                name="Open current file">
          </command>
+         <command
+            defaultHandler="org.argeo.jcr.ui.explorer.commands.SortChildNodes"
+            id="org.argeo.jcr.ui.explorer.sortChildNodes"
+            name="Sort node tree">
+            <state 
+                               id="org.argeo.jcr.ui.explorer.sortChildNodes.toggleState">
+                               <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>
+                       locationURI="menu:org.argeo.jcr.ui.explorer.browserView">
+            <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="%addNewFolderCmdLbl"
+         style="push">
+                               <visibleWhen>
+                                       <iterate>
+                                     <and>
+                                        <or>
+                                           <instanceof
+                                                 value="org.argeo.jcr.ui.explorer.model.SingleJcrNode">
+                                           </instanceof>
+                                           <instanceof
+                                                 value="org.argeo.jcr.ui.explorer.model.WorkspaceNode">
+                                           </instanceof>
+                                        </or>
+             <reference
+                   definitionId="expression.onlyOneItemSelected">
+             </reference>
+                                     </and>
+                                       </iterate>
+                               </visibleWhen>
+                       </command>
      <command
-           commandId="org.argeo.jcr.ui.explorer.deleteNode"
+           commandId="org.argeo.jcr.ui.explorer.deleteNodes"
            icon="icons/remove.gif"
            style="push">
+        <visibleWhen>
+           <iterate>
+              <or>
+                 <instanceof
+                       value="org.argeo.jcr.ui.explorer.model.SingleJcrNode">
+                 </instanceof>
+                 <instanceof
+                       value="org.argeo.jcr.ui.explorer.model.WorkspaceNode">
+                 </instanceof>
+              </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 to the repository">
+        <visibleWhen>
+           <iterate>
+              <and>
+                 <or>
+                    <instanceof
+                          value="org.argeo.jcr.ui.explorer.model.SingleJcrNode">
+                    </instanceof>
+                    <instanceof
+                          value="org.argeo.jcr.ui.explorer.model.WorkspaceNode">
+                    </instanceof>
+                 </or>
+                 <with
+                     variable="activeMenuSelection">
+                  <count
+                        value="1">
+                  </count>
+               </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.RepositoriesNode">
+                                       </instanceof>
+                                       <instanceof
+                                               value="org.argeo.jcr.ui.explorer.model.RepositoryNode">
+                                       </instanceof>
+                               </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.SingleJcrNode">
+                 </instanceof>
+                 <instanceof
+                       value="org.argeo.jcr.ui.explorer.model.WorkspaceNode">
+                 </instanceof>
+              </or>
+           </iterate>
+        </visibleWhen>
      </command>
   </menuContribution>
        </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>
+       
   <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 -->
         <activityPatternBinding
-              activityId="org.argeo.jcr.ui.explorer.adminActivity"
+              activityId="org.argeo.security.ui.adminActivity"
               isEqualityPattern="true"
               pattern="org.argeo.jcr.ui.explorer/org.argeo.jcr.ui.explorer.perspective">
         </activityPatternBinding>