Examples of NavigationContext


Examples of org.exoplatform.portal.mop.navigation.NavigationContext

{
   private NavigationUtils(){}

   public static PageNavigation loadPageNavigation(NavigationKey key, NavigationService navigationService, DescriptionService descriptionService)
   {
      NavigationContext navigation = navigationService.loadNavigation(key.getSiteKey());
      if (navigation == null) return null;

      NodeContext<NodeContext<?>> node = loadNode(navigationService, navigation, key.getNavUri());
      if (node == null) return null;
View Full Code Here

Examples of org.exoplatform.portal.mop.navigation.NavigationContext

   public List<UserNavigation> getNavigations() throws UserPortalException, NavigationServiceException
   {
      if (navigations == null)
      {
         List<UserNavigation> navigations = new ArrayList<UserNavigation>(userName == null ? 1 : 10);
         NavigationContext portalNav = service.getNavigationService().loadNavigation(new SiteKey(SiteType.PORTAL, portalName));
         if (portalNav != null && portalNav.getState() != null)
         {
            navigations.add(new UserNavigation(this, portalNav, service.getUserACL().hasEditPermission(portal)));
         }
         //
         if (userName != null)
         {
            // Add user nav if any
            NavigationContext userNavigation = service.getNavigationService().loadNavigation(SiteKey.user(userName));
            if (userNavigation != null && userNavigation.getState() != null)
            {
               navigations.add(new UserNavigation(this, userNavigation, true));
            }

            //
            Collection<?> groups;
            try
            {
               if (service.getUserACL().getSuperUser().equals(userName))
               {
                  groups = service.getOrganizationService().getGroupHandler().getAllGroups();
               }
               else
               {
                  groups = service.getOrganizationService().getGroupHandler().findGroupsOfUser(userName);
               }
            }
            catch (Exception e)
            {
               throw new UserPortalException("Could not retrieve groups", e);
            }

            //
            for (Object group : groups)
            {
               Group m = (Group)group;
               String groupId = m.getId().trim();
               if (!groupId.equals(service.getUserACL().getGuestsGroup()))
               {
                  NavigationContext groupNavigation = service.getNavigationService().loadNavigation(SiteKey.group(groupId));
                  if (groupNavigation != null && groupNavigation.getState() != null)
                  {
                     navigations.add(new UserNavigation(
                        this,
                        groupNavigation,
                        service.getUserACL().hasEditPermissionOnNavigation(groupNavigation.getKey())));
                  }
               }
            }

            // Sort the list finally
View Full Code Here

Examples of org.exoplatform.portal.mop.navigation.NavigationContext

      return null;
   }
  
   public UserNode getDefaultPath(UserNavigation userNavigation, UserNodeFilterConfig filterConfig) throws UserPortalException, NavigationServiceException
   {
      NavigationContext navigation = userNavigation.navigation;
      if (navigation.getState() != null)
      {
         UserNodeContext context = new UserNodeContext(userNavigation, filterConfig);
         NodeContext<UserNode> nodeContext = service.getNavigationService().loadNode(context, navigation, Scope.CHILDREN, null);
         if (nodeContext != null)
         {
View Full Code Here

Examples of org.exoplatform.portal.mop.navigation.NavigationContext

      PortalConfig portalConfig = dataStorage.getPortalConfig(siteKey.getTypeName(), siteKey.getName());
      if (portalConfig == null) throw new Exception("Cannot import navigation because site does not exist for " + siteKey);

      Locale locale = (portalConfig.getLocale() == null) ? Locale.ENGLISH : new Locale(portalConfig.getLocale());

      final NavigationContext navContext = navigationService.loadNavigation(siteKey);
      if (navContext == null)
      {
         rollbackTask = new RollbackTask()
         {
            @Override
View Full Code Here

Examples of org.exoplatform.portal.mop.navigation.NavigationContext

    @Override
    public Navigation getNavigation(SiteId siteId) {
        Parameters.requireNonNull(siteId, "siteId");

        try {
            NavigationContext ctx = navigationService.loadNavigation(Util.from(siteId));
            if (ctx == null) return null;

            return new NavigationImpl(siteId, navigationService, ctx, descriptionService, bundleManager);
        } catch (Throwable t) {
            throw new ApiException("Failed to load navigation", t);
View Full Code Here

Examples of org.exoplatform.portal.mop.navigation.NavigationContext

    }

    private static List<Site> fromList(List<PortalConfig> internalSites, NavigationService service, boolean includeAllSites) {
        List<Site> sites = new ArrayList<Site>(internalSites.size());
        for (PortalConfig internalSite : internalSites) {
            NavigationContext ctx = null;
            if (!includeAllSites) {
                try {
                    ctx = service.loadNavigation(new SiteKey(internalSite.getType(), internalSite.getName()));
                } catch (Throwable t) {
                    throw new ApiException("Failed to find sites", t);
View Full Code Here

Examples of org.exoplatform.portal.mop.navigation.NavigationContext

    @Override
    public Navigation getNavigation(SiteId siteId) {
        Parameters.requireNonNull(siteId, "siteId");

        try {
            NavigationContext ctx = navigationService.loadNavigation(Util.from(siteId));
            if (ctx == null) return null;

            return new NavigationImpl(siteId, navigationService, ctx, descriptionService, bundleManager);
        } catch (Throwable t) {
            throw new ApiException("Failed to load navigation", t);
View Full Code Here

Examples of org.exoplatform.portal.mop.navigation.NavigationContext

        PortalConfig[] loaded = access.load(start, end);
        List<PortalConfig> list = new ArrayList<PortalConfig>(loaded.length);
        for (PortalConfig pc : loaded) {
            if (pc == null) continue;

            NavigationContext ctx = null;
            if (!includeAllSites) {
                try {
                    ctx = navigationService.loadNavigation(new SiteKey(pc.getType(), pc.getName()));
                } catch (Throwable t) {
                    throw new ApiException("Failed to find sites", t);
View Full Code Here

Examples of org.exoplatform.portal.mop.navigation.NavigationContext

    }

    protected String getNodeIfExists(String redirectSite, String requestPath, Boolean useCommonAncestor) {
        log.info("GetNodeExits called [" + redirectSite + "] : [" + requestPath + "]");

        NavigationContext navContext = null;

        if (redirectSite == null || navService == null) {
            log.warn("Redirect site name [" + redirectSite + "] or the navigation service object [" + navService
                    + "] is null. Cannot perform redirect.");
            return null;
View Full Code Here

Examples of org.exoplatform.portal.mop.navigation.NavigationContext

            storage_.create(cfg);
        }

        // Create a blank navigation if needed
        SiteKey key = SiteKey.user(userName);
        NavigationContext nav = navService.loadNavigation(key);
        if (nav == null) {
            nav = new NavigationContext(key, new NavigationState(5));
            navService.saveNavigation(nav);
        }
    }
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.