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
FieldsModifier and TypeFieldDescriptionprotected final com.google.common.cache.LoadingCache<Entity, ContentTreeNode> -
Constructor Summary
ConstructorsConstructorDescriptionContentTreeServiceImpl(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 ContentTreeContextgetContentTreeContext(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 theContentTreeNodeModelfor e certain entity model.voidvoidsetNodeFactories(List<ContentTreeNodeFactory> nodeFactories) voidsetNodeModels(List<ContentTreeNodeModel> nodeModels) booleansupportsEntityModel(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:
getContentTreeNodein interfaceContentTreeService- Parameters:
path- path- Returns:
ContentTreeNoderepresented by the passedpath
-
getContentTreeNode
- Specified by:
getContentTreeNodein interfaceContentTreeService- Parameters:
uri- uri- Returns:
ContentTreeNoderepresented by the passeuri
-
getContentTreeNode
- Specified by:
getContentTreeNodein interfaceContentTreeService- Parameters:
entity- entity to be wrapped in its corresponding ContentTreeNode implementation- Returns:
ContentTreeNoderepresented by the passedentity
-
getContentTreeNode
- Specified by:
getContentTreeNodein interfaceContentTreeService- Parameters:
path- pathcontentTreeContext- specify theContentTreeContextfor the node- Returns:
ContentTreeNoderepresented by the passedpath
-
getContentTreeNode
- Specified by:
getContentTreeNodein interfaceContentTreeService- Parameters:
uri- uricontentTreeContext- specify theContentTreeContextfor the node- Returns:
ContentTreeNoderepresented by the passeuri
-
getContentTreeNode
- Specified by:
getContentTreeNodein interfaceContentTreeService- Parameters:
entity- entity to be wrapped in its corresponding ContentTreeNode implementationcontentTreeContext- specify theContentTreeContextfor the node- Returns:
ContentTreeNoderepresented by the passedentity
-
getContentTreeNode
- Specified by:
getContentTreeNodein interfaceContentTreeService- Parameters:
entity- entity to be wrapped in its corresponding ContentTreeNode implementationexpectedClass- the concrete type of ContentTreeNode to return- Returns:
ContentTreeNoderepresented by the passedentity
-
getContentTreeNode
public <T extends ContentTreeNode> T getContentTreeNode(Entity entity, ContentTreeContext context, Class<T> expectedClass) - Specified by:
getContentTreeNodein interfaceContentTreeService- Parameters:
entity- entity to be wrapped in its corresponding ContentTreeNode implementationcontext- specify theContentTreeContextfor the nodeexpectedClass- the concrete type of ContentTreeNode to return- Returns:
ContentTreeNoderepresented by the passedentity
-
getContentTreeNode
- Specified by:
getContentTreeNodein interfaceContentTreeService- Parameters:
path- pathexpectedClass- the concrete type of ContentTreeNode to return- Returns:
ContentTreeNoderepresented by the passedpath
-
getContentTreeNode
- Specified by:
getContentTreeNodein interfaceContentTreeService- Parameters:
uri- uriexpectedClass- the concrete type of ContentTreeNode to return- Returns:
ContentTreeNoderepresented by the passeuri
-
createContentTreeNode
public ContentTreeNode createContentTreeNode(@Nullable @Nullable ContentTreeNode parent, String modelName) Description copied from interface:ContentTreeServiceCreate 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:
createContentTreeNodein 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:ContentTreeServiceCreate 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:
createContentTreeNodein 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:
getContentTreeContextin interfaceContentTreeService- Parameters:
mode- aContentTreeContext.Modemodule- a module name (i.e. the "moduleName" property of the entity explorer module (client)- Returns:
- a matching
ContentTreeContextor null (if multiple are found)
-
supportsEntityModel
Description copied from interface:ContentTreeServiceTells if an entity model is supported by content tree service.- Specified by:
supportsEntityModelin interfaceContentTreeService- Parameters:
entityModel- model to check- Returns:
- true if it is supported, false if not
-
getContentTreeNodeModel
Description copied from interface:ContentTreeServiceGet theContentTreeNodeModelfor e certain entity model.- Specified by:
getContentTreeNodeModelin interfaceContentTreeService- Parameters:
entityModel- the entity model to get theContentTreeNodeModelfor.- Returns:
- the
ContentTreeNodeModel.
-
setNodeFactories
-
setNodeModels
-
setContentTreeContextProviders
-