08-27-2008 08:37 PM
08-28-2008 01:50 AM
/**
* This action will take the comma separated list of tags and add them
* separately to the tags property after applying the taggable aspect.
*
* If no tags are supplied the aspect is still applied.
*/
@Override
protected void executeImpl(Action action, NodeRef actionedUponNodeRef)
{
if (this.nodeService.exists(actionedUponNodeRef) == true)
{
// add the aspect if it is not already present on the node
QName tagAspect = QName.createQName("extension.tags", "taggable");
if (this.nodeService.hasAspect(actionedUponNodeRef, tagAspect) == false)
{
this.nodeService.addAspect(actionedUponNodeRef, tagAspect, null);
}
// create the tags as a list
String tags = (String)action.getParameterValue(PARAM_TAGS);
List<String> tagsList = new ArrayList<String>();
if (tags != null && tags.length() > 0)
{
StringTokenizer tokenizer = new StringTokenizer(tags, ",");
while (tokenizer.hasMoreTokens())
{
tagsList.add(tokenizer.nextToken().trim());
}
}
// set the tags property
QName tagsProp = QName.createQName("extension.tags", "tags");
this.nodeService.setProperty(actionedUponNodeRef, tagsProp, (Serializable)tagsList);
}
06-25-2009 12:48 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.