cancel
Showing results for 
Search instead for 
Did you mean: 

Simple question (categories)

avro
Champ in-the-making
Champ in-the-making
I've got a simple question to make:

How to assign a category to a node via the native Java API?

I hope this gets an answer. I have to make an API to access to the functionalities of Alfresco in order to use it from an Adobe Flex client and I don't really get the way a node is categorised.

Thank you in advance.
5 REPLIES 5

kevinr
Star Contributor
Star Contributor
Set the NodeRef value(s) to the categories in the multi-value property 'cm:categories' on the node you want to be categorised. The 'cm:categories' is a multi-value property of type NodeRef - so you apply a List (Collection) of NodeRef values representing the categories. See the code in the DocumentDetailsBean.java (download the SDK) in the method saveCategories() as a working example.

Thanks,

Kevin

avro
Champ in-the-making
Champ in-the-making
Thanks.

Where in the SDK is that code?

kevinr
Star Contributor
Star Contributor
In the web-client project:
web-client\source\java\org\alfresco\web\bean\DocumentDetailsBean.java

avro
Champ in-the-making
Champ in-the-making
Thank you, kevinr!

SVN is not working right now, I'll see if tomorrow…

kevinr
Star Contributor
Star Contributor
Try the HTTP access to SVN as that seems more reliable.