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:
Roy Wetherall
2011-07-26 05:03:44 +00:00
parent b3ce73691e
commit f1fe03239e
2 changed files with 33 additions and 7 deletions

View File

@@ -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)
@@ -490,9 +493,18 @@ public class TaggingServiceImpl implements TaggingService,
* @see org.alfresco.service.cmr.tagging.TaggingService#getTags(org.alfresco.service.cmr.repository.StoreRef, java.lang.String)
*/
public List<String> getTags(StoreRef storeRef, String filter)
{
ParameterCheck.mandatory("storeRef", storeRef);
List<String> result = null;
if (filter == null || filter.length() == 0)
{
result = getTags(storeRef);
}
else
{
Collection<ChildAssociationRef> rootCategories = this.categoryService.getRootCategories(storeRef, ContentModel.ASPECT_TAGGABLE);
List<String> result = new ArrayList<String>(rootCategories.size());
result = new ArrayList<String>(rootCategories.size());
for (ChildAssociationRef rootCategory : rootCategories)
{
String name = (String)this.nodeService.getProperty(rootCategory.getChildRef(), ContentModel.PROP_NAME);
@@ -501,6 +513,8 @@ public class TaggingServiceImpl implements TaggingService,
result.add(name);
}
}
}
return result;
}

View File

@@ -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);
}
}