cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a Tag in Alfresco Java Web Services

mazhar_shaukat
Champ in-the-making
Champ in-the-making
Hi,

I'm trying to add a tag to a content. But for that purpose I need to create tags first.
Bu I can't find a way to create a new tag using Alfresco Web Services.
I'm using Alfresco Community 4.0.d

Thanks,
Mazhar
6 REPLIES 6

scouil
Star Contributor
Star Contributor

mazhar_shaukat
Champ in-the-making
Champ in-the-making
Thanks Scouil for the reply, but I'm asking to do it in Java web service and not javascript

mazhar_shaukat
Champ in-the-making
Champ in-the-making
I'm still waiting desperately for a solution Smiley Sad

scouil
Star Contributor
Star Contributor
Well the behaviour is the same in java:
http://dev.alfresco.com/resource/docs/java/repository/org/alfresco/service/cmr/tagging/TaggingServic...

addTag() takes the node to tag + the tag as a string

mazhar_shaukat
Champ in-the-making
Champ in-the-making
thanks again scouil for the reply. I have tried this but it gives me null pointer exception Smiley Sad

scouil
Star Contributor
Star Contributor
Then double-check that the node that you want to tag isn't null.

Oh and, I'm not sure about this one, but maybe you first need to add the aspect cm:taggable to your node before being able to add a tag.
I'm not sure since I haven't tried it myself but it's possible that the "addTag" function doesn't automatically adds the aspect.