|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.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,
NamespaceRegistryImpl nsReg,
NamespaceResolver nsResolver,
NamePathResolver resolver,
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(PrintStream ps)
Dumps the state of this instance in a human readable format for diagnostic purposes. |
NodeTypeIterator |
getAllNodeTypes()
|
NodeTypeIterator |
getMixinNodeTypes()
|
NodeDefinitionImpl |
getNodeDefinition(NodeDefId id)
|
NodeTypeImpl |
getNodeType(Name name)
|
NodeType |
getNodeType(String nodeTypeName)
|
NodeTypeRegistry |
getNodeTypeRegistry()
|
NodeTypeIterator |
getPrimaryNodeTypes()
|
PropertyDefinitionImpl |
getPropertyDefinition(PropDefId id)
|
NodeDefinitionImpl |
getRootNodeDefinition()
|
boolean |
hasNodeType(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. |
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. |
NodeTypeIterator |
registerNodeTypes(Collection definitions,
boolean allowUpdate)
Registers or updates the specified Collection of
NodeTypeDefinition objects. |
NodeType[] |
registerNodeTypes(InputSource in)
Registers the node types defined in the given XML stream. |
NodeType[] |
registerNodeTypes(InputStream in,
String contentType)
Registers the node types defined in the given input stream depending on the content type specified for the stream. |
NodeType[] |
registerNodeTypes(InputStream in,
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(String name)
Unregisters the specified node type. |
void |
unregisterNodeTypes(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, NamespaceRegistryImpl nsReg, NamespaceResolver nsResolver, NamePathResolver resolver, DataStore store)
NodeTypeManagerImpl
instance.
ntReg
- node type registrynsReg
- namespace registryresolver
- Method Detail |
---|
public NodeDefinitionImpl getRootNodeDefinition()
public NodeDefinitionImpl getNodeDefinition(NodeDefId id)
id
-
public PropertyDefinitionImpl getPropertyDefinition(PropDefId id)
id
-
public NodeTypeImpl getNodeType(Name name) throws NoSuchNodeTypeException
name
-
NoSuchNodeTypeException
public NodeTypeRegistry getNodeTypeRegistry()
public NodeType[] registerNodeTypes(InputStream in, String contentType, boolean reregisterExisting) throws IOException, RepositoryException
in
- node type XML streamcontentType
- type of the input streamreregisterExisting
- flag indicating whether node types should be
reregistered if they already exist
IOException
- if the input stream could not be read or parsed
RepositoryException
- if the node types are invalid or another
repository error occurspublic void nodeTypeRegistered(Name ntName)
nodeTypeRegistered
in interface NodeTypeRegistryListener
ntName
- name of the node type that has been registeredpublic void nodeTypeReRegistered(Name ntName)
nodeTypeReRegistered
in interface NodeTypeRegistryListener
ntName
- name of the node type that has been registeredpublic void nodeTypeUnregistered(Name ntName)
nodeTypeUnregistered
in interface NodeTypeRegistryListener
ntName
- name of the node type that has been unregisteredpublic NodeTypeIterator getAllNodeTypes() throws RepositoryException
getAllNodeTypes
in interface NodeTypeManager
RepositoryException
public NodeTypeIterator getPrimaryNodeTypes() throws RepositoryException
getPrimaryNodeTypes
in interface NodeTypeManager
RepositoryException
public NodeTypeIterator getMixinNodeTypes() throws RepositoryException
getMixinNodeTypes
in interface NodeTypeManager
RepositoryException
public NodeType getNodeType(String nodeTypeName) throws NoSuchNodeTypeException
getNodeType
in interface NodeTypeManager
NoSuchNodeTypeException
public NodeType[] registerNodeTypes(InputSource in) throws SAXException, 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 JackrabbitNodeTypeManager
in
- node type XML stream
SAXException
- if the XML stream could not be read or parsed
RepositoryException
- if the node types are invalid or another
repository error occurspublic NodeType[] registerNodeTypes(InputStream in, String contentType) throws IOException, RepositoryException
registerNodeTypes
in interface JackrabbitNodeTypeManager
in
- node type streamcontentType
- type of the input stream
IOException
- if the input stream could not be read or parsed
RepositoryException
- if the node types are invalid or another
repository error occurspublic boolean hasNodeType(String name) throws RepositoryException
hasNodeType
in interface JackrabbitNodeTypeManager
name
- node type name
true
if the named node type exists,
false
otherwise
RepositoryException
- if the name format is invalidpublic NodeTypeTemplate createNodeTypeTemplate() throws UnsupportedRepositoryOperationException, 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
.
UnsupportedRepositoryOperationException
- if this implementation
does not support node type registration.
RepositoryException
- if another error occurs.public NodeTypeTemplate createNodeTypeTemplate(NodeTypeDefinition ntd) throws UnsupportedRepositoryOperationException, 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
.
UnsupportedRepositoryOperationException
- if this implementation
does not support node type registration.
RepositoryException
- if another error occurs.public NodeDefinitionTemplate createNodeDefinitionTemplate() throws UnsupportedRepositoryOperationException, 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
.
UnsupportedRepositoryOperationException
- if this implementation
does not support node type registration.
RepositoryException
- if another error occurs.public PropertyDefinitionTemplate createPropertyDefinitionTemplate() throws UnsupportedRepositoryOperationException, 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
.
UnsupportedRepositoryOperationException
- if this implementation
does not support node type registration.
RepositoryException
- if another error occurs.public NodeType registerNodeType(NodeTypeDefinition ntd, boolean allowUpdate) throws InvalidNodeTypeDefinitionException, NodeTypeExistsException, UnsupportedRepositoryOperationException, 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.
UnsupportedRepositoryOperationException
- if this implementation
does not support node type registration.
RepositoryException
- if another error occurs.public NodeTypeIterator registerNodeTypes(Collection definitions, boolean allowUpdate) throws InvalidNodeTypeDefinitionException, NodeTypeExistsException, UnsupportedRepositoryOperationException, 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 NodeTypeDefinition
sallowUpdate
- 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.
UnsupportedRepositoryOperationException
- if this implementation
does not support node type registration.
RepositoryException
- if another error occurs.public void unregisterNodeType(String name) throws UnsupportedRepositoryOperationException, NoSuchNodeTypeException, RepositoryException
NoSuchNodeTypeException
if no registered node type
exists with the specified name.
name
- a String
.
UnsupportedRepositoryOperationException
- if this implementation
does not support node type registration.
NoSuchNodeTypeException
- if no registered node type exists with
the specified name.
RepositoryException
- if another error occurs.public void unregisterNodeTypes(String[] names) throws UnsupportedRepositoryOperationException, NoSuchNodeTypeException, 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
UnsupportedRepositoryOperationException
- if this implementation does not support node type registration.
NoSuchNodeTypeException
- if one of the names listed is not a registered node type.
RepositoryException
- if another error occurs.public void dump(PrintStream ps)
dump
in interface Dumpable
ps
- stream to dump state to
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |