Package org.exoplatform.portal.config

Examples of org.exoplatform.portal.config.UserPortalConfigService


            UIPageBrowser uiPageBrowser = event.getSource();
            String id = event.getRequestContext().getRequestParameter(OBJECTID);
            WebuiRequestContext ctx = event.getRequestContext();
            UIApplication uiApp = ctx.getUIApplication();
            UIPageSelector uiPageSelector = uiPageBrowser.getAncestorOfType(UIPageSelector.class);
            UserPortalConfigService service = uiPageBrowser.getApplicationComponent(UserPortalConfigService.class);
            UserACL userACL = uiPageBrowser.getApplicationComponent(UserACL.class);
            if (!userACL.hasPermission(service.getPageService().loadPage(PageKey.parse(id)))) {
                uiApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.NoPermission", new String[] { id }));
            }
            uiPageSelector.setValue(id);
            // uiPageBrowser.feedDataWithQuery(null);
View Full Code Here


                UIApplication uiApp = Util.getPortalRequestContext().getUIApplication();
                uiApp.addMessage(new ApplicationMessage("UIPortalForm.msg.sameName", null));
                return;
            }

            UserPortalConfigService service = uiForm.getApplicationComponent(UserPortalConfigService.class);
            service.createUserPortalConfig(SiteType.PORTAL.getName(), portalName, template);

            PortalConfig pconfig = dataService.getPortalConfig(portalName);
            UIPortal uiPortal = uiForm.createUIComponent(UIPortal.class, null, null);
            PortalDataMapper.toUIPortal(uiPortal, pconfig);
View Full Code Here

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

        public void execute(Event<UIPageBrowser> event) throws Exception {
            UIPageBrowser uiPageBrowser = event.getSource();
            WebuiRequestContext context = event.getRequestContext();
            String id = context.getRequestParameter(OBJECTID);

            UserPortalConfigService service = uiPageBrowser.getApplicationComponent(UserPortalConfigService.class);
            UIApplication uiApp = context.getUIApplication();
            PageContext page = (id != null) ? service.getPageService().loadPage(PageKey.parse(id)) : null;

            if (page == null) {
                uiApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.PageNotExist", new String[] { id }, 1));
                return;
            }

            UserACL userACL = uiPageBrowser.getApplicationComponent(UserACL.class);
            if (!userACL.hasEditPermission(page)) {
                uiApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.delete.NotDelete", new String[] { id }, 1));
                return;
            }

            UIPortal uiPortal = Util.getUIPortal();
            UserNode userNode = uiPortal.getSelectedUserNode();
            boolean isDeleteCurrentPage = page.getKey().equals(userNode.getPageRef());

            service.getPageService().destroyPage(page.getKey());
            // Minh Hoang TO: The cached UIPage objects corresponding to removed Page should be removed here.
            // As we have multiple UIPortal, which means multiple caches of UIPage. It 's unwise to garbage
            // all UIPage caches at once. Better solution is to clear UIPage on browsing to PageNode having Page
            // removed
View Full Code Here

            UIPageBrowser uiPageBrowser = event.getSource();
            WebuiRequestContext context = event.getRequestContext();
            PortalRequestContext pcontext = (PortalRequestContext) context.getParentAppRequestContext();
            UIPortalApplication uiPortalApp = (UIPortalApplication) pcontext.getUIApplication();
            String id = context.getRequestParameter(OBJECTID);
            UserPortalConfigService service = uiPageBrowser.getApplicationComponent(UserPortalConfigService.class);

            // Check existence of the page
            PageContext pageContext = (id != null) ? service.getPage(PageKey.parse(id)) : null;
            if (pageContext == null) {
                uiPortalApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.PageNotExist", new String[] { id }, 1));
                return;
            }

            // Check current user 's permissions on the page
            UserACL userACL = uiPageBrowser.getApplicationComponent(UserACL.class);
            if (!userACL.hasEditPermission(pageContext)) {
                uiPortalApp.addMessage(new ApplicationMessage("UIPageBrowser.msg.edit.NotEditPage", new String[] { id }, 1));
                return;
            }

            // Need this code to override editpage action in extension project
            UIPageFactory clazz = UIPageFactory.getInstance(pageContext.getState().getFactoryId());
            UIPage uipage = clazz.createUIPage(null);
            Page page = service.getDataStorage().getPage(id);
            pageContext.update(page);
            uipage.switchToEditMode(page);
        }
View Full Code Here

    public static class EditPortalPropertiesActionListener extends EventListener<UIPortal> {
        public void execute(Event<UIPortal> event) throws Exception {
            String portalName = event.getRequestContext().getRequestParameter("portalName");
            UIPortal uiPortal = Util.getUIPortal();
            UIPortalApplication uiApp = uiPortal.getAncestorOfType(UIPortalApplication.class);
            UserPortalConfigService service = uiApp.getApplicationComponent(UserPortalConfigService.class);
            PortalRequestContext context = Util.getPortalRequestContext();
            if (portalName != null
                    && service.getUserPortalConfig(portalName, event.getRequestContext().getRemoteUser()) == null) {
                uiApp.addMessage(new ApplicationMessage("UISiteManagement.msg.portal-not-exist", new String[] { portalName }));
                context.addUIComponentToUpdateByAjax(uiApp.findFirstComponentOfType(UIWorkingWorkspace.class));
                context.setFullRender(true);
                return;
            }
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

            UIFormStringInput pageNameInput = uiPageInfo.getUIStringInput(UIWizardPageSetInfo.PAGE_NAME);

            Page page = uiPageTemplateOptions.createPageFromSelectedOption(ownerType, ownerId);

            // Set default permissions on the page
            UserPortalConfigService configService = uiPortalApp.getApplicationComponent(UserPortalConfigService.class);
            configService.setDefaultPermissions(page);

            page.setName(pageName);
            page.setModifiable(true);

            String title = pageNameInput.getValue();
View Full Code Here

            String portalName = null;
            String remoteUser = getRemoteUser();
            SiteType siteType = getSiteType();

            ExoContainer appContainer = getApplication().getApplicationServiceContainer();
            UserPortalConfigService service_ = (UserPortalConfigService) appContainer
                    .getComponentInstanceOfType(UserPortalConfigService.class);
            if (SiteType.PORTAL == siteType) {
                portalName = getSiteName();
            }

            HttpSession session = request_.getSession();
            if (portalName == null) {
                if (session != null) {
                    portalName = (String) session.getAttribute(LAST_PORTAL_NAME);
                }
            }

            if (portalName == null) {
                portalName = service_.getDefaultPortal();
            }
            try {
                userPortalConfig = service_.getUserPortalConfig(portalName, remoteUser,
                        PortalRequestContext.USER_PORTAL_CONTEXT);
                if (userPortalConfig != null) {
                    session.setAttribute(LAST_PORTAL_NAME, portalName);
                }
            } catch (Exception e) {
View Full Code Here

        PageService pageService = getApplicationComponent(PageService.class);
        PageKey pageKey = new SiteKey(ownerType, ownerId).page(page.getName());

        if (pageService.loadPage(pageKey) == null) {
            // Set defaults only on new pages
            UserPortalConfigService configService = getApplicationComponent(UserPortalConfigService.class);
            configService.setDefaultPermissions(page);
        }

        String title = getUIStringInput("title").getValue();
        if (title == null || title.trim().length() < 1) {
            title = page.getName();
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.