Create rule to a folder with Javascript for tagging file with Tags present on subfolder

cancel
Showing results for 
Search instead for 
Did you mean: 
DoZi
Active Member

Create rule to a folder with Javascript for tagging file with Tags present on subfolder

Hi i want to create in my site a rule with javascript that make this.

i create in the document root 4 folder that would have the rules that each file that was created or uploaded will be tagged with the tag of the subfolder that they belongs.

I'm newbie and i don't know about alfresco with javascript ... I create a simple js file in Dictionary and i associate this to the rule and work ( i find a little example on internet --- i make an array with 3 tag in js and add this to the file).

I don't know how to find methods, how to get subfolder tags...

Please can someone help me? 

Can someone can help me with this task and i take this like example for other task, please? THX

3 Replies
EddieMay
Community Manager
Community Manager

Re: Create rule to a folder with Javascript for tagging file with Tags present on subfolder

Hi @DoZi 

It might be helpful to take a look at the tagging api. There are also a few solutions to similar problems here on the Hub - see one, two, three, four and five. These might provide the basis of a solution you can craft.

HTH,

Digital Community Manager, Alfresco Software.
Problem solved? Click Accept as Solution!
DoZi
Active Member

Re: Create rule to a folder with Javascript for tagging file with Tags present on subfolder

Hi, thx for your answer,

 

i have red everything but i have another question, can i know which tag was removed from a folder and in the child document remove only this one ...

 

can i compare tags between two node...

can i know what tags are addes or are removed

 

Please, let me know and THX

kaynezhang
Advanced

Re: Create rule to a folder with Javascript for tagging file with Tags present on subfolder

You can try follwoing methods

tags = document.tags; // gets document tags
folder.childrenByTags("tag"); gets all children of this node that have the tag specified.

 of Tagging API