Package org.apache.jackrabbit.spi

Examples of org.apache.jackrabbit.spi.Name


        // init label cache
        try {
            PropertyState[] labels = labelNode.getProperties();
            for (PropertyState pState : labels) {
                if (pState.getType() == PropertyType.REFERENCE) {
                    Name labelName = pState.getName();
                    NodeId id = pState.getValues()[0].getNodeId();
                    if (node.getState().hasChildNodeEntry(id)) {
                        labelCache.put(labelName, node.getState().getChildNodeEntry(id).getName());
                    } else {
                        log.warn("Error while resolving label reference. Version missing: " + id);
View Full Code Here


            versionCache.put(v.getId(), v);
            vMgr.versionCreated(v);

            // add labels
            for (Name labelName: labelCache.keySet()) {
                Name versionName = labelCache.get(labelName);
                if (v.getName().equals(versionName)) {
                    v.internalAddLabel(labelName);
                }
            }
            return v;
View Full Code Here

            v.clear();
        } else {
            // check if baseline
            try {
                NodeStateEx frozen = child.getNode(NameConstants.JCR_FROZENNODE, 1);
                Name frozenType = frozen.getPropertyValue(NameConstants.JCR_FROZENPRIMARYTYPE).getName();
                if (NameConstants.NT_CONFIGURATION.equals(frozenType)) {
                    v = new InternalBaselineImpl(this, child, child.getName());
                } else {
                    v = new InternalVersionImpl(this, child, child.getName());
                }
View Full Code Here

    /**
     * {@inheritDoc}
     */
    public synchronized InternalVersion getVersionByLabel(Name label) {
        Name versionName = labelCache.get(label);
        if (versionName == null) {
            return null;
        }

        NodeId id = nameCache.get(versionName);
View Full Code Here

        InternalVersion version =
            (versionName != null) ? getVersion(versionName) : null;
        if (versionName != null && version == null) {
            throw new VersionException("Version " + versionName + " does not exist in this version history.");
        }
        Name prevName = labelCache.get(label);
        InternalVersionImpl prev = null;
        if (prevName == null) {
            if (version == null) {
                return null;
            }
View Full Code Here

            /**
             * first check if relPath is just a name (in which case we don't
             * have to build & resolve absolute path)
             */
            if (relPath.indexOf('/') == -1) {
                Name propName = session.getQName(relPath);
                // check if property entry exists
                NodeState thisState = data.getNodeState();
                if (thisState.hasPropertyName(propName)) {
                    return new PropertyId(thisState.getNodeId(), propName);
                } else {
View Full Code Here

        NodeTypeImpl mixin = ntMgr.getNodeType(mixinName);
        if (!mixin.isMixin()) {
            throw new RepositoryException(mixinName + ": not a mixin node type");
        }

        final Name primaryTypeName = data.getNodeState().getNodeTypeName();
        NodeTypeImpl primaryType = ntMgr.getNodeType(primaryTypeName);
        if (primaryType.isDerivedFrom(mixinName)) {
            // new mixin is already included in primary type
            return;
        }
View Full Code Here

    public boolean isNodeType(Name ntName) throws RepositoryException {
        // check state of this instance
        sanityCheck();

        // first do trivial checks without using type hierarchy
        Name primary = data.getNodeState().getNodeTypeName();
        if (ntName.equals(primary)) {
            return true;
        }
        Set<Name> mixins = data.getNodeState().getMixinTypeNames();
        if (mixins.contains(ntName)) {
View Full Code Here

    /**
     * @see ItemImpl#getQName()
     */
    public Name getQName() throws RepositoryException {
        HierarchyManager hierMgr = session.getHierarchyManager();
        Name name;

        if (!isShareable()) {
            name = hierMgr.getName(id);
        } else {
            name = hierMgr.getName(getNodeId(), getParentId());
View Full Code Here

            // this is the root node
            return "";
        }

        HierarchyManager hierMgr = session.getHierarchyManager();
        Name name;

        if (!isShareable()) {
            name = hierMgr.getName(id);
        } else {
            name = hierMgr.getName(getNodeId(), getParentId());
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.