cancel
Showing results for 
Search instead for 
Did you mean: 

multiple categories not getting added to Content

mphasis
Champ in-the-making
Champ in-the-making
Hi,

This is my current scenario. I am trying to upload a document from scratch through webscript. I am having multiple categories to be attached to this content.

This is my code
[b]upload.addAspect("cm:generalclassifiable");
upload.properties["cm:categories"] = catNodes[0];
upload.properties["cm:categories"] = catNodes[1];[/b]

now the problem I am facing is although catNodes[0],catNodes[1] contain values in them. Only last value assigned gets added to document overriding the previous one. The problem is
upload.properties["cm:categories"]
is not able to assign an array as alist of categories.

I even tried
upload.properties["cm:categories"] = catNodes;
. But then it doesn't add anything

I have even tried the following links http://forums.alfresco.com/en/viewtopic.php?f=36&t=15494 and this
http://forums.alfresco.com/en/viewtopic.php?f=36&t=10048

But in vain. Any ideas?
2 REPLIES 2

asterixko
Champ in-the-making
Champ in-the-making
Hello,

You have to add the categories in this way:

var categories = new Array();
categories["cm:categories"] = catNodes;
upload.addAspect("cm:generalclassifiable", categories);

This should work.

mphasis
Champ in-the-making
Champ in-the-making
thanks, it's working!