Examples of UserPortalConfigService


Examples of org.exoplatform.portal.config.UserPortalConfigService

    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

Examples of org.exoplatform.portal.config.UserPortalConfigService

            String ownerType = uiSelectBox.getValue();
            if (PortalConfig.PORTAL_TYPE.equals(ownerType)) {
                String[] accessPermissions = {};
                String editPermission = "";
                String portalIdSelected = uiForm.portalIdSelectBox.getValue();
                UserPortalConfigService service = uiForm.getApplicationComponent(UserPortalConfigService.class);
                UserPortalConfig userConfig = service.getUserPortalConfig(portalIdSelected, Util.getPortalRequestContext()
                        .getRemoteUser());
                if (userConfig != null) {
                    PortalConfig config = userConfig.getPortalConfig();
                    accessPermissions = config.getAccessPermissions();
                    editPermission = config.getEditPermission();
View Full Code Here

Examples of org.exoplatform.portal.config.UserPortalConfigService

        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

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

Examples of org.exoplatform.portal.config.UserPortalConfigService

    public void onStartRequest(Application app, PortalRequestContext context) throws Exception {
        String userName = context.getRemoteUser();
        if (userName != null && SiteType.USER == context.getSiteType() && userName.equals(context.getSiteName())) {
            DataStorage storage = (DataStorage) PortalContainer.getComponent(DataStorage.class);
            UserPortalConfigService configService = (UserPortalConfigService) PortalContainer
                    .getComponent(UserPortalConfigService.class);
            PortalConfig portalConfig = storage.getPortalConfig("user", userName);

            //
            if (portalConfig == null) {
                log.debug("About to create user site for user " + userName);
                configService.createUserSite(userName);
            }

            UserPortalConfig userPortalConfig = context.getUserPortalConfig();
            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 = new PageState(page.getTitle(), page.getDescription(), page.isShowMaxWindow(),
                            page.getFactoryId(), page.getAccessPermissions() != null ? Arrays.asList(page
                                    .getAccessPermissions()) : null, page.getEditPermission());
                    configService.getPageService().savePage(new PageContext(page.getPageKey(), pageState));

                    //
                    storage.save(page);

                    //
View Full Code Here

Examples of org.exoplatform.portal.config.UserPortalConfigService

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

        UserPortalConfigService configService = getApplicationComponent(UserPortalConfigService.class);

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

Examples of org.exoplatform.portal.config.UserPortalConfigService

            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

Examples of org.exoplatform.portal.config.UserPortalConfigService

            //
            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);
View Full Code Here

Examples of org.exoplatform.portal.config.UserPortalConfigService

    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

Examples of org.exoplatform.portal.config.UserPortalConfigService

    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
TOP
Copyright © 2018 www.massapi.com. 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.