Examples of QNodeTypeDefinition


Examples of org.apache.jackrabbit.spi.QNodeTypeDefinition

            tmpNTDefCache.put(ntd.getName(), ntd);
        }

        // check if all node type defs have proper nt:base subtyping
        for (int i = 0; i < defs.size(); i++) {
            QNodeTypeDefinition ntd = defs.get(i);
            QNodeTypeDefinition mod = checkNtBaseSubtyping(ntd, tmpNTDefCache);
            if (mod != ntd) {
                // check fixed subtyping
                // -> update cache and list of defs
                tmpNTDefCache.put(mod.getName(), mod);
                defs.set(i, mod);
            }
        }

        // create working copies of current ent & ntd caches:
View Full Code Here

Examples of org.apache.jackrabbit.spi.QNodeTypeDefinition

        // finally add newly created effective node types to entCache
        entCache = tmpENTCache;
    }

    private void internalUnregister(Name name) throws NoSuchNodeTypeException {
        QNodeTypeDefinition ntd = registeredNTDefs.get(name);
        if (ntd == null) {
            throw new NoSuchNodeTypeException(name.toString());
        }
        registeredNTDefs.remove(name);
        entCache.invalidate(name);
View Full Code Here

Examples of org.apache.jackrabbit.spi.QNodeTypeDefinition

        } else {
            // check if all supertypes (except nt:base) are mixins
            boolean allMixins = true;
            for (Name name: supertypes) {
                if (!name.equals(NameConstants.NT_BASE)) {
                    QNodeTypeDefinition def = ntdCache.get(name);
                    if (def != null && !def.isMixin()) {
                        allMixins = false;
                        break;
                    }
                }
            }
View Full Code Here

Examples of org.apache.jackrabbit.spi.QNodeTypeDefinition

        synchronized (ntCache) {
            NodeTypeImpl nt = ntCache.get(name);
            if (nt == null) {
                NodeTypeRegistry registry = context.getNodeTypeRegistry();
                EffectiveNodeType ent = registry.getEffectiveNodeType(name);
                QNodeTypeDefinition def = registry.getNodeTypeDef(name);
                nt = new NodeTypeImpl(
                        ent, def, this, context,
                        context.getValueFactory(), context.getDataStore());
                ntCache.put(name, nt);
            }
View Full Code Here

Examples of org.apache.jackrabbit.spi.QNodeTypeDefinition

        // registered node types which make circular dependencies possible
        List<QNodeTypeDefinition> addedDefs = new ArrayList<QNodeTypeDefinition>();
        List<QNodeTypeDefinition> modifiedDefs = new ArrayList<QNodeTypeDefinition>();
        for (NodeTypeDefinition definition : definitions) {
            // convert to QNodeTypeDefinition
            QNodeTypeDefinition def = toNodeTypeDef(definition);
            if (registry.isRegistered(def.getName())) {
              if (allowUpdate) {
                  modifiedDefs.add(def);
              } else {
                  throw new NodeTypeExistsException(definition.getName());
              }
View Full Code Here

Examples of org.apache.jackrabbit.spi.QNodeTypeDefinition

        if (ntd.hasOrderableChildNodes()) {
            ent.orderableChildNodes = true;
        } else {
            Name[] nta = ent.getInheritedNodeTypes();
            for (Name aNta : nta) {
                QNodeTypeDefinition def = ntdCache.get(aNta);
                if (def.hasOrderableChildNodes()) {
                    ent.orderableChildNodes = true;
                    break;
                }
            }
        }

        // resolve 'primary item' attribute value (JCR-1947)
        if (ntd.getPrimaryItemName() != null) {
            ent.primaryItemName = ntd.getPrimaryItemName();
        } else {
            Name[] nta = ent.getInheritedNodeTypes();
            for (Name aNta : nta) {
                QNodeTypeDefinition def = ntdCache.get(aNta);
                if (def.getPrimaryItemName() != null) {
                    ent.primaryItemName = def.getPrimaryItemName();
                    break;
                }
            }
        }
View Full Code Here

Examples of org.apache.jackrabbit.spi.QNodeTypeDefinition

     */
    public void checkAddNodeConstraints(Name name, Name nodeTypeName,
                                        NodeTypeRegistry ntReg)
            throws ConstraintViolationException, NoSuchNodeTypeException {
        if (nodeTypeName != null) {
            QNodeTypeDefinition ntDef = ntReg.getNodeTypeDef(nodeTypeName);
            if (ntDef.isAbstract()) {
                throw new ConstraintViolationException(nodeTypeName + " is abstract.");
            }
            if (ntDef.isMixin()) {
                throw new ConstraintViolationException(nodeTypeName + " is mixin.");
            }
        }
        QItemDefinition nd = getApplicableChildNodeDef(name, nodeTypeName, ntReg);
        if (nd.isProtected()) {
View Full Code Here

Examples of org.apache.jackrabbit.spi.QNodeTypeDefinition

                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

Examples of org.apache.jackrabbit.spi.QNodeTypeDefinition

        }
    }

    public void nodeTypeRegistered(Name ntName) {
        try {
            QNodeTypeDefinition def = registry.getNodeTypeDef(ntName);
            QPropertyDefinition[] propDefs = def.getPropertyDefs();
            synchronized (typeMapping) {
                for (QPropertyDefinition propDef : propDefs) {
                    int type = propDef.getRequiredType();
                    if (!propDef.definesResidual() && type != PropertyType.UNDEFINED) {
                        Name name = propDef.getName();
View Full Code Here

Examples of org.apache.jackrabbit.spi.QNodeTypeDefinition

    /**
     * @see NodeTypeRegistry#getNodeTypeDefinition(Name)
     */
    public QNodeTypeDefinition getNodeTypeDefinition(Name nodeTypeName)
        throws NoSuchNodeTypeException {
        QNodeTypeDefinition def = registeredNTDefs.get(nodeTypeName);
        if (def == null) {
            throw new NoSuchNodeTypeException("Nodetype " + nodeTypeName + " doesn't exist");
        }
        return def;
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.