Examples of PageNode


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

        // The last encountered child
        NodeContext<?> previousChild = null;

        // Replay the changes and apply them
        for (Change change : foo) {
            PageNode srcChild = src.getNode(change.name);
            NodeContext<?> dstChild = dst.get(change.name);

            //
            switch (change.type) {
                case SAME:
View Full Code Here

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

        parentUri.insert(0, node.getName()).insert(0, "/");
        getPath(node.getParent(), parentUri);
    }

    private static PageNode createPageNode(DescriptionService service, NodeContext<NodeContext<?>> node) {
        PageNode pageNode = new PageNode();
        pageNode.setName(node.getName());

        if (node.getState().getLabel() == null) {
            Map<Locale, Described.State> descriptions = service.getDescriptions(node.getId());
            if (descriptions != null && !descriptions.isEmpty()) {
                I18NString labels = new I18NString();
                for (Map.Entry<Locale, Described.State> entry : descriptions.entrySet()) {
                    labels.add(new LocalizedString(entry.getValue().getName(), entry.getKey()));
                }

                pageNode.setLabels(labels);
            }
        } else {
            pageNode.setLabel(node.getState().getLabel());
        }

        pageNode.setIcon(node.getState().getIcon());
        long startPublicationTime = node.getState().getStartPublicationTime();
        if (startPublicationTime != -1) {
            pageNode.setStartPublicationDate(new Date(startPublicationTime));
        }

        long endPublicationTime = node.getState().getEndPublicationTime();
        if (endPublicationTime != -1) {
            pageNode.setEndPublicationDate(new Date(endPublicationTime));
        }

        pageNode.setVisibility(node.getState().getVisibility());
        pageNode.setPageReference(node.getState().getPageRef() != null ? node.getState().getPageRef().format() : null);

        if (node.getNodes() != null) {
            ArrayList<PageNode> children = new ArrayList<PageNode>(node.getNodeCount());
            for (NodeContext<?> child : node.getNodes()) {
                @SuppressWarnings("unchecked")
                NodeContext<NodeContext<?>> childNode = (NodeContext<NodeContext<?>>) child;
                children.add(createPageNode(service, childNode));
            }

            pageNode.setChildren(children);
        } else {
            pageNode.setChildren(new ArrayList<PageNode>(0));
        }

        return pageNode;
    }
View Full Code Here

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

            }
        }
    }

    private PageNode unmarshalNode(StaxNavigator<Element> navigator) throws StaxNavException {
        PageNode node = new PageNode();
        I18NString labels = new I18NString();
        ArrayList<PageNode> children = new ArrayList<PageNode>();

        Element current = navigator.child();
        while (current != null) {
            switch (navigator.getName()) {
                case URI: // For backwards compatibility
                    current = navigator.sibling();
                    break;
                case NAME:
                    node.setName(navigator.getContent());
                    current = navigator.sibling();
                    break;
                case LABEL:
                    labels.add(Utils.parseLocalizedString(navigator));
                    current = navigator.sibling();
                    break;
                case ICON:
                    node.setIcon(navigator.getContent());
                    current = navigator.sibling();
                    break;
                case START_PUBLICATION_DATE:
                    node.setStartPublicationDate(navigator.parseContent(ValueType.DATE_TIME));
                    current = navigator.sibling();
                    break;
                case END_PUBLICATION_DATE:
                    node.setEndPublicationDate(navigator.parseContent(ValueType.DATE_TIME));
                    current = navigator.sibling();
                    break;
                case VISIBILITY:
                    node.setVisibility(navigator.parseContent(ValueType.get(Visibility.class)));
                    current = navigator.sibling();
                    break;
                case PAGE_REFERENCE:
                    node.setPageReference(navigator.getContent());
                    current = navigator.sibling();
                    break;
                case NODE:
                    PageNode child = unmarshalNode(navigator.fork());
                    children.add(child);
                    current = navigator.sibling();
                    break;
                case UNKNOWN:
                    throw unknownElement(navigator);
View Full Code Here

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

         return null;
      List<PageNode> pageNodes = pageNav.getNodes();
      UITree uiTree = getChild(UITree.class);
      for (PageNode ele : pageNodes)
      {
         PageNode returnPageNode = searchPageNodeByUri(ele, uri, uiTree);
         if (returnPageNode == null)
            continue;
         if (uiTree.getSibbling() == null)
            uiTree.setSibbling(pageNodes);
         return returnPageNode;
View Full Code Here

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

      WebuiRequestContext context = Util.getPortalRequestContext();
      ExoContainer appContainer = context.getApplication().getApplicationServiceContainer();
      UserPortalConfigService userPortalConfigService =
         (UserPortalConfigService)appContainer.getComponentInstanceOfType(UserPortalConfigService.class);
      Page page = null;
      PageNode pageNode = Util.getUIPortal().getSelectedNode();
      if (pageNode != null)
      {
         try
         {
            if (pageNode.getPageReference() != null)
            {
               page = userPortalConfigService.getPage(pageNode.getPageReference(), context.getRemoteUser());
            }
         }
         catch (NoSuchDataException nsde)
         {
            return false;
View Full Code Here

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

      List<PageNode> children = pageNode.getChildren();
      if (children == null)
         return null;
      for (PageNode ele : children)
      {
         PageNode returnPageNode = searchPageNodeByUri(ele, uri, tree);
         if (returnPageNode == null)
            continue;
         if (tree.getSibbling() == null)
            tree.setSibbling(children);
         if (tree.getParentSelected() == null)
View Full Code Here

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

         //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

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

      {
         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

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

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

         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
TOP
Copyright © 2018 www.massapi.com. 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.