|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.core.nodetype.NodeTypeManagerImpl
public class NodeTypeManagerImpl
A NodeTypeManagerImpl implements a session dependant
NodeTypeManager.
| Field Summary |
|---|
| Fields inherited from interface org.apache.jackrabbit.api.JackrabbitNodeTypeManager |
|---|
TEXT_X_JCR_CND, TEXT_XML |
| Constructor Summary | |
|---|---|
NodeTypeManagerImpl(NodeTypeRegistry ntReg,
SessionImpl session,
DataStore store)
Creates a new NodeTypeManagerImpl instance. |
|
| Method Summary | |
|---|---|
NodeDefinitionTemplate |
createNodeDefinitionTemplate()
Returns an empty NodeDefinitionTemplate which can then be
used to create a child node definition and attached to a
NodeTypeTemplate. |
NodeTypeTemplate |
createNodeTypeTemplate()
Returns an empty NodeTypeTemplate which can then be used to
define a node type and passed to
NodeTypeManager.registerNodeType. |
NodeTypeTemplate |
createNodeTypeTemplate(NodeTypeDefinition ntd)
Returns a NodeTypeTemplate holding the specified node type
definition. |
PropertyDefinitionTemplate |
createPropertyDefinitionTemplate()
Returns an empty PropertyDefinitionTemplate which can then
be used to create a property definition and attached to a
NodeTypeTemplate. |
void |
dump(java.io.PrintStream ps)
Dumps the state of this instance in a human readable format for diagnostic purposes. |
javax.jcr.nodetype.NodeTypeIterator |
getAllNodeTypes()
|
javax.jcr.nodetype.NodeTypeIterator |
getMixinNodeTypes()
|
NodeDefinitionImpl |
getNodeDefinition(NodeDefId id)
|
NodeTypeImpl |
getNodeType(Name name)
|
javax.jcr.nodetype.NodeType |
getNodeType(java.lang.String nodeTypeName)
|
NodeTypeRegistry |
getNodeTypeRegistry()
|
javax.jcr.nodetype.NodeTypeIterator |
getPrimaryNodeTypes()
|
PropertyDefinitionImpl |
getPropertyDefinition(PropDefId id)
|
NodeDefinitionImpl |
getRootNodeDefinition()
|
boolean |
hasNodeType(java.lang.String name)
Checks whether a node type with the given name exists. |
void |
nodeTypeRegistered(Name ntName)
Called when a node type has been registered. |
void |
nodeTypeReRegistered(Name ntName)
Called when a node type has been re-registered. |
void |
nodeTypeUnregistered(Name ntName)
Called when a node type has been deregistered. |
javax.jcr.nodetype.NodeType |
registerNodeType(NodeTypeDefinition ntd,
boolean allowUpdate)
Registers a new node type or updates an existing node type using the specified definition and returns the resulting NodeType
object. |
javax.jcr.nodetype.NodeTypeIterator |
registerNodeTypes(java.util.Collection definitions,
boolean allowUpdate)
Registers or updates the specified Collection of
NodeTypeDefinition objects. |
javax.jcr.nodetype.NodeType[] |
registerNodeTypes(org.xml.sax.InputSource in)
Registers the node types defined in the given XML stream. |
javax.jcr.nodetype.NodeType[] |
registerNodeTypes(java.io.InputStream in,
java.lang.String contentType)
Registers the node types defined in the given input stream depending on the content type specified for the stream. |
javax.jcr.nodetype.NodeType[] |
registerNodeTypes(java.io.InputStream in,
java.lang.String contentType,
boolean reregisterExisting)
Registers the node types defined in the given input stream depending on the content type specified for the stream. |
void |
unregisterNodeType(java.lang.String name)
Unregisters the specified node type. |
void |
unregisterNodeTypes(java.lang.String[] names)
Unregisters the specified set of node types. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public NodeTypeManagerImpl(NodeTypeRegistry ntReg,
SessionImpl session,
DataStore store)
NodeTypeManagerImpl instance.
ntReg - node type registrysession - current session| Method Detail |
|---|
public NodeDefinitionImpl getRootNodeDefinition()
public NodeDefinitionImpl getNodeDefinition(NodeDefId id)
id -
public PropertyDefinitionImpl getPropertyDefinition(PropDefId id)
id -
public NodeTypeImpl getNodeType(Name name)
throws javax.jcr.nodetype.NoSuchNodeTypeException
name -
javax.jcr.nodetype.NoSuchNodeTypeExceptionpublic NodeTypeRegistry getNodeTypeRegistry()
public javax.jcr.nodetype.NodeType[] registerNodeTypes(java.io.InputStream in,
java.lang.String contentType,
boolean reregisterExisting)
throws java.io.IOException,
javax.jcr.RepositoryException
in - node type XML streamcontentType - type of the input streamreregisterExisting - flag indicating whether node types should be
reregistered if they already exist
java.io.IOException - if the input stream could not be read or parsed
javax.jcr.RepositoryException - if the node types are invalid or another
repository error occurspublic void nodeTypeRegistered(Name ntName)
nodeTypeRegistered in interface NodeTypeRegistryListenerntName - name of the node type that has been registeredpublic void nodeTypeReRegistered(Name ntName)
nodeTypeReRegistered in interface NodeTypeRegistryListenerntName - name of the node type that has been registeredpublic void nodeTypeUnregistered(Name ntName)
nodeTypeUnregistered in interface NodeTypeRegistryListenerntName - name of the node type that has been unregistered
public javax.jcr.nodetype.NodeTypeIterator getAllNodeTypes()
throws javax.jcr.RepositoryException
getAllNodeTypes in interface javax.jcr.nodetype.NodeTypeManagerjavax.jcr.RepositoryException
public javax.jcr.nodetype.NodeTypeIterator getPrimaryNodeTypes()
throws javax.jcr.RepositoryException
getPrimaryNodeTypes in interface javax.jcr.nodetype.NodeTypeManagerjavax.jcr.RepositoryException
public javax.jcr.nodetype.NodeTypeIterator getMixinNodeTypes()
throws javax.jcr.RepositoryException
getMixinNodeTypes in interface javax.jcr.nodetype.NodeTypeManagerjavax.jcr.RepositoryException
public javax.jcr.nodetype.NodeType getNodeType(java.lang.String nodeTypeName)
throws javax.jcr.nodetype.NoSuchNodeTypeException
getNodeType in interface javax.jcr.nodetype.NodeTypeManagerjavax.jcr.nodetype.NoSuchNodeTypeException
public javax.jcr.nodetype.NodeType[] registerNodeTypes(org.xml.sax.InputSource in)
throws org.xml.sax.SAXException,
javax.jcr.RepositoryException
NodeTypeReader and NodeTypeRegistry methods and
heuristically creates the returned node type array. It will also
register any namespaces defined in the input source that have not
already been registered.
Registers node types from the given node type XML stream.
registerNodeTypes in interface JackrabbitNodeTypeManagerin - node type XML stream
org.xml.sax.SAXException - if the XML stream could not be read or parsed
javax.jcr.RepositoryException - if the node types are invalid or another
repository error occurs
public javax.jcr.nodetype.NodeType[] registerNodeTypes(java.io.InputStream in,
java.lang.String contentType)
throws java.io.IOException,
javax.jcr.RepositoryException
registerNodeTypes in interface JackrabbitNodeTypeManagerin - node type streamcontentType - type of the input stream
java.io.IOException - if the input stream could not be read or parsed
javax.jcr.RepositoryException - if the node types are invalid or another
repository error occurs
public boolean hasNodeType(java.lang.String name)
throws javax.jcr.RepositoryException
hasNodeType in interface JackrabbitNodeTypeManagername - node type name
true if the named node type exists,
false otherwise
javax.jcr.RepositoryException - if the name format is invalid
public NodeTypeTemplate createNodeTypeTemplate()
throws javax.jcr.UnsupportedRepositoryOperationException,
javax.jcr.RepositoryException
NodeTypeTemplate which can then be used to
define a node type and passed to
NodeTypeManager.registerNodeType.
Throws an UnsupportedRepositoryOperationException if this
implementation does not support node type registration.
NodeTypeTemplate.
javax.jcr.UnsupportedRepositoryOperationException - if this implementation
does not support node type registration.
javax.jcr.RepositoryException - if another error occurs.
public NodeTypeTemplate createNodeTypeTemplate(NodeTypeDefinition ntd)
throws javax.jcr.UnsupportedRepositoryOperationException,
javax.jcr.RepositoryException
NodeTypeTemplate holding the specified node type
definition. This template can then be altered and passed to
NodeTypeManager.registerNodeType.
Throws an UnsupportedRepositoryOperationException if this
implementation does not support node type registration.
ntd - a NodeTypeDefinition.
NodeTypeTemplate.
javax.jcr.UnsupportedRepositoryOperationException - if this implementation
does not support node type registration.
javax.jcr.RepositoryException - if another error occurs.
public NodeDefinitionTemplate createNodeDefinitionTemplate()
throws javax.jcr.UnsupportedRepositoryOperationException,
javax.jcr.RepositoryException
NodeDefinitionTemplate which can then be
used to create a child node definition and attached to a
NodeTypeTemplate.
Throws an UnsupportedRepositoryOperationException if this
implementation does not support node type registration.
NodeDefinitionTemplate.
javax.jcr.UnsupportedRepositoryOperationException - if this implementation
does not support node type registration.
javax.jcr.RepositoryException - if another error occurs.
public PropertyDefinitionTemplate createPropertyDefinitionTemplate()
throws javax.jcr.UnsupportedRepositoryOperationException,
javax.jcr.RepositoryException
PropertyDefinitionTemplate which can then
be used to create a property definition and attached to a
NodeTypeTemplate.
Throws an UnsupportedRepositoryOperationException if this
implementation does not support node type registration.
PropertyDefinitionTemplate.
javax.jcr.UnsupportedRepositoryOperationException - if this implementation
does not support node type registration.
javax.jcr.RepositoryException - if another error occurs.
public javax.jcr.nodetype.NodeType registerNodeType(NodeTypeDefinition ntd,
boolean allowUpdate)
throws InvalidNodeTypeDefinitionException,
NodeTypeExistsException,
javax.jcr.UnsupportedRepositoryOperationException,
javax.jcr.RepositoryException
NodeType
object.
Typically, the object passed to this method will be a
NodeTypeTemplate (a subclass of
NodeTypeDefinition) acquired from
NodeTypeManager.createNodeTypeTemplate and then filled-in
with definition information.
Throws an InvalidNodeTypeDefinitionException if the
NodeTypeDefinition is invalid.
Throws a NodeTypeExistsException if allowUpdate
is false and the NodeTypeDefinition specifies a
node type name that is already registered.
Throws an UnsupportedRepositoryOperationException if this
implementation does not support node type registration.
ntd - an NodeTypeDefinition.allowUpdate - a boolean
InvalidNodeTypeDefinitionException - if the
NodeTypeDefinition is invalid.
NodeTypeExistsException - if allowUpdate is
false and the NodeTypeDefinition specifies a
node type name that is already registered.
javax.jcr.UnsupportedRepositoryOperationException - if this implementation
does not support node type registration.
javax.jcr.RepositoryException - if another error occurs.
public javax.jcr.nodetype.NodeTypeIterator registerNodeTypes(java.util.Collection definitions,
boolean allowUpdate)
throws InvalidNodeTypeDefinitionException,
NodeTypeExistsException,
javax.jcr.UnsupportedRepositoryOperationException,
javax.jcr.RepositoryException
Collection of
NodeTypeDefinition objects. This method is used to register
or update a set of node types with mutual dependencies. Returns an
iterator over the resulting NodeType objects.
The effect of the method is "all or nothing"; if an error occurs, no node
types are registered or updated.
Throws an InvalidNodeTypeDefinitionException if a
NodeTypeDefinition within the Collection is
invalid or if the Collection contains an object of a type
other than NodeTypeDefinition.
Throws a NodeTypeExistsException if allowUpdate
is false and a NodeTypeDefinition within the
Collection specifies a node type name that is already
registered.
Throws an UnsupportedRepositoryOperationException if this
implementation does not support node type registration.
definitions - a collection of NodeTypeDefinitionsallowUpdate - a boolean
InvalidNodeTypeDefinitionException - if a
NodeTypeDefinition within the Collection is
invalid or if the Collection contains an object of a type
other than NodeTypeDefinition.
NodeTypeExistsException - if allowUpdate is
false and a NodeTypeDefinition within the
Collection specifies a node type name that is already
registered.
javax.jcr.UnsupportedRepositoryOperationException - if this implementation
does not support node type registration.
javax.jcr.RepositoryException - if another error occurs.
public void unregisterNodeType(java.lang.String name)
throws javax.jcr.UnsupportedRepositoryOperationException,
javax.jcr.nodetype.NoSuchNodeTypeException,
javax.jcr.RepositoryException
NoSuchNodeTypeException if no registered node type
exists with the specified name.
name - a String.
javax.jcr.UnsupportedRepositoryOperationException - if this implementation
does not support node type registration.
javax.jcr.nodetype.NoSuchNodeTypeException - if no registered node type exists with
the specified name.
javax.jcr.RepositoryException - if another error occurs.
public void unregisterNodeTypes(java.lang.String[] names)
throws javax.jcr.UnsupportedRepositoryOperationException,
javax.jcr.nodetype.NoSuchNodeTypeException,
javax.jcr.RepositoryException
NoSuchNodeTypeException if one of the names listed is not a registered node type.
Throws an UnsupportedRepositoryOperationException
if this implementation does not support node type registration.
names - a String array
javax.jcr.UnsupportedRepositoryOperationException - if this implementation does not support node type registration.
javax.jcr.nodetype.NoSuchNodeTypeException - if one of the names listed is not a registered node type.
javax.jcr.RepositoryException - if another error occurs.public void dump(java.io.PrintStream ps)
dump in interface Dumpableps - stream to dump state to
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||