Search in sources :

Example 1 with NodeTypeDefinitionImpl

use of org.apache.jackrabbit.spi.commons.nodetype.NodeTypeDefinitionImpl in project jackrabbit by apache.

the class CompactNodeTypeDefWriter method write.

/**
     * Write one QNodeTypeDefinition to this writer
     *
     * @param ntd node type definition
     * @throws IOException if an I/O error occurs
     */
public void write(QNodeTypeDefinition ntd) throws IOException {
    NodeTypeDefinition def = new NodeTypeDefinitionImpl(ntd, npResolver, new ValueFactoryQImpl(QValueFactoryImpl.getInstance(), npResolver));
    super.write(def);
}
Also used : NodeTypeDefinitionImpl(org.apache.jackrabbit.spi.commons.nodetype.NodeTypeDefinitionImpl) QNodeTypeDefinition(org.apache.jackrabbit.spi.QNodeTypeDefinition) NodeTypeDefinition(javax.jcr.nodetype.NodeTypeDefinition) ValueFactoryQImpl(org.apache.jackrabbit.spi.commons.value.ValueFactoryQImpl)

Example 2 with NodeTypeDefinitionImpl

use of org.apache.jackrabbit.spi.commons.nodetype.NodeTypeDefinitionImpl in project jackrabbit by apache.

the class RepositoryServiceImpl method registerNodeTypes.

/**
     * {@inheritDoc}
     */
public void registerNodeTypes(SessionInfo sessionInfo, QNodeTypeDefinition[] nodeTypeDefinitions, boolean allowUpdate) throws InvalidNodeTypeDefinitionException, NodeTypeExistsException, UnsupportedRepositoryOperationException, RepositoryException {
    SessionInfoImpl sInfo = getSessionInfoImpl(sessionInfo);
    NodeTypeManager ntMgr = sInfo.getSession().getWorkspace().getNodeTypeManager();
    NodeTypeDefinition[] defs = new NodeTypeDefinition[nodeTypeDefinitions.length];
    for (int i = 0; i < nodeTypeDefinitions.length; i++) {
        defs[i] = new NodeTypeDefinitionImpl(nodeTypeDefinitions[i], sInfo.getNamePathResolver(), sInfo.getSession().getValueFactory()) {
        };
    }
    ntMgr.registerNodeTypes(defs, allowUpdate);
}
Also used : NodeTypeManager(javax.jcr.nodetype.NodeTypeManager) NodeTypeDefinitionImpl(org.apache.jackrabbit.spi.commons.nodetype.NodeTypeDefinitionImpl) QNodeTypeDefinitionImpl(org.apache.jackrabbit.spi.commons.QNodeTypeDefinitionImpl) QNodeTypeDefinition(org.apache.jackrabbit.spi.QNodeTypeDefinition) NodeTypeDefinition(javax.jcr.nodetype.NodeTypeDefinition)

Aggregations

NodeTypeDefinition (javax.jcr.nodetype.NodeTypeDefinition)2 QNodeTypeDefinition (org.apache.jackrabbit.spi.QNodeTypeDefinition)2 NodeTypeDefinitionImpl (org.apache.jackrabbit.spi.commons.nodetype.NodeTypeDefinitionImpl)2 NodeTypeManager (javax.jcr.nodetype.NodeTypeManager)1 QNodeTypeDefinitionImpl (org.apache.jackrabbit.spi.commons.QNodeTypeDefinitionImpl)1 ValueFactoryQImpl (org.apache.jackrabbit.spi.commons.value.ValueFactoryQImpl)1