Package org.exoplatform.portal.mop.user

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


     *
     * @param firstIndex
     * @param secondIndex
     */
    public boolean permutePageNode(int firstIndex, int secondIndex) throws Exception {
        UserNode parentNode = getParentTab();
        List<UserNode> siblings = new ArrayList<UserNode>(getSameSiblingsNode());
        if (firstIndex == secondIndex) {
            return false;
        }

        try {
            UserNode firstNode = siblings.get(firstIndex);
            parentNode.addChild(secondIndex, firstNode);

            getUserPortal().saveNode(parentNode, null);
            return true;
        } catch (Exception ex) {
View Full Code Here


     * default path
     *
     * @throws Exception
     */
    public UserNode getFirstAvailableNode() throws Exception {
        UserNode parentTab = getParentTab();
        if (parentTab != null) {
            UserNode currNode = Util.getUIPortal().getSelectedUserNode();
            if (parentTab.getChildren().size() == 0 && parentTab.getURI() != null) {
                return parentTab;
            }

            if (parentTab.getChild(currNode.getName()) != null) {
                return currNode;
            } else {
                return parentTab.getChild(0);
            }
        }
View Full Code Here

    public static class DeleteTabActionListener extends EventListener<UITabPaneDashboard> {
        public void execute(Event<UITabPaneDashboard> event) throws Exception {
            UITabPaneDashboard source = event.getSource();
            PortletRequestContext context = (PortletRequestContext) event.getRequestContext();
            String nodeName = context.getRequestParameter(UIComponent.OBJECTID);
            UserNode nextNode = source.getFirstAvailableNode();
            UserNode selectedNode = source.removePageNode(nodeName);

            // If the node is removed successfully, then redirect to the node specified by tab on the left
            if (selectedNode != null) {
                nextNode = selectedNode;
            }
View Full Code Here

    public static class AddDashboardActionListener extends EventListener<UITabPaneDashboard> {
        public void execute(Event<UITabPaneDashboard> event) throws Exception {
            UITabPaneDashboard tabPane = event.getSource();
            PortletRequestContext context = (PortletRequestContext) event.getRequestContext();
            String newTabLabel = context.getRequestParameter(UIComponent.OBJECTID);
            UserNode node = tabPane.getFirstAvailableNode();
            if (!tabPane.validateName(newTabLabel)) {
                Object[] args = { newTabLabel };
                context.getUIApplication().addMessage(new ApplicationMessage("UITabPaneDashboard.msg.wrongTabName", args));
            } else {
                UserNode createdNode = tabPane.createNewPageNode(newTabLabel);
                if (createdNode != null) {
                    node = createdNode;
                }
            }
View Full Code Here

            UITabPaneDashboard tabPane = event.getSource();
            PortletRequestContext context = (PortletRequestContext) event.getRequestContext();
            UIApplication rootUI = context.getUIApplication();

            String newTabLabel = context.getRequestParameter(RENAMED_TAB_LABEL_PARAMETER);
            UserNode node = tabPane.getFirstAvailableNode();
            if (!tabPane.validateName(newTabLabel)) {
                Object[] args = { newTabLabel };
                rootUI.addMessage(new ApplicationMessage("UITabPaneDashboard.msg.wrongTabName", args));
            } else {
                String nodeName = context.getRequestParameter(UIComponent.OBJECTID);
                UserNode renamedNode = tabPane.renamePageNode(nodeName, newTabLabel);
                if (renamedNode != null) {
                    node = renamedNode;
                }
            }
            PortalRequestContext prContext = Util.getPortalRequestContext();
View Full Code Here

        UIPortalApplication portalApp = (UIPortalApplication) prc.getUIApplication();
        UIPortal portal = portalApp.getCurrentSite();

        //
        try {
            UserNode node = portal.getSelectedUserNode();
            if (node != null) {
                UserPortalConfigService configService = portal.getApplicationComponent(UserPortalConfigService.class);
                PageContext page = configService.getPageService().loadPage(node.getPageRef());
                if (page != null) {
                    UserACL userACL = portal.getApplicationComponent(UserACL.class);
                    return userACL.hasEditPermission(page);
                }
            }
View Full Code Here

TOP

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

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.