The ExtendedNodeTypeManager
interface provides the
following methods related to registering node types:
public static final int IGNORE_IF_EXISTS = 0;
public static final int FAIL_IF_EXISTS = 2;
public static final int REPLACE_IF_EXISTS = 4;
/**
* Return NodeType for a given InternalQName.
*
* @param qname nodetype name
* @return NodeType
* @throws NoSuchNodeTypeException if no nodetype found with the name
* @throws RepositoryException Repository error
*/
NodeType findNodeType(InternalQName qname) throws NoSuchNodeTypeException, RepositoryException;
/**
* Registers node type using value object.
*
* @param nodeTypeValue
* @param alreadyExistsBehaviour
* @throws RepositoryException
*/
NodeType registerNodeType(NodeTypeValue nodeTypeValue, int alreadyExistsBehaviour) throws RepositoryException;
/**
* Registers all node types using XML binding value objects from xml stream.
*
* @param xml a InputStream
* @param alreadyExistsBehaviour a int
* @throws RepositoryException
*/
NodeTypeIterator registerNodeTypes(InputStream xml, int alreadyExistsBehaviour, String contentType)
throws RepositoryException;
/**
* Gives the {@link NodeTypeManager}
*
* @throws RepositoryException if another error occurs.
*/
NodeTypeDataManager getNodeTypesHolder() throws RepositoryException;
/**
* Return <code>NodeTypeValue</code> for a given nodetype name. Used for
* nodetype update. Value can be edited and registered via
* <code>registerNodeType(NodeTypeValue nodeTypeValue, int alreadyExistsBehaviour)</code>
* .
*
* @param ntName nodetype name
* @return NodeTypeValue
* @throws NoSuchNodeTypeException if no nodetype found with the name
* @throws RepositoryException Repository error
*/
NodeTypeValue getNodeTypeValue(String ntName) throws NoSuchNodeTypeException, RepositoryException;
/**
* Registers or updates the specified <code>Collection</code> of
* <code>NodeTypeValue</code> objects. This method is used to register or
* update a set of node types with mutual dependencies. Returns an iterator
* over the resulting <code>NodeType</code> objects. <p/> The effect of the
* method is "all or nothing"; if an error occurs, no node types are
* registered or updated. <p/> Throws an
* <code>InvalidNodeTypeDefinitionException</code> if a
* <code>NodeTypeDefinition</code> within the <code>Collection</code> is
* invalid or if the <code>Collection</code> contains an object of a type
* other than <code>NodeTypeDefinition</code> . <p/> Throws a
* <code>NodeTypeExistsException</code> if <code>allowUpdate</code> is
* <code>false</code> and a <code>NodeTypeDefinition</code> within the
* <code>Collection</code> specifies a node type name that is already
* registered. <p/> Throws an
* <code>UnsupportedRepositoryOperationException</code> if this implementation
* does not support node type registration.
*
* @param values a collection of <code>NodeTypeValue</code>s
* @param alreadyExistsBehaviour a int
* @return the registered node types.
* @throws InvalidNodeTypeDefinitionException if a
* <code>NodeTypeDefinition</code> within the
* <code>Collection</code> is invalid or if the
* <code>Collection</code> contains an object of a type other than
* <code>NodeTypeDefinition</code>.
* @throws NodeTypeExistsException if <code>allowUpdate</code> is
* <code>false</code> and a <code>NodeTypeDefinition</code> within
* the <code>Collection</code> specifies a node type name that is
* already registered.
* @throws UnsupportedRepositoryOperationException if this implementation does
* not support node type registration.
* @throws RepositoryException if another error occurs.
*/
public NodeTypeIterator registerNodeTypes(List<NodeTypeValue> values, int alreadyExistsBehaviour)
throws UnsupportedRepositoryOperationException, RepositoryException;
/**
* Unregisters the specified node type.
*
* @param name a <code>String</code>.
* @throws UnsupportedRepositoryOperationException if this implementation does
* not support node type registration.
* @throws NoSuchNodeTypeException if no registered node type exists with the
* specified name.
* @throws RepositoryException if another error occurs.
*/
public void unregisterNodeType(String name) throws UnsupportedRepositoryOperationException, NoSuchNodeTypeException,
RepositoryException;
/**
* Unregisters the specified set of node types.<p/> Used to unregister a set
* of node types with mutual dependencies.
*
* @param names a <code>String</code> array
* @throws UnsupportedRepositoryOperationException if this implementation does
* not support node type registration.
* @throws NoSuchNodeTypeException if one of the names listed is not a
* registered node type.
* @throws RepositoryException if another error occurs.
*/
public void unregisterNodeTypes(String[] names) throws UnsupportedRepositoryOperationException,
NoSuchNodeTypeException, RepositoryException;
The NodeTypeValue
interface represents a simple container
structure used to define node types which are then registered through
the ExtendedNodeTypeManager.registerNodeType
method. The implementation of
this interface does not contain any validation logic.
/**
* @return Returns the declaredSupertypeNames.
*/
public List<String> getDeclaredSupertypeNames();
/**
* @param declaredSupertypeNames
*The declaredSupertypeNames to set.
*/
public void setDeclaredSupertypeNames(List<String> declaredSupertypeNames);
/**
* @return Returns the mixin.
*/
public boolean isMixin();
/**
* @param mixin
*The mixin to set.
*/
public void setMixin(boolean mixin);
/**
* @return Returns the name.
*/
public String getName();
/**
* @param name
*The name to set.
*/
public void setName(String name);
/**
* @return Returns the orderableChild.
*/
public boolean isOrderableChild();
/**
* @param orderableChild
*The orderableChild to set.
*/
public void setOrderableChild(boolean orderableChild);
/**
* @return Returns the primaryItemName.
*/
public String getPrimaryItemName();
/**
* @param primaryItemName
*The primaryItemName to set.
*/
public void setPrimaryItemName(String primaryItemName);
/**
* @return Returns the declaredChildNodeDefinitionNames.
*/
public List<NodeDefinitionValue> getDeclaredChildNodeDefinitionValues();
/**
* @param declaredChildNodeDefinitionNames
*The declaredChildNodeDefinitionNames to set.
*/
public void setDeclaredChildNodeDefinitionValues(List<NodeDefinitionValue> declaredChildNodeDefinitionValues);
/**
* @return Returns the declaredPropertyDefinitionNames.
*/
public List<PropertyDefinitionValue> getDeclaredPropertyDefinitionValues();
/**
* @param declaredPropertyDefinitionNames
*The declaredPropertyDefinitionNames to set.
*/
public void setDeclaredPropertyDefinitionValues(List<PropertyDefinitionValue> declaredPropertyDefinitionValues);
The NodeDefinitionValue
interface extends ItemDefinitionValue
with
the addition of writing methods, enabling the characteristics of a child
node definition to be set. After that, the NodeDefinitionValue
is added to a NodeTypeValue
.
/**
* @return Returns the defaultNodeTypeName.
*/
public String getDefaultNodeTypeName()
/**
* @param defaultNodeTypeName The defaultNodeTypeName to set.
*/
public void setDefaultNodeTypeName(String defaultNodeTypeName)
/**
* @return Returns the sameNameSiblings.
*/
public boolean isSameNameSiblings()
/**
* @param sameNameSiblings The sameNameSiblings to set.
*/
public void setSameNameSiblings(boolean multiple)
/**
* @return Returns the requiredNodeTypeNames.
*/
public List<String> getRequiredNodeTypeNames()
/**
* @param requiredNodeTypeNames The requiredNodeTypeNames to set.
*/
public void setRequiredNodeTypeNames(List<String> requiredNodeTypeNames)
The PropertyDefinitionValue
interface extends ItemDefinitionValue
with the addition of writing methods, enabling the characteristics of a
child property definition to be set, after that, the
PropertyDefinitionValue
is added to a NodeTypeValue
.
/**
* @return Returns the defaultValues.
*/
public List<String> getDefaultValueStrings();
/**
* @param defaultValues The defaultValues to set.
*/
public void setDefaultValueStrings(List<String> defaultValues);
/**
* @return Returns the multiple.
*/
public boolean isMultiple();
/**
* @param multiple The multiple to set.
*/
public void setMultiple(boolean multiple);
/**
* @return Returns the requiredType.
*/
public int getRequiredType();
/**
* @param requiredType The requiredType to set.
*/
public void setRequiredType(int requiredType);
/**
* @return Returns the valueConstraints.
*/
public List<String> getValueConstraints();
/**
* @param valueConstraints The valueConstraints to set.
*/
public void setValueConstraints(List<String> valueConstraints);
/**
* @return Returns the autoCreate.
*/
public boolean isAutoCreate();
/**
* @param autoCreate The autoCreate to set.
*/
public void setAutoCreate(boolean autoCreate);
/**
* @return Returns the mandatory.
*/
public boolean isMandatory();
/**
* @param mandatory The mandatory to set.
*/
public void setMandatory(boolean mandatory);
/**
* @return Returns the name.
*/
public String getName();
/**
* @param name The name to set.
*/
public void setName(String name);
/**
* @return Returns the onVersion.
*/
public int getOnVersion();
/**
* @param onVersion The onVersion to set.
*/
public void setOnVersion(int onVersion);
/**
* @return Returns the readOnly.
*/
public boolean isReadOnly();
/**
* @param readOnly The readOnly to set.
*/
public void setReadOnly(boolean readOnly);