Class NodeTypeHierarchyComponent
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.workspaces.repository.jcr.NodeTypeHierarchyComponent
- All Implemented Interfaces:
Component
,Contextualizable
,LogEnabled
,Serviceable
public class NodeTypeHierarchyComponent
extends AbstractLogEnabled
implements Component, Contextualizable, Serviceable
Node type hierarchy component.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Context
The avalon context.protected ServiceManager
The service manager.protected RepositoryProvider
The repository provider.The subtypes registry, by workspace.static final String
The avalon role. -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
_buildTypeHierarchy
(String workspaceName) Compute the primary type hierarchy.protected javax.jcr.Workspace
_getWorkspace
(Request request, String workspaceName) Get the repository and session and set the _repository and _session protected fieldsvoid
contextualize
(Context context) getAvailableChildrenTypes
(javax.jcr.nodetype.NodeDefinition nodeDef, String workspaceName) Get the available children types for a given node type in a workspace.getDirectSubTypes
(javax.jcr.nodetype.NodeType nodeType, String workspaceName) Get the sub types of a given node type in a specific workspace.getRecursiveSubTypes
(String nodeType, String workspaceName) Get the sub types of a given node type in a specific workspace.void
service
(ServiceManager manager) Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
ROLE
The avalon role. -
_subTypes
The subtypes registry, by workspace. -
_repositoryProvider
The repository provider. -
_context
The avalon context. -
_manager
The service manager.
-
-
Constructor Details
-
NodeTypeHierarchyComponent
public NodeTypeHierarchyComponent()
-
-
Method Details
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getDirectSubTypes
public Set<String> getDirectSubTypes(javax.jcr.nodetype.NodeType nodeType, String workspaceName) throws javax.jcr.RepositoryException Get the sub types of a given node type in a specific workspace.- Parameters:
nodeType
- the node type.workspaceName
- the workspace name.- Returns:
- the sub types of the node type in the given workspace.
- Throws:
javax.jcr.RepositoryException
- if an error occurred
-
getRecursiveSubTypes
public Set<String> getRecursiveSubTypes(String nodeType, String workspaceName) throws javax.jcr.RepositoryException Get the sub types of a given node type in a specific workspace.- Parameters:
nodeType
- the node type.workspaceName
- the workspace name.- Returns:
- the sub types of the node type in the given workspace.
- Throws:
javax.jcr.RepositoryException
- if an error occurred
-
getAvailableChildrenTypes
public Set<String> getAvailableChildrenTypes(javax.jcr.nodetype.NodeDefinition nodeDef, String workspaceName) throws javax.jcr.RepositoryException Get the available children types for a given node type in a workspace.- Parameters:
nodeDef
- the node definition.workspaceName
- the workspace name.- Returns:
- the available node types.
- Throws:
javax.jcr.RepositoryException
- if an error occurred
-
_buildTypeHierarchy
Compute the primary type hierarchy.- Parameters:
workspaceName
- The workspace name to use- Throws:
javax.jcr.RepositoryException
- if an error occurs.
-
_getWorkspace
protected javax.jcr.Workspace _getWorkspace(Request request, String workspaceName) throws javax.jcr.RepositoryException, ServiceException Get the repository and session and set the _repository and _session protected fields- Parameters:
request
- The requestworkspaceName
- The jcr workspace- Returns:
- the workspace.
- Throws:
javax.jcr.RepositoryException
- if an error occured.ServiceException
- if the repository can't be looked up.
-