Package org.exoplatform.portal.mop.user

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


            uiPage = (UIPage) uiPageBody.getUIComponent();
        }

        UIWizardPageSetInfo uiPageInfo = getChild(UIWizardPageSetInfo.class);
        UIPageNodeSelector uiNodeSelector = uiPageInfo.getChild(UIPageNodeSelector.class);
        UserNode selectedNode = uiNodeSelector.getSelectedNode();

        Page page = (Page) PortalDataMapper.buildModelObject(uiPage);
        UserNode createdNode = uiPageInfo.createUserNode(selectedNode);

        createdNode.setPageRef(page.getPageKey());

        //
        PageService pageService = getApplicationComponent(PageService.class);
        PageState pageState = PageUtils.toPageState(page);
        pageService.savePage(new PageContext(page.getPageKey(), pageState));

        //
        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();

        for (String strLocale : cachedLabels.keySet()) {
            Locale locale;
            if (strLocale.contains("_")) {
                String[] arr = strLocale.split("_");
                if (arr.length > 2) {
                    locale = new Locale(arr[0], arr[1], arr[2]);
                } else {
                    locale = new Locale(arr[0], arr[1]);
                }
            } else {
                locale = new Locale(strLocale);
            }

            descriptions.put(locale, new Described.State(cachedLabels.get(strLocale), null));
        }

        descriptionService.setDescriptions(createdNode.getId(), descriptions);
        return createdNode;
    }
View Full Code Here


     * @throws Exception
     */
    private boolean isSelectedNodeExist() {
        UIWizardPageSetInfo uiPageSetInfo = getChild(UIWizardPageSetInfo.class);
        String pageName = uiPageSetInfo.getUIStringInput(UIWizardPageSetInfo.PAGE_NAME).getValue();
        UserNode selectedPageNode = uiPageSetInfo.getSelectedPageNode();
        if (selectedPageNode.getChild(pageName) != null) {
            return true;
        }
        return false;
    }
View Full Code Here

            uiWorkingWS.setRenderedChild(UIPortalApplication.UI_VIEWING_WS_ID);

            PortalRequestContext pcontext = Util.getPortalRequestContext();

            try {
                UserNode newNode = uiWizard.saveData();
                NodeURL nodeURL = pcontext.createURL(NodeURL.TYPE).setNode(newNode);
                UIPortalToolPanel toolPanel = uiWorkingWS.findFirstComponentOfType(UIPortalToolPanel.class);
                toolPanel.setUIComponent(null);
                uiWizard.updateUIPortal(event);
                pcontext.sendRedirect(nodeURL.toString());
View Full Code Here

        }

        protected void fireChangeNode(WebuiRequestContext prContext, UIPortalApplication uiPortalApp, UIPortal uiPortal) throws Exception {
            UIWorkingWorkspace uiWorkingWS = uiPortalApp.getChildById(UIPortalApplication.UI_WORKING_WS_ID);

            UserNode currentNode = uiPortal.getSelectedUserNode();
            SiteKey siteKey = currentNode.getNavigation().getKey();
            PageNodeEvent<UIPortalApplication> pnevent = new PageNodeEvent<UIPortalApplication>(uiPortalApp,
                    PageNodeEvent.CHANGE_NODE, siteKey, currentNode.getURI());
            uiPortalApp.broadcast(pnevent, Event.Phase.PROCESS);


            prContext.addUIComponentToUpdateByAjax(uiWorkingWS);
            Util.updatePortalMode();
View Full Code Here

        //
        if (title == null) {
            UIPortal uiportal = Util.getUIPortal();

            //
            UserNode node = uiportal.getSelectedUserNode();
            if (node != null) {
                ExoContainer container = getApplication().getApplicationServiceContainer();
                container.getComponentInstanceOfType(UserPortalConfigService.class);
                UserPortalConfigService configService = (UserPortalConfigService) container
                        .getComponentInstanceOfType(UserPortalConfigService.class);
                PageKey pageRef = node.getPageRef();
                PageContext page = configService.getPage(pageRef);

                //
                if (page != null) {
                    title = page.getState().getDisplayName();
                    String resolvedTitle = ExpressionUtil.getExpressionValue(this.getApplicationResourceBundle(), title);
                    if (resolvedTitle != null) {
                        return resolvedTitle;
                    }
                }
                title = node.getResolvedLabel();
            }
        }

        return title == null ? "" : title;
    }
View Full Code Here

            UserPortal userPortal = userPortalConfig.getUserPortal();
            SiteKey siteKey = context.getSiteKey();
            UserNavigation nav = userPortal.getNavigation(siteKey);

            try {
                UserNode rootNode = userPortal.getNode(nav, Scope.CHILDREN, UserNodeFilterConfig.builder().build(), null);
                if (rootNode.getChildren().size() < 1) {
                    // TODO: Retrieve tab name from request
                    Page page = configService.createPageTemplate(PAGE_TEMPLATE, siteKey.getTypeName(), siteKey.getName());
                    page.setName(DEFAULT_TAB_NAME);
                    page.setTitle(DEFAULT_TAB_NAME);

                    //
                    PageState pageState = PageUtils.toPageState(page);
                    configService.getPageService().savePage(new PageContext(page.getPageKey(), pageState));

                    //
                    storage.save(page);

                    //
                    UserNode tabNode = rootNode.addChild(DEFAULT_TAB_NAME);
                    tabNode.setLabel(DEFAULT_TAB_NAME);
                    tabNode.setPageRef(PageKey.parse(page.getPageId()));

                    userPortal.saveNode(tabNode, null);
                }
            } catch (Exception ex) {
                log.warn("Navigation " + nav.getKey().getName() + " does not exist!", ex);
View Full Code Here

                        ApplicationMessage.WARNING));
                uiPortalApp.setModeState(UIPortalApplication.NORMAL_MODE);
                uiWorkingWS.setRenderedChild(UIPortalApplication.UI_VIEWING_WS_ID);
                Util.getPortalRequestContext().ignoreAJAXUpdateOnPortlets(true);

                UserNode currentNode = uiPortal.getSelectedUserNode();
                SiteKey siteKey = currentNode.getNavigation().getKey();
                PageNodeEvent<UIPortalApplication> pnevent = new PageNodeEvent<UIPortalApplication>(uiPortalApp,
                        PageNodeEvent.CHANGE_NODE, siteKey, currentNode.getURI());
                uiPortalApp.broadcast(pnevent, Event.Phase.PROCESS);

                Util.updatePortalMode();
                return;
            }
View Full Code Here

                uiApp.addMessage(new ApplicationMessage("UIPortalManagement.msg.Invalid-CreatePage-Permission", null));
                return;
            }

            // Should renew the selectedNode. Don't reuse the cached selectedNode
            UserNode selectedNode = Util.getUIPortal().getSelectedUserNode();
            UserNodeFilterConfig filterConfig = createFilterConfig();
            UserNode resolvedNode = resolveNode(selectedNode, filterConfig);
            if (resolvedNode == null) {
                resolvedNode = resolveNode(selectedNode, null);

                WebuiRequestContext context = WebuiRequestContext.getCurrentInstance();
                if (resolvedNode == null) {
View Full Code Here

        PortletPreferences pref = pcontext.getRequest().getPreferences();
        return pref.getValue("url", "");
    }

    public String getNavigationTitle() throws Exception {
        UserNode navPath = Util.getUIPortal().getNavPath();
        UserNavigation nav = navPath.getNavigation();
        if (nav.getKey().getType().equals(SiteType.GROUP)) {
            return OrganizationUtils.getGroupLabel(nav.getKey().getName());
        } else if (nav.getKey().getType().equals(SiteType.USER)) {
            ConversationState state = ConversationState.getCurrent();
            User user = (User) state.getAttribute(CacheUserProfileFilter.USER_PROFILE);
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) {
                // set maximizedUIComponent of UIPageBody is null if it is maximized portlet of removed page
                UIPortal uiPortal = Util.getUIPortal();
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.