Examples of NavigationContext


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

        @Override
        protected void doEdit(UserNavigation navigation, Event<UIGroupNavigationManagement> event) throws Exception {
            UIGroupNavigationManagement uicomp = event.getSource();
            NavigationService service = uicomp.getApplicationComponent(NavigationService.class);

            NavigationContext ctx = service.loadNavigation(navigation.getKey());
            if (ctx != null) {
                service.destroyNavigation(ctx);
            }

            //
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

            UIFormSelectBox uiSelectBox = uiForm.findComponentById("priority");
            int priority = Integer.parseInt(uiSelectBox.getValue());

            // update navigation
            NavigationService service = uiForm.getApplicationComponent(NavigationService.class);
            NavigationContext ctx = service.loadNavigation(userNav.getKey());
            ctx.setState(new NavigationState(priority));
            service.saveNavigation(ctx);

            UIPopupWindow uiPopup = uiForm.getParent();
            uiPopup.setShow(false);
            UIComponent opener = uiPopup.getParent();
View Full Code Here

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

            SiteKey siteKey = pageNodeEvent.getSiteKey();
            if (siteKey != null) {
                if (pcontext.getRemoteUser() == null
                        && (siteKey.getType().equals(SiteType.GROUP) || siteKey.getType().equals(SiteType.USER))) {
                    NavigationService service = uiPortalApp.getApplicationComponent(NavigationService.class);
                    NavigationContext navContext = service.loadNavigation(siteKey);
                    if (navContext != null) {
                        uiPortalApp.setLastRequestNavData(null);
                        pcontext.requestAuthenticationLogin();
                        return;
                    }
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

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

      return config;
   }

   public NodeContext<?> perform()
   {
      NavigationContext navigationCtx = navigationService.loadNavigation(navigationKey);

      //
      if (navigationCtx != null)
      {
         NodeContext root = navigationService.loadNode(NodeModel.SELF_MODEL, navigationCtx, GenericScope.branchShape(path), null);
View Full Code Here

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

      deletedNavigationGroups.add(group.getId());
      for (String childGroup : deletedNavigationGroups)
      {
         SiteKey key = SiteKey.group(childGroup);
         NavigationService navService = portalConfigService.getNavigationService();
         NavigationContext nav = navService.loadNavigation(key);
         if (nav != null)
         {
            navService.destroyNavigation(nav);
         }
      }
View Full Code Here

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

      //
      SiteKey key = new SiteKey(src.getOwnerType(), src.getOwnerId());

      //
      NavigationContext dst = service.loadNavigation(key);

      //
      switch (mode)
      {
         case CONSERVE:
            if (dst == null)
            {
               dst = new NavigationContext(key, new NavigationState(src.getPriority()));
               service.saveNavigation(dst);
            }
            else
            {
               dst = null;
            }
            break;
         case MERGE:
         case INSERT:
            if (dst == null)
            {
               dst = new NavigationContext(key, new NavigationState(src.getPriority()));
               service.saveNavigation(dst);
            }
            break;
         case OVERWRITE:
            if (dst == null)
            {
               dst = new NavigationContext(key, new NavigationState(src.getPriority()));
               service.saveNavigation(dst);
            }
            break;
         default:
            throw new AssertionError();
      }

      //
      if (dst != null)
      {
         ArrayList<NavigationFragment> fragments = src.getFragments();
         if (fragments != null && fragments.size() > 0)
         {
            for (NavigationFragment fragment : fragments)
            {
               String parentURI = fragment.getParentURI();

               // Find something better than that for building the path
               List<String> path;
               if (parentURI != null)
               {
                  path = new ArrayList<String>();
                  String[] names = Utils.split("/", parentURI);
                  for (String name : names)
                  {
                     if (name.length() > 0)
                     {
                        path.add(name);
                     }
                  }
               }
               else
               {
                  path = Collections.emptyList();
               }

               //
               NavigationFragmentImporter fragmentImporter = new NavigationFragmentImporter(
                  path.toArray(new String[path.size()]),
                  service,
                  dst.getKey(),
                  portalLocale,
                  descriptionService,
                  fragment,
                  mode.config);
View Full Code Here

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

   {
      SiteKey siteKey = getSiteKey(defaultNavigation.getSite());
      String navUri = operationContext.getAddress().resolvePathTemplate("nav-uri");

      NavigationService navigationService = operationContext.getRuntimeContext().getRuntimeComponent(NavigationService.class);
      NavigationContext navigation = navigationService.loadNavigation(siteKey);

      Set<String> children = new LinkedHashSet<String>();

      NodeContext<NodeContext<?>> node = NavigationUtils.loadNode(navigationService, navigation, navUri);
      if (node == null)
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.