Examples of POMSession


Examples of org.exoplatform.portal.pom.config.POMSession

    }

    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

Examples of org.exoplatform.portal.pom.config.POMSession

    private boolean performImport() throws Exception {
        RequestLifeCycle.begin(PortalContainer.getInstance());
        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);
View Full Code Here

Examples of org.exoplatform.portal.pom.config.POMSession

        if (key == null) {
            throw new NullPointerException();
        }

        //
        POMSession session = manager.getSession();
        PageData data = dataCache.getPageData(session, key);
        return data != null && data != PageData.EMPTY ? new PageContext(data) : null;
    }
View Full Code Here

Examples of org.exoplatform.portal.pom.config.POMSession

        if (siteKey == null) {
            throw new NullPointerException("No null site key accepted");
        }

        //
        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

Examples of org.exoplatform.portal.pom.config.POMSession

        if (page == null) {
            throw new NullPointerException();
        }

        //
        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

Examples of org.exoplatform.portal.pom.config.POMSession

        if (key == null) {
            throw new NullPointerException("No null page argument");
        }

        //
        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

Examples of org.exoplatform.portal.pom.config.POMSession

        }
    }

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

Examples of org.exoplatform.portal.pom.config.POMSession

    }

    @Override
    public QueryResult<PageContext> findPages(int from, int to, SiteType siteType, String siteName, String pageName,
            String pageTitle) {
        POMSession session = manager.getSession();
        org.chromattic.api.query.QueryResult<Page> a = session.findObjects(ObjectType.PAGE, Utils.objectType(siteType),
                siteName, pageTitle, from, to);
        int size = a.size();
        PageContext[] array = new PageContext[size];
        int ptr = 0;
        while (a.hasNext()) {
View Full Code Here

Examples of org.exoplatform.portal.pom.config.POMSession

        InputStream inputStream = attachment.getStream();
        if (inputStream == null)
            throw new OperationException(operationContext.getOperationName(), "No data stream available for import.");

        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

Examples of org.exoplatform.portal.pom.config.POMSession

        if (objectType == null) {
            throw new ResourceNotFoundException("No site type found for " + siteType);
        }

        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");

        execute(operationContext, resultHandler, workspace, objectType);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.