Package org.exoplatform.portal.pom.config

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


        return pages;
    }

    public UIWindow getWindowFrom(String uuid) {
        POMSession session = pomManager.getSession();
        return session.findObjectById(ObjectType.WINDOW, uuid);
    }
View Full Code Here


        POMSession session = pomManager.getSession();
        return session.findObjectById(ObjectType.WINDOW, uuid);
    }

    public void saveChangesTo(UIWindow window) {
        POMSession session = pomManager.getSession();

        // mark page for cache invalidation otherwise DataCache will use the previous customization id when trying to set
        // the portlet state in UIPortlet.setState and will not find it resulting in an error
        Page page = window.getPage();
        session.scheduleForEviction(new org.exoplatform.portal.pom.data.PageKey("portal", page.getSite().getName(), page
                .getName()));

        // save
        session.save();
    }
View Full Code Here

        // save
        session.save();
    }

    public Page getPageFrom(org.exoplatform.portal.config.model.Page portalPage) {
        POMSession session = pomManager.getSession();
        Site site = session.getWorkspace().getSite(Mapper.parseSiteType(portalPage.getOwnerType()), portalPage.getOwnerId());
        return getPagesFrom(site).getChild(portalPage.getName());
    }
View Full Code Here

        Site site = session.getWorkspace().getSite(Mapper.parseSiteType(portalPage.getOwnerType()), portalPage.getOwnerId());
        return getPagesFrom(site).getChild(portalPage.getName());
    }

    public Page getPageFrom(PageKey pageKey) {
        POMSession session = pomManager.getSession();
        final SiteKey siteKey = pageKey.getSite();
        final SiteType siteType = siteKey.getType();
        final String siteName = siteKey.getName();
        Site site = session.getWorkspace().getSite(Mapper.parseSiteType(siteType.getName()), siteName);
        return getPagesFrom(site).getChild(pageKey.getName());
    }
View Full Code Here

    private void initBackendServices(OperationContext operationContext, OperationAttributes attr, BackendServices svc)
            throws OperationException {

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

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

        svc.dataStorage = operationContext.getRuntimeContext().getRuntimeComponent(DataStorage.class);
        if (svc.dataStorage == null)
View Full Code Here

    }

    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

    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

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

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

    public List<NavigationContext> loadNavigations(SiteType type) throws NullPointerException, NavigationServiceException {
        if (type == null) {
            throw new NullPointerException();
        }

        POMSession session = manager.getSession();
        ObjectType<Site> objectType = objectType(type);
        Collection<Site> sites = session.getWorkspace().getSites(objectType);

        List<NavigationContext> navigations = new LinkedList<NavigationContext>();
        for (Site site : sites) {
            Navigation defaultNavigation = site.getRootNavigation().getChild("default");
            if (defaultNavigation != null) {
View Full Code Here

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

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

        //
        if (site == null) {
            throw new NavigationServiceException(NavigationError.NAVIGATION_NO_SITE);
View Full Code Here

TOP

Related Classes of org.exoplatform.portal.pom.config.POMSession

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.