Package org.exoplatform.portal.mop.page

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


    @Override
    public Page getPage(PageId pageId) {
        Parameters.requireNonNull(pageId, "pageId");

        try {
            PageContext context = pageService.loadPage(Util.from(pageId));

            if (context == null) {
                // Page not found
                return null;
            }
View Full Code Here


        PageState pageState = new PageState(pageId.getPageName(), null, false, null,
                Arrays.asList(Util.from(accessPermissions)),
                Util.from(edit)[0], Arrays.asList(Util.from(moveAppsPermissions)),
                Arrays.asList(Util.from(moveContainersPermissions)));

        PageImpl p = new PageImpl(this, new PageContext(Util.from(pageId), pageState));
        p.setCreate(true);
        return p;
    }
View Full Code Here

        if (pageImpl.isCreate() && getPage(pageImpl.getId()) != null) {
            // There is still a small chance someone else creates the page, but this is currently the best we can do
            throw new EntityAlreadyExistsException("Cannot create page. Page " + pageImpl.getId() + " already exists.");
        }

        PageContext context = pageImpl.getPageContext();

        try {
            pageService.savePage(context);

            if (!pageImpl.isChildrenSet()) {
View Full Code Here

    public PageContext getPage(PageKey pageRef) {
        if (pageRef == null) {
            return null;
        }

        PageContext page = pageService.loadPage(pageRef);
        if (page == null || !userACL_.hasPermission(page)) {
            return null;
        }
        return page;
    }
View Full Code Here

    @Override
    public Page getPage(PageId pageId) {
        Parameters.requireNonNull(pageId, "pageId");

        try {
            PageContext context = pageService.loadPage(Util.from(pageId));
            return (context == null) ? null : new PageImpl(context);
        } catch (Throwable e) {
            throw new ApiException("Failed to get page", e);
        }
    }
View Full Code Here

        List<String> moveContainersPermissions = ProtectedContainer.DEFAULT_MOVE_CONTAINERS_PERMISSIONS;

        PageState pageState = new PageState(pageId.getPageName(), null, false, null, Arrays.asList(Util.from(Permission
                .everyone())), Util.from(edit)[0], moveAppsPermissions, moveContainersPermissions);

        PageImpl p = new PageImpl(new PageContext(Util.from(pageId), pageState));
        p.setCreate(true);
        return p;
    }
View Full Code Here

        if (((PageImpl) page).isCreate() && getPage(page.getId()) != null) {
            // There is still a small chance someone else creates the page, but this is currently the best we can do
            throw new EntityAlreadyExistsException("Cannot create page. Page " + page.getId() + " already exists.");
        }

        PageContext context = ((PageImpl) page).getPageContext();

        try {
            pageService.savePage(context);
        } catch (Throwable t) {
            throw new ApiException("Failed to save page " + page.getId(), t);
View Full Code Here

    public int compareTo(Page page) {
        return getName().compareTo(page.getName());
    }

    public PageContext getPageContext() {
        return new PageContext(key, state);
    }
View Full Code Here

    public PageContext getPage(PageKey pageRef) {
        if (pageRef == null) {
            return null;
        }

        PageContext page = pageService.loadPage(pageRef);
        if (page == null || !userACL_.hasPermission(page)) {
            return null;
        }
        return page;
    }
View Full Code Here

public class PageUtils {
    private PageUtils() {
    }

    public static Page getPage(DataStorage dataStorage, PageService pageService, PageKey pageKey) throws Exception {
        PageContext pageContext = pageService.loadPage(pageKey);
        if (pageContext == null)
            return null;

        // PageService does not support the entire page at the moment, so we must grab the page from legacy service
        // and update it with data page service does support.
        Page page = dataStorage.getPage(pageKey.format());
        pageContext.update(page);

        return page;
    }
View Full Code Here

TOP

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

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.