I'm doing something like this:
document.properties["my:customProperty"] = getSomehowTheProperty(document);
my:customProperty
is a string, which has some allowed values in the content model.
How can I get the allowed values from the content model, so that I don't have to store them in a JavaScript array inside the script?
Or how else can I check, that the function getSomehowTheProperty
returned an allowed value?
I tried to wrap it with try-catch:
try {
document.properties["my:customProperty"] = getSomehowTheProperty(document);
document.save();
} catch (e) {
document.properties["my:customProperty"] = "Default Value";
document.save();
}
But it looks like integrity is checked and th error is thrown at the end of executing the script, not inside the try block.
Googling "alfresco js allowed values of node properties" and similar queries gives me nothing.
/Data Dictionary/Scripts/
. It is executed as a content rule action in some space, when new document is uploaded to the space. Sorry for not being clear enough at first and hope it's better now.