Examples of PageNavigation


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

      }
   }

   private boolean hasEditPermissionOnNavigation() throws Exception
   {
      PageNavigation selectedNavigation = getSelectedNavigation();
      UIPortalApplication portalApp = Util.getUIPortalApplication();
      UserACL userACL = portalApp.getApplicationComponent(UserACL.class);
      if (selectedNavigation == null || userACL == null)
      {
         return false;
      }
      else
      {
         if (PortalConfig.PORTAL_TYPE.equals(selectedNavigation.getOwnerType()))
         {
            return hasEditPermissionOnPortal();
         }
         return userACL.hasEditPermission(selectedNavigation);
      }
View Full Code Here

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

      public void execute(Event<UIUserToolBarDashboardPortlet> event) throws Exception
      {
         UIUserToolBarDashboardPortlet toolBarPortlet = event.getSource();
         String nodeName = event.getRequestContext().getRequestParameter(UIComponent.OBJECTID);

         PageNavigation cachedNavigation = toolBarPortlet.getCurrentUserNavigation();
        
         // Update navigation for prevent create first node which already existed
         DataStorage dataStorage = toolBarPortlet.getApplicationComponent(DataStorage.class);        
         PageNavigation userNavigation =
            dataStorage.getPageNavigation(cachedNavigation.getOwnerType(), cachedNavigation.getOwnerId());
         cachedNavigation.merge(userNavigation);

         UserPortalConfigService configService = toolBarPortlet.getApplicationComponent(UserPortalConfigService.class);
         if (cachedNavigation != null && configService != null && cachedNavigation.getNodes().size() < 1)
View Full Code Here

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

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

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

public class TestGroupNavACL extends AbstractTestUserACL
{

   public void testNavEditByManager()
   {
      PageNavigation nav = new PageNavigation();
      nav.setOwnerType("group");
      nav.setOwnerId("manageable");

      //
      assertTrue(root.hasEditPermission(nav));
      assertFalse(administrator.hasEditPermission(nav));
      assertTrue(manager.hasEditPermission(nav));
      assertFalse(user.hasEditPermission(nav));
      assertFalse(guest.hasEditPermission(nav));

      //
      nav.setOwnerId("foo");

      //
      assertTrue(root.hasEditPermission(nav));
      assertFalse(administrator.hasEditPermission(nav));
      assertFalse(manager.hasEditPermission(nav));
View Full Code Here

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

{

   public void testNav()
   {

      PageNavigation nav = new PageNavigation();
      nav.setOwnerType("user");
      nav.setOwnerId("user");

      assertTrue(root.hasEditPermission(nav));
      assertFalse(administrator.hasEditPermission(nav));
      assertFalse(manager.hasEditPermission(nav));
      assertTrue(user.hasEditPermission(nav));
View Full Code Here

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

public class TestPortalNavACL extends AbstractTestUserACL
{

   public void testNavEditByRoot()
   {
      PageNavigation nav = new PageNavigation();
      nav.setOwnerType("portal");
      nav.setOwnerId("foo");

      //
      assertTrue(root.hasEditPermission(nav));
      assertFalse(administrator.hasEditPermission(nav));
      assertFalse(manager.hasEditPermission(nav));
View Full Code Here

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

        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();
                        if (parentUri == null) {
View Full Code Here

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

      {
         return null;
      }

      List<PageNavigation> navigations = new ArrayList<PageNavigation>();
      PageNavigation navigation = storage_.getPageNavigation(PortalConfig.PORTAL_TYPE, portalName);
      if (navigation != null)
      {
         navigation.setModifiable(userACL_.hasPermission(portal.getEditPermission()));
         navigations.add(navigation);
      }

      if (accessUser == null)
      {
         // navigation = getPageNavigation(PortalConfig.GROUP_TYPE,
         // userACL_.getGuestsGroup());
         // if (navigation != null)
         // navigations.add(navigation);
      }
      else
      {
         navigation = storage_.getPageNavigation(PortalConfig.USER_TYPE, accessUser);
         if (navigation != null)
         {
            navigation.setModifiable(true);
            navigations.add(navigation);
         }

         Collection<?> groups = null;
         if (userACL_.getSuperUser().equals(accessUser))
         {
            groups = orgService_.getGroupHandler().getAllGroups();
         }
         else
         {
            groups = orgService_.getGroupHandler().findGroupsOfUser(accessUser);
         }
         for (Object group : groups)
         {
            Group m = (Group)group;
            String groupId = m.getId().trim();
            if (groupId.equals(userACL_.getGuestsGroup()))
            {
               continue;
            }
            navigation = storage_.getPageNavigation(PortalConfig.GROUP_TYPE, groupId);
            if (navigation == null)
            {
               continue;
            }
            navigation.setModifiable(userACL_.hasEditPermission(navigation));
            navigations.add(navigation);
         }
      }
      Collections.sort(navigations, new Comparator<PageNavigation>()
      {
View Full Code Here

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

         cfg.setName(userName);
         storage_.create(cfg);
      }

      // Create a blank navigation if needed
      PageNavigation navigation = storage_.getPageNavigation(PortalConfig.USER_TYPE, userName);
      if (navigation == null)
      {
         PageNavigation pageNav = new PageNavigation();
         pageNav.setOwnerType(PortalConfig.USER_TYPE);
         pageNav.setOwnerId(userName);
         pageNav.setPriority(5);
         pageNav.setNodes(new ArrayList<PageNode>());
         storage_.create(pageNav);
      }
   }
View Full Code Here

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

    * @throws Exception
    */
   @Deprecated
   public PageNavigation getPageNavigation(String ownerType, String id) throws Exception
   {
      PageNavigation navigation = storage_.getPageNavigation(ownerType, id);
      return navigation;
   }
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.