Examples of NavigationContext


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

            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

        // Filters groups with Navigation activated
        Iterator<String> iterGroupNames = groupNames.iterator();
        while (iterGroupNames.hasNext()) {
            String name = iterGroupNames.next();
            NavigationContext navigation = svc.navigationService.loadNavigation(SiteKey.group(name));
            if (navigation == null || navigation.getState() == null) {
                iterGroupNames.remove();
            }
        }

        for (String groupName : groupNames) {
View Full Code Here

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)
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.springframework.springfaces.mvc.navigation.NavigationContext

    assertThat(navigationCase, is(not(nullValue())));
    verify(this.destinationAndModelRegistry).put(eq(this.context), this.destinationAndModel.capture());
    assertThat(this.destinationAndModel.getValue().getDestination(),
        is(equalTo(this.navigationOutcome.getDestination())));
    assertThat(this.destinationAndModel.getValue().getComponent(), is(equalTo(component)));
    NavigationContext navigationContext = this.navigationContext.getValue();
    assertThat(navigationContext.getOutcome(), is(equalTo(this.outcome)));
    assertThat(navigationContext.getFromAction(), is(equalTo(this.fromAction)));
    assertThat(navigationContext.isPreemptive(), is(true));
    assertThat(navigationContext.getComponent(), is(sameInstance(component)));
    assertThat(navigationContext.getHandler(), is(sameInstance(this.handler)));
    assertThat(navigationContext.getController(), is(sameInstance(this.controller)));
  }
View Full Code Here

Examples of org.springframework.springfaces.mvc.navigation.NavigationContext

    verify(this.destinationAndModelRegistry).put(eq(this.context), this.destinationAndModel.capture());
    assertThat(this.destinationAndModel.getValue().getDestination(),
        is(equalTo(this.navigationOutcome.getDestination())));
    assertThat(this.destinationAndModel.getValue().getComponent(), is(equalTo(component)));
    verify(this.context).setViewRoot(viewRoot);
    NavigationContext navigationContext = this.navigationContext.getValue();
    assertThat(navigationContext.getOutcome(), is(equalTo(this.outcome)));
    assertThat(navigationContext.getFromAction(), is(equalTo(this.fromAction)));
    assertThat(navigationContext.isPreemptive(), is(false));
    assertThat(navigationContext.getComponent(), is(sameInstance(component)));
    assertThat(navigationContext.getHandler(), is(sameInstance(this.handler)));
    assertThat(navigationContext.getController(), is(sameInstance(this.controller)));
  }
View Full Code Here

Examples of org.springframework.springfaces.mvc.navigation.NavigationContext

    if (SpringFacesContext.getCurrentInstance() != null) {
      PreRenderComponentEvent preRenderComponentEvent = MvcNavigationSystemEventListener
          .getLastPreRenderComponentEvent(context);
      UIComponent component = (preRenderComponentEvent == null ? null : preRenderComponentEvent.getComponent());
      String defaultDestinationViewId = getDefaultDestinationViewId(context, fromAction, outcome);
      NavigationContext navigationContext = new NavigationContextImpl(fromAction, outcome, true, component,
          defaultDestinationViewId);
      if (this.navigationOutcomeResolver.canResolve(context, navigationContext)) {
        try {
          NavigationOutcome navigationOutcome = this.navigationOutcomeResolver.resolve(context,
              navigationContext);
View Full Code Here

Examples of org.springframework.springfaces.mvc.navigation.NavigationContext

  public void handleNavigation(FacesContext context, String fromAction, String outcome) {
    if (SpringFacesContext.getCurrentInstance() != null) {
      ActionEvent actionEvent = MvcNavigationActionListener.getLastActionEvent(context);
      UIComponent component = (actionEvent == null ? null : actionEvent.getComponent());
      String defaultDestinationViewId = getDefaultDestinationViewId(context, fromAction, outcome);
      NavigationContext navigationContext = new NavigationContextImpl(fromAction, outcome, false, component,
          defaultDestinationViewId);
      if (this.navigationOutcomeResolver.canResolve(context, navigationContext)) {
        try {
          NavigationOutcome navigationOutcome = this.navigationOutcomeResolver.resolve(context,
              navigationContext);
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.