Package org.exoplatform.portal.config.model

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


     
      private boolean hasPageCreationPermission() throws Exception
      {
         UIPortal currentPortal = Util.getUIPortal();
         UserACL userACL = Util.getUIPortalApplication().getApplicationComponent(UserACL.class);
         PageNavigation selectedNavigation = currentPortal.getSelectedNavigation();
         if (PortalConfig.PORTAL_TYPE.equals(selectedNavigation.getOwnerType()))
         {
            return userACL.hasEditPermissionOnPortal(currentPortal.getOwnerType(), currentPortal.getOwner(), currentPortal.getEditPermission());
         }
        
         return userACL.hasEditPermission(selectedNavigation);
View Full Code Here


         // get navigation id
         String ownerId = event.getRequestContext().getRequestParameter(OBJECTID);
         ownerId = URLDecoder.decode(ownerId);

         //Add navigation
         PageNavigation pageNav = new PageNavigation();

         // set properties for navigation
         pageNav.setPriority(1);
         pageNav.setModifiable(true);
         pageNav.setOwnerId(ownerId);
         pageNav.setOwnerType(PortalConfig.GROUP_TYPE);
         //UIPortalApplication uiPortalApp = uiForm.getAncestorOfType(UIPortalApplication.class);     
         UIPortalApplication uiPortalApp = Util.getUIPortal().getAncestorOfType(UIPortalApplication.class);

         // ensure this navigation is not exist
         DataStorage dataService = uicomp.getApplicationComponent(DataStorage.class);
         if (dataService.getPageNavigation(pageNav.getOwnerType(), pageNav.getOwnerId()) != null)
         {
            uiPortalApp.addMessage(new ApplicationMessage("UIPageNavigationForm.msg.existPageNavigation",
               new String[]{pageNav.getOwnerId()}));
            return;
         }

         // Create group when it does not exist
         if (dataService.getPortalConfig("group", ownerId) == null)
View Full Code Here

         UINavigationManagement uiManagement = event.getSource();
         UINavigationNodeSelector uiNodeSelector = uiManagement.getChild(UINavigationNodeSelector.class);
         DataStorage dataService = uiManagement.getApplicationComponent(DataStorage.class);
         UserPortalConfigService portalConfigService = uiManagement.getApplicationComponent(UserPortalConfigService.class);
        
         PageNavigation navigation = uiNodeSelector.getEdittedNavigation();
         String editedOwnerType = navigation.getOwnerType();
         String editedOwnerId = navigation.getOwnerId();
         // Check existed
         PageNavigation persistNavigation =  dataService.getPageNavigation(editedOwnerType, editedOwnerId);
         if (persistNavigation == null)
         {
            UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
            uiApp.addMessage(new ApplicationMessage("UINavigationManagement.msg.NavigationNotExistAnymore", null));
            UIPopupWindow uiPopup = uiManagement.getParent();
View Full Code Here

         UINavigationNodeSelector uiNodeSelector = uiManagement.getChild(UINavigationNodeSelector.class);
         UIPopupWindow uiManagementPopup = uiNodeSelector.getAncestorOfType(UIPopupWindow.class);
         UIPageNodeForm uiNodeForm = uiManagementPopup.createUIComponent(UIPageNodeForm.class, null, null);
         uiNodeForm.setValues(null);
         uiManagementPopup.setUIComponent(uiNodeForm);
         PageNavigation nav = uiNodeSelector.getEdittedNavigation();
         uiNodeForm.setSelectedParent(nav);

         uiNodeForm.setContextPageNavigation(nav);

         uiManagementPopup.setWindowSize(800, 500);
View Full Code Here

   {
      if (navigations == null || navigations.size() < 1)
         return;
      if (selectedNode == null)
      {
         PageNavigation navigation = navigations.get(0);
         selectedNode = new SelectedNode(navigation, null, null);
         if (navigation.getNodes().size() > 0)
            selectedNode.setNode(navigation.getNodes().get(0));
      }
      selectNavigation(selectedNode.getPageNavigation().getId());
      if (selectedNode.getNode() != null)
         selectPageNodeByUri(selectedNode.getNode().getUri());
   }
View Full Code Here

      if (ownerType != null)
      {
         Iterator<PageNavigation> itr = navis.iterator();
         while (itr.hasNext())
         {
            PageNavigation nav = itr.next();
            if (!nav.getOwnerType().equals(ownerType))
               itr.remove();
         }
      }

      return navis;
View Full Code Here

         //UIPageManagement2 uiManagement = uiPortalNodeSelector.getParent();
         Class<?>[] childrenToRender = new Class<?>[]{UIPortalNodeSelector.class};
         //uiManagement.setRenderedChildrenOfTypes(childrenToRender);     
         //event.getRequestContext().addUIComponentToUpdateByAjax(uiManagement);

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

         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

         UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);
         PortalRequestContext pcontext = Util.getPortalRequestContext();
         pcontext.setFullRender(true);
         pcontext.addUIComponentToUpdateByAjax(uiWorkingWS);
        
         PageNavigation currentNav = showedUIPortal.getSelectedNavigation();
         String currentUri = showedUIPortal.getSelectedNode().getUri();
         if(currentUri.startsWith("/"))
         {
            currentUri = currentUri.substring(1);
         }
        
         //This if branche is to make sure that the first time user logs in, showedUIPortal has selectedPaths
         //Otherwise, there will be NPE on BreadcumbsPortlet
         if(showedUIPortal.getSelectedPath() == null)
         {
            List<PageNode> currentSelectedPath = findPath(currentNav, currentUri.split("/"));
            showedUIPortal.setSelectedPath(currentSelectedPath);
         }
        
         String targetedUri = ((PageNodeEvent<UIPortal>)event).getTargetNodeUri();
         if(targetedUri.startsWith("/"))
         {
            targetedUri = targetedUri.substring(1);
         }
        
         PageNavigation targetedNav = getTargetedNav(uiPortalApp, targetedUri);
        
         if(targetedNav == null)
         {
            return;
         }
      
         String formerNavType = currentNav.getOwnerType();
         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);
        
View Full Code Here

      protected void moveNode(Event<UIRightClickPopupMenu> event, int i)
      {
         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)
         {
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.