Package org.exoplatform.portal.config.model

Examples of org.exoplatform.portal.config.model.PageNode


         String formerNavId = currentNav.getOwnerId();
         String newNavType = targetedNav.getOwnerType();
         String newNavId = targetedNav.getOwnerId();
        
         String[] targetPath = targetedUri.split("/");
         PageNode targetPageNode = getTargetedNode(targetedNav, targetPath);
         List<PageNode> targetedPathNodes = findPath(targetedNav, targetPath);
        
         if(formerNavType.equals(newNavType) && formerNavId.equals(newNavId))
         {
            //Case 1: Both navigation type and id are not changed, but current page node is changed
View Full Code Here


         if(pathNodes.length == 0)
         {
            return 0;
         }
        
         PageNode currentNode = nav.getNode(pathNodes[0]);
         int numberOfMatch = (currentNode != null)? 1 : 0 ;
        
         for(int i = 1; i < pathNodes.length; i++)
         {
            if(currentNode == null)
            {
               break;
            }
            currentNode = currentNode.getChild(pathNodes[i]);
         }
         return numberOfMatch;
      }
View Full Code Here

         if(pathNodes.length == 0)
         {
           return getDefaultNode(targetedNav);
         }
        
         PageNode currentNode = targetedNav.getNode(pathNodes[0]);
         if(currentNode == null)
         {
            return getDefaultNode(targetedNav);
         }
        
         PageNode tempNode = null;
        
         for(int i = 1; i < pathNodes.length; i++)
         {
            tempNode = currentNode.getChild(pathNodes[i]);
            if (tempNode == null)
View Full Code Here

       * @param nav
       * @return
       */
      private PageNode getDefaultNode(PageNavigation nav)
      {
         PageNode defaultNode;
         try
         {
            defaultNode = nav.getNodes().get(0);
         }
         catch (IndexOutOfBoundsException ex)
         {
            return null;
         }
         if (defaultNode != null && !("notfound".equals(defaultNode.getName())))
         {
            return defaultNode;
         }
         else
         {
View Full Code Here

         if(pathNodes.length == 0)
         {
            nodes.add(nav.getNodes().get(0));
            return nodes;
         }
         PageNode startNode = nav.getNode(pathNodes[0]);
         if (startNode == null)
         {
            return nodes;
         }
         nodes.add(startNode);

         for (int i = 1; i < pathNodes.length; i++)
         {
            startNode = startNode.getChild(pathNodes[i]);
            if(startNode == null)
            {
               break;
            }
            else
View Full Code Here

         //event.getRequestContext().addUIComponentToUpdateByAjax(uiManagement);
         SelectedNode selectedNode = uiPortalNodeSelector.getCopyNode();
         if (selectedNode == null)
            return;

         PageNode newNode = selectedNode.getNode().clone();
         PageNavigation targetNav = uiPortalNodeSelector.getSelectedNavigation();
         PageNode targetNode = PageNavigationUtils.searchPageNodeByUri(targetNav, targetUri);

         if (targetNode != null && newNode.getUri().equals(targetNode.getUri()))
         {
            UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
            uiApp.addMessage(new ApplicationMessage("UIPageNodeSelector.msg.paste.sameSrcAndDes", null));
            return;
         }

         if (isExistChild(targetNode, newNode) || (targetNode == null && isExitChild(targetNav, newNode)))
         {
            UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
            uiApp.addMessage(new ApplicationMessage("UIPageNodeSelector.msg.paste.sameName", null));
            return;
         }
         if (selectedNode.isDeleteNode())
         {
            if (selectedNode.getParentNode() != null)
            {
               selectedNode.getParentNode().getChildren().remove(selectedNode.getNode());
            }
            else
            {
               selectedNode.getPageNavigation().getNodes().remove(selectedNode.getNode());
            }
         }
         event.getRequestContext().addUIComponentToUpdateByAjax(uiPortalNodeSelector);
         uiPortalNodeSelector.setCopyNode(null);
         UITree uitree = uiPortalNodeSelector.getChild(UITree.class);
         UIRightClickPopupMenu popup = uitree.getUIRightClickPopupMenu();
         popup.setActions(new String[]{"AddNode", "EditPageNode", "EditSelectedNode", "CopyNode", "CutNode",
            "CloneNode", "DeleteNode", "MoveUp", "MoveDown"});

         UserPortalConfigService service = uiPopupMenu.getApplicationComponent(UserPortalConfigService.class);
         if (targetNode == null)
         {
            newNode.setUri(newNode.getName());
            targetNav.addNode(newNode);
            if (selectedNode.isCloneNode())
            {
               clonePageFromNode(newNode, targetNav.getOwnerType(), targetNav.getOwnerId(), service);
            }
            return;
         }
         setNewUri(targetNode, newNode);
         targetNode.getChildren().add(newNode);
         if (selectedNode.isCloneNode())
         {
            clonePageFromNode(newNode, targetNav.getOwnerType(), targetNav.getOwnerId(), service);
         }
         uiPortalNodeSelector.selectPageNodeByUri(targetNode.getUri());
      }
View Full Code Here

      {
         String uri = event.getRequestContext().getRequestParameter(UIComponent.OBJECTID);
         UIPortalNodeSelector uiPortalNodeSelector = event.getSource().getAncestorOfType(UIPortalNodeSelector.class);
         event.getRequestContext().addUIComponentToUpdateByAjax(uiPortalNodeSelector.getParent());
         PageNavigation nav = uiPortalNodeSelector.getSelectedNavigation();
         PageNode targetNode = PageNavigationUtils.searchPageNodeByUri(nav, uri);
         Object parentNode = PageNavigationUtils.searchParentNode(nav, uri);
         List<PageNode> children = new ArrayList<PageNode>();
         if (parentNode instanceof PageNavigation)
         {
            children = ((PageNavigation)parentNode).getNodes();
View Full Code Here

   }

   public void loadTreeNodes() throws Exception
   {
      WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
      treeNode_ = new TreeNode(new PageNode(), new PageNavigation(), true);
      for (PageNavigation nav : Util.getUIPortalApplication().getNavigations())
      {
         if (!showUserNavigation && nav.getOwnerType().equals("user"))
         {
            continue;
View Full Code Here

   {
      if (selectedNode_ != null && node.getUri().equals(selectedNode_.getUri()))
         return true;
      if (selectedParent_ == null || selectedParent_ instanceof PageNavigation)
         return false;
      PageNode pageNode = (PageNode)selectedParent_;
      return node.getUri().equals(pageNode.getUri());
   }
View Full Code Here

         {
            String navId = uri.substring(0, index);
            //selectNav = uiPortal.getPageNavigation(Integer.parseInt(navId));
            selectNav = uiPortal.getSelectedNavigation();
         }
         PageNode selectNode = PageNavigationUtils.searchPageNodeByUri(selectNav, id);
         uiNavigation.selectedNode_ = selectNode;
         String parentUri = null;
         index = uri.lastIndexOf("/");
         if (index > 0)
            parentUri = uri.substring(0, index);
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.config.model.PageNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.