Examples of NavigationContext


Examples of net.sf.wfnm.NavigationContext

     * Notify to the WFNM framework that a page has been reached
     *
     * @param request the HttpServletRequest
     */
    protected void notifyReachedPage(HttpServletRequest request) {
        NavigationContext navigationContext = NavigationContextFactory.getInstance();

        try {
            if (!navigationContext.isIgnorePage()) {
                AttributeContainer container = (AttributeContainer) HttpSessionWrapper.wrapItIfNecessary(request.getSession());

                if (Config.getInstance().isEnabled()) {
                    if (navigationContext.isFrameworkToReset()) {
                        NavigationManagerFactory.resetInstance(container);
                    } else {
                        navigationContext.notifyPage(container, urlCalculator.calculateUrl(request));
                    }
                }

                if (Config.getInstance().isStatsEnabled()) {
                    StatsFactory.getInstance().logStatistic(container);
View Full Code Here

Examples of net.sf.wfnm.NavigationContext

     *
     * @throws JspException if the parameters of this tags are wrong
     */
    public int doStartTag() throws JspException {
        if (Config.getInstance().isEnabled()) {
            NavigationContext navigationContext = NavigationContextFactory.getInstance();
            navigationContext.setWebflowName(name);

            if ((forcePrevious != null) && (forcePrevious.trim().length() > 0)) {
                navigationContext.setPreviousWebflowToForce(forcePrevious);
            }

            int ownership = 0;

            if ((owner != null) && (owner.length() > 0)) {
                ownership = StringUtils.findIgnoreCase(owner, NavigationManager.OWNERSHIP_DESC);

                if (ownership < 0) {
                    throw new JspException("The ownership must be included in " +
                        Arrays.asList(NavigationManager.OWNERSHIP_DESC).toString());
                }
            } else {
                ownership = Config.getInstance().getDefaultOwnership();
            }

            navigationContext.setDefaultOwnership(ownership);
        }

        return SKIP_BODY;
    }
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

        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
                public String getDescription() {
                    return "Deleting navigation for site " + siteKey;
View Full Code Here

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

     * @throws UserPortalException any user portal exception
     */
    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));
                }

                // Add group navigations
                if (service.getUserACL().getSuperUser().equals(userName)) {
                    List<NavigationContext> navCtxs = service.getNavigationService().loadNavigations(SiteType.GROUP);
                    for (NavigationContext navCtx : navCtxs) {
                        if (!navCtx.getKey().getName().equals(service.getUserACL().getGuestsGroup())) {
                            navigations.add(new UserNavigation(this, navCtx, true));
                        }
                    }
                } else {
                    Collection<?> groups;
                    try {
                        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())));
                            }
                        }
                    }
                }

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, null);
            NodeContext<UserNode> nodeContext = service.getNavigationService().loadNode(context, navigation, Scope.CHILDREN,
                    null);
            if (nodeContext != null) {
                UserNode root = nodeContext.getNode();
View Full Code Here

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

        deletedNavigationGroups.addAll(descendantGroups);
        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);

                    //
                    fragmentImporter.perform();
                }
            }
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
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.