mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
ALF-9542 - SVC 65: Contribution: Share Tag Management Console
* based on contribution from iptech * replaced origional web scripts with versions that compliement and extend exitsing tagging REST API * updated UI to use changed webScripts * fixed rename action caps sensitivity (rename with different capitalisation, but same name deleted tag!) * tested Also fixes: * ALF-8688 - Can't remove a tag from the tag list * ALF-4710 - Share Impossible to Permanently Remove Content Tags git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29327 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -66,6 +66,7 @@ import org.alfresco.service.cmr.tagging.TaggingService;
|
||||
import org.alfresco.service.namespace.NamespaceService;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.alfresco.util.ISO9075;
|
||||
import org.alfresco.util.ParameterCheck;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
|
||||
@@ -476,6 +477,8 @@ public class TaggingServiceImpl implements TaggingService,
|
||||
*/
|
||||
public List<String> getTags(StoreRef storeRef)
|
||||
{
|
||||
ParameterCheck.mandatory("storeRef", storeRef);
|
||||
|
||||
Collection<ChildAssociationRef> rootCategories = this.categoryService.getRootCategories(storeRef, ContentModel.ASPECT_TAGGABLE);
|
||||
List<String> result = new ArrayList<String>(rootCategories.size());
|
||||
for (ChildAssociationRef rootCategory : rootCategories)
|
||||
@@ -491,16 +494,27 @@ public class TaggingServiceImpl implements TaggingService,
|
||||
*/
|
||||
public List<String> getTags(StoreRef storeRef, String filter)
|
||||
{
|
||||
Collection<ChildAssociationRef> rootCategories = this.categoryService.getRootCategories(storeRef, ContentModel.ASPECT_TAGGABLE);
|
||||
List<String> result = new ArrayList<String>(rootCategories.size());
|
||||
for (ChildAssociationRef rootCategory : rootCategories)
|
||||
ParameterCheck.mandatory("storeRef", storeRef);
|
||||
|
||||
List<String> result = null;
|
||||
if (filter == null || filter.length() == 0)
|
||||
{
|
||||
String name = (String)this.nodeService.getProperty(rootCategory.getChildRef(), ContentModel.PROP_NAME);
|
||||
if (name.contains(filter.toLowerCase()) == true)
|
||||
result = getTags(storeRef);
|
||||
}
|
||||
else
|
||||
{
|
||||
Collection<ChildAssociationRef> rootCategories = this.categoryService.getRootCategories(storeRef, ContentModel.ASPECT_TAGGABLE);
|
||||
result = new ArrayList<String>(rootCategories.size());
|
||||
for (ChildAssociationRef rootCategory : rootCategories)
|
||||
{
|
||||
result.add(name);
|
||||
String name = (String)this.nodeService.getProperty(rootCategory.getChildRef(), ContentModel.PROP_NAME);
|
||||
if (name.contains(filter.toLowerCase()) == true)
|
||||
{
|
||||
result.add(name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
|
@@ -87,7 +87,7 @@ public class ScriptTaggingService extends BaseScopableProcessorExtension
|
||||
NodeRef result = this.serviceRegistry.getTaggingService().getTagNodeRef(storeRef, tag);
|
||||
if (result != null)
|
||||
{
|
||||
return new ScriptNode(result, this.serviceRegistry);
|
||||
return new ScriptNode(result, this.serviceRegistry, this.getScope());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -109,4 +109,16 @@ public class ScriptTaggingService extends BaseScopableProcessorExtension
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* delete tag at the given store
|
||||
*
|
||||
* @param store store reference
|
||||
* @param tag tag name
|
||||
*/
|
||||
public void deleteTag(String store, String tag)
|
||||
{
|
||||
StoreRef storeRef = new StoreRef(store);
|
||||
this.serviceRegistry.getTaggingService().deleteTag(storeRef, tag);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user