Package org.apache.jackrabbit.spi

Examples of org.apache.jackrabbit.spi.Name


        private Path getPath() throws RepositoryException {
            if (parent == null) {
                return PathFactoryImpl.getInstance().getRootPath();
            }
            else {
                Name name = NameFactoryImpl.getInstance().create(Name.NS_DEFAULT_URI, this.name);
                return PathFactoryImpl.getInstance().create(parent.getPath(), name, true);
            }
        }
View Full Code Here


            }
            else {
                stale = true;

                NodeId parentId = parent.getId();
                Name propertyName = NameFactoryImpl.getInstance().create(Name.NS_DEFAULT_URI, this.name);
                Path path = PathFactoryImpl.getInstance().create(parentId.getPath(), propertyName, true);
                PropertyId id = IdFactoryImpl.getInstance().createPropertyId(parentId, propertyName);

                propertyInfo = new PropertyInfoImpl(path, id, type, isMultivalued,
                        values.toArray(new QValue[values.size()]));
View Full Code Here

                // we can use == operator for namespaceURI since it is internalized
                return namespaceURI == other.namespaceURI && localName.equals(other.localName);
            }
            // some other Name implementation
            if (obj instanceof Name) {
                Name other = (Name) obj;
                return namespaceURI.equals(other.getNamespaceURI()) && localName.equals(other.getLocalName());
            }
            return false;
        }
View Full Code Here

         */
        public int compareTo(Object o) {
            if (this == o) {
                return 0;
            }
            Name other = (Name) o;
            if (namespaceURI.equals(other.getNamespaceURI())) {
                return localName.compareTo(other.getLocalName());
            } else {
                return namespaceURI.compareTo(other.getNamespaceURI());
            }
        }
View Full Code Here

        }

        NodeState srcState = getNodeState(srcPath, hierMgr);
        NodeState srcParentState = getNodeState(srcPath.getAncestor(1), hierMgr);
        NodeState destParentState = getNodeState(destPath.getAncestor(1), hierMgr);
        Name destName = destPath.getName();

        if (sessionMove) {
            NodeEntry destEntry = (NodeEntry) destParentState.getHierarchyEntry();

            // force child node entries list to be present before the move is executed
View Full Code Here

        /**
         * @see OperationVisitor#visit(AddProperty)
         */
        public void visit(AddProperty operation) throws RepositoryException {
            NodeId parentId = operation.getParentId();
            Name propertyName = operation.getPropertyName();
            if (operation.isMultiValued()) {
                batch.addProperty(parentId, propertyName, operation.getValues());
            } else {
                QValue value = operation.getValues()[0];
                batch.addProperty(parentId, propertyName, value);
View Full Code Here

            Path p = getPathFactory().create(nPath, NameConstants.JCR_UUID, true);
            PropertyInfo pi = new PropertyInfoImpl(id, p, PropertyType.STRING, false, vs);
            l.add(pi);
        }

        Name pName = NameConstants.JCR_PRIMARYTYPE;
        QValue[] vs = new QValue[] {getQValueFactory().create(nInfo.getNodetype())};
        PropertyInfo pi = new PropertyInfoImpl(getIdFactory().createPropertyId(nid, pName),
                getPathFactory().create(nPath, pName, true), PropertyType.NAME, false, vs);
        l.add(pi);
View Full Code Here

            }
        }
    }

    private ChildInfo buildChildInfo(DavPropertySet properties, SessionInfo sessionInfo) throws RepositoryException {
        Name qName = getQName(properties, getNamePathResolver(sessionInfo));
        int index = getIndex(properties);
        String uuid = getUniqueID(properties);

        return new ChildInfoImpl(qName, uuid, index);
    }
View Full Code Here

    /**
     * @see RepositoryService#importXml(SessionInfo, NodeId, InputStream, int)
     */
    public void importXml(SessionInfo sessionInfo, NodeId parentId, InputStream xmlStream, int uuidBehaviour) throws RepositoryException {
        // TODO: improve. currently random name is built instead of retrieving name of new resource from top-level xml element within stream
        Name nodeName = getNameFactory().create(Name.NS_DEFAULT_URI, UUID.randomUUID().toString());
        String uri = getItemUri(parentId, nodeName, sessionInfo);
        MkColMethod method = new MkColMethod(uri);
        method.addRequestHeader(JcrRemotingConstants.IMPORT_UUID_BEHAVIOR, Integer.toString(uuidBehaviour));
        method.setRequestEntity(new InputStreamRequestEntity(xmlStream, "text/xml"));
        execute(method, sessionInfo);
View Full Code Here

            case JJTTYPENAME:
                if (queryNode.getType() == QueryNode.TYPE_LOCATION) {
                    LocationStepQueryNode loc = (LocationStepQueryNode) queryNode;
                    String ntName = ((SimpleNode) node.jjtGetChild(0)).getValue();
                    try {
                        Name nt = resolver.getQName(ntName);
                        NodeTypeQueryNode nodeType = factory.createNodeTypeQueryNode(loc, nt);
                        loc.addPredicate(nodeType);
                    } catch (NameException e) {
                        exceptions.add(new InvalidQueryException("Not a valid name: " + ntName));
                    } catch (NamespaceException e) {
View Full Code Here

TOP

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

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.