Package org.exoplatform.portal.config

Examples of org.exoplatform.portal.config.UserPortalConfigService


        if (selectedItemOption_ == null)
            return null;
        Object temp = selectedItemOption_.getValue();
        if (temp == null)
            return null;
        UserPortalConfigService configService = getApplicationComponent(UserPortalConfigService.class);
        return configService.createPageTemplate(temp.toString(), ownerType, ownerId);
    }
View Full Code Here


     */
    private UIPage getUIPage(UserNode pageNode, UIPortal uiPortal, WebuiRequestContext context) throws Exception {
        PageContext pageContext = null;
        String pageReference = null;
        ExoContainer appContainer = context.getApplication().getApplicationServiceContainer();
        UserPortalConfigService userPortalConfigService = (UserPortalConfigService) appContainer
                .getComponentInstanceOfType(UserPortalConfigService.class);

        if (pageNode != null && pageNode.getPageRef() != null) {
            pageReference = pageNode.getPageRef().format();
            pageContext = userPortalConfigService.getPage(pageNode.getPageRef());
        }

        // The page has been deleted
        if (pageContext == null) {
            // Clear the UIPage from cache in UIPortal
            uiPortal.clearUIPage(pageReference);
            return null;
        }

        UIPage uiPage = uiPortal.getUIPage(pageReference);
        if (uiPage != null) {
            return uiPage;
        }

        try {
            UIPageFactory clazz = UIPageFactory.getInstance(pageContext.getState().getFactoryId());
            uiPage = clazz.createUIPage(context);

            Page page = userPortalConfigService.getDataStorage().getPage(pageReference);
            pageContext.update(page);
            PortalDataMapper.toUIPage(uiPage, page);
            uiPortal.setUIPage(pageReference, uiPage);
        } catch (Exception e) {
            if (log.isDebugEnabled()) {
View Full Code Here

            UIPage uiPage = uiToolPanel.findFirstComponentOfType(UIPage.class);
            Page page = (Page) PortalDataMapper.buildModelObject(uiPage);
            String pageId = page.getPageId();

            UserPortalConfigService portalConfigService = uiWorkingWS.getApplicationComponent(UserPortalConfigService.class);

            /*
             * if it is a edition of the current page and it is not available to current remote user anymore.
             */
            PortalRequestContext pContext = Util.getPortalRequestContext();
            PageKey pageKey = PageKey.parse(pageId);
            if (page.getStorageId() != null && portalConfigService.getPageService().loadPage(pageKey) == null) {
                uiPortalApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.PageNotExist", new String[] { pageId },
                        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);

                JavascriptManager jsManager = event.getRequestContext().getJavascriptManager();
                jsManager.require("SHARED/portal", "portal").addScripts(
                        "eXo.portal.portalMode=" + UIPortalApplication.NORMAL_MODE + ";");
                return;
            }
            UIPortalComposer composer = uiWorkingWS.findFirstComponentOfType(UIPortalComposer.class).setRendered(false);
            composer.setEditted(false);

            // If it is a page creation wizard
            if (composer.isUsedInWizard()) {
                UIWizard wizard = (UIWizard) uiToolPanel.getUIComponent();
                int step = wizard.getCurrentStep();
                step++;
                Event<UIComponent> uiEvent = wizard.createEvent("ViewStep" + step, Phase.PROCESS, event.getRequestContext());
                uiEvent.broadcast();
                return;
            }

            // Perform model update
            UserPortalConfigService configService = uiWorkingWS.getApplicationComponent(UserPortalConfigService.class);
            DataStorage dataService = uiWorkingWS.getApplicationComponent(DataStorage.class);
            PageService pageService = uiWorkingWS.getApplicationComponent(PageService.class);
            try {
                PageState pageState = new PageState(page.getTitle(), page.getDescription(), page.isShowMaxWindow(),
                        page.getFactoryId(), page.getAccessPermissions() != null ? Arrays.asList(page.getAccessPermissions())
                                : null, page.getEditPermission());
                pageService.savePage(new PageContext(pageKey, pageState));
                dataService.save(page);
            } catch (StaleModelException ex) {
                // Temporary solution to concurrency-related issue
                // This catch block should be put in an appropriate ApplicationLifecyclec
            }
            uiToolPanel.setUIComponent(null);

            // Synchronize model object with UIPage object, that seems redundant but in fact
            // mandatory to have consequent edit actions (on the same page) work properly
            uiPage.getChildren().clear();
            page = dataService.getPage(page.getPageId());
            PageContext pageContext = configService.getPage(pageKey);
            pageContext.update(page);
            PortalDataMapper.toUIPage(uiPage, page);

            // Invalidate UIPage cache on UIPortal
            uiPortalApp.invalidateUIPage(pageId);
View Full Code Here

            portalOwner = editPortal.getName();
        } else {
            portalOwner = Util.getPortalRequestContext().getPortalOwner();
        }

        UserPortalConfigService configService = getApplicationComponent(UserPortalConfigService.class);

        return configService.getUserPortalConfig(portalOwner, remoteUser) != null;
    }
View Full Code Here

    private void loadMakableGroupNavigations() throws Exception {
        if (groupIdSelectBox == null) {
            UIFormInputSet uiSettingSet = getChildById("PageSetting");
            PortalRequestContext pcontext = Util.getPortalRequestContext();
            UserPortalConfigService userPortalConfigService = getApplicationComponent(UserPortalConfigService.class);
            List<String> groups = userPortalConfigService.getMakableNavigations(pcontext.getRemoteUser(), true);
            if (groups.size() > 0) {
                Collections.sort(groups);
                List<SelectItemOption<String>> groupsItem = new ArrayList<SelectItemOption<String>>();
                for (String group : groups) {
                    groupsItem.add(new SelectItemOption<String>(group));
View Full Code Here

        List<SelectItemOption<String>> ownerTypes = new ArrayList<SelectItemOption<String>>();
        if (pConfig != null && acl.hasEditPermission(pConfig)) {
            ownerTypes.add(new SelectItemOption<String>(SiteType.PORTAL.getName()));
        }

        UserPortalConfigService userPortalConfigService = getApplicationComponent(UserPortalConfigService.class);
        List<String> groups = userPortalConfigService.getMakableNavigations(pcontext.getRemoteUser(), true);
        if (groups.size() > 0) {
            ownerTypes.add(new SelectItemOption<String>(SiteType.GROUP.getName()));
        }

        ownerTypes.add(new SelectItemOption<String>(SiteType.USER.getName()));
View Full Code Here

    public static UIPage toUIPage(PageNode node, UIComponent uiParent) throws Exception {
        return toUIPage(node.getPageReference(), uiParent);
    }

    public static UIPage toUIPage(String pageRef, UIComponent uiParent) throws Exception {
        UserPortalConfigService configService = uiParent.getApplicationComponent(UserPortalConfigService.class);
        PageContext pageContext = configService.getPage(PageKey.parse(pageRef));
        Page page = configService.getDataStorage().getPage(pageRef);
        pageContext.update(page);
        return toUIPage(page, uiParent);
    }
View Full Code Here

        setSelectedTab(uiPortalSetting.getId());

        setActions(new String[] { "Save", "Close" });

        UserPortalConfigService configService = this.getApplicationComponent(UserPortalConfigService.class);
        List<String> portalTemplates = new ArrayList<String>(configService.getPortalTemplates());
        Collections.sort(portalTemplates);
        for (String tempName : portalTemplates) {
            SelectItemCategory<String> category = new SelectItemCategory<String>(tempName);
            PortalConfig config = configService.getPortalConfigFromTemplate(tempName);
            if (config != null) {
                SelectItemOption<String> option = new SelectItemOption<String>(config.getLabel(), tempName,
                        config.getDescription(), tempName);
                category.addSelectItemOption(option);
                uiTemplateInput.getItemCategories().add(category);
View Full Code Here

        setName(iname);
        setBindingField(bfield);
    }

    public UIFormInput<?> setValue(String value) throws Exception {
        UserPortalConfigService service = getApplicationComponent(UserPortalConfigService.class);
        PageContext page = value != null ? service.getPage(PageKey.parse(value)) : null;
        page_ = page;
        super.setValue(value);
        return this;
    }
View Full Code Here

                uiForm.invokeSetBindingBean(uiPortal);
                // uiPortal.refreshNavigation(localeConfigService.getLocaleConfig(uiPortal.getLocale()).getLocale()) ;
                if (uiPortalApp.getModeState() == UIPortalApplication.NORMAL_MODE) {
                    PortalConfig portalConfig = (PortalConfig) PortalDataMapper.buildModelObject(uiPortal);
                    dataService.save(portalConfig);
                    UserPortalConfigService service = uiForm.getApplicationComponent(UserPortalConfigService.class);
                    if (prContext.getPortalOwner().equals(uiForm.getPortalOwner())) {
                        prContext.setUserPortalConfig(service.getUserPortalConfig(uiForm.getPortalOwner(),
                                prContext.getRemoteUser(), PortalRequestContext.USER_PORTAL_CONTEXT));
                        uiPortalApp.reloadPortalProperties();
                    }

                    // We should use IPC to update some portlets in the future instead of
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.config.UserPortalConfigService

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.