Examples of PageNode


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

         return userACL.hasEditPermissionOnPage(uiPage.getOwnerType(), uiPage.getOwnerId(), uiPage.getEditPermission());
      }
      else
      {
         UIPortal currentUIPortal = portalApp.<UIWorkingWorkspace>findComponentById(UIPortalApplication.UI_WORKING_WS_ID).findFirstComponentOfType(UIPortal.class);
         PageNode currentNode = currentUIPortal.getSelectedNode();
         String pageReference = currentNode.getPageReference();
         if(pageReference == null)
         {
            return false;
         }
         else
View Full Code Here

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

               _configService.createPageTemplate(PAGE_TEMPLATE, _pageNavigation.getOwnerType(), _pageNavigation
                  .getOwnerId());
            page.setTitle(_nodeName);
            page.setName(_nodeName);

            PageNode pageNode = new PageNode();
            pageNode.setName(_nodeName);
            pageNode.setLabel(prContext.getApplicationResourceBundle().getString("UIUserToolBarDashboard.page.ClickAndType"));
            pageNode.setResolvedLabel(prContext.getApplicationResourceBundle());
            pageNode.setUri(_nodeName);
            pageNode.setPageReference(page.getPageId());

            _pageNavigation.addNode(pageNode);
            _configService.create(page);
            _configService.update(_pageNavigation);
View Full Code Here

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

   {
      List<PageNode> siblings = getPageNavigation().getNodes();
      List<PageNode> selectedPath = Util.getUIPortal().getSelectedPath();
      if (selectedPath != null && selectedPath.size() > 1)
      {
         PageNode currentParent = selectedPath.get(selectedPath.size() - 2);
         siblings = currentParent.getChildren();
      }
      return siblings;
   }
View Full Code Here

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

   public PageNode removePageNode(int nodeIndex)
   {
      try
      {
         List<PageNode> nodes = pageNavigation.getNodes();
         PageNode tobeRemoved = nodes.get(nodeIndex);
         PageNode selectedNode = uiPortal.getSelectedNode();

         boolean isRemoved = true; // To check
         PageNavigation updateNav =
            dataService.getPageNavigation(pageNavigation.getOwnerType(), pageNavigation.getOwnerId());
         for (PageNode pageNode : updateNav.getNodes())
         {
            if (pageNode.getUri().equals(tobeRemoved.getUri()))
            {
               isRemoved = false;
               break;
            }
         }

         if (nodes.size() >= 2)
         {
            // Remove node
            nodes.remove(tobeRemoved);

            // Choose selected Node
            if (tobeRemoved.getUri().equals(selectedNode.getUri()))
            {
               selectedNode = nodes.get(Math.max(0, nodeIndex - 1));

            }
            else if (!nodes.contains(selectedNode))
View Full Code Here

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

            configService.createPageTemplate(UITabPaneDashboard.PAGE_TEMPLATE, pageNavigation.getOwnerType(),
               pageNavigation.getOwnerId());
         page.setTitle(nodeLabel);

         List<PageNode> selectedPath = uiPortal.getSelectedPath();
         PageNode parentNode = null;
         if (selectedPath != null && selectedPath.size() > 1)
         {
            parentNode = selectedPath.get(selectedPath.size() - 2);
         }

         PageNode pageNode = new PageNode();
         pageNode.setLabel(nodeLabel);
         String uniqueNodeName = nodeLabel.toLowerCase().replace(' ', '_');
         if (nameExisted(uniqueNodeName))
         {
            uniqueNodeName = uniqueNodeName + "_" + System.currentTimeMillis();
         }

         String fullName = (parentNode != null) ? parentNode.getUri() + "/" + uniqueNodeName : uniqueNodeName;

         page.setName(uniqueNodeName);
         pageNode.setName(uniqueNodeName);
         pageNode.setUri(fullName);
         pageNode.setPageReference(page.getPageId());

         if (parentNode == null)
         {
            pageNavigation.addNode(pageNode);
         }
View Full Code Here

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

   {
      try
      {
         List<PageNode> nodes = pageNavigation.getNodes();
         List<PageNode> selectedPath = uiPortal.getSelectedPath();
         PageNode parentNode = null;
         if (selectedPath != null && selectedPath.size() > 1)
         {
            parentNode = selectedPath.get(selectedPath.size() - 2);
            nodes = parentNode.getChildren();
         }

         PageNode renamedNode = nodes.get(nodeIndex);
         if (renamedNode == null || newNodeLabel.length() == 0)
         {
            return null;
         }

         renamedNode.setLabel(newNodeLabel);

         String newNodeName = newNodeLabel.toLowerCase().replace(' ', '_');
         if (nameExisted(newNodeName))
         {
            newNodeName = newNodeName + "_" + System.currentTimeMillis();
         }
         renamedNode.setName(newNodeName);

         String newUri = (parentNode != null) ? parentNode.getUri() + "/" + newNodeName : newNodeName;

         renamedNode.setUri(newUri);

         Page page = configService.getPage(renamedNode.getPageReference());
         page.setTitle(newNodeLabel);
         if (page != null)
            dataService.save(page);
        
         dataService.save(pageNavigation);
View Full Code Here

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

      }

      try
      {
         ArrayList<PageNode> nodes = pageNavigation.getNodes();
         PageNode firstNode = nodes.get(firstIndex);
         PageNode secondNode = nodes.get(secondIndex);
         nodes.set(firstIndex, secondNode);
         nodes.set(secondIndex, firstNode);

         dataService.save(pageNavigation);
         return true;
View Full Code Here

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

      public void execute(Event<UITabPaneDashboard> event) throws Exception
      {
         UITabPaneDashboard source = event.getSource();
         WebuiRequestContext context = event.getRequestContext();
         int removedNodeIndex = Integer.parseInt(context.getRequestParameter(UIComponent.OBJECTID));
         PageNode selectedNode = source.removePageNode(removedNodeIndex);

         //If the node is removed successfully, then redirect to the node specified by tab on the left
         if (selectedNode != null)
         {
            // set maximizedUIComponent of UIPageBody is null if it is maximized portlet of removed page
            UIPortal uiPortal = Util.getUIPortal();
            UIPageBody uiPageBody = uiPortal.findFirstComponentOfType(UIPageBody.class);
            if (uiPageBody != null && uiPageBody.getMaximizedUIComponent() != null)
            {
               uiPageBody.setMaximizedUIComponent(null);
            }

            PortalRequestContext prContext = Util.getPortalRequestContext();
            prContext.setResponseComplete(true);
            prContext.getResponse().sendRedirect(prContext.getPortalURI() + selectedNode.getUri());
         }
      }
View Full Code Here

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

            throw unknownElement(navigator);
        }
    }

    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

    */
   public PageNode createNodeFromPageTemplate(String nodeName, String nodeLabel, String pageId, String ownerType,
                                              String ownerId) throws Exception
   {
      Page page = storage_.clonePage(pageId, nodeName, ownerType, ownerId);
      PageNode pageNode = new PageNode();
      if (nodeLabel == null || nodeLabel.trim().length() < 1)
      {
         nodeLabel = nodeName;
      }
      pageNode.setName(nodeName);
      pageNode.setLabel(nodeLabel);
      pageNode.setPageReference(page.getPageId());
      return pageNode;
   }
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.