title: Alfresco apply category with js to doc
body: <p>How to apply category to document in Alfresco with javascript?</p>
  
  <p>tried like this:</p>
  
  <pre><code>document.properties["cm:categories"] = "testCat";
  </code></pre>
  
  <p>UPDATE:</p>
  
  <p>like this I am able to get "root categories" but not "sub categories":</p>
  
  <pre><code>var rootCats =  classification.getRootCategories("cm:generalclassifiable");
  document. properties["cm:categories"] = rootCats[3];
  </code></pre>
  
  <p>this doesnt work:</p>
  
  <pre><code>document. properties["cm:categories"] = rootCats[3][1];
  </code></pre>