mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Coding standards
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@22726 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -176,6 +176,7 @@ public class TaggingServiceImpl implements TaggingService,
|
||||
OnCreateNodePolicy.QNAME,
|
||||
ContentModel.ASPECT_TAGGABLE,
|
||||
createTagBehaviour);
|
||||
|
||||
// We need to register on content and folders, rather than
|
||||
// tagable, so we can pick up when things start and
|
||||
// stop being tagged
|
||||
@@ -261,61 +262,67 @@ public class TaggingServiceImpl implements TaggingService,
|
||||
}
|
||||
|
||||
/**
|
||||
* Fired once per node, before a copy overrides one node
|
||||
* (which is possibly newly created) with the contents
|
||||
* Fired once per node, before a copy overrides one node (which is possibly newly created) with the contents
|
||||
* of another one.
|
||||
* We should remove any tags from the scope, as they'll
|
||||
* shortly be overwritten.
|
||||
* We should remove any tags from the scope, as they'll shortly be overwritten.
|
||||
*/
|
||||
public void beforeCopy(QName classRef, NodeRef sourceNodeRef,
|
||||
NodeRef targetNodeRef) {
|
||||
if(this.nodeService.hasAspect(targetNodeRef, ContentModel.ASPECT_TAGGABLE)) {
|
||||
public void beforeCopy(QName classRef, NodeRef sourceNodeRef, NodeRef targetNodeRef)
|
||||
{
|
||||
if (this.nodeService.hasAspect(targetNodeRef, ContentModel.ASPECT_TAGGABLE))
|
||||
{
|
||||
updateAllScopeTags(targetNodeRef, Boolean.FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Fired once per node that was copied, after the copy
|
||||
* has completed.
|
||||
* Fired once per node that was copied, after the copy has completed.
|
||||
* We need to add in all the tags to the scope.
|
||||
*/
|
||||
public void onCopyComplete(QName classRef, NodeRef sourceNodeRef,
|
||||
NodeRef targetNodeRef, boolean copyToNewNode,
|
||||
Map<NodeRef, NodeRef> copyMap) {
|
||||
if(this.nodeService.hasAspect(targetNodeRef, ContentModel.ASPECT_TAGGABLE)) {
|
||||
public void onCopyComplete(QName classRef, NodeRef sourceNodeRef, NodeRef targetNodeRef, boolean copyToNewNode,
|
||||
Map<NodeRef, NodeRef> copyMap)
|
||||
{
|
||||
if (this.nodeService.hasAspect(targetNodeRef, ContentModel.ASPECT_TAGGABLE))
|
||||
{
|
||||
updateAllScopeTags(targetNodeRef, Boolean.TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
public void onMoveNode(ChildAssociationRef oldChildAssocRef,
|
||||
ChildAssociationRef newChildAssocRef) {
|
||||
public void onMoveNode(ChildAssociationRef oldChildAssocRef, ChildAssociationRef newChildAssocRef)
|
||||
{
|
||||
NodeRef oldRef = oldChildAssocRef.getChildRef();
|
||||
NodeRef oldParent = oldChildAssocRef.getParentRef();
|
||||
NodeRef newRef = newChildAssocRef.getChildRef();
|
||||
NodeRef newParent = newChildAssocRef.getParentRef();
|
||||
|
||||
// Do nothing if it's a "rename" not a move
|
||||
if(oldParent.equals(newParent)) {
|
||||
if (oldParent.equals(newParent))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// It has moved somewhere
|
||||
// Remove the tags from the old location
|
||||
if(this.nodeService.hasAspect(oldRef, ContentModel.ASPECT_TAGGABLE)) {
|
||||
if (this.nodeService.hasAspect(oldRef, ContentModel.ASPECT_TAGGABLE))
|
||||
{
|
||||
// Use the parent we were passed in, rather than re-fetching
|
||||
// via the node, as we need to reference the old scope!
|
||||
ChildAssociationRef scopeParent;
|
||||
if(oldChildAssocRef.isPrimary()) {
|
||||
if (oldChildAssocRef.isPrimary())
|
||||
{
|
||||
scopeParent = oldChildAssocRef;
|
||||
} else {
|
||||
}
|
||||
else
|
||||
{
|
||||
scopeParent = this.nodeService.getPrimaryParent(oldParent);
|
||||
}
|
||||
if(scopeParent != null) {
|
||||
if (scopeParent != null)
|
||||
{
|
||||
updateAllScopeTags(oldRef, scopeParent.getParentRef(), Boolean.FALSE);
|
||||
}
|
||||
}
|
||||
// Add the tags at its new location
|
||||
if(this.nodeService.hasAspect(newRef, ContentModel.ASPECT_TAGGABLE)) {
|
||||
if (this.nodeService.hasAspect(newRef, ContentModel.ASPECT_TAGGABLE))
|
||||
{
|
||||
updateAllScopeTags(newRef, Boolean.TRUE);
|
||||
}
|
||||
}
|
||||
@@ -390,9 +397,7 @@ public class TaggingServiceImpl implements TaggingService,
|
||||
public boolean isTag(StoreRef storeRef, String tag)
|
||||
{
|
||||
// Lower the case of the tag
|
||||
tag = tag.toLowerCase();
|
||||
|
||||
return (getTagNodeRef(storeRef, tag) != null);
|
||||
return (getTagNodeRef(storeRef, tag.toLowerCase()) != null);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user