Package org.apache.jackrabbit.spi

Examples of org.apache.jackrabbit.spi.Name


            }
        }

        try {
            DavPropertySet propSet = response.getProperties(DavServletResponse.SC_OK);
            Name name = resolver.getQName(propSet.get(ItemResourceConstants.JCR_NAME).getValue().toString());
            PropertyId propertyId = service.getIdFactory().createPropertyId(parentId, name);

            cache.add(response.getHref(), propertyId);
            return propertyId;
        } catch (NameException e) {
View Full Code Here


        String propName = Text.unescape(Text.getName(uri, true));
        // retrieve parent node id
        NodeId parentId = getNodeId(parentUri, sessionInfo);
        // build property id
        try {
            Name name = service.getNamePathResolver(sessionInfo).getQName(propName);
            PropertyId propertyId = service.getIdFactory().createPropertyId(parentId, name);
            cache.add(uri, propertyId);

            return propertyId;
        } catch (NameException e) {
View Full Code Here

     * {@inheritDoc}
     */
    public NodeType getNodeType(String nodeTypeName)
            throws NoSuchNodeTypeException {
        try {
            Name qName = getNamePathResolver().getQName(nodeTypeName);
            return getNodeType(qName);
        } catch (NamespaceException e) {
            throw new NoSuchNodeTypeException(nodeTypeName, e);
        } catch (NameException e) {
            throw new NoSuchNodeTypeException(nodeTypeName, e);
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

    /**
     * @see NodeTypeManager#hasNodeType(String)
     */
    public boolean hasNodeType(String name) throws RepositoryException {
        try {
            Name qName = getNamePathResolver().getQName(name);
            return hasNodeType(qName);
        } catch (NamespaceException e) {
            return false;
        } catch (NameException e) {
            return false;
View Full Code Here

            // supertypes
            deps.addAll(Arrays.asList(supertypes));
            // child node definitions
            for (QNodeDefinition childNodeDef : childNodeDefs) {
                // default primary type
                Name ntName = childNodeDef.getDefaultPrimaryType();
                if (ntName != null && !name.equals(ntName)) {
                    deps.add(ntName);
                }
                // required primary type
                Name[] ntNames = childNodeDef.getRequiredPrimaryTypes();
                for (Name ntName1 : ntNames) {
                    if (ntName1 != null && !name.equals(ntName1)) {
                        deps.add(ntName1);
                    }
                }
            }
            // property definitions
            for (QPropertyDefinition propertyDef : propertyDefs) {
                // [WEAK]REFERENCE value constraints
                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

            return QPropertyDefinition.EMPTY_ARRAY;
        }
        QPropertyDefinition[] declaredPropDefs = new QPropertyDefinition[pds.length];
        for (int i = 0; i < pds.length; i++) {
            PropertyDefinition propDef = pds[i];
            Name name = propDef.getName().equals(NameConstants.ANY_NAME.getLocalName())
                    ? NameConstants.ANY_NAME
                    : resolver.getQName(propDef.getName());
            // check if propDef provides declaring node type and if it matches 'this' one.
            if (propDef.getDeclaringNodeType() != null) {
                if (!declName.equals(resolver.getQName(propDef.getDeclaringNodeType().getName()))) {
View Full Code Here

            return QNodeDefinition.EMPTY_ARRAY;
        }
        QNodeDefinition[] declaredNodeDefs = new QNodeDefinition[nds.length];
        for (int i = 0; i < nds.length; i++) {
            NodeDefinition nodeDef = nds[i];
            Name name = nodeDef.getName().equals(NameConstants.ANY_NAME.getLocalName())
                    ? NameConstants.ANY_NAME
                    : resolver.getQName(nodeDef.getName());
            // check if propDef provides declaring node type and if it matches 'this' one.
            if (nodeDef.getDeclaringNodeType() != null) {
                if (!declName.equals(resolver.getQName(nodeDef.getDeclaringNodeType().getName()))) {
                    throw new RepositoryException("Childnode definition specified invalid declaring nodetype: "
                            + nodeDef.getDeclaringNodeType().getName() + ", but should be " + declName);
                }
            }
            Name defaultPrimaryType = nodeDef.getDefaultPrimaryTypeName() == null
                    ? null
                    : resolver.getQName(nodeDef.getDefaultPrimaryTypeName());
            Name[] requiredPrimaryTypes = getNames(nodeDef.getRequiredPrimaryTypeNames(), resolver);

            declaredNodeDefs[i] = new QNodeDefinitionImpl(
View Full Code Here

     * @see Item#getName()
     */
    @Override
    public String getName() throws RepositoryException {
        checkStatus();
        Name name = getQName();
        return session.getNameResolver().getJCRName(name);
    }
View Full Code Here

        // update NodeEntry from the information present in the NodeInfo (prop entries)
        List<Name> propNames = new ArrayList<Name>();
        for (Iterator<PropertyId> it = info.getPropertyIds(); it.hasNext(); ) {
            PropertyId pId = it.next();
            Name propertyName = pId.getName();
            propNames.add(propertyName);
        }
        try {
            entry.setPropertyEntries(propNames);
        } catch (ItemExistsException 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.