Package org.apache.jackrabbit.spi

Examples of org.apache.jackrabbit.spi.PathFactory.create()


     */
    public ScoreDocComparator newComparator(IndexReader reader,
                                            String relPath)
            throws IOException {
        PathFactory factory = PathFactoryImpl.getInstance();
        Path p = factory.create(relPath);
        try {
            ScoreDocComparator simple = new SimpleScoreDocComparator(
                    reader, nsMappings.translatePath(p));
            if (p.getLength() == 1) {
                return simple;


            PathFactory pf = getPathFactory();
            if (parent == null) {
                // root node
                return idFactory.createNodeId((String) null, pf.getRootPath());
            } else {
                Path p = pf.create(getName(), getIndex());
                return idFactory.createNodeId(parent.getId(), p);
            }
        }
    }

                new PropertyId(id, factory.create("", "path")));
        property.setType(PropertyType.PATH);
        property.setMultiValued(true);
        PathFactory pathFactory = PathFactoryImpl.getInstance();
        Path root = pathFactory.getRootPath();
        Path path = pathFactory.create(root, NameConstants.JCR_SYSTEM, false);
        property.setValues(new InternalValue[] {
                InternalValue.create(root), InternalValue.create(path) });
        bundle.addProperty(property);

        property = new PropertyEntry(

    @Override
    public FieldComparator newComparator(String propertyName, int numHits, int sortPos,
                                         boolean reversed) throws IOException {

        PathFactory factory = PathFactoryImpl.getInstance();
        Path path = factory.create(propertyName);

        try {
            SimpleFieldComparator simple = new SimpleFieldComparator(nsMappings.translatePath(path), field, numHits);

            return path.getLength() == 1

     */
    public ScoreDocComparator newComparator(IndexReader reader,
                                            String relPath)
            throws IOException {
        PathFactory factory = PathFactoryImpl.getInstance();
        Path p = factory.create(relPath);
        try {
            ScoreDocComparator simple = new SimpleScoreDocComparator(
                    reader, nsMappings.translatePath(p));
            if (p.getLength() == 1) {
                return simple;

            PathFactory pf = getPathFactory();
            if (parent == null) {
                // root node
                return idFactory.createNodeId((String) null, pf.getRootPath());
            } else {
                Path p = pf.create(getName(), getIndex());
                return idFactory.createNodeId(parent.getId(), p);
            }
        }
    }

                new PropertyId(id, factory.create("", "path")));
        property.setType(PropertyType.PATH);
        property.setMultiValued(true);
        PathFactory pathFactory = PathFactoryImpl.getInstance();
        Path root = pathFactory.getRootPath();
        Path path = pathFactory.create(root, NameConstants.JCR_SYSTEM, false);
        property.setValues(new InternalValue[] {
                InternalValue.create(root), InternalValue.create(path) });
        bundle.addProperty(property);

        property = new PropertyEntry(

    @Override
    public FieldComparator newComparator(String propertyName, int numHits, int sortPos,
                                         boolean reversed) throws IOException {

        PathFactory factory = PathFactoryImpl.getInstance();
        Path path = factory.create(propertyName);

        try {
            SimpleFieldComparator simple = new SimpleFieldComparator(nsMappings.translatePath(path), field, numHits);

            return path.getLength() == 1

            PathFactory pf = factory.getPathFactory();
            if (parent == null) {
                // root node
                return idFactory.createNodeId((String) null, pf.getRootPath());
            } else {
                Path p = pf.create(getName(), getIndex());
                return idFactory.createNodeId(parent.getId(), p);
            }
        }
    }

            // uniqueID and root-node -> internal id is always the same as getId().
            return getId();
        } else {
            PathFactory pf = factory.getPathFactory();
            NodeId parentId = (revertInfo != null) ? revertInfo.oldParent.getWorkspaceId() : parent.getWorkspaceId();
            return idFactory.createNodeId(parentId, pf.create(getName(true), getIndex(true)));
        }
    }

    /**
     * @inheritDoc
 

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.