Package org.exoplatform.portal.mop.page

Examples of org.exoplatform.portal.mop.page.PageKey


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


        page.setOwnerId(ownerId);
        page.setName(getUIStringInput("name").getValue());

        // Check if the page exists
        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);
View Full Code Here

            }

            /*
             * if it is a edition of the current page and it is not available to current remote user anymore.
             */
            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);
View Full Code Here

                        break;
                    }
                    prevNode = child;
                }

                PageKey pageRef = tobeRemoved.getPageRef();
                if (pageRef != null) {
                    PageContext page = configService.getPageService().loadPage(pageRef);
                    if (page != null) {
                        configService.getPageService().destroyPage(pageRef);
                    }
                    UIPortal uiPortal = Util.getUIPortal();
                    // Remove from cache
                    uiPortal.setUIPage(pageRef.format(), null);
                }
                getUserPortal().saveNode(parentNode, null);
            } else {
                getAncestorOfType(UIApplication.class).addMessage(
                        new ApplicationMessage("UITabPaneDashboard.msg.cannotDeleteLastTab", null));
View Full Code Here

                    siteKey.getName());
            page.setTitle(HTMLEntityEncoder.getInstance().encode(nodeLabel));
            page.setName(uniqueNodeName + page.hashCode());

            //
            PageKey pageKey = new PageKey(siteKey, page.getName());
            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(pageKey, pageState));
View Full Code Here

        if (null == name) {
            throw new IllegalStateException("API usage error: either the PageKey should be set or both SiteKey and page name should be set.");
        }
        SiteKey siteKey = new SiteKey(siteType, siteName);

        PageKey pageKey = new PageKey(siteKey, name);

        PageState pageState = new PageState(displayName,
                description,
                showMaxWindow,
                null,
View Full Code Here

    public static PageKey from(PageId pageId) {
        if (pageId == null)
            return null;

        return new PageKey(from(pageId.getSiteId()), pageId.getPageName());
    }
View Full Code Here

    public static PageKey from(PageId pageId) {
        if (pageId == null)
            return null;

        return new PageKey(from(pageId.getSiteId()), pageId.getPageName());
    }
View Full Code Here

        String eventName = event.getEventName();

        // get the MOP page from the event data
        final Object eventData = event.getData();
        final Page page;
        PageKey pageKey = null;
        if (eventData instanceof PageKey) {
            pageKey = (PageKey) eventData;
            page = structureAccess.getPageFrom(pageKey);
        } else {
            org.exoplatform.portal.config.model.Page portalPage = (org.exoplatform.portal.config.model.Page) eventData;
            page = structureAccess.getPageFrom(portalPage);
        }

        if (pageKey != null && page == null && EventType.PAGE_DESTROYED.equals(eventName)) {
            // if we try to remove a page, when we get this event, the page has already been removed from JCR
            // so we need to work around that fact by retrieving the corresponding PageInfo from the portal page title
            // which should match the Described name and check that it matches the internal name before removing it
            removePageByInternalName(pageKey.getName());
            return;
        }

        if (page != null) {
            if (EventType.PAGE_CREATED.equals(eventName)) {
View Full Code Here

        }
        return false;
    }

    public boolean hasPermission(PageContext page) {
        PageKey key = page.getKey();
        Identity identity = getIdentity();
        if (SiteType.USER == key.getSite().getType()) {
            if (key.getSite().getName().equals(identity.getUserId())) {
                return true;
            }
        }
        if (superUser_.equals(identity.getUserId())) {
            return true;
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.mop.page.PageKey

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.