Examples of HierarchyManager


Examples of info.magnolia.cms.core.HierarchyManager

            return null;
        }

        synchronized (ExclusiveWrite.getInstance())
        {
            HierarchyManager hm = MgnlContext.getSystemContext().getHierarchyManager(ContentRepository.CONFIG);

            try
            {
                Content root = hm.getContent(SchedulerConsts.ROOT_PATH_FOR_JOBS);
                Content jobNode = ContentUtil.getOrCreateContent(root, definition.getName(), ItemType.CONTENTNODE);
                NodeDataUtil.getOrCreateAndSet(jobNode, "active", definition.isActive());
                if (StringUtils.isNotBlank(definition.getCatalog()))
                    NodeDataUtil.getOrCreateAndSet(jobNode, "catalog", definition.getCatalog());
                if (StringUtils.isNotBlank(definition.getCommand()))
View Full Code Here

Examples of org.apache.directory.studio.schemaeditor.model.hierarchy.HierarchyManager

     */
    private List<TreeNode> createTypeHierarchyObjectClass( MutableObjectClass oc )
    {
        List<TreeNode> children = new ArrayList<TreeNode>();

        HierarchyManager hierarchyManager = new HierarchyManager();

        // Creating the wrapper of the object class
        ObjectClassWrapper ocw = new ObjectClassWrapper( oc );

        int mode = Activator.getDefault().getDialogSettings().getInt( PluginConstants.PREFS_HIERARCHY_VIEW_MODE );
        if ( mode == PluginConstants.PREFS_HIERARCHY_VIEW_MODE_TYPE )
        {
            // Creating its children's wrappers
            createChildrenHierarchy( ocw, hierarchyManager.getChildren( oc ), hierarchyManager );

            // Creating its parents' wrappers
            createParentHierarchy( hierarchyManager.getParents( oc ), children, ocw, hierarchyManager );
        }
        else if ( mode == PluginConstants.PREFS_HIERARCHY_VIEW_MODE_SUPERTYPE )
        {
            // Creating its parents' wrappers
            createParentHierarchy( hierarchyManager.getParents( oc ), children, ocw, hierarchyManager );
        }
        else if ( mode == PluginConstants.PREFS_HIERARCHY_VIEW_MODE_SUBTYPE )
        {
            // Creating its children's wrappers
            createChildrenHierarchy( ocw, hierarchyManager.getChildren( oc ), hierarchyManager );

            children.add( ocw );
        }

        return children;
View Full Code Here

Examples of org.apache.jackrabbit.core.HierarchyManager

                                    PropertyTypeRegistry propReg,
                                    SynonymProvider synonymProvider,
                                    IndexFormatVersion indexFormatVersion,
                                    PerQueryCache cache)
            throws RepositoryException {
        HierarchyManager hmgr = new HierarchyManagerImpl(
                RepositoryImpl.ROOT_NODE_ID, sharedItemMgr);
        LuceneQueryBuilder builder = new LuceneQueryBuilder(
                root, session, sharedItemMgr, hmgr, nsMappings,
                analyzer, propReg, synonymProvider, indexFormatVersion,
                cache);
View Full Code Here

Examples of org.apache.jackrabbit.core.HierarchyManager

     * @throws ItemStateException  if an error occurs while reading item
     *                             states.
     */
    protected Path getRelativePath(NodeState nodeState, PropertyState propState)
            throws RepositoryException, ItemStateException {
        HierarchyManager hmgr = getContext().getHierarchyManager();
        Path nodePath = hmgr.getPath(nodeState.getId());
        Path propPath = hmgr.getPath(propState.getId());
        Path p = nodePath.computeRelativePath(propPath);
        // make sure it does not contain indexes
        boolean clean = true;
        Path.Element[] elements = p.getElements();
        for (int i = 0; i < elements.length; i++) {
View Full Code Here

Examples of org.apache.jackrabbit.core.HierarchyManager

        // b) the parent node of a property state with STATUS_EXISTING_MODIFIED

        // collect all candidates based on above criteria
        Collection<NodeId> candidateIds = new LinkedList<NodeId>();
        try {
            HierarchyManager hierMgr = getHierarchyMgr();
            for (ItemState state : transientStore.values()) {
                if (state.getStatus() == ItemState.STATUS_EXISTING_MODIFIED) {
                    NodeId nodeId;
                    if (state.isNode()) {
                        nodeId = (NodeId) state.getId();
                    } else {
                        nodeId = state.getParentId();
                    }
                    // remove any descendant candidates
                    boolean skip = false;
                    for (Iterator<NodeId> it = candidateIds.iterator(); it.hasNext();) {
                        NodeId id = it.next();   
                        if (nodeId.equals(id) || hierMgr.isAncestor(id, nodeId)) {
                            // already a candidate or a descendant thereof
                            // => skip
                            skip = true;
                            break;
                        }
                        if (hierMgr.isAncestor(nodeId, id)) {
                            // candidate is a descendant => remove
                            it.remove();
                        }
                    }
                    if (!skip) {
                        // add to candidates
                        candidateIds.add(nodeId);
                    }
                }
            }

            if (candidateIds.size() == 1) {
                return candidateIds.iterator().next();
            }

            // pick (any) candidate with shortest path to start with
            NodeId candidateId = null;
            for (NodeId id : candidateIds) {
                if (candidateId == null) {
                    candidateId = id;
                } else {
                    if (hierMgr.getDepth(id) < hierMgr.getDepth(candidateId)) {
                        candidateId = id;
                    }
                }
            }

            // starting with this candidate closest to root, find first parent
            // which is an ancestor of all candidates
            NodeState state = (NodeState) getItemState(candidateId);
            NodeId parentId = state.getParentId();
            boolean continueWithParent = false;
            while (parentId != null) {
                for (NodeId id : candidateIds) {
                    if (hierMgr.getRelativeDepth(parentId, id) == -1) {
                        continueWithParent = true;
                        break;
                    }
                }
                if (continueWithParent) {
View Full Code Here

Examples of org.apache.jackrabbit.core.HierarchyManager

     * @throws ItemStateException  if an error occurs while reading item
     *                             states.
     */
    protected Path getRelativePath(NodeState nodeState, PropertyState propState)
            throws RepositoryException, ItemStateException {
        HierarchyManager hmgr = getContext().getHierarchyManager();
        Path nodePath = hmgr.getPath(nodeState.getId());
        Path propPath = hmgr.getPath(propState.getId());
        Path p = nodePath.computeRelativePath(propPath);
        // make sure it does not contain indexes
        boolean clean = true;
        Path.Element[] elements = p.getElements();
        for (int i = 0; i < elements.length; i++) {
View Full Code Here

Examples of org.apache.jackrabbit.core.HierarchyManager

                                    Analyzer analyzer,
                                    PropertyTypeRegistry propReg,
                                    SynonymProvider synonymProvider,
                                    IndexFormatVersion indexFormatVersion)
            throws RepositoryException {
        HierarchyManager hmgr = new HierarchyManagerImpl(
                RepositoryImpl.ROOT_NODE_ID, sharedItemMgr);
        LuceneQueryBuilder builder = new LuceneQueryBuilder(
                root, session, sharedItemMgr, hmgr, nsMappings,
                analyzer, propReg, synonymProvider, indexFormatVersion);
View Full Code Here

Examples of org.apache.jackrabbit.core.HierarchyManager

     * @throws ItemStateException  if an error occurs while reading item
     *                             states.
     */
    protected Path getRelativePath(NodeState nodeState, PropertyState propState)
            throws RepositoryException, ItemStateException {
        HierarchyManager hmgr = getContext().getHierarchyManager();
        Path nodePath = hmgr.getPath(nodeState.getId());
        Path propPath = hmgr.getPath(propState.getId());
        Path p = nodePath.computeRelativePath(propPath);
        // make sure it does not contain indexes
        boolean clean = true;
        Path.Element[] elements = p.getElements();
        for (int i = 0; i < elements.length; i++) {
View Full Code Here

Examples of org.apache.jackrabbit.core.HierarchyManager

        // b) the parent node of a property state with STATUS_EXISTING_MODIFIED or STATUS_STALE_DESTROYED

        // collect all candidates based on above criteria
        Collection<NodeId> candidateIds = new LinkedList<NodeId>();
        try {
            HierarchyManager hierMgr = getHierarchyMgr();
            ItemState[] states =
                    transientStore.values().toArray(new ItemState[0]);
            for (ItemState state : states) {
                if (state.getStatus() == ItemState.STATUS_EXISTING_MODIFIED
                        || state.getStatus() == ItemState.STATUS_STALE_DESTROYED) {
                    NodeId nodeId;
                    if (state.isNode()) {
                        nodeId = (NodeId) state.getId();
                    } else {
                        nodeId = state.getParentId();
                    }
                    // remove any descendant candidates
                    boolean skip = false;
                    for (Iterator<NodeId> it = candidateIds.iterator(); it.hasNext();) {
                        NodeId id = it.next();
                        if (nodeId.equals(id) || hierMgr.isAncestor(id, nodeId)) {
                            // already a candidate or a descendant thereof
                            // => skip
                            skip = true;
                            break;
                        }
                        if (hierMgr.isAncestor(nodeId, id)) {
                            // candidate is a descendant => remove
                            it.remove();
                        }
                    }
                    if (!skip) {
                        // add to candidates
                        candidateIds.add(nodeId);
                    }
                }
            }

            if (candidateIds.size() == 1) {
                return candidateIds.iterator().next();
            }

            // pick (any) candidate with shortest path to start with
            NodeId candidateId = null;
            for (NodeId id : candidateIds) {
                if (candidateId == null) {
                    candidateId = id;
                } else {
                    if (hierMgr.getDepth(id) < hierMgr.getDepth(candidateId)) {
                        candidateId = id;
                    }
                }
            }

            // starting with this candidate closest to root, find first parent
            // which is an ancestor of all candidates
            NodeState state = (NodeState) getItemState(candidateId);
            NodeId parentId = state.getParentId();
            boolean continueWithParent = false;
            while (parentId != null) {
                for (NodeId id : candidateIds) {
                    if (hierMgr.getRelativeDepth(parentId, id) == -1) {
                        continueWithParent = true;
                        break;
                    }
                }
                if (continueWithParent) {
View Full Code Here

Examples of org.apache.jackrabbit.core.HierarchyManager

     * @throws ItemStateException  if an error occurs while reading item
     *                             states.
     */
    protected Path getRelativePath(NodeState nodeState, PropertyState propState)
            throws RepositoryException, ItemStateException {
        HierarchyManager hmgr = getContext().getHierarchyManager();
        Path nodePath = hmgr.getPath(nodeState.getId());
        Path propPath = hmgr.getPath(propState.getId());
        Path p = nodePath.computeRelativePath(propPath);
        // make sure it does not contain indexes
        boolean clean = true;
        Path.Element[] elements = p.getElements();
        for (int i = 0; i < elements.length; i++) {
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.