Package org.exoplatform.portal.config.model

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


      return pageNavigation;
   }

   private static PageNavigation createFragmentedPageNavigation(DescriptionService service, NavigationContext navigation, NodeContext<NodeContext<?>> node)
   {
      PageNavigation pageNavigation = new PageNavigation();
      pageNavigation.setPriority(navigation.getState().getPriority());
      pageNavigation.setOwnerType(navigation.getKey().getTypeName());
      pageNavigation.setOwnerId(navigation.getKey().getName());

      ArrayList<PageNode> children = new ArrayList<PageNode>(1);
      children.add(createPageNode(service, node));

      NavigationFragment fragment = new NavigationFragment();
      StringBuilder parentUri = new StringBuilder("");
      getPath(node.getParent(), parentUri);
      fragment.setParentURI(parentUri.toString());
      fragment.setNodes(children);

      pageNavigation.addFragment(fragment);

      return pageNavigation;
   }
View Full Code Here


      writer.writeEndElement(); // End of node
   }

   private PageNavigation unmarshalNavigation(StaxNavigator<Element> navigator) throws StaxNavException
   {
      PageNavigation navigation = new PageNavigation();

      if (navigator.getName() == Element.NODE_NAVIGATION)
      {
         Element next = navigator.child();
         if (next != Element.PRIORITY)
         {
            throw expectedElement(navigator, Element.PRIORITY);
         }
         Integer priority = parseRequiredContent(navigator, ValueType.INTEGER);
         navigation.setPriority(priority);

         next = navigator.sibling();
         if (next == Element.PAGE_NODES)
         {
            for (StaxNavigator<Element> fork: navigator.fork(Element.PAGE_NODES))
            {
               NavigationFragment fragment = new NavigationFragment();
               navigation.addFragment(fragment);

               next = fork.child();
               if (next == Element.PARENT_URI)
               {
                  String parentUri = fork.getContent();
View Full Code Here

         WebuiRequestContext ctx = event.getRequestContext();
         UIRightClickPopupMenu popupMenu = event.getSource();
         UIApplication uiApp = ctx.getUIApplication();
         String uri = event.getRequestContext().getRequestParameter(UIComponent.OBJECTID);
         UINavigationNodeSelector uiNodeSelector = popupMenu.getAncestorOfType(UINavigationNodeSelector.class);
         PageNavigation selectedNav = uiNodeSelector.getSelectedNavigation();
         Object obj = PageNavigationUtils.searchParentNode(selectedNav, uri);
         PageNode selectedNode = PageNavigationUtils.searchPageNodeByUri(selectedNav, uri);
         String pageId = selectedNode.getPageReference();

         UserPortalConfigService service = uiApp.getApplicationComponent(UserPortalConfigService.class);
View Full Code Here

         UINavigationManagement uiManagement = uiNodeSelector.getParent();
         Class<?>[] childrenToRender = new Class<?>[]{UINavigationNodeSelector.class};
         uiManagement.setRenderedChildrenOfTypes(childrenToRender);
         event.getRequestContext().addUIComponentToUpdateByAjax(uiManagement);

         PageNavigation nav = uiNodeSelector.getSelectedNavigation();
         if (nav == null)
         {
            return;
         }
         PageNode[] pageNodes = PageNavigationUtils.searchPageNodesByUri(nav, uri);
View Full Code Here

         {
            return;
         }

         PageNode newNode = selectedNode.getNode().clone();
         PageNavigation targetNav = uiNodeSelector.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(uiNodeSelector);
         uiNodeSelector.setCopyNode(null);
         UITree uitree = uiNodeSelector.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);
         }
         uiNodeSelector.selectPageNodeByUri(targetNode.getUri());
      }
View Full Code Here

         if (pageNode.getLabel() == null)
            pageNode.setLabel(pageNode.getName());

         String remoteUser = ctx.getRemoteUser();
         Object selectedParent = uiPageNodeForm.getSelectedParent();
         PageNavigation pageNav = null;

         if (selectedParent instanceof PageNavigation)
         {
            pageNav = (PageNavigation)selectedParent;
            pageNode.setUri(pageNode.getName());
            if (!pageNav.getNodes().contains(pageNode))
            {
               if (PageNavigationUtils.searchPageNodeByUri(pageNav, pageNode.getUri()) != null)
               {
                  uiApp.addMessage(new ApplicationMessage("UIPageNodeForm2.msg.SameName", null));
                  return;
               }
               pageNav.addNode(pageNode);
            }
         }
         else if (selectedParent instanceof PageNode)
         {
            PageNode parentNode = (PageNode)selectedParent;
View Full Code Here

      protected void moveNode(Event<UIRightClickPopupMenu> event, int i)
      {
         String uri = event.getRequestContext().getRequestParameter(UIComponent.OBJECTID);
         UINavigationNodeSelector uiNodeSelector = event.getSource().getAncestorOfType(UINavigationNodeSelector.class);
         event.getRequestContext().addUIComponentToUpdateByAjax(uiNodeSelector.getParent());
         PageNavigation nav = uiNodeSelector.getSelectedNavigation();
         PageNode targetNode = PageNavigationUtils.searchPageNodeByUri(nav, uri);
         Object parentNode = PageNavigationUtils.searchParentNode(nav, uri);
         List<PageNode> children = new ArrayList<PageNode>();
         if (parentNode instanceof PageNavigation)
         {
View Full Code Here

         String uri = event.getRequestContext().getRequestParameter(UIComponent.OBJECTID);
         WebuiRequestContext pcontext = event.getRequestContext();
         UINavigationNodeSelector uiNodeSelector = event.getSource().getAncestorOfType(UINavigationNodeSelector.class);
         pcontext.addUIComponentToUpdateByAjax(uiNodeSelector);

         PageNavigation nav = uiNodeSelector.getSelectedNavigation();
         if (nav == null)
         {
            return;
         }

         PageNode[] pageNodes = PageNavigationUtils.searchPageNodesByUri(nav, uri);
         if (pageNodes == null)
         {
            return;
         }

         if (pageNodes[0] == null)
         {
            nav.getNodes().remove(pageNodes[1]);
            return;
         }
         pageNodes[0].getChildren().remove(pageNodes[1]);
         uiNodeSelector.selectPageNodeByUri(pageNodes[0].getUri());
      }
View Full Code Here

         UserPortalConfigService service = uiForm.getApplicationComponent(UserPortalConfigService.class);
         service.createUserPortalConfig(PortalConfig.PORTAL_TYPE, portalName, template);
         UserPortalConfig userPortalConfig = service.getUserPortalConfig(portalName, pcontext.getRemoteUser());
         PortalConfig pconfig = userPortalConfig.getPortalConfig();
         uiForm.invokeSetBindingBean(pconfig);
         PageNavigation navigation = dataService.getPageNavigation(PortalConfig.PORTAL_TYPE, portalName);
         dataService.save(pconfig);
         dataService.save(navigation);
         UIPortalApplication uiPortalApp = event.getSource().getAncestorOfType(UIPortalApplication.class);
         UIMaskWorkspace uiMaskWS = uiPortalApp.getChildById(UIPortalApplication.UI_MASK_WS_ID);
         uiMaskWS.setUIComponent(null);
View Full Code Here

         UIPageTemplateOptions uiPageTemplateOptions = uiWizard.findFirstComponentOfType(UIPageTemplateOptions.class);
         UIWizardPageSetInfo uiPageInfo = uiWizard.getChild(UIWizardPageSetInfo.class);

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

TOP

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

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.