public abstract class AbstractJCRTagsDAO extends AbstractLogEnabled implements Serviceable, Component
Modifier and Type | Field and Description |
---|---|
protected CurrentUserProvider |
_currentUserProvider
The current user provider
|
protected ObservationManager |
_observationManager
Observer manager.
|
protected AmetysObjectResolver |
_resolver
The ametys object resolver
|
Constructor and Description |
---|
AbstractJCRTagsDAO() |
Modifier and Type | Method and Description |
---|---|
protected abstract void |
_checkUserRight()
Check if the user right to access the feature
|
protected abstract JCRTag |
_createJCRTag(String parentId,
String name,
String title,
String description,
Map<String,Object> otherParameters,
Map<String,Object> contextualParameters)
Create a JCR tag under his parent
|
protected String |
_findUniqueName(String originalName,
Map<String,Object> contextualParameters)
Find a unique name for the tag
|
protected abstract Tag |
_getTagFromName(String name,
Map<String,Object> contextualParameters)
Get the tag from the name
|
protected abstract Set<TagProvider<? extends Tag>> |
_getTagProviders()
Get all tag's providers
|
abstract ModifiableTraversableAmetysObject |
_getTagRootObject(String tagProviderId,
Map<String,Object> contextualParameters)
Get the tag root node object
|
protected boolean |
_hasTag(Set<TagProvider<? extends Tag>> providers,
String name,
Map<String,Object> contextualParameters)
Determines if a tag with given name already exists
|
protected abstract JCRTag |
_updateJCRTag(String tagId,
String title,
String description,
Map<String,Object> otherParameters)
Update a JCR tag
|
JCRTag |
addTag(String parentId,
String originalName,
String title,
String description,
Map<String,Object> otherParameters,
Map<String,Object> contextualParameters)
Create a new tag regardless of user rights.
|
Map<String,Object> |
createTag(String parentId,
String originalName,
String title,
String description,
Map<String,Object> otherParameters,
Map<String,Object> contextualParameters)
Create a new tag from client-side.
|
Map<String,Object> |
deleteTag(String tagId,
Map<String,Object> contextualParameters)
Deletes a JCR tag
|
Map<String,Object> |
getTag(String tagId)
Find a JCR tag and return its data
|
Map<String,Object> |
getTagRootNode(String tagProviderId,
Map<String,Object> contextualParameters)
Get the root node for tags
|
Map<String,Object> |
moveTags(String targetId,
List<String> ids)
Move a JCR tag
|
void |
service(ServiceManager manager) |
Map<String,Object> |
updateTag(String tagId,
String title,
String description,
Map<String,Object> otherParameters)
Updates a JCR tag
|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
protected AmetysObjectResolver _resolver
protected ObservationManager _observationManager
protected CurrentUserProvider _currentUserProvider
public AbstractJCRTagsDAO()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public Map<String,Object> createTag(String parentId, String originalName, String title, String description, Map<String,Object> otherParameters, Map<String,Object> contextualParameters)
parentId
- The id of parent tagoriginalName
- The original nametitle
- The tag's titledescription
- The tag's descriptionotherParameters
- the other parameterscontextualParameters
- Contextual parameters transmitted by the environment.public JCRTag addTag(String parentId, String originalName, String title, String description, Map<String,Object> otherParameters, Map<String,Object> contextualParameters) throws UnknownAmetysObjectException, RepositoryException
parentId
- The id of parent tagoriginalName
- The original nametitle
- The tag's titledescription
- The tag's descriptionotherParameters
- the other parameterscontextualParameters
- Contextual parameters transmitted by the environment.UnknownAmetysObjectException
- if the parent does not existRepositoryException
- if failed to create tagpublic Map<String,Object> deleteTag(String tagId, Map<String,Object> contextualParameters)
tagId
- The tag's idcontextualParameters
- Contextual parameters transmitted by the environment.public Map<String,Object> updateTag(String tagId, String title, String description, Map<String,Object> otherParameters)
tagId
- The tag's idtitle
- The tag's titledescription
- The tag's descriptionotherParameters
- the other parameterspublic Map<String,Object> moveTags(String targetId, List<String> ids) throws ProcessingException
targetId
- The tag where to move toids
- The ids of tag to moveProcessingException
- If an error occurredpublic Map<String,Object> getTagRootNode(String tagProviderId, Map<String,Object> contextualParameters) throws ProcessingException
tagProviderId
- The tag provider idcontextualParameters
- Contextual parameters transmitted by the environment.ProcessingException
- If an error occurred in the repositorypublic Map<String,Object> getTag(String tagId)
tagId
- The tag's idpublic abstract ModifiableTraversableAmetysObject _getTagRootObject(String tagProviderId, Map<String,Object> contextualParameters) throws RepositoryException
tagProviderId
- The tag provider idcontextualParameters
- Contextual parameters transmitted by the environment.RepositoryException
- If an error occurred in the repositoryprotected abstract void _checkUserRight() throws IllegalStateException
IllegalStateException
- if the user has no rightprotected abstract Tag _getTagFromName(String name, Map<String,Object> contextualParameters)
name
- the namecontextualParameters
- the contextual parametersprotected abstract Set<TagProvider<? extends Tag>> _getTagProviders()
protected abstract JCRTag _createJCRTag(String parentId, String name, String title, String description, Map<String,Object> otherParameters, Map<String,Object> contextualParameters) throws RepositoryException
parentId
- the parent idname
- the nametitle
- the titledescription
- the descriptionotherParameters
- the other parameterscontextualParameters
- Contextual parameters transmitted by the environment.RepositoryException
- if an error occurredprotected abstract JCRTag _updateJCRTag(String tagId, String title, String description, Map<String,Object> otherParameters) throws UnknownAmetysObjectException
tagId
- the tag id to updatetitle
- the titledescription
- the descriptionotherParameters
- the other parametersUnknownAmetysObjectException
- if an error occurredprotected String _findUniqueName(String originalName, Map<String,Object> contextualParameters)
originalName
- The requested namecontextualParameters
- Contextual parameters transmitted by the environment.protected boolean _hasTag(Set<TagProvider<? extends Tag>> providers, String name, Map<String,Object> contextualParameters)
providers
- The tag providersname
- The name of the tagcontextualParameters
- Contextual parameters transmitted by the environment.