|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.repo.tagging.TaggingServiceImpl
public class TaggingServiceImpl
Tagging service implementation
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface org.alfresco.repo.policy.Policy |
---|
Policy.Arg |
Field Summary | |
---|---|
static java.lang.String |
TAG_UPDATES
|
protected static java.lang.String |
TAGGING_AUDIT_APPLICATION_NAME
|
protected static java.lang.String |
TAGGING_AUDIT_KEY_NODEREF
|
protected static java.lang.String |
TAGGING_AUDIT_KEY_TAGS
|
protected static java.lang.String |
TAGGING_AUDIT_ROOT_PATH
|
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.BeforeDeleteNodePolicy |
---|
QNAME |
Fields inherited from interface org.alfresco.repo.node.NodeServicePolicies.OnMoveNodePolicy |
---|
QNAME |
Fields inherited from interface org.alfresco.repo.copy.CopyServicePolicies.OnCopyCompletePolicy |
---|
QNAME |
Fields inherited from interface org.alfresco.repo.copy.CopyServicePolicies.BeforeCopyPolicy |
---|
QNAME |
Fields inherited from interface org.alfresco.repo.policy.Policy |
---|
NAMESPACE |
Constructor Summary | |
---|---|
TaggingServiceImpl()
|
Method Summary | |
---|---|
void |
addTag(org.alfresco.service.cmr.repository.NodeRef nodeRef,
java.lang.String tagName)
Add a tag to a node. |
void |
addTags(org.alfresco.service.cmr.repository.NodeRef nodeRef,
java.util.List tags)
Adds a list of tags to a node. |
void |
addTagScope(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Adds a tag scope to the specified node |
void |
afterCommit()
Invoked after transaction commit. |
void |
afterRollback()
Invoked after transaction rollback. |
void |
beforeCommit(boolean readOnly)
Called before a transaction is committed. |
void |
beforeCompletion()
Invoked before transaction commit/rollback. |
void |
beforeCopy(org.alfresco.service.namespace.QName classRef,
org.alfresco.service.cmr.repository.NodeRef sourceNodeRef,
org.alfresco.service.cmr.repository.NodeRef targetNodeRef)
Fired once per node, before a copy overrides one node (which is possibly newly created) with the contents of another one. |
void |
beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Called before a node is deleted. |
void |
clearTags(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Clears all tags from an already tagged node. |
org.alfresco.service.cmr.repository.NodeRef |
createTag(org.alfresco.service.cmr.repository.StoreRef storeRef,
java.lang.String tag)
Create a new tag |
void |
createTags(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
|
void |
deleteTag(org.alfresco.service.cmr.repository.StoreRef storeRef,
java.lang.String tag)
Delete an existing tag |
java.util.List |
findAllTagScopes(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Finds all the tag scopes for the specified node. |
java.util.List |
findTaggedNodes(org.alfresco.service.cmr.repository.StoreRef storeRef,
java.lang.String tag)
Find all nodes that have been tagged with the specified tag. |
java.util.List |
findTaggedNodes(org.alfresco.service.cmr.repository.StoreRef storeRef,
java.lang.String tag,
org.alfresco.service.cmr.repository.NodeRef nodeRef)
Find all nodes that have been tagged with the specified tag and reside within the context of the node reference provided. |
TagScope |
findTagScope(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Finds the 'nearest' tag scope for the specified node. |
void |
flush()
|
org.alfresco.service.cmr.repository.NodeRef |
getTagNodeRef(org.alfresco.service.cmr.repository.StoreRef storeRef,
java.lang.String tag)
Gets the node reference for a given tag. |
java.util.List |
getTags(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Get all the tags on a node |
java.util.List |
getTags(org.alfresco.service.cmr.repository.StoreRef storeRef)
Get all the tags currently available |
java.util.List |
getTags(org.alfresco.service.cmr.repository.StoreRef storeRef,
java.lang.String filter)
Get all the tags currently available that match the provided filter. |
boolean |
hasTag(org.alfresco.service.cmr.repository.NodeRef nodeRef,
java.lang.String tag)
Indicates whether a node has the specified tag or not. |
void |
init()
Init method |
boolean |
isTag(org.alfresco.service.cmr.repository.StoreRef storeRef,
java.lang.String tag)
Indicates whether the tag already exists |
boolean |
isTagScope(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Indicates whether the node reference is a tag scope |
void |
onCopyComplete(org.alfresco.service.namespace.QName classRef,
org.alfresco.service.cmr.repository.NodeRef sourceNodeRef,
org.alfresco.service.cmr.repository.NodeRef targetNodeRef,
boolean copyToNewNode,
java.util.Map copyMap)
Fired once per node that was copied, after the copy has completed. |
void |
onMoveNode(org.alfresco.service.cmr.repository.ChildAssociationRef oldChildAssocRef,
org.alfresco.service.cmr.repository.ChildAssociationRef newChildAssocRef)
Called when a node has been moved. |
void |
refreshTagScope(org.alfresco.service.cmr.repository.NodeRef nodeRef,
boolean async)
Refreshes the tag count of the passed tag scope by recounting all the tags of the children of the scope. |
void |
removeTag(org.alfresco.service.cmr.repository.NodeRef nodeRef,
java.lang.String tag)
Remove a tag from a node. |
void |
removeTags(org.alfresco.service.cmr.repository.NodeRef nodeRef,
java.util.List tags)
Removes a list of tags from a node. |
void |
removeTagScope(org.alfresco.service.cmr.repository.NodeRef nodeRef)
Removes a tag scope from a specified node. |
void |
setActionService(ActionService actionService)
Set the action service |
void |
setAuditComponent(AuditComponent auditComponent)
Set the audit component |
void |
setAuditService(AuditService auditService)
Set the audit service |
void |
setCategoryService(CategoryService categoryService)
Set the cateogry service |
void |
setContentService(ContentService contentService)
Set the content service |
void |
setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
Set the namespace service |
void |
setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
Set the node service |
void |
setPolicyComponent(PolicyComponent policyComponent)
Policy component |
void |
setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
Set the search service |
void |
setTags(org.alfresco.service.cmr.repository.NodeRef nodeRef,
java.util.List tags)
Sets the list of tags that are applied to a node, replaces any existing tags with those provided. |
void |
updateTags(org.alfresco.service.cmr.repository.NodeRef nodeRef,
java.util.Map before,
java.util.Map after)
Update tag policy behaviour |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final java.lang.String TAGGING_AUDIT_APPLICATION_NAME
protected static final java.lang.String TAGGING_AUDIT_ROOT_PATH
protected static final java.lang.String TAGGING_AUDIT_KEY_NODEREF
protected static final java.lang.String TAGGING_AUDIT_KEY_TAGS
public static final java.lang.String TAG_UPDATES
Constructor Detail |
---|
public TaggingServiceImpl()
Method Detail |
---|
public void setCategoryService(CategoryService categoryService)
public void setNodeService(org.alfresco.service.cmr.repository.NodeService nodeService)
public void setSearchService(org.alfresco.service.cmr.search.SearchService searchService)
public void setActionService(ActionService actionService)
public void setContentService(ContentService contentService)
public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
public void setPolicyComponent(PolicyComponent policyComponent)
public void setAuditService(AuditService auditService)
public void setAuditComponent(AuditComponent auditComponent)
public void init()
public void beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef nodeRef)
NodeServicePolicies.BeforeDeleteNodePolicy
beforeDeleteNode
in interface NodeServicePolicies.BeforeDeleteNodePolicy
nodeRef
- the node referenceNodeServicePolicies.BeforeDeleteNodePolicy.beforeDeleteNode(org.alfresco.service.cmr.repository.NodeRef)
public void beforeCopy(org.alfresco.service.namespace.QName classRef, org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, org.alfresco.service.cmr.repository.NodeRef targetNodeRef)
beforeCopy
in interface CopyServicePolicies.BeforeCopyPolicy
classRef
- the type of the node that will be copiedsourceNodeRef
- the original nodetargetNodeRef
- the destination nodepublic void onCopyComplete(org.alfresco.service.namespace.QName classRef, org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, org.alfresco.service.cmr.repository.NodeRef targetNodeRef, boolean copyToNewNode, java.util.Map copyMap)
onCopyComplete
in interface CopyServicePolicies.OnCopyCompletePolicy
classRef
- the type of the node that was copiedsourceNodeRef
- the original nodetargetNodeRef
- the destination nodecopyMap
- a map containing all the nodes that have been created during the copypublic void onMoveNode(org.alfresco.service.cmr.repository.ChildAssociationRef oldChildAssocRef, org.alfresco.service.cmr.repository.ChildAssociationRef newChildAssocRef)
NodeServicePolicies.OnMoveNodePolicy
onMoveNode
in interface NodeServicePolicies.OnMoveNodePolicy
oldChildAssocRef
- the child association reference prior to the movenewChildAssocRef
- the child association reference after the movepublic void createTags(org.alfresco.service.cmr.repository.ChildAssociationRef childAssocRef)
public void updateTags(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.util.Map before, java.util.Map after)
public boolean isTag(org.alfresco.service.cmr.repository.StoreRef storeRef, java.lang.String tag)
TaggingService
isTag
in interface TaggingService
storeRef
- store referencetag
- tag name
org.alfresco.service.cmr.tagging.TaggingService#isTag(java.lang.String)
public org.alfresco.service.cmr.repository.NodeRef createTag(org.alfresco.service.cmr.repository.StoreRef storeRef, java.lang.String tag)
TaggingService
createTag
in interface TaggingService
storeRef
- store referencetag
- tag nameorg.alfresco.service.cmr.tagging.TaggingService#createTag(java.lang.String)
public void deleteTag(org.alfresco.service.cmr.repository.StoreRef storeRef, java.lang.String tag)
TaggingService
deleteTag
in interface TaggingService
storeRef
- store referencetag
- tag nameTaggingService.deleteTag(org.alfresco.service.cmr.repository.StoreRef, java.lang.String)
public java.util.List getTags(org.alfresco.service.cmr.repository.StoreRef storeRef)
TaggingService
getTags
in interface TaggingService
org.alfresco.service.cmr.tagging.TaggingService#getTags()
public java.util.List getTags(org.alfresco.service.cmr.repository.StoreRef storeRef, java.lang.String filter)
TaggingService
getTags
in interface TaggingService
storeRef
- store referencefilter
- tag filter
TaggingService.getTags(org.alfresco.service.cmr.repository.StoreRef, java.lang.String)
public boolean hasTag(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.lang.String tag)
TaggingService
hasTag
in interface TaggingService
nodeRef
- node referencetag
- tag name
TaggingService.hasTag(org.alfresco.service.cmr.repository.NodeRef, java.lang.String)
public void addTag(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.lang.String tagName)
TaggingService
addTag
in interface TaggingService
nodeRef
- node referencetagName
- tag nameTaggingService.addTag(org.alfresco.service.cmr.repository.NodeRef, java.lang.String)
public void addTags(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.util.List tags)
TaggingService
Tags are created if they do not exist.
addTags
in interface TaggingService
nodeRef
- node referencetags
- list of tagsTaggingService.addTags(org.alfresco.service.cmr.repository.NodeRef, java.util.List)
public org.alfresco.service.cmr.repository.NodeRef getTagNodeRef(org.alfresco.service.cmr.repository.StoreRef storeRef, java.lang.String tag)
Returns null if tag is not present.
getTagNodeRef
in interface TaggingService
storeRef
- store referencetag
- tag
public void removeTag(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.lang.String tag)
TaggingService
removeTag
in interface TaggingService
nodeRef
- node referencetag
- tag nameTaggingService.removeTag(org.alfresco.service.cmr.repository.NodeRef, java.lang.String)
public void removeTags(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.util.List tags)
TaggingService
removeTags
in interface TaggingService
nodeRef
- node referencetags
- list of tagsTaggingService.removeTags(org.alfresco.service.cmr.repository.NodeRef, java.util.List)
public java.util.List getTags(org.alfresco.service.cmr.repository.NodeRef nodeRef)
TaggingService
getTags
in interface TaggingService
nodeRef
- node reference
TaggingService.getTags(org.alfresco.service.cmr.repository.NodeRef)
public void setTags(org.alfresco.service.cmr.repository.NodeRef nodeRef, java.util.List tags)
TaggingService
setTags
in interface TaggingService
nodeRef
- node referencetags
- list of tagsTaggingService.setTags(org.alfresco.service.cmr.repository.NodeRef, java.util.List)
public void clearTags(org.alfresco.service.cmr.repository.NodeRef nodeRef)
TaggingService
clearTags
in interface TaggingService
nodeRef
- node referenceTaggingService.clearTags(org.alfresco.service.cmr.repository.NodeRef)
public boolean isTagScope(org.alfresco.service.cmr.repository.NodeRef nodeRef)
TaggingService
isTagScope
in interface TaggingService
nodeRef
- node reference
TaggingService.isTagScope(org.alfresco.service.cmr.repository.NodeRef)
public void addTagScope(org.alfresco.service.cmr.repository.NodeRef nodeRef)
TaggingService
addTagScope
in interface TaggingService
nodeRef
- node referenceTaggingService.addTagScope(org.alfresco.service.cmr.repository.NodeRef)
public void refreshTagScope(org.alfresco.service.cmr.repository.NodeRef nodeRef, boolean async)
TaggingService
refreshTagScope
in interface TaggingService
nodeRef
- tag scope node referenceasync
- indicates whether the tag scope refresh should happen asynchronously or notorg.alfresco.service.cmr.tagging.TaggingService#refreshTagScopt(org.alfresco.service.cmr.repository.NodeRef, boolean)
public void removeTagScope(org.alfresco.service.cmr.repository.NodeRef nodeRef)
TaggingService
removeTagScope
in interface TaggingService
nodeRef
- node referenceTaggingService.removeTagScope(org.alfresco.service.cmr.repository.NodeRef)
public TagScope findTagScope(org.alfresco.service.cmr.repository.NodeRef nodeRef)
TaggingService
The 'nearest' tag scope is discovered by walking up the primary parent path until a tag scope is found or the root node is reached.
If no tag scope if found then a null value is returned.
findTagScope
in interface TaggingService
nodeRef
- node reference
TaggingService.findTagScope(org.alfresco.service.cmr.repository.NodeRef)
public java.util.List findAllTagScopes(org.alfresco.service.cmr.repository.NodeRef nodeRef)
TaggingService
The resulting list of tag scopes is ordered with the 'nearest' at the bedining of the list.
If no tag scopes are found an empty list is returned.
findAllTagScopes
in interface TaggingService
nodeRef
- node reference
TaggingService.findAllTagScopes(org.alfresco.service.cmr.repository.NodeRef)
public java.util.List findTaggedNodes(org.alfresco.service.cmr.repository.StoreRef storeRef, java.lang.String tag)
TaggingService
findTaggedNodes
in interface TaggingService
tag
- tag name
org.alfresco.service.cmr.tagging.TaggingService#findTaggedNodes(java.lang.String)
public java.util.List findTaggedNodes(org.alfresco.service.cmr.repository.StoreRef storeRef, java.lang.String tag, org.alfresco.service.cmr.repository.NodeRef nodeRef)
TaggingService
findTaggedNodes
in interface TaggingService
tag
- tag namenodeRef
- node providing context for the search
org.alfresco.service.cmr.tagging.TaggingService#findTaggedNodes(java.lang.String, org.alfresco.service.cmr.repository.NodeRef)
public void afterCommit()
TransactionListener
Any exceptions generated here will cause the transaction to rollback.
Although all transaction resources are still available, this method should be used only for cleaning up resources after a commit has occured.
afterCommit
in interface TransactionListener
TransactionListener.afterCommit()
public void afterRollback()
TransactionListener
Although all transaction resources are still available, this method should be used only for cleaning up resources after a rollback has occured.
afterRollback
in interface TransactionListener
TransactionListener.afterRollback()
public void beforeCommit(boolean readOnly)
TransactionListener
All transaction resources are still available.
beforeCommit
in interface TransactionListener
readOnly
- true if the transaction is read-onlyTransactionListener.beforeCommit(boolean)
public void beforeCompletion()
TransactionListener
TransactionListener.beforeCommit(boolean)
even if TransactionListener.beforeCommit(boolean)
failed.
Any exceptions generated here will only be logged and will have no effect on the state of the transaction.
All transaction resources are still available.
beforeCompletion
in interface TransactionListener
TransactionListener.beforeCompletion()
public void flush()
flush
in interface TransactionListener
TransactionListener.flush()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |