Examples of POMSession


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

        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

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

        if (navigation.data == null) {
            throw new IllegalArgumentException("Already removed");
        }

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

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

        if (scope == null) {
            throw new NullPointerException("No null scope accepted");
        }
        String nodeId = navigation.data.rootId;
        if (navigation.data.rootId != null) {
            POMSession session = manager.getSession();
            NodeData data = dataCache.getNodeData(session, nodeId);
            if (data != null) {
                NodeContext<N> context = new NodeContext<N>(model, data);
                updateNode(context, scope, listener);
                return context;
View Full Code Here

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

        if (tree.hasChanges()) {
            throw new IllegalArgumentException("For now we don't accept to update a context that has pending changes");
        }

        //
        POMSession session = manager.getSession();
        NodeData data = dataCache.getNodeData(session, tree.root.data.id);
        if (data == null) {
            throw new NavigationServiceException(NavigationError.UPDATE_CONCURRENTLY_REMOVED_NODE);
        }
View Full Code Here

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

        dataCache.clear();
    }

    private <N> void saveTree(TreeContext<N> tree, NodeChangeListener<NodeContext<N>> listener) throws NullPointerException,
            NavigationServiceException {
        POMSession session = manager.getSession();

        //
        NodeData data = dataCache.getNodeData(session, tree.root.data.id);
        if (data == null) {
            throw new NavigationServiceException(NavigationError.UPDATE_CONCURRENTLY_REMOVED_NODE);
View Full Code Here

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

                    NodeContextUpdateAdapter.<N> create(), listener, rebased);
        }
    }

    private <N> TreeContext<N> rebase(TreeContext<N> tree, Scope.Visitor visitor) throws NavigationServiceException {
        POMSession session = manager.getSession();
        NodeData data = dataCache.getNodeData(session, tree.root.getId());
        if (data == null) {
            throw new NavigationServiceException(NavigationError.UPDATE_CONCURRENTLY_REMOVED_NODE);
        }
View Full Code Here

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

      {
         throw new NullPointerException("No null locale accepted");
      }

      //
      POMSession session = manager.getSession();
      Described.State state = resolveDescription(session, id, locale1);
      if (state == null && locale2 != null)
      {
         state = resolveDescription(session, id, locale2);
      }
View Full Code Here

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

      }
      if (locale == null)
      {
         throw new NullPointerException("No null locale accepted");
      }
      POMSession session = manager.getSession();
      WorkspaceObject obj = session.findObjectById(id);
      I18NAdapter able = obj.adapt(I18NAdapter.class);
      Described desc = able.getI18NMixin(Described.class, locale, false);
      return desc != null ? desc.getState() : null;
   }
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.