Package org.apache.jackrabbit.spi

Examples of org.apache.jackrabbit.spi.QNodeTypeDefinition


     * @see javax.jcr.nodetype.NodeType#canAddChildNode(String, String)
     */
    public boolean canAddChildNode(String childNodeName, String nodeTypeName) {
        try {
            Name ntName = resolver().getQName(nodeTypeName);
            QNodeTypeDefinition def = ntMgr.getNodeTypeDefinition(ntName);
            ent.checkAddNodeConstraints(resolver().getQName(childNodeName), def, definitionProvider());
            return true;
        } catch (NameException be) {
            // implementation specific exception, fall through
        } catch (RepositoryException re) {
View Full Code Here


    private void resolveNodeType(Set resolved, Name ntName) {
        if (!resolved.add(ntName)) {
            return;
        }
        QNodeTypeDefinition def = (QNodeTypeDefinition) nodeTypeDefinitions.get(ntName);
        if (def != null) {
            Name[] supertypes = def.getSupertypes();
            for (int i = 0; i < supertypes.length; i++) {
                resolveNodeType(resolved, supertypes[i]);
            }
        }
    }
View Full Code Here

            }
            // refresh node type definitions map
            synchronized (nodeTypeDefinitions) {
                nodeTypeDefinitions.clear();
                for (Iterator defIt = ntDefs.iterator(); defIt.hasNext(); ) {
                    QNodeTypeDefinition def = (QNodeTypeDefinition) defIt.next();
                    nodeTypeDefinitions.put(def.getName(), def);
                }
            }
            return ntDefs.iterator();
    }
View Full Code Here

                    (String) entry.getValue());
        }
        CompactNodeTypeDefReader reader = new CompactNodeTypeDefReader(
                cnd, "", this.namespaces, new QNodeTypeDefinitionsBuilderImpl());
        for (Iterator it = reader.getNodeTypeDefs().iterator(); it.hasNext(); ) {
            QNodeTypeDefinition def = (QNodeTypeDefinition) it.next();
            nodeTypeDefs.put(def.getName(), def);
        }
        this.wspNames = Collections.unmodifiableList(new ArrayList(wspNames));
    }
View Full Code Here

            ValueFactory valueFactory, Writer out)
            throws IOException {
        CompactNodeTypeDefWriter w = new CompactNodeTypeDefWriter(out, r, npResolver, valueFactory, true);
        Iterator iter = l.iterator();
        while (iter.hasNext()) {
            QNodeTypeDefinition def = (QNodeTypeDefinition) iter.next();
            w.write(def);
        }
        w.close();
    }
View Full Code Here

        if (ntdList1.size() == 0 || ntdList1.size() != ntdList2.size()) {
            fail("Exported node type definition was not successfully read back in");
        } else {
            for(int k = 0; k < ntdList1.size(); k++) {
                QNodeTypeDefinition ntd1 = (QNodeTypeDefinition) ntdList1.get(k);
                QNodeTypeDefinition ntd2 = (QNodeTypeDefinition) ntdList2.get(k);

                NodeTypeDefDiff diff = NodeTypeDefDiff.create(ntd1, ntd2);
                if (diff.isModified() && !diff.isTrivial()){
                    fail("Exported node type definition was not successfully read back in. "
                            + ntd2.getName() + "differs from original");
                }
            }
        }
    }
View Full Code Here

    public boolean equals(Object obj) {
        if (this == obj) {
            return true;
        }
        if (obj instanceof QNodeTypeDefinition) {
            QNodeTypeDefinition other = (QNodeTypeDefinition) obj;
            return (name == null ? other.getName() == null : name.equals(other.getName()))
                && (primaryItemName == null ? other.getPrimaryItemName() == null : primaryItemName.equals(other.getPrimaryItemName()))
                && Arrays.equals(supertypes, other.getSupertypes())
                && mixin == other.isMixin()
                && isAbstract == other.isAbstract()
                && isQueryable == other.isQueryable()
                && orderableChildNodes == other.hasOrderableChildNodes()
                && Arrays.equals(propDefs, other.getPropertyDefs())
                && Arrays.equals(nodeDefs, other.getChildNodeDefs());
        }
        return false;
    }
View Full Code Here

                break;
            case NodeTypeRecord.UNREGISTER:
                nodeTypeListener.externalUnregistered(coll);
                break;
            case NodeTypeRecord.REREGISTER:
                QNodeTypeDefinition ntd = (QNodeTypeDefinition) coll.iterator().next();
                nodeTypeListener.externalReregistered(ntd);
                break;
            }
        } catch (InvalidNodeTypeDefException e) {
            String msg = "Unable to deliver node type operation: " + e.getMessage();
View Full Code Here

    //------------------------------------------------------< Reading items >---

    public QNodeDefinition getNodeDefinition(SessionInfo sessionInfo, NodeId nodeId)
            throws RepositoryException {

        QNodeTypeDefinition ntd = nodeTypes.getQNodeTypeDefinition(NameConstants.NT_UNSTRUCTURED);
        QNodeDefinition[] nds = ntd.getChildNodeDefs();
        for (int k = 0; k < nds.length; k++) {
            QNodeDefinition nd = nds[k];
            if (NameConstants.ANY_NAME.equals(nd.getName())) {
                return nd;
            }
View Full Code Here

    }

    public QPropertyDefinition getPropertyDefinition(SessionInfo sessionInfo, PropertyId propertyId)
            throws RepositoryException {

        QNodeTypeDefinition ntd = nodeTypes.getQNodeTypeDefinition(NameConstants.NT_UNSTRUCTURED);
        QPropertyDefinition[] pds = ntd.getPropertyDefs();
        for (int k = 0; k < pds.length; k++) {
            QPropertyDefinition pd = pds[k];
            if (NameConstants.ANY_NAME.equals(pd)) {
                return pd;
            }
View Full Code Here

TOP

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

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.