|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.jackrabbit.core.nodetype.NodeTypeRegistry
A NodeTypeRegistry
...
Constructor Summary | |
protected |
NodeTypeRegistry(NamespaceRegistry nsReg,
FileSystem ntStore)
Protected constructor |
Method Summary | |
void |
addListener(NodeTypeRegistryListener listener)
Add a NodeTypeRegistryListener |
protected void |
checkForConflictingContent(NodeTypeDef ntd)
Checks whether there is existing content that would conflict with the given node type definition. |
protected void |
checkForReferencesInContent(QName nodeTypeName)
Checks whether there is existing content that directly or indirectly refers to the specified node type. |
static NodeTypeRegistry |
create(NamespaceRegistry nsReg,
FileSystem ntStore)
Create a new NodeTypeRegistry |
void |
dump(PrintStream ps)
Dumps the state of this instance in a human readable format for diagnostic purposes. |
Set |
getDependentNodeTypes(QName nodeTypeName)
Returns the names of those registered node types that have dependencies on the given node type. |
EffectiveNodeType |
getEffectiveNodeType(QName ntName)
|
EffectiveNodeType |
getEffectiveNodeType(QName[] ntNames)
|
EffectiveNodeType |
getEffectiveNodeType(QName[] ntNames,
org.apache.jackrabbit.core.nodetype.EffectiveNodeTypeCache anEntCache,
Map aRegisteredNTDefCache)
|
EffectiveNodeType |
getEffectiveNodeType(QName ntName,
org.apache.jackrabbit.core.nodetype.EffectiveNodeTypeCache anEntCache,
Map aRegisteredNTDefCache)
|
NodeDef |
getNodeDef(NodeDefId id)
|
NodeTypeDef |
getNodeTypeDef(QName nodeTypeName)
Returns the node type definition of the node type with the given name. |
PropDef |
getPropDef(PropDefId id)
|
QName[] |
getRegisteredNodeTypes()
Returns the names of all registered node types. |
NodeDef |
getRootNodeDef()
|
boolean |
isBuiltIn(QName nodeTypeName)
|
boolean |
isRegistered(QName nodeTypeName)
|
protected void |
loadBuiltInNodeTypeDefs(NodeTypeDefStore store)
Loads the built-in node type definitions into the given store . |
protected void |
loadCustomNodeTypeDefs(NodeTypeDefStore store)
Loads the custom node type definitions into the given store . |
protected void |
persistCustomNodeTypeDefs(NodeTypeDefStore store)
Persists the custom node type definitions contained in the given store . |
EffectiveNodeType |
registerNodeType(NodeTypeDef ntd)
Validates the NodeTypeDef and returns
an EffectiveNodeType object representing the newly
registered node type. |
void |
registerNodeTypes(Collection ntDefs)
Same as except
that a collection of NodeTypeDef s is registered instead of
just one. |
void |
removeListener(NodeTypeRegistryListener listener)
Remove a NodeTypeRegistryListener |
EffectiveNodeType |
reregisterNodeType(NodeTypeDef ntd)
|
void |
unregisterNodeType(QName ntName)
Unregisters the specified node type. |
void |
unregisterNodeTypes(Collection ntNames)
Same as except
that a set of node types is unregistered instead of just one. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
protected NodeTypeRegistry(NamespaceRegistry nsReg, FileSystem ntStore) throws RepositoryException
nsReg
- ntStore
-
RepositoryException
Method Detail |
public static NodeTypeRegistry create(NamespaceRegistry nsReg, FileSystem ntStore) throws RepositoryException
NodeTypeRegistry
- Parameters:
nsReg
- ntStore
-
- Returns:
NodeTypeRegistry object
- Throws:
RepositoryException
public void addListener(NodeTypeRegistryListener listener)
NodeTypeRegistryListener
listener
- the new listener to be informed on (un)registration
of node typespublic void removeListener(NodeTypeRegistryListener listener)
NodeTypeRegistryListener
listener
- an existing listenerpublic EffectiveNodeType getEffectiveNodeType(QName ntName, org.apache.jackrabbit.core.nodetype.EffectiveNodeTypeCache anEntCache, Map aRegisteredNTDefCache) throws NoSuchNodeTypeException
ntName
- anEntCache
- aRegisteredNTDefCache
-
NoSuchNodeTypeException
public EffectiveNodeType getEffectiveNodeType(QName[] ntNames, org.apache.jackrabbit.core.nodetype.EffectiveNodeTypeCache anEntCache, Map aRegisteredNTDefCache) throws NodeTypeConflictException, NoSuchNodeTypeException
ntNames
- anEntCache
- aRegisteredNTDefCache
-
NodeTypeConflictException
NoSuchNodeTypeException
public QName[] getRegisteredNodeTypes()
public NodeDef getRootNodeDef()
public EffectiveNodeType getEffectiveNodeType(QName ntName) throws NoSuchNodeTypeException
ntName
-
NoSuchNodeTypeException
public EffectiveNodeType getEffectiveNodeType(QName[] ntNames) throws NodeTypeConflictException, NoSuchNodeTypeException
ntNames
-
NodeTypeConflictException
NoSuchNodeTypeException
public EffectiveNodeType registerNodeType(NodeTypeDef ntd) throws InvalidNodeTypeDefException, RepositoryException
NodeTypeDef
and returns
an EffectiveNodeType
object representing the newly
registered node type.
The validation includes the following checks:
ntd
- the definition of the new node type
EffectiveNodeType
instance
InvalidNodeTypeDefException
RepositoryException
public void registerNodeTypes(Collection ntDefs) throws InvalidNodeTypeDefException, RepositoryException
registerNodeType(NodeTypeDef)
except
that a collection of NodeTypeDef
s is registered instead of
just one.
This method can be used to register a set of node types that have
dependencies on each other.
ntDefs
- a collection of NodeTypeDef objects
- Throws:
InvalidNodeTypeDefException
RepositoryException
public void unregisterNodeTypes(Collection ntNames) throws NoSuchNodeTypeException, RepositoryException
unregisterNodeType(QName)
except
that a set of node types is unregistered instead of just one.
This method can be used to unregister a set of node types that depend on
each other.
ntNames
- a collection of QName
objects denoting the
node types to be unregistered
NoSuchNodeTypeException
- if any of the specified names does not
denote a registered node type.
RepositoryException
- if another error occursunregisterNodeType(QName)
public void unregisterNodeType(QName ntName) throws NoSuchNodeTypeException, RepositoryException
ntName
- name of the node type to be unregistered
NoSuchNodeTypeException
- if ntName
does not
denote a registered node type.
RepositoryException
- if another error occurs.unregisterNodeTypes(Collection)
public EffectiveNodeType reregisterNodeType(NodeTypeDef ntd) throws NoSuchNodeTypeException, InvalidNodeTypeDefException, RepositoryException
ntd
-
NoSuchNodeTypeException
InvalidNodeTypeDefException
RepositoryException
public Set getDependentNodeTypes(QName nodeTypeName) throws NoSuchNodeTypeException
nodeTypeName
- node type name
QName
s
NoSuchNodeTypeException
public NodeTypeDef getNodeTypeDef(QName nodeTypeName) throws NoSuchNodeTypeException
nodeTypeName
- name of node type whose definition should be returned.
NoSuchNodeTypeException
- if a node type with the given name
does not existpublic boolean isRegistered(QName nodeTypeName)
nodeTypeName
-
true
if the specified node type is registered;
false
otherwise.public boolean isBuiltIn(QName nodeTypeName)
nodeTypeName
-
true
if the specified node type is built-in;
false
otherwise.public NodeDef getNodeDef(NodeDefId id)
id
-
public PropDef getPropDef(PropDefId id)
id
-
public void dump(PrintStream ps)
dump
in interface Dumpable
ps
- stream to dump state toprotected void loadBuiltInNodeTypeDefs(NodeTypeDefStore store) throws RepositoryException
store
.
This method may be overridden by extensions of this class; It must
only be called once and only from within the constructor though.
store
- The NodeTypeDefStore
into which the node type
definitions are loaded.
RepositoryException
- If an error occurrs while loading the
built-in node type definitions.protected void loadCustomNodeTypeDefs(NodeTypeDefStore store) throws RepositoryException
store
.
This method may be overridden by extensions of this class; It must
only be called once and only from within the constructor though.
store
- The NodeTypeDefStore
into which the node type
definitions are loaded.
RepositoryException
- If an error occurrs while loading the
custom node type definitions.protected void persistCustomNodeTypeDefs(NodeTypeDefStore store) throws RepositoryException
store
.
store
- The NodeTypeDefStore
containing the definitons to
be persisted.
RepositoryException
- If an error occurrs while persisting the
custom node type definitions.protected void checkForConflictingContent(NodeTypeDef ntd) throws RepositoryException
RepositoryException
.
TODO
ntd
- The node type definition replacing the former node type
definition of the same name.
RepositoryException
- If there is conflicting content or if the
check failed for some other reason.protected void checkForReferencesInContent(QName nodeTypeName) throws RepositoryException
RepositoryException
.
TODO:
nodeTypeName
- The name of the node type to be checked.
RepositoryException
- If the specified node type is currently
being referenced or if the check failed for
some other reason.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |