Examples of NameFactory


Examples of org.apache.jackrabbit.spi.NameFactory

        FileSystemResource resource = new FileSystemResource(fs, "/privileges/custom_privileges.xml");
        if (!resource.exists()) {
            resource.makeParentDirs();
        }

        NameFactory nf = NameFactoryImpl.getInstance();
        Name test = nf.create(Name.NS_DEFAULT_URI, "test");
        Name test2 = nf.create(Name.NS_DEFAULT_URI, "test2");
        Name test3 = nf.create(Name.NS_DEFAULT_URI, "test3");
        Name test4 = nf.create(Name.NS_DEFAULT_URI, "test4");
        Name test5 = nf.create(Name.NS_DEFAULT_URI, "test5");
        Name test6 = nf.create(Name.NS_DEFAULT_URI, "test6");

        OutputStream out = resource.getOutputStream();
        try {
            List<PrivilegeDefinition> defs = new ArrayList<PrivilegeDefinition>();
            defs.add(new PrivilegeDefinitionImpl(test, false, createNameSet(test2, test3)));
View Full Code Here

Examples of org.apache.jackrabbit.spi.NameFactory

                if (propertyDef.getRequiredType() == PropertyType.REFERENCE
                        || propertyDef.getRequiredType() == PropertyType.WEAKREFERENCE) {
                    QValueConstraint[] ca = propertyDef.getValueConstraints();
                    if (ca != null) {
                        for (QValueConstraint aCa : ca) {
                            NameFactory factory = NameFactoryImpl.getInstance();
                            Name ntName = factory.create(aCa.getString());
                            if (!name.equals(ntName)) {
                                deps.add(ntName);
                            }
                        }
                    }
View Full Code Here

Examples of org.apache.jackrabbit.spi.NameFactory

        } else if (elementString.startsWith("[") && elementString.endsWith("]") && elementString.length() > 2) {
            return new IdentifierPath(
                    elementString.substring(1, elementString.length()-1));
        }

        NameFactory factory = NameFactoryImpl.getInstance();
        int pos = elementString.indexOf('[');
        if (pos == -1) {
            Name name = factory.create(elementString);
            return new NamePath(null, name, Path.INDEX_UNDEFINED);
        }
        Name name = factory.create(elementString.substring(0, pos));
        int pos1 = elementString.indexOf(']');
        if (pos1 == -1) {
            throw new IllegalArgumentException("invalid PathElement literal: " + elementString + " (missing ']')");
        }
        try {
View Full Code Here

Examples of org.apache.jackrabbit.spi.NameFactory

            if (lostNFoundId != null) {
                final NodePropBundle bundle = getBundle(nodeId);
                final NodePropBundle lfBundle = getBundle(lostNFoundId);

                final String nodeName = nodeId + "-" + System.currentTimeMillis();
                final NameFactory nameFactory = NameFactoryImpl.getInstance();
                lfBundle.addChildNodeEntry(nameFactory.create("", nodeName), nodeId);
                bundle.setParentId(lostNFoundId);

                saveBundle(bundle);
                saveBundle(lfBundle);
View Full Code Here

Examples of org.apache.jackrabbit.spi.NameFactory

        }

        private Name createNodeName() {
            int n = (int) System.currentTimeMillis() + new Random().nextInt();
            final String localName = Integer.toHexString(n);
            final NameFactory nameFactory = NameFactoryImpl.getInstance();
            return nameFactory.create("{}" + localName);
        }
View Full Code Here

Examples of org.apache.jackrabbit.spi.NameFactory

        return repository;
    }

    protected RepositoryService createService(String uri) throws RepositoryException {
        IdFactory idFactory = IdFactoryImpl.getInstance();
        NameFactory nFactory = NameFactoryImpl.getInstance();
        PathFactory pFactory = PathFactoryImpl.getInstance();
        QValueFactory vFactory = QValueFactoryImpl.getInstance();
        return new RepositoryServiceImpl(uri, idFactory, nFactory, pFactory, vFactory);
    }
View Full Code Here

Examples of org.apache.jackrabbit.spi.NameFactory

            idFactory = (IdFactory) param;
        } else {
            idFactory = IdFactoryImpl.getInstance();
        }

        NameFactory nameFactory;
        param = parameters.get(PARAM_NAME_FACTORY);
        if (param != null && param instanceof NameFactory) {
            nameFactory = (NameFactory) param;
        } else {
            nameFactory = NameFactoryImpl.getInstance();
View Full Code Here

Examples of org.apache.jackrabbit.spi.NameFactory

    @Override
    public RepositoryService getRepositoryService() throws RepositoryException {
        if (service == null) {
            String uri = getProperty(PROP_REPOSITORY_URI);
            IdFactory idFactory = IdFactoryImpl.getInstance();
            NameFactory nFactory = NameFactoryImpl.getInstance();
            PathFactory pFactory = PathFactoryImpl.getInstance();
            QValueFactory vFactory = QValueFactoryImpl.getInstance();
            service = new RepositoryServiceImpl(uri, idFactory, nFactory, pFactory, vFactory);
        }
        return service;
View Full Code Here

Examples of org.apache.jackrabbit.spi.NameFactory

        this.nsMappings = nsMappings;
    }

    @Override
    public FieldComparator newComparator(String fieldname, int numHits, int sortPos, boolean reversed) throws IOException {
        NameFactory factory = NameFactoryImpl.getInstance();
        try {
            return new SimpleFieldComparator(nsMappings.translateName(factory.create(fieldname)), FieldNames.PROPERTY_LENGTHS, numHits);
        }
        catch (IllegalNameException e) {
            throw Util.createIOException(e);
        }
    }
View Full Code Here

Examples of org.apache.jackrabbit.spi.NameFactory

     * @throws IOException if an error occurs while reading from the index.
     */
    public ScoreDocComparator newComparator(IndexReader reader,
                                            String fieldname)
            throws IOException {
        NameFactory factory = NameFactoryImpl.getInstance();
        try {
            return new Comparator(reader,
                    nsMappings.translateName(factory.create(fieldname)));
        } catch (IllegalNameException e) {
            throw Util.createIOException(e);
        }
    }
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.