Skip to content
Advertisement

Alfresco Add Category based on Tag

I would like to create a script to use as a folder rule to add a category based on the tag.

This script successfully adds the category to the file.

JavaScript

However, when I add the findTaggedNodes, the script fails.

JavaScript

I have also tried

JavaScript

Any help would be appreciated. (NOTE: I am not a developer)

Advertisement

Answer

findTaggedNodes don’t work in javascript, you can use it in Java with TaggingService , in JavaScript you need to use search.findNode(TAG_NODE_REF) to get the node of the tag with the nodeRef.

var taggable = document.properties["cm:taggable"]; return a collection of tags, you cannot compare it with string value. you need a loop to compare if the collection contain same node et use node1.equals(node2)

You find script here :

JavaScript
User contributions licensed under: CC BY-SA
10 People found this is helpful
Advertisement