How set a multiple property with the javascript api

cancel
Showing results for 
Search instead for 
Did you mean: 
Established Member II

How set a multiple property with the javascript api

Jump to solution

Hi i have a little script for add a aspect and set some property:
============================================================================

// add the aspect to this document if it needs it
if (document.hasAspect("conta:contatore")) {
    logger.log("Document already as aspect conta:contatore");
} else {
    logger.log("Adding conta:contatore aspect");
    document.addAspect("conta:contatore");
}
//add a new property string
document.properties["conta:soggetto_produttore"] = "";
document.properties["conta:data_ultima_registrazione"] = new Date();//datetime
document.properties["conta:tipo"] = "";
document.properties["conta:amministrazione"] = "";
document.properties["conta:destinatari"] = "";
document.properties["conta:registrazioni"] = ""; //this is a multiple property how can i set with multiple value?

// save the property modifications
document.save();

==================================================================================

i  cannot find a example for the correct way to set a property with multiple value , or what is the defult separator of alfresco if i insert a single string with many value.

Can someone show the way?

Greetings.

1 Solution

Accepted Solutions
Master

Re: How set a multiple property with the javascript api

Jump to solution

The logical data structure to use for multiple values in JavaScript would be an array. The ScriptNode API for properties supports arrays.

View solution in original post

2 Replies
Master

Re: How set a multiple property with the javascript api

Jump to solution

The logical data structure to use for multiple values in JavaScript would be an array. The ScriptNode API for properties supports arrays.

View solution in original post

Established Member II

Re: How set a multiple property with the javascript api

Jump to solution

Yes Faust is right alfresco accepted the array for example:

document.properties["conta:registrazioni"] = ["A","B","C"];