Example #1
0
 List<UIComponent> getGroundActionsExtensionList() throws Exception {
   List<UIComponent> uiGroundActionList = new ArrayList<UIComponent>();
   List<UIExtension> uiExtensionList = getUIExtensionList();
   UIJCRExplorer uiExplorer = getAncestorOfType(UIJCRExplorer.class);
   Node currentNode = uiExplorer.getCurrentNode();
   UIComponent uiAddedActionManage;
   for (UIExtension uiextension : uiExtensionList) {
     if (GROUND_CONTEXT_MENU.equals(uiextension.getCategory())
         || ITEM_GROUND_CONTEXT_MENU.equals(uiextension.getCategory())) {
       uiAddedActionManage = addUIExtension(uiextension, createContext(currentNode));
       if (uiAddedActionManage != null) {
         if (!uiGroundActionList.contains(uiAddedActionManage))
           uiGroundActionList.add(uiAddedActionManage);
       }
     }
   }
   return uiGroundActionList;
 }
Example #2
0
    public void execute(Event<UIWorkingArea> event) throws Exception {
      UIJCRExplorer uiExplorer = event.getSource().getAncestorOfType(UIJCRExplorer.class);

      // Get path before renaming
      String pathBeforeRename = event.getRequestContext().getRequestParameter("oldPath");

      // Get path after renaming
      String renamedNodeUUID = event.getRequestContext().getRequestParameter("uuid");
      String pathAfterRename = null;
      Node renamedNode = null;
      try {
        renamedNode = uiExplorer.getSession().getNodeByUUID(renamedNodeUUID);
      } catch (ItemNotFoundException e) {
        // Try to find node in other workspaces
        String[] workspaceNames = uiExplorer.getRepository().getWorkspaceNames();
        String currentWorkSpaceName = uiExplorer.getWorkspaceName();
        for (String workspaceName : workspaceNames) {
          if (!workspaceName.equals(currentWorkSpaceName)) {
            try {
              renamedNode =
                  uiExplorer.getSessionByWorkspace(workspaceName).getNodeByUUID(renamedNodeUUID);
              break;
            } catch (ItemNotFoundException infE) {
              renamedNode = null;
            }
          }
        }
      }
      if (renamedNode != null) {
        pathAfterRename = renamedNode.getPath();
      } else {
        LOG.warn("Can not find renamed node with old path: [%s]", pathBeforeRename);
        return;
      }

      // Update content explorer
      String currentPath = uiExplorer.getCurrentPath();
      if (currentPath.equals(pathBeforeRename)) {
        uiExplorer.setCurrentPath(pathAfterRename);
      } else if (currentPath.startsWith(pathBeforeRename)) {
        uiExplorer.setCurrentPath(
            pathAfterRename + currentPath.replace(pathBeforeRename, StringUtils.EMPTY));
      }
      uiExplorer.updateAjax(event);
    }
Example #3
0
 public void setShowSideBar(boolean b) throws Exception {
   UIJCRExplorer jcrExplorer = getParent();
   jcrExplorer.getPreference().setShowSideBar(b);
 }
Example #4
0
 public boolean isJcrViewEnable() throws Exception {
   UIJCRExplorer uiExplorer = getAncestorOfType(UIJCRExplorer.class);
   return uiExplorer.getPreference().isJcrEnable();
 }
Example #5
0
 // Should use this method to check for when execute Actions in Working Area instead in
 // UIEditingTagsForm (line 120)
 public boolean isShowSideBar() throws Exception {
   UIJCRExplorer jcrExplorer = getParent();
   return jcrExplorer.getPreference().isShowSideBar()
       && getAncestorOfType(UIJCRExplorerPortlet.class).isShowSideBar();
 }