Package org.gatein.mop.api.workspace

Examples of org.gatein.mop.api.workspace.Site


            return PageData.class;
        }

        public PageData run(POMSession session) {
            Workspace workspace = session.getWorkspace();
            Site site = workspace.getSite(siteType, ownerId);
            if (site != null) {
                org.gatein.mop.api.workspace.Page root = site.getRootPage();
                org.gatein.mop.api.workspace.Page pages = root.getChild("pages");
                org.gatein.mop.api.workspace.Page page = pages.getChild(name);
                if (page != null) {
                    return new Mapper(session).load(page);
                }
View Full Code Here


        this.id = null;
        this.state = null;
    }

    PageData(Page page) {
        Site site = page.getSite();

        //
        this.key = new SiteKey(Utils.siteType(site.getObjectType()), site.getName()).page(page.getName());
        this.id = page.getObjectId();
        this.state = new PageState(page);
    }
View Full Code Here

        //
        POMSession session = manager.getSession();
        ObjectType<Site> objectType = Utils.objectType(siteKey.getType());
        Workspace workspace = session.getWorkspace();
        Site site = workspace.getSite(objectType, siteKey.getName());

        //
        if (site == null) {
            throw new PageServiceException(PageError.NO_SITE);
        }

        //
        org.gatein.mop.api.workspace.Page root = site.getRootPage();
        Collection<org.gatein.mop.api.workspace.Page> pages = root.getChild("pages").getChildren();
        List<PageContext> list = new ArrayList<PageContext>(pages.size());
        for (Page page : pages) {
            list.add(loadPage(new PageKey(siteKey, page.getName())));
        }
View Full Code Here

        //
        POMSession session = manager.getSession();
        ObjectType<Site> objectType = Utils.objectType(page.key.getSite().getType());
        Workspace workspace = session.getWorkspace();
        Site site = workspace.getSite(objectType, page.key.getSite().getName());

        //
        if (site == null) {
            throw new PageServiceException(PageError.NO_SITE);
        }

        //
        org.gatein.mop.api.workspace.Page root = site.getRootPage();
        org.gatein.mop.api.workspace.Page pages = root.getChild("pages");
        org.gatein.mop.api.workspace.Page dst = pages.getChild(page.key.getName());

        //
        boolean created;
View Full Code Here

        //
        POMSession session = manager.getSession();
        ObjectType<Site> objectType = Utils.objectType(key.getSite().getType());
        Workspace workspace = session.getWorkspace();
        Site site = workspace.getSite(objectType, key.getSite().getName());

        //
        if (site == null) {
            throw new PageServiceException(PageError.NO_SITE);
        }

        //
        org.gatein.mop.api.workspace.Page root = site.getRootPage();
        org.gatein.mop.api.workspace.Page pages = root.getChild("pages");
        org.gatein.mop.api.workspace.Page page = pages.getChild(key.getName());
        if (page != null) {
            page.destroy();
            dataCache.removePage(session, key);
View Full Code Here

        Workspace workspace = session.getWorkspace();

        //
        org.gatein.mop.api.workspace.Page srcPage;
        ObjectType<Site> srcType = Utils.objectType(src.site.getType());
        Site srcSite = workspace.getSite(srcType, src.site.getName());
        if (srcSite == null) {
            throw new PageServiceException(PageError.CLONE_NO_SRC_SITE, "Could not clone page " + src.getName()
                    + "from non existing site of type " + src.site.getType() + " with id " + src.site.getName());
        } else {
            org.gatein.mop.api.workspace.Page root = srcSite.getRootPage();
            org.gatein.mop.api.workspace.Page pages = root.getChild("pages");
            srcPage = pages.getChild(src.getName());
        }

        //
        if (srcPage == null) {
            throw new PageServiceException(PageError.CLONE_NO_SRC_PAGE, "Could not clone non existing page " + src.getName()
                    + " from site of type " + src.site.getType() + " with id " + src.site.getName());
        }

        //
        ObjectType<Site> dstType = Utils.objectType(dst.getSite().getType());
        Site dstSite = workspace.getSite(dstType, dst.getSite().getName());
        if (dstSite == null) {
            throw new PageServiceException(PageError.CLONE_NO_DST_SITE, "Could not clone page " + dst.name
                    + "to non existing site of type " + dst.site.getType() + " with id " + dst.site.getName());
        }

        //
        org.gatein.mop.api.workspace.Page dstRoot = dstSite.getRootPage();
        org.gatein.mop.api.workspace.Page dstPages = dstRoot.getChild("pages");
        if (dstPages.getChild(dst.getName()) != null) {
            throw new PageServiceException(PageError.CLONE_DST_ALREADY_EXIST, "Could not clone page " + dst.name
                    + "to existing page " + dst.site.getType() + " with id " + dst.site.getName());
        }
View Full Code Here

    }

    protected final PageData loadPage(POMSession session, PageKey key) {
        Workspace workspace = session.getWorkspace();
        ObjectType<Site> objectType = Utils.objectType(key.getSite().getType());
        Site site = workspace.getSite(objectType, key.getSite().getName());
        if (site != null) {
            org.gatein.mop.api.workspace.Page root = site.getRootPage();
            org.gatein.mop.api.workspace.Page pages = root.getChild("pages");
            org.gatein.mop.api.workspace.Page page = pages.getChild(key.getName());
            if (page != null) {
                return new PageData(page);
            } else {
View Full Code Here

    public <N> void saveNode(NodeContext<N> context, NodeChangeListener<NodeContext<N>> listener)
            throws NavigationServiceException {
        service.saveNode(context, listener);
        org.gatein.mop.api.workspace.Navigation nav = service.manager.getSession().findObjectById(ObjectType.NAVIGATION,
                context.data.id);
        Site site = nav.getSite();
        SiteKey key = new SiteKey(siteType(site.getObjectType()), site.getName());
        notify(EventType.NAVIGATION_UPDATED, key);
    }
View Full Code Here

        POMSession session = pomMgr.getSession();

        WorkspaceObject workspaceObject = session.findObjectById(workspaceObjectId);

        if (workspaceObject instanceof UIComponent) {
            Site site = ((UIComponent) workspaceObject).getPage().getSite();
            ObjectType<? extends Site> siteType = site.getObjectType();

            String[] siteInfo = new String[2];

            // Put the siteType on returned map
            if (siteType == ObjectType.PORTAL_SITE) {
                siteInfo[0] = PortalConfig.PORTAL_TYPE;
            } else if (siteType == ObjectType.GROUP_SITE) {
                siteInfo[0] = PortalConfig.GROUP_TYPE;
            } else if (siteType == ObjectType.USER_SITE) {
                siteInfo[0] = PortalConfig.USER_TYPE;
            }

            // Put the siteOwner on returned map
            siteInfo[1] = site.getName();

            return siteInfo;
        }

        throw new Exception("The provided ID is not associated with an application");
View Full Code Here

            }
        }
    }

    public PageData load(org.gatein.mop.api.workspace.Page src) {
        Site site = src.getSite();
        String ownerType = getOwnerType(site.getObjectType());
        String ownerId = site.getName();
        String name = src.getName();
        List<ComponentData> children = loadChildren(src.getRootComponent());

        List<String> moveAppsPermissions = null;
        List<String> moveContainersPermissions = null;
View Full Code Here

TOP

Related Classes of org.gatein.mop.api.workspace.Site

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.