Package org.exoplatform.portal.mop

Examples of org.exoplatform.portal.mop.SiteKey


            portlet.setPortletInPortal(false);
        }
    }

    public static void toUIPortal(UIPortal uiPortal, PortalConfig model) throws Exception {
        uiPortal.setSiteKey(new SiteKey(model.getType(), model.getName()));
        uiPortal.setStorageId(model.getStorageId());
        uiPortal.setName(model.getName());
        uiPortal.setId("UIPortal");
        // uiPortal.setFactoryId(model.getFactoryId());
        uiPortal.setModifiable(model.isModifiable());
View Full Code Here


                // Close the registration popup
                UIMaskWorkspace.CloseActionListener closePopupListener = new UIMaskWorkspace.CloseActionListener();
                closePopupListener.execute((Event)event);

                // Redirect to finish login with new user
                SiteKey siteKey = portalRequestContext.getSiteKey();
                NodeURL urlToRedirect = portalRequestContext.createURL(NodeURL.TYPE);
                urlToRedirect.setResource(new NavigationResource(siteKey, portalRequestContext.getNodePath()));

                portalRequestContext.getJavascriptManager().addJavascript("window.location = '" + urlToRedirect.toString() + "';");
            }
View Full Code Here

            PageNodeEvent<UIPortalApplication> pageNodeEvent = (PageNodeEvent<UIPortalApplication>) event;
            String nodePath = pageNodeEvent.getTargetNodeUri();

            UserNode targetNode = null;
            SiteKey siteKey = pageNodeEvent.getSiteKey();
            if (siteKey != null) {
                if (pcontext.getRemoteUser() == null
                        && (siteKey.getType().equals(SiteType.GROUP) || siteKey.getType().equals(SiteType.USER))) {
                    NavigationService service = uiPortalApp.getApplicationComponent(NavigationService.class);
                    NavigationContext navContext = service.loadNavigation(siteKey);
                    if (navContext != null) {
                        uiPortalApp.setLastRequestNavData(null);
                        pcontext.requestAuthenticationLogin();
                        return;
                    }
                }

                UserNavigation navigation = userPortal.getNavigation(siteKey);
                if (navigation != null) {
                    targetNode = userPortal.resolvePath(navigation, builder.build(), nodePath);
                    if (targetNode == null) {
                        // If unauthenticated users have no permission on PORTAL node and URL is valid, they will be required to
                        // login
                        if (pcontext.getRemoteUser() == null && siteKey.getType().equals(SiteType.PORTAL)) {
                            targetNode = userPortal.resolvePath(navigation, null, nodePath);
                            if (targetNode != null) {
                                uiPortalApp.setLastRequestNavData(null);
                                pcontext.requestAuthenticationLogin();
                                return;
View Full Code Here

                uiPage.setMoveAppsPermissions(page.getMoveAppsPermissions());
                uiPage.setMoveContainersPermissions(page.getMoveContainersPermissions());
            } else {
                /* set defaults if the page does not exist yet */
                UserPortalConfigService configService = uiPageForm.getApplicationComponent(UserPortalConfigService.class);
                PageKey pageKey = new PageKey(new SiteKey(page.getOwnerType(), page.getOwnerId()), page.getName());
                if (configService.getPageService().loadPage(pageKey) == null) {
                    configService.setDefaultPermissions(page);
                    uiPage.setMoveAppsPermissions(page.getMoveAppsPermissions());
                    uiPage.setMoveContainersPermissions(page.getMoveContainersPermissions());
                }
View Full Code Here

                ownerId = uiForm.groupIdSelectBox.getValue();
            } else {
                /* if you feel something should happen for SiteType.USER, change this accordingly */
                throw new IllegalStateException("Unexpected page owner type '"+ ownerType +"'.");
            }
            uiForm.buildMovePermissionForm(new SiteKey(ownerType, ownerId));

            uiForm.setDefaultPermissions(ownerType, ownerId);
            prContext.addUIComponentToUpdateByAjax(uiForm.getParent());

        }
View Full Code Here

            String doLoginPath = request.getContextPath() + "/login" + "?initialURI=" + initialURI.toString();
            response.sendRedirect(response.encodeRedirectURL(doLoginPath));
            return true;
        }

        SiteKey siteKey = SiteKey.portal(requestSiteName);
        String uri = requestPath;

        // Resolve the user node if node path is indicated
        if (!requestPath.equals("")) {
            UserPortalConfig cfg = userPortalService.getUserPortalConfig(requestSiteName, request.getRemoteUser(),
                    userPortalContext);
            if (cfg != null) {
                UserPortal userPortal = cfg.getUserPortal();
                UserNodeFilterConfig.Builder builder = UserNodeFilterConfig.builder().withAuthMode(
                        UserNodeFilterConfig.AUTH_READ);
                UserNode userNode = userPortal.resolvePath(builder.build(), requestPath);

                if (userNode != null) {
                    siteKey = userNode.getNavigation().getKey();
                    uri = userNode.getURI();
                }
            }
        }

        //
        PortalURLContext urlContext = new PortalURLContext(context, siteKey);
        NodeURL url = urlFactory.newURL(NodeURL.TYPE, urlContext);

        url.setResource(new NavigationResource(siteKey.getType(), siteKey.getName(), uri));

        if (URLWriter.isUrlEncoded()) {
            url.setMimeType(MimeType.XHTML);
        } else {
            url.setMimeType(MimeType.PLAIN);
View Full Code Here

    public static class ChangeOwnerIdActionListener extends EventListener<UIPageForm> {
        public void execute(Event<UIPageForm> event) throws Exception {
            UIPageForm uiForm = event.getSource();
            UIFormSelectBox uiSelectBox = uiForm.getUIFormSelectBox(OWNER_TYPE);
            String ownerType = uiSelectBox.getValue();
            uiForm.buildMovePermissionForm(new SiteKey(ownerType, uiForm.ownerIdInput.getValue()));
            if (SiteType.GROUP.getName().equals(ownerType)) {
                String ownerId = uiForm.groupIdSelectBox.getValue();
                uiForm.setDefaultPermissions(ownerType, ownerId);
            } else {
                /* this handler should be called only on change of groupIdSelectBox
View Full Code 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

            if (isDeleteCurrentPage) {
                SiteKey siteKey = userNode.getNavigation().getKey();
                PageNodeEvent<UIPortalApplication> pnevent = new PageNodeEvent<UIPortalApplication>(
                        Util.getUIPortalApplication(), PageNodeEvent.CHANGE_NODE, siteKey, userNode.getURI());
                uiPortal.broadcast(pnevent, Phase.PROCESS);
            } else {
                boolean dataAvailable = uiPageBrowser.feedDataWithQuery(uiPageBrowser.getLastQuery());
View Full Code Here

            // Update the cache of UIPortal from UIPortalApplication
            uiPortalApp.refreshCachedUI();

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

            if (!acl.hasPermission(portalConfig) && editPortal.getName().equals(prContext.getPortalOwner())) {
View Full Code Here

            String ownerType = pageNavi.getKey().getTypeName();
            String ownerId = pageNavi.getKey().getName();
            String pageName = "page" + UUID.randomUUID().hashCode();

            // Check if the page exists
            PageKey pageKey = new SiteKey(ownerType, ownerId).page(pageName);
            PageService pageService = uiWizard.getApplicationComponent(PageService.class);
            if (pageService.loadPage(pageKey) != null) {
                uiPortalApp.addMessage(new ApplicationMessage("UIPageCreationWizard.msg.NameNotSame", null));
                uiWizard.viewStep(FIRST_STEP);
                uiWizard.updateWizardComponent();
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.mop.SiteKey

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.