Package org.apache.jackrabbit.spi

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


        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

     * @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

            // a future attempt to put the node under version control again
            // (see JCR-3115)
           
            log.info("trying to rename version history of node " + node.getId());

            NameFactory nf = NameFactoryImpl.getInstance();
           
            // Name of VHR in parent folder is ID of versionable node
            Name vhrname = nf.create(Name.NS_DEFAULT_URI, node.getId().toString());

            try {
                NodeState vhrState = versionManager.getPersistenceManager().load(vhid);
                NodeState vhrParentState = versionManager.getPersistenceManager().load(vhrState.getParentId());
               
                if (vhrParentState.hasChildNodeEntry(vhrname)) {
                    NodeState modifiedParent = (NodeState) vworkspaceChanges.get(vhrState.getParentId());
                    if (modifiedParent == null) {
                        modifiedParent = new NodeState(vhrParentState, NodeState.STATUS_EXISTING_MODIFIED, true);
                    }
                   
                    Calendar now = Calendar.getInstance();
                    String appendme = " (disconnected by RepositoryChecker on "
                            + ISO8601.format(now) + ")";
                    modifiedParent.renameChildNodeEntry(vhid,
                            nf.create(vhrname.getNamespaceURI(), vhrname.getLocalName() + appendme));

                    vworkspaceChanges.modified(modifiedParent);
                }
                else {
                    log.info("child node entry " + vhrname + " for version history not found inside parent folder.");
View Full Code Here

        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

                // REFERENCE value constraints
                if (propertyDefs[i].getRequiredType() == PropertyType.REFERENCE) {
                    String[] ca = propertyDefs[i].getValueConstraints();
                    if (ca != null) {
                        for (int j = 0; j < ca.length; j++) {
                            NameFactory factory = NameFactoryImpl.getInstance();
                            Name ntName = factory.create(ca[j]);
                            if (!name.equals(ntName)) {
                                deps.add(ntName);
                            }
                        }
                    }
View Full Code Here

                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

            super(service, logWriter);
            this.logWriterProvider = logWriterProvider;
        }

        public NameFactory getNameFactory() throws RepositoryException {
            NameFactory result = super.getNameFactory();
            return result == null
                ? null
                : create(result, logWriterProvider);
        }
View Full Code Here

        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

    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

TOP

Related Classes of org.apache.jackrabbit.spi.NameFactory

Copyright © 2018 www.massapicom. 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.