Examples of ItemStateManager


Examples of org.apache.jackrabbit.core.state.ItemStateManager

            try {
                Term aggregateIds =
                    new Term(FieldNames.AGGREGATED_NODE_UUID, "");
                TermDocs tDocs = reader.termDocs();
                try {
                    ItemStateManager ism = getContext().getItemStateManager();
                    for (NodeId id : removedIds) {
                        aggregateIds =
                            aggregateIds.createTerm(id.toString());
                        tDocs.seek(aggregateIds);
                        while (tDocs.next()) {
                            Document doc = reader.document(
                                    tDocs.doc(), FieldSelectors.UUID);
                            NodeId nId = new NodeId(doc.get(FieldNames.UUID));
                            NodeState nodeState = (NodeState) ism.getItemState(nId);
                            aggregates.put(nId, nodeState);
                            found++;

                            // JCR-2989 Support for embedded index aggregates
                            int sizeBefore = aggregates.size();
View Full Code Here

Examples of org.apache.jackrabbit.core.state.ItemStateManager

                // maybe fix the root cause
                if (parentId != null && sessionContext.getSessionImpl().autoFixCorruptions()) {
                    try {
                        // it might be an access right problem
                        // we need to check if the item doesn't exist in the ism
                        ItemStateManager ism = sessionContext.getItemStateManager();
                        if (!ism.hasItemState(id)) {
                            NodeImpl p = (NodeImpl) itemMgr.getItem(parentId);
                            p.removeChildNode((NodeId) id);
                            p.save();
                        }
                    } catch (RepositoryException e2) {
View Full Code Here

Examples of org.apache.jackrabbit.core.state.ItemStateManager

        } catch (ItemNotFoundException e) {
            boolean ignoreError = false;
            if (sessionContext.getSessionImpl().autoFixCorruptions()) {
                // it might be an access right problem
                // we need to check if the item doesn't exist in the ism
                ItemStateManager ism = sessionContext.getItemStateManager();
                if (!ism.hasItemState(childId)) {
                    log.warn("Node " + childId + " not found, ignore", e);
                    ignoreError = true;
                }
            }
            if (!ignoreError) {
View Full Code Here

Examples of org.apache.jackrabbit.core.state.ItemStateManager

                } catch (ItemNotFoundException e) {
                    boolean ignoreError = false;
                    if (parentId != null && sessionContext.getSessionImpl().autoFixCorruptions()) {
                        // it might be an access right problem
                        // we need to check if the item doesn't exist in the ism
                        ItemStateManager ism = sessionContext.getItemStateManager();
                        if (!ism.hasItemState(childId)) {
                            log.warn("Child named " + entry.getName() + " (index " + entry.getIndex() + ", " +
                                    "node id " + childId + ") " +
                                    "not found when trying to remove " + getPath() + " " +
                                    "(node id " + getNodeId() + ") - ignored", e);
                            ignoreError = true;
View Full Code Here

Examples of org.apache.jackrabbit.core.state.ItemStateManager

            AggregateRule[] aggregateRules = indexingConfig.getAggregateRules();
            if (aggregateRules == null) {
                return;
            }
            try {
                ItemStateManager ism = getContext().getItemStateManager();
                for (AggregateRule aggregateRule : aggregateRules) {
                    boolean ruleMatched = false;
                    // node includes
                    NodeState[] aggregates = aggregateRule.getAggregatedNodeStates(state);
                    if (aggregates != null) {
                        ruleMatched = true;
                        for (NodeState aggregate : aggregates) {
                            Document aDoc = createDocument(aggregate, getNamespaceMappings(), ifv);
                            // transfer fields to doc if there are any
                            Fieldable[] fulltextFields = aDoc.getFieldables(FieldNames.FULLTEXT);
                            if (fulltextFields != null) {
                                for (Fieldable fulltextField : fulltextFields) {
                                    doc.add(fulltextField);
                                }
                                doc.add(new Field(
                                        FieldNames.AGGREGATED_NODE_UUID, false,
                                        aggregate.getNodeId().toString(),
                                        Field.Store.NO,
                                        Field.Index.NOT_ANALYZED_NO_NORMS,
                                        Field.TermVector.NO));
                            }
                        }
                        // make sure that fulltext fields are aligned properly
                        // first all stored fields, then remaining
                        Fieldable[] fulltextFields = doc
                                .getFieldables(FieldNames.FULLTEXT);
                        doc.removeFields(FieldNames.FULLTEXT);
                        Arrays.sort(fulltextFields, FIELDS_COMPARATOR_STORED);
                        for (Fieldable f : fulltextFields) {
                            doc.add(f);
                        }
                    }
                    // property includes
                    PropertyState[] propStates = aggregateRule.getAggregatedPropertyStates(state);
                    if (propStates != null) {
                        ruleMatched = true;
                        for (PropertyState propState : propStates) {
                            String namePrefix = FieldNames.createNamedValue(getNamespaceMappings().translateName(propState.getName()), "");
                            NodeState parent = (NodeState) ism.getItemState(propState.getParentId());
                            Document aDoc = createDocument(parent, getNamespaceMappings(), ifv);
                            try {
                                // find the right fields to transfer
                                Fieldable[] fields = aDoc.getFieldables(FieldNames.PROPERTIES);
                                for (Fieldable field : fields) {
View Full Code Here

Examples of org.apache.jackrabbit.core.state.ItemStateManager

            try {
                Term aggregateIds =
                    new Term(FieldNames.AGGREGATED_NODE_UUID, "");
                TermDocs tDocs = reader.termDocs();
                try {
                    ItemStateManager ism = getContext().getItemStateManager();
                    for (NodeId id : removedIds) {
                        aggregateIds =
                            aggregateIds.createTerm(id.toString());
                        tDocs.seek(aggregateIds);
                        while (tDocs.next()) {
                            Document doc = reader.document(
                                    tDocs.doc(), FieldSelectors.UUID);
                            NodeId nId = new NodeId(doc.get(FieldNames.UUID));
                            NodeState nodeState = (NodeState) ism.getItemState(nId);
                            aggregates.put(nId, nodeState);
                            found++;

                            // JCR-2989 Support for embedded index aggregates
                            int sizeBefore = aggregates.size();
View Full Code Here

Examples of org.apache.jackrabbit.core.state.ItemStateManager

     * @throws RepositoryException if an error occurs while reading.
     */
    public final PropertyState getPropertyState(ScoreNode sn,
                                                EvaluationContext context)
            throws RepositoryException {
        ItemStateManager ism = context.getItemStateManager();
        PropertyId propId = new PropertyId(sn.getNodeId(), operand.getPropertyQName());
        try {
            return (PropertyState) ism.getItemState(propId);
        } catch (NoSuchItemStateException e) {
            return null;
        } catch (ItemStateException e) {
            throw new RepositoryException(e);
        }
View Full Code Here

Examples of org.apache.jackrabbit.core.state.ItemStateManager

    volatile boolean stop;
    CachingHierarchyManager cache;

    public void testResolveNodePath() throws Exception {
        NodeId rootNodeId = new NodeId(UUID.randomUUID());
        ItemStateManager provider = new MyItemStateManager();
        cache = new CachingHierarchyManager(rootNodeId, provider, null);
        PathFactory factory = PathFactoryImpl.getInstance();
        final Path path = factory.create("{}\t{}");
        for(int i=0; i<3; i++) {
            new Thread(new Runnable() {
View Full Code Here

Examples of org.apache.jackrabbit.core.state.ItemStateManager

                try {
                    Term aggregateIds =
                        new Term(FieldNames.AGGREGATED_NODE_UUID, "");
                    TermDocs tDocs = reader.termDocs();
                    try {
                        ItemStateManager ism = getContext().getItemStateManager();
                        for (NodeId id : removedIds) {
                            aggregateIds =
                                aggregateIds.createTerm(id.toString());
                            tDocs.seek(aggregateIds);
                            while (tDocs.next()) {
                                Document doc = reader.document(
                                        tDocs.doc(), FieldSelectors.UUID);
                                NodeId nId = new NodeId(doc.get(FieldNames.UUID));
                                map.put(nId, (NodeState) ism.getItemState(nId));
                                found++;
                            }
                        }
                    } finally {
                        tDocs.close();
View Full Code Here

Examples of org.apache.jackrabbit.core.state.ItemStateManager

            AggregateRule[] aggregateRules = indexingConfig.getAggregateRules();
            if (aggregateRules == null) {
                return;
            }
            try {
                ItemStateManager ism = getContext().getItemStateManager();
                for (AggregateRule aggregateRule : aggregateRules) {
                    boolean ruleMatched = false;
                    // node includes
                    NodeState[] aggregates = aggregateRule.getAggregatedNodeStates(state);
                    if (aggregates != null) {
                        ruleMatched = true;
                        for (NodeState aggregate : aggregates) {
                            Document aDoc = createDocument(aggregate, getNamespaceMappings(), ifv);
                            // transfer fields to doc if there are any
                            Fieldable[] fulltextFields = aDoc.getFieldables(FieldNames.FULLTEXT);
                            if (fulltextFields != null) {
                                for (Fieldable fulltextField : fulltextFields) {
                                    doc.add(fulltextField);
                                }
                                doc.add(new Field(FieldNames.AGGREGATED_NODE_UUID, aggregate.getNodeId().toString(), Field.Store.NO, Field.Index.NOT_ANALYZED_NO_NORMS));
                            }
                        }
                    }
                    // property includes
                    PropertyState[] propStates = aggregateRule.getAggregatedPropertyStates(state);
                    if (propStates != null) {
                        ruleMatched = true;
                        for (PropertyState propState : propStates) {
                            String namePrefix = FieldNames.createNamedValue(getNamespaceMappings().translateName(propState.getName()), "");
                            NodeState parent = (NodeState) ism.getItemState(propState.getParentId());
                            Document aDoc = createDocument(parent, getNamespaceMappings(), ifv);
                            try {
                                // find the right fields to transfer
                                Fieldable[] fields = aDoc.getFieldables(FieldNames.PROPERTIES);
                                Token t = new Token();
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.