Package org.gatein.mop.api.workspace

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


    private void touchImport() {
        RequestLifeCycle.begin(PortalContainer.getInstance());
        try {
            POMSession session = pomMgr.getSession();
            Workspace workspace = session.getWorkspace();
            Imported imported = workspace.adapt(Imported.class);
            imported.setLastModificationDate(new Date());
            imported.setStatus(Status.DONE.status());
            session.save();
        } finally {
            RequestLifeCycle.end();
View Full Code Here


        try {

            POMSession session = pomMgr.getSession();

            // Obtain the status
            Workspace workspace = session.getWorkspace();
            boolean perform = !workspace.isAdapted(Imported.class);

            // We mark it
            if (perform) {
                Imported imported = workspace.adapt(Imported.class);
                imported.setCreationDate(new Date());

                // for legacy checking
                if (dataStorage_.getPortalConfig(defaultPortal) != null) {
                    perform = false;
                    imported.setStatus(Status.DONE.status());
                } else {
                    isFirstStartup = true;
                }
                session.save();
            } else {
                Imported imported = workspace.adapt(Imported.class);
                Integer st = imported.getStatus();
                if (st != null) {
                    Status status = Status.getStatus(st);
                    perform = (Status.WANT_REIMPORT == status);
                }
View Full Code Here

        final POMSessionManager mgr = operationContext.getRuntimeContext().getRuntimeComponent(POMSessionManager.class);
        POMSession session = mgr.getSession();
        if (session == null)
            throw new OperationException(operationName, "MOP session was null");

        Workspace workspace = session.getWorkspace();
        if (workspace == null)
            throw new OperationException(operationName, "MOP workspace was null");

        DataStorage dataStorage = operationContext.getRuntimeContext().getRuntimeComponent(DataStorage.class);
        if (dataStorage == null)
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);
        }
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);
        }
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);
        }
View Full Code Here

    }

    @Override
    public PageContext clone(PageKey src, PageKey dst) {
        POMSession session = manager.getSession();
        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());
        }
View Full Code Here

   public Customization getCustomization()
   {
      CategoryDefinition category = getCategory();
      POMSession session = category.registry.mopManager.getSession();
      Workspace workspace = session.getWorkspace();
      String name = getName();
      return workspace.getCustomizationContext().getCustomization(name);
   }
View Full Code Here

      //
      POMSession session = registry.mopManager.getSession();

      //
      Workspace workspace = session.getWorkspace();

      //
      Customization customization = workspace.getCustomizationContext().getCustomization(definitionName);

      //
      if (customization == null)
      {
         workspace.getCustomizationContext().customize(definitionName, contentType, contentId, null);
      }
      else if (customization.getContentId().equals(contentId))
      {
         // Do nothing here
      }
View Full Code Here

        this.pomManager = pomManager;
    }

    public Collection<Page> getPages() {
        POMSession session = pomManager.getSession();
        Workspace workspace = session.getWorkspace();
        Collection<Site> sites = workspace.getSites(ObjectType.PORTAL_SITE);

        List<Page> pages = new ArrayList<Page>(sites.size() * 10);

        for (Site site : sites) {
            Page pagesRoot = getPagesFrom(site);
View Full Code Here

TOP

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

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.