Package org.exoplatform.portal.config.model

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


         if(path.length == 1)
         {
            return new ParentChildPair(null, rootNode);
         }
        
         PageNode tempNode = rootNode;
        
         PageNode parentNode = null;
         PageNode childNode = null;
         for(int i = 1; i< path.length; i++)
         {
            childNode = tempNode.getChild(path[i]);
            if(childNode == null)
            {
View Full Code Here


      if (node.getChildren() == null)
         return null;
      List<PageNode> children = node.getChildren();
      for (PageNode ele : children)
      {
         PageNode returnNode = searchPageNodeByUri(ele, uri);
         if (returnNode != null)
            return returnNode;
      }
      return null;
   }
View Full Code Here

      if (nav.getNodes() == null)
         return null;
      List<PageNode> nodes = nav.getNodes();
      for (PageNode ele : nodes)
      {
         PageNode returnNode = searchPageNodeByUri(ele, uri);
         if (returnNode != null)
            return returnNode;
      }
      return null;
   }
View Full Code Here

         (UserPortalConfigService)container.getComponentInstanceOfType(UserPortalConfigService.class);
      UserACL userACL = (UserACL)container.getComponentInstanceOfType(UserACL.class);

      for (PageNode node : nav.getNodes())
      {
         PageNode newNode = filterNodeNavigation(node, userName, acceptNonDisplayedNode, acceptNodeWithoutPage, userService, userACL);
         if (newNode != null)
            filter.addNode(newNode);
      }
      return filter;
   }
View Full Code Here

    * @throws Exception
    */
   @Deprecated
   private static PageNode filterNodeNavigation(PageNode startNode, String userName, boolean acceptNonDisplayedNode,
          UserPortalConfigService userService, UserACL userACL) throws Exception {
     PageNode cloneStartNode = filterNodeNavigation(startNode, userName, acceptNonDisplayedNode, false, userService, userACL);
     return cloneStartNode;
   }
View Full Code Here

      if (doNothingCase_1 || doNothingCase_2 || doNothingCase_3)
      {
         return null;
      }

      PageNode cloneStartNode = startNode.clone();
      ArrayList<PageNode> filteredChildren = new ArrayList<PageNode>();

      List<PageNode> children = startNode.getChildren();

      if (children != null)
      {
         for (PageNode child : children)
         {
            PageNode filteredChildNode = filterNodeNavigation(child, userName, acceptNonDisplayedNode, acceptNodeWithoutPage, userService, userACL);
            if (filteredChildNode != null)
            {
               filteredChildren.add(filteredChildNode);
            }
         }
View Full Code Here

         UIPageNodeSelector uiNodeSelector = uiPageInfo.getChild(UIPageNodeSelector.class);
         PageNavigation pageNavi = uiNodeSelector.getSelectedNavigation();
         String ownerType = pageNavi.getOwnerType();
         String ownerId = pageNavi.getOwnerId();

         PageNode pageNode = uiPageInfo.getPageNode();
         Page page = uiPageTemplateOptions.createPageFromSelectedOption(ownerType, ownerId);
         page.setName("page" + page.hashCode());
         String pageId = pageNavi.getOwnerType() + "::" + pageNavi.getOwnerId() + "::" + page.getName();
         DataStorage storage = uiWizard.getApplicationComponent(DataStorage.class);
         if (storage.getPage(pageId) != null)
         {
            uiPortalApp.addMessage(new ApplicationMessage("UIPageCreationWizard.msg.NameNotSame", null));
            uiWizard.viewStep(FIRST_STEP);
            uiWizard.updateWizardComponent();
         }
         page.setModifiable(true);

         // Set default permissions on the page
         setDefaultPermission(page, ownerType, ownerId);

         if (page.getTitle() == null || page.getTitle().trim().length() == 0)
         {
            page.setTitle(pageNode.getName());
         }

         boolean isDesktopPage = Page.DESKTOP_PAGE.equals(page.getFactoryId());
         if (isDesktopPage)
         {
            page.setShowMaxWindow(true);
         }

         UIPagePreview uiPagePreview = uiWizard.getChild(UIPagePreview.class);
         UIPage uiPage;
         if (Page.DESKTOP_PAGE.equals(page.getFactoryId()))
         {
            uiPage = uiWizard.createUIComponent(context, UIDesktopPage.class, null, null);
         }
         else
         {
            uiPage = uiWizard.createUIComponent(context, UIPage.class, null, null);
         }

         PortalDataMapper.toUIPage(uiPage, page);
         uiPagePreview.setUIComponent(uiPage);

         if (isDesktopPage)
         {
            uiWizard.saveData();
            PageNode selectedNode = uiNodeSelector.getSelectedPageNode();
            UIPortal uiPortal = Util.getUIPortal();
            PageNodeEvent<UIPortal> pnevent = new PageNodeEvent<UIPortal>(uiPortal, PageNodeEvent.CHANGE_PAGE_NODE, selectedNode.getUri());
            uiPortal.broadcast(pnevent, Event.Phase.PROCESS);
            uiWizard.updateUIPortal(event);
            return;
         }
View Full Code Here

         UIPortalToolPanel toolPanel = uiWorkingWS.findFirstComponentOfType(UIPortalToolPanel.class);
         toolPanel.setUIComponent(null);
         uiWizard.updateUIPortal(event);
         UIWizardPageSetInfo uiPageInfo = uiWizard.getChild(UIWizardPageSetInfo.class);
         UIPageNodeSelector uiNodeSelector = uiPageInfo.getChild(UIPageNodeSelector.class);
         PageNode selectedNode = uiNodeSelector.getSelectedPageNode();
        
         PortalRequestContext pcontext = Util.getPortalRequestContext();
         String uri = pcontext.getPortalURI() + selectedNode.getUri();
         pcontext.getResponse().sendRedirect(uri);
      }
View Full Code Here

      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)
         {
View Full Code Here

      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());

      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

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.