public class JCRTagsDAO 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
|
protected RightManager |
_rightManager
The rights manager
|
protected TagProviderExtensionPoint |
_tagProviderExtPt
The tag provider extension point
|
protected TagsDAO |
_tagsDAO
Tags DAO
|
protected TagTargetTypeExtensionPoint |
_targetTypeEP
Target types
|
static String |
ROLE
The Avalon role
|
Constructor and Description |
---|
JCRTagsDAO() |
Modifier and Type | Method and Description |
---|---|
protected void |
_checkUserRight(String rightId,
String context)
Check if the user right to access the feature
|
protected String |
_findUniqueName(String originalName,
Map<String,Object> contextualParameters)
Find a unique name for the tag
|
protected Set<TagProvider> |
_getTagProviders()
Get all tag's providers
|
protected boolean |
_hasTag(Set<TagProvider> providers,
String name,
Map<String,Object> contextualParameters)
Determines if a tag with given name already exists
|
JCRTag |
addTag(String parentId,
String originalName,
String title,
String description,
String visibility,
String targetType,
Map<String,Object> contextualParameters)
Create a new tag regardless of user rights.
|
Map<String,Object> |
createTag(String parentId,
String originalName,
String title,
String description,
String visibility,
String targetType,
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)
Deletes a JCR tag
|
void |
service(ServiceManager serviceManager) |
Map<String,Object> |
updateTag(String tagId,
String title,
String description,
String visibility,
String targetType)
Updates a JCR tag
|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
protected TagProviderExtensionPoint _tagProviderExtPt
protected AmetysObjectResolver _resolver
protected ObservationManager _observationManager
protected CurrentUserProvider _currentUserProvider
protected RightManager _rightManager
protected TagTargetTypeExtensionPoint _targetTypeEP
public JCRTagsDAO()
public void service(ServiceManager serviceManager) throws ServiceException
service
in interface Serviceable
ServiceException
public 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 occured in the repositorypublic Map<String,Object> createTag(String parentId, String originalName, String title, String description, String visibility, String targetType, Map<String,Object> contextualParameters)
parentId
- The id of parent tagoriginalName
- The original nametitle
- The tag's titledescription
- The tag's descriptionvisibility
- The tag's visibilitytargetType
- The tag's target typecontextualParameters
- Contextual parameters transmitted by the environment.public JCRTag addTag(String parentId, String originalName, String title, String description, String visibility, String targetType, Map<String,Object> contextualParameters) throws UnknownAmetysObjectException, RepositoryException
parentId
- The id of parent tagoriginalName
- The original nametitle
- The tag's titledescription
- The tag's descriptionvisibility
- The tag's visibilitytargetType
- The tag's target typecontextualParameters
- Contextual parameters transmitted by the environment.UnknownAmetysObjectException
- if the parent does not existRepositoryException
- if failed to create tagpublic Map<String,Object> getTag(String tagId)
tagId
- The tag's idpublic Map<String,Object> updateTag(String tagId, String title, String description, String visibility, String targetType)
tagId
- The tag's idtitle
- The tag's titledescription
- The tag's descriptionvisibility
- The tag's visibilitytargetType
- The tag's target typepublic Map<String,Object> deleteTag(String tagId, Map<String,Object> contextualParameters)
tagId
- The tag's idcontextualParameters
- Contextual parameters transmitted by the environment.protected void _checkUserRight(String rightId, String context) throws IllegalStateException
rightId
- The right idecontext
- The right contextIllegalStateException
- if the user has no rightprotected String _findUniqueName(String originalName, Map<String,Object> contextualParameters)
originalName
- The requested namecontextualParameters
- Contextual parameters transmitted by the environment.protected boolean _hasTag(Set<TagProvider> providers, String name, Map<String,Object> contextualParameters)
providers
- The tag providersname
- The name of the tagcontextualParameters
- Contextual parameters transmitted by the environment.protected Set<TagProvider> _getTagProviders()
public 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 occurred