public class NodeTypeHierarchyComponent extends AbstractLogEnabled implements Component, Contextualizable, Serviceable
Modifier and Type | Field and Description |
---|---|
protected Context |
_context
The avalon context.
|
protected ServiceManager |
_manager
The service manager.
|
protected RepositoryProvider |
_repositoryProvider
The repository provider.
|
protected Map<String,Map<String,Set<String>>> |
_subTypes
The subtypes registry, by workspace.
|
static String |
ROLE
The avalon role.
|
Constructor and Description |
---|
NodeTypeHierarchyComponent() |
Modifier and Type | Method and Description |
---|---|
protected void |
_buildTypeHierarchy(String workspaceName)
Compute the primary type hierarchy.
|
protected Workspace |
_getWorkspace(Request request,
String workspaceName)
Get the repository and session and set the _repository and _session protected fields
|
void |
contextualize(Context context) |
Set<String> |
getAvailableChildrenTypes(NodeDefinition nodeDef,
String workspaceName)
Get the available children types for a given node type in a workspace.
|
Set<String> |
getDirectSubTypes(NodeType nodeType,
String workspaceName)
Get the sub types of a given node type in a specific workspace.
|
Set<String> |
getRecursiveSubTypes(String nodeType,
String workspaceName)
Get the sub types of a given node type in a specific workspace.
|
void |
service(ServiceManager manager) |
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
protected Map<String,Map<String,Set<String>>> _subTypes
protected RepositoryProvider _repositoryProvider
protected ServiceManager _manager
public NodeTypeHierarchyComponent()
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public Set<String> getDirectSubTypes(NodeType nodeType, String workspaceName) throws RepositoryException
nodeType
- the node type.workspaceName
- the workspace name.RepositoryException
- if an error occurredpublic Set<String> getRecursiveSubTypes(String nodeType, String workspaceName) throws RepositoryException
nodeType
- the node type.workspaceName
- the workspace name.RepositoryException
- if an error occurredpublic Set<String> getAvailableChildrenTypes(NodeDefinition nodeDef, String workspaceName) throws RepositoryException
nodeDef
- the node definition.workspaceName
- the workspace name.RepositoryException
- if an error occurredprotected void _buildTypeHierarchy(String workspaceName) throws RepositoryException
workspaceName
- The workspace name to useRepositoryException
- if an error occurs.protected Workspace _getWorkspace(Request request, String workspaceName) throws RepositoryException, ServiceException
request
- The requestworkspaceName
- The jcr workspaceRepositoryException
- if an error occured.ServiceException
- if the repository can't be looked up.