Package org.exoplatform.portal.mop.user

Examples of org.exoplatform.portal.mop.user.UserPortal


    public UserNode updateNode(UserNode node) {
        if (node == null) {
            return null;
        }
        UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
        NodeChangeQueue<UserNode> queue = new NodeChangeQueue<UserNode>();
        userPortal.updateNode(node, navigationScope, queue);
        for (NodeChange<UserNode> change : queue) {
            if (change instanceof NodeChange.Removed) {
                UserNode deletedNode = ((NodeChange.Removed<UserNode>) change).getTarget();
                if (hasRelationship(deletedNode, node)) {
                    // Node has been deleted
View Full Code Here


        }
        return null;
    }

    private UserNode getCurrentNavigation() throws Exception {
        UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
        UserNavigation userNavigation = Util.getUIPortal().getUserNavigation();
        try {
            UserNode rootNode = userPortal.getNode(userNavigation, navigationScope, NAVIGATION_FILTER_CONFIG, null);
            return rootNode;
        } catch (Exception ex) {
            log.error("Navigation has been deleted");
        }
        return null;
View Full Code Here

        //
        DataStorage dataService = getApplicationComponent(DataStorage.class);
        dataService.save(page);

        UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
        userPortal.saveNode(selectedNode, null);

        DescriptionService descriptionService = getApplicationComponent(DescriptionService.class);
        Map<Locale, Described.State> descriptions = new HashMap<Locale, Described.State>();
        Map<String, String> cachedLabels = uiPageInfo.getCachedLabels();
View Full Code Here

        UIPopupWindow editNavigation = addChild(UIPopupWindow.class, null, null);
        editNavigation.setId(editNavigation.getId() + "-" + UUID.randomUUID().toString().replaceAll("-", ""));
    }

    public void loadNavigations() throws Exception {
        UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();

        List<UserNavigation> allNavs = userPortal.getNavigations();
        final List<UserNavigation> groupNav = new ArrayList<UserNavigation>();
        for (UserNavigation nav : allNavs) {
            if (nav.getKey().getType().equals(SiteType.GROUP) && nav.isModifiable()) {
                groupNav.add(nav);
            }
View Full Code Here

        }
    }

    public abstract static class BaseEditAction extends EventListener<UIGroupNavigationManagement> {
        public void execute(Event<UIGroupNavigationManagement> event) throws Exception {
            UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
            UIGroupNavigationManagement uicomp = event.getSource();
            WebuiRequestContext context = event.getRequestContext();
            UIApplication uiApplication = context.getUIApplication();

            // get navigation id
            String groupName = event.getRequestContext().getRequestParameter(OBJECTID);
            SiteKey siteKey = SiteKey.group(groupName);

            // check edit permission, ensure that user has edit permission on that
            // navigation
            UserACL userACL = uicomp.getApplicationComponent(UserACL.class);
            if (!userACL.hasEditPermissionOnNavigation(siteKey)) {
                uiApplication
                        .addMessage(new ApplicationMessage("UIGroupNavigationManagement.msg.Invalid-editPermission", null));
                return;
            }

            UserNavigation navigation = userPortal.getNavigation(siteKey);
            if (navigation == null) {
                uiApplication.addMessage(new ApplicationMessage("UIGroupNavigationManagement.msg.navigation-not-exist", null));
                UIWorkingWorkspace uiWorkingWS = Util.getUIPortalApplication().getChild(UIWorkingWorkspace.class);
                uiWorkingWS.updatePortletsByName("UserToolbarGroupPortlet");
                return;
View Full Code Here

    }

    public static class EditNavigationActionListener extends BaseEditAction {
        @Override
        protected void doEdit(UserNavigation nav, Event<UIGroupNavigationManagement> event) throws Exception {
            UserPortal userPortal = Util.getPortalRequestContext().getUserPortalConfig().getUserPortal();
            UIGroupNavigationManagement uicomp = event.getSource();
            SiteKey siteKey = nav.getKey();

            UIPopupWindow popUp = uicomp.getChild(UIPopupWindow.class);
            UINavigationManagement naviManager = popUp.createUIComponent(UINavigationManagement.class, null, null, popUp);
View Full Code Here

            toolbarScope = GenericScope.treeShape(level);
        }
    }

    protected Collection<UserNode> getNavigationNodes(UserNavigation nav) {
        UserPortal userPortal = getUserPortal();
        if (nav != null) {
            try {
                UserNode rootNodes = userPortal.getNode(nav, toolbarScope, toolbarFilterConfig, null);
                return rootNodes.getChildren();
            } catch (Exception ex) {
                log.warn(nav.getKey().getName() + " has been deleted");
            }
        }
View Full Code Here

        }
        return Collections.emptyList();
    }

    protected UserNavigation getNavigation(SiteKey key) {
        UserPortal userPortal = getUserPortal();
        return userPortal.getNavigation(key);
    }
View Full Code Here

            UINavigationManagement naviManager = popUp.createUIComponent(UINavigationManagement.class, null, null, popUp);
            uicomp.naviManager = naviManager;

            naviManager.setSiteKey(SiteKey.portal(portalName));

            UserPortal userPortal = userPortalConfig.getUserPortal();
            UserNavigation edittedNavigation = userPortal.getNavigation(SiteKey.portal(portalName));

            UINavigationNodeSelector selector = naviManager.getChild(UINavigationNodeSelector.class);
            selector.setScope(uicomp.getScope());
            selector.setEdittedNavigation(edittedNavigation);
            selector.setUserPortal(userPortal);
View Full Code Here

    protected UserNode getNodeFromResourceID(String resourceId) throws Exception {
        UserNavigation currNav = getNavigation(SiteKey.portal(getCurrentPortal()));
        if (currNav == null)
            return null;

        UserPortal userPortal = getUserPortal();
        UserNode node = userPortal.resolvePath(currNav, toolbarFilterConfig, resourceId);
        if (node != null && node.getURI().equals(resourceId)) {
            return node;
        }
        return null;
    }
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.mop.user.UserPortal

Copyright © 2018 www.massapicom. 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.