Package ch.tocco.nice2.dms.impl.tree
Class ContentTreeServiceImpl
java.lang.Object
ch.tocco.nice2.dms.impl.tree.ContentTreeServiceImpl
- All Implemented Interfaces:
ContentTreeService
-
Field Summary
Modifier and TypeFieldDescriptionprotected final com.google.common.cache.LoadingCache
<Entity, ContentTreeNode> -
Constructor Summary
ConstructorDescriptionContentTreeServiceImpl
(UriResolver uriResolver, Context context, EntityDefaultValueService defaultValueService) -
Method Summary
Modifier and TypeMethodDescriptioncreateContentTreeNode
(@Nullable ContentTreeNode parent, String modelName) Create a new ContentTreeNode.<T extends ContentTreeNode>
TcreateContentTreeNode
(@Nullable ContentTreeNode parent, String modelName, Class<T> expectedClass) Create a new ContentTreeNode.@Nullable ContentTreeContext
getContentTreeContext
(ContentTreeContext.Mode mode, String module) getContentTreeNode
(Entity entity) getContentTreeNode
(Entity entity, ContentTreeContext contentTreeContext) <T extends ContentTreeNode>
TgetContentTreeNode
(Entity entity, ContentTreeContext context, Class<T> expectedClass) <T extends ContentTreeNode>
TgetContentTreeNode
(Entity entity, Class<T> expectedClass) getContentTreeNode
(String path) getContentTreeNode
(String path, ContentTreeContext contentTreeContext) <T extends ContentTreeNode>
TgetContentTreeNode
(String path, Class<T> expectedClass) getContentTreeNode
(URI uri) getContentTreeNode
(URI uri, ContentTreeContext contentTreeContext) <T extends ContentTreeNode>
TgetContentTreeNode
(URI uri, Class<T> expectedClass) getContentTreeNodeModel
(EntityModel entityModel) Get theContentTreeNodeModel
for e certain entity model.void
void
setNodeFactories
(List<ContentTreeNodeFactory> nodeFactories) void
setNodeModels
(List<ContentTreeNodeModel> nodeModels) boolean
supportsEntityModel
(EntityModel entityModel) Tells if an entity model is supported by content tree service.
-
Field Details
-
cache
-
-
Constructor Details
-
ContentTreeServiceImpl
public ContentTreeServiceImpl(UriResolver uriResolver, Context context, EntityDefaultValueService defaultValueService)
-
-
Method Details
-
getContentTreeNode
- Specified by:
getContentTreeNode
in interfaceContentTreeService
- Parameters:
path
- path- Returns:
ContentTreeNode
represented by the passedpath
-
getContentTreeNode
- Specified by:
getContentTreeNode
in interfaceContentTreeService
- Parameters:
uri
- uri- Returns:
ContentTreeNode
represented by the passeuri
-
getContentTreeNode
- Specified by:
getContentTreeNode
in interfaceContentTreeService
- Parameters:
entity
- entity to be wrapped in its corresponding ContentTreeNode implementation- Returns:
ContentTreeNode
represented by the passedentity
-
getContentTreeNode
- Specified by:
getContentTreeNode
in interfaceContentTreeService
- Parameters:
path
- pathcontentTreeContext
- specify theContentTreeContext
for the node- Returns:
ContentTreeNode
represented by the passedpath
-
getContentTreeNode
- Specified by:
getContentTreeNode
in interfaceContentTreeService
- Parameters:
uri
- uricontentTreeContext
- specify theContentTreeContext
for the node- Returns:
ContentTreeNode
represented by the passeuri
-
getContentTreeNode
- Specified by:
getContentTreeNode
in interfaceContentTreeService
- Parameters:
entity
- entity to be wrapped in its corresponding ContentTreeNode implementationcontentTreeContext
- specify theContentTreeContext
for the node- Returns:
ContentTreeNode
represented by the passedentity
-
getContentTreeNode
- Specified by:
getContentTreeNode
in interfaceContentTreeService
- Parameters:
entity
- entity to be wrapped in its corresponding ContentTreeNode implementationexpectedClass
- the concrete type of ContentTreeNode to return- Returns:
ContentTreeNode
represented by the passedentity
-
getContentTreeNode
public <T extends ContentTreeNode> T getContentTreeNode(Entity entity, ContentTreeContext context, Class<T> expectedClass) - Specified by:
getContentTreeNode
in interfaceContentTreeService
- Parameters:
entity
- entity to be wrapped in its corresponding ContentTreeNode implementationcontext
- specify theContentTreeContext
for the nodeexpectedClass
- the concrete type of ContentTreeNode to return- Returns:
ContentTreeNode
represented by the passedentity
-
getContentTreeNode
- Specified by:
getContentTreeNode
in interfaceContentTreeService
- Parameters:
path
- pathexpectedClass
- the concrete type of ContentTreeNode to return- Returns:
ContentTreeNode
represented by the passedpath
-
getContentTreeNode
- Specified by:
getContentTreeNode
in interfaceContentTreeService
- Parameters:
uri
- uriexpectedClass
- the concrete type of ContentTreeNode to return- Returns:
ContentTreeNode
represented by the passeuri
-
createContentTreeNode
public ContentTreeNode createContentTreeNode(@Nullable @Nullable ContentTreeNode parent, String modelName) Description copied from interface:ContentTreeService
Create a new ContentTreeNode. Note that this method does not start it's own transaction and thus needs to be called within a transaction.- Specified by:
createContentTreeNode
in interfaceContentTreeService
- Parameters:
parent
- parent for the new nodemodelName
- model for the new node- Returns:
- the new ContentTreeNode with the representing entity in state
Entity.State.CONCEPTION
- See Also:
-
createContentTreeNode
public <T extends ContentTreeNode> T createContentTreeNode(@Nullable @Nullable ContentTreeNode parent, String modelName, Class<T> expectedClass) throws ContentException Description copied from interface:ContentTreeService
Create a new ContentTreeNode. Note that this method does not start it's own transaction and thus needs to be called within a transaction.- Specified by:
createContentTreeNode
in interfaceContentTreeService
- Parameters:
parent
- parent for the new nodemodelName
- model for the new nodeexpectedClass
- expected class for return type- Returns:
- the new ContentTreeNode with the representing entity in state
Entity.State.CONCEPTION
- Throws:
ContentException
- See Also:
-
getContentTreeContext
@Nullable public @Nullable ContentTreeContext getContentTreeContext(ContentTreeContext.Mode mode, String module) - Specified by:
getContentTreeContext
in interfaceContentTreeService
- Parameters:
mode
- aContentTreeContext.Mode
module
- a module name (i.e. the "moduleName" property of the entity explorer module (client)- Returns:
- a matching
ContentTreeContext
or null (if multiple are found)
-
supportsEntityModel
Description copied from interface:ContentTreeService
Tells if an entity model is supported by content tree service.- Specified by:
supportsEntityModel
in interfaceContentTreeService
- Parameters:
entityModel
- model to check- Returns:
- true if it is supported, false if not
-
getContentTreeNodeModel
Description copied from interface:ContentTreeService
Get theContentTreeNodeModel
for e certain entity model.- Specified by:
getContentTreeNodeModel
in interfaceContentTreeService
- Parameters:
entityModel
- the entity model to get theContentTreeNodeModel
for.- Returns:
- the
ContentTreeNodeModel
.
-
setNodeFactories
-
setNodeModels
-
setContentTreeContextProviders
-