Package org.apache.jackrabbit.spi

Examples of org.apache.jackrabbit.spi.QNodeTypeDefinition


     */
    public NodeTypeIterator registerNodeTypes(NodeTypeDefinition[] ntds, boolean allowUpdate)
            throws RepositoryException {
        List<QNodeTypeDefinition> defs = new ArrayList<QNodeTypeDefinition>(ntds.length);
        for (NodeTypeDefinition definition : ntds) {
            QNodeTypeDefinition qdef = new QNodeTypeDefinitionImpl(definition, resolver(), mgrProvider.getQValueFactory());
            if (!allowUpdate && hasNodeType(qdef.getName())) {
                throw new NodeTypeExistsException("NodeType " + definition.getName() + " already exists.");
            }
            defs.add(qdef);
        }

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

    public Iterator<QNodeTypeDefinition> getQNodeTypeDefinitions(SessionInfo sessionInfo, Name[] nodetypeNames)
            throws RepositoryException {
        checkSessionInfo(sessionInfo);
        List<QNodeTypeDefinition> ntDefs = new ArrayList<QNodeTypeDefinition>();
        for (Name nodetypeName : nodetypeNames) {
            QNodeTypeDefinition def = nodeTypeDefs.get(nodetypeName);
            if (def == null) {
                throw new RepositoryException("unknown node type: " + nodetypeName);
            }
            ntDefs.add(def);
        }
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

            validateNodeTypeDef(ntd, entCache, registeredNTDefs, nsReg, false);

            /**
             * build diff of current and new definition and determine type of change
             */
            QNodeTypeDefinition ntdOld = registeredNTDefs.get(name);
            NodeTypeDefDiff diff = NodeTypeDefDiff.create(ntdOld, ntd);
            if (!diff.isModified()) {
                // the definition has not been modified, there's nothing to do here...
                return getEffectiveNodeType(name);
            }
View Full Code Here

     * @throws NoSuchNodeTypeException if a node type with the given name
     *                                 does not exist
     */
    public QNodeTypeDefinition getNodeTypeDef(Name nodeTypeName)
            throws NoSuchNodeTypeException {
        QNodeTypeDefinition def = registeredNTDefs.get(nodeTypeName);
        if (def == null) {
            throw new NoSuchNodeTypeException(nodeTypeName.toString());
        }
        return def;
    }
View Full Code Here

        if (ent != null) {
            return ent;
        }

        // 2. make sure we've got the definition of the specified node type
        QNodeTypeDefinition ntd = ntdCache.get(ntName);
        if (ntd == null) {
            throw new NoSuchNodeTypeException(ntName.toString());
        }

        // 3. build effective node type
View Full Code Here

                     * no matching sub-aggregates found:
                     * build aggregate of remaining node types through iteration
                     */
                    Name[] remainder = key.getNames();
                    for (Name aRemainder : remainder) {
                        QNodeTypeDefinition ntd = ntdCache.get(aRemainder);
                        EffectiveNodeType ent =
                                EffectiveNodeType.create(ntd, entCache, ntdCache);
                        // store new effective node type
                        entCache.put(ent);
                        if (result == null) {
View Full Code Here

                buf.append(nt);
                throw new InvalidNodeTypeDefException("circular inheritance detected: " + buf.toString());
            }

            try {
                QNodeTypeDefinition ntd = ntDefCache.get(nt);
                Name[] sta = ntd.getSupertypes();
                if (sta.length > 0) {
                    // check recursively
                    inheritanceChain.push(nt);
                    checkForCircularInheritance(sta, inheritanceChain, ntDefCache);
                    inheritanceChain.pop();
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.