Package org.exoplatform.portal.mop.page

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


    public void export(OutputStream outputStream) throws IOException {
        Page.PageSet pages = new Page.PageSet();
        pages.setPages(new ArrayList<Page>(pageNames.size()));
        for (String pageName : pageNames) {
            try {
                PageKey pageKey = new PageKey(siteKey, pageName);
                pages.getPages().add(PageUtils.getPage(dataStorage, pageService, pageKey));
            } catch (Exception e) {
                throw new IOException("Could not retrieve page name " + pageName + " for site " + siteKey, e);
            }
        }
View Full Code Here


    public String getName() {
        return name;
    }

    public PageKey page(String name) {
        return new PageKey(this, name);
    }
View Full Code Here

                    dst = new Page.PageSet();
                    rollbackSaves = new Page.PageSet();
                    rollbackDeletes = new Page.PageSet();
                    for (Page src : data.getPages()) {
                        dst.getPages().add(src);
                        PageKey pageKey = siteKey.page(src.getName());
                        if (pages.getChild(src.getName()) == null) {
                            rollbackDeletes.getPages().add(src);
                        } else {
                            PageContext pageContext = pageService.loadPage(pageKey);
                            Page existing = dataStorage.getPage(pageKey.format());
                            pageContext.update(existing);
                            rollbackSaves.getPages().add(PageUtils.copy(existing));
                        }
                    }
                }
View Full Code Here

        this.userPortal = userPortal;
        this.config = config;
    }

    private boolean canRead(NodeState state) {
        PageKey pageRef = state.getPageRef();
        if (pageRef != null) {
            try {
                PageContext page = userPortal.service.getPageService().loadPage(pageRef);
                if (page != null) {
                    return userPortal.service.getUserACL().hasPermission(page);
View Full Code Here

        }
        return true;
    }

    private boolean canWrite(NodeState state) {
        PageKey pageRef = state.getPageRef();
        if (pageRef != null) {
            try {
                PageContext page = userPortal.service.getPageService().loadPage(pageRef);
                if (page != null) {
                    return userPortal.service.getUserACL().hasEditPermission(page);
View Full Code Here

            startPublicationDate = visible.getStartPublicationDate();
            endPublicationDate = visible.getEndPublicationDate();
        }

        //
        PageKey pageRef = null;
        Link link = navigation.getLink();
        if (link instanceof PageLink) {
            PageLink pageLink = (PageLink) link;
            org.gatein.mop.api.workspace.Page target = pageLink.getPage();
            if (target != null) {
View Full Code Here

            resultHandler.completed(new ReadResourceModel("List of all available pages for site '"
                    + rootPage.getSite().getName() + "'", children));
        } else {
            PageService pageService = operationContext.getRuntimeContext().getRuntimeComponent(PageService.class);
            PageKey pageKey = new PageKey(getSiteKey(rootPage.getSite()), pageName);

            if (pageService.loadPage(pageKey) == null) {
                throw new ResourceNotFoundException("No page found for " + pageKey);
            }
View Full Code Here

                pageExportTask.addPageName(page.getName());
            }
        }

        if (pageExportTask.getPageNames().isEmpty() && pageName != null) {
            throw new ResourceNotFoundException("No page found for " + new PageKey(siteKey, pageName));
        } else if (pageExportTask.getPageNames().isEmpty()) {
            resultHandler.completed(new ExportResourceModel(Collections.<ExportTask> emptyList()));
        } else {
            tasks.add(pageExportTask);
            resultHandler.completed(new ExportResourceModel(tasks));
View Full Code Here

                resultHandler.completed(PageUtils.getAllPages(dataStorage, pageService, siteKey));
            } catch (Exception e) {
                throw new OperationException(operationName, "Could not retrieve pages for site " + siteKey);
            }
        } else {
            PageKey key = new PageKey(siteKey, pageName);
            try {
                Page page = PageUtils.getPage(dataStorage, pageService, key);
                if (page == null) {
                    throw new ResourceNotFoundException("No page found for " + key);
                } else {
View Full Code Here

            Navigation sourceNav = session.findObjectById(ObjectType.NAVIGATION, source.data.id);

            //
            toEvict.add(sourceNav.getObjectId());
            Workspace workspace = sourceNav.getSite().getWorkspace();
            PageKey reference = state.getPageRef();
            if (reference != null) {
                ObjectType<? extends Site> siteType = Utils.objectType(reference.getSite().getType());
                Site site = workspace.getSite(siteType, reference.getSite().getName());
                org.gatein.mop.api.workspace.Page target = site.getRootPage().getChild("pages").getChild(reference.getName());
                PageLink link = sourceNav.linkTo(ObjectType.PAGE_LINK);
                link.setPage(target);
            } else {
                PageLink link = sourceNav.linkTo(ObjectType.PAGE_LINK);
                link.setPage(null);
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.