I want to use a categoryService with rules

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

I want to use a categoryService with rules

Newbie question:

 

I'm using version of Aflresco Community - 5.2.0 (r135134-b14)

I'm custmizing page of the document-details.

 I would like to use categoryService in rule definition, but I do not know how to realize it.

ex)

 NodeRef newCategory = categoryService.createCategory(yearsCategory, "1901");

As far as I know ,can do with Alfresco Share Javascript API.

How do I use ?

 Please how should I solve this problem?

Thanks in advanced.

1 Reply
sychel
Active Member

Re: I want to use a categoryService with rules

Hi Yoshida,

I think you can try Alfresco JavaScript Classification API

And there is a method called createSubCategory

Only one thing, you'll have to know the category NodeRef before you write your scripts.

Example code:

var category = classification.getCategory(nodeRef);
      if (category !== null)
      {
         category.createSubCategory(name);
      }