|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface NodeTypeManager
This interface defines the API for JCR Node Type Management implementations. It does not contain any JCR vendor specific methods. Classes that implement this interface are used to create custom node types in a JCR repository. Each JCR repository has its own way of doing this as it is not defined by the JSR-170 spec. The default implementation of jcr-nodemanagement is Jackrabbit. In order to create JCR custom node types you need to provide an established session to a JCR repository. The user that is logged into has to have the necessary permissions to create nodes (user has to have "superuser" rights). The JCR Node Type Management tools are an extension to the jcr-mapping tools. NodeTypeManager implementations depend on the jcr-mapping xml file and the object model defined by jcr-mapping.
Method Summary | |
---|---|
void |
createNamespace(Session session,
String namespace,
String namespaceUri)
Creates a new namespace in the repository. |
void |
createNodeTypeFromClass(Session session,
Class clazz,
String jcrNodeType,
boolean reflectSuperClasses)
This method creates a JCR node type from a given Java Bean class by using reflection. |
void |
createNodeTypes(Session session,
ClassDescriptor[] classDescriptors)
This method creates JCR node types based on ClassDescriptor objects which are created by a jcr-mapping Mapper implementation. |
void |
createNodeTypes(Session session,
MappingDescriptor mappingDescriptor)
This method creates JCR node types based on the MappingDescriptor object which is created by a jcr-mapping Mapper implementation. |
void |
createNodeTypesFromConfiguration(Session session,
InputStream jcrRepositoryConfigurationFile)
This method creates JCR node types from a JCR vendor specific configuration file. |
void |
createNodeTypesFromMappingFiles(Session session,
InputStream[] mappingXmlFiles)
This method creates JCR node types based on jcr-mapping xml files. |
void |
createSingleNodeType(Session session,
ClassDescriptor classDescriptor)
This method creates a single JCR node type identified by its ClassDescriptor read from the jcr mapping file. |
void |
createSingleNodeTypeFromMappingFile(Session session,
InputStream mappingXmlFile,
String jcrNodeType)
This method creates a single JCR node type identified by its jcrNodeType name defined in a jcr-mapping xml file. |
List |
getAllPrimaryNodeTypeNames(Session session)
Returns a list of all JCR node types. |
List |
getPrimaryNodeTypeNames(Session session,
String namespace)
Returns the names of all node types in the repository identified by a given namespace. |
void |
removeNodeTypesFromConfiguration(Session session,
InputStream jcrRepositoryConfigurationFile)
This method removes JCR node types from a JCR vendor specific configuration file |
void |
removeNodeTypesFromMappingFile(Session session,
InputStream[] mappingXmlFiles)
This method removes all JCR node types that are defined in one to many jcr-mapping XML files. |
void |
removeSingleNodeType(Session session,
String jcrNodeType)
This method removes a single JCR node type identified by its jcrNodeType name. |
Method Detail |
---|
void createNamespace(Session session, String namespace, String namespaceUri) throws NamespaceCreationException
namespace
- NamespacenamespaceUri
- Full namespace URI
NamespaceCreationException
void createNodeTypes(Session session, MappingDescriptor mappingDescriptor) throws NodeTypeCreationException
session
- Repository sessionmappingDescriptor
- Mapping descriptor object created by
jcr-mapping
NodeTypeCreationException
- NodeTypeCreationExceptionvoid createNodeTypes(Session session, ClassDescriptor[] classDescriptors) throws NodeTypeCreationException
session
- Repository sessionclassDescriptors
- Array of ClassDescriptor objects created by
jcr-mapping
NodeTypeCreationException
- NodeTypeCreationExceptionvoid createNodeTypesFromMappingFiles(Session session, InputStream[] mappingXmlFiles) throws NodeTypeCreationException
session
- Repository sessionmappingXmlFiles
- InputStreams to jcr-mapping xml files
NodeTypeCreationException
- NodeTypeCreationExceptionvoid createSingleNodeType(Session session, ClassDescriptor classDescriptor) throws NodeTypeCreationException
session
- Repository sessionclassDescriptor
- ClassDescriptor object created by jcr-mappingjcrNodeType
- Name of the class that needs to be created identified
by its jcrNodeType name
NodeTypeCreationException
- NodeTypeCreationExceptionvoid createSingleNodeTypeFromMappingFile(Session session, InputStream mappingXmlFile, String jcrNodeType) throws NodeTypeCreationException
session
- Repository sessionmappingXmlFile
- InputStream to a jcr-mapping xml filejcrNodeType
- Name of the class that needs to be created identified
by its jcrNodeType name
NodeTypeCreationException
- NodeTypeCreationExceptionvoid createNodeTypeFromClass(Session session, Class clazz, String jcrNodeType, boolean reflectSuperClasses) throws NodeTypeCreationException
session
- Repository sessionclazz
- Java classjcrNodeType
- Name of JCR node type (including namespace)reflectSuperClasses
- If true, all base classes are also reflected
NodeTypeCreationException
- NodeTypeCreationExceptionvoid createNodeTypesFromConfiguration(Session session, InputStream jcrRepositoryConfigurationFile) throws OperationNotSupportedException, NodeTypeCreationException
session
- Repository sessionjcrRepositoryXmlConfigurationFile
- InputStream to file
OperationNotSupportedException
- OperationNotSupportedException
NodeTypeCreationException
- NodeTypeCreationExceptionvoid removeNodeTypesFromMappingFile(Session session, InputStream[] mappingXmlFiles) throws NodeTypeRemovalException
session
- Repository sessionmappingXmlFiles
- InputStreams to jcr-mapping xml file
NodeTypeRemovalException
- NodeTypeRemovalExceptionvoid removeNodeTypesFromConfiguration(Session session, InputStream jcrRepositoryConfigurationFile) throws NodeTypeRemovalException
session
- Repository sessionjcrRepositoryConfigurationFile
- the file that contains the node type definition
NodeTypeRemovalException
void removeSingleNodeType(Session session, String jcrNodeType) throws NodeTypeRemovalException
session
- Repository sessionjcrNodeType
-
NodeTypeRemovalException
- NodeTypeRemovalExceptionList getPrimaryNodeTypeNames(Session session, String namespace)
namespace
- Name of nodetypes to return
List getAllPrimaryNodeTypeNames(Session session)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |