Hi,
i have a custom model with a multiple value property like this:
<property name="mytype:myprop"> <title>MyProp</title> <type>d:text</type> <mandatory>false</mandatory> <multiple>true</multiple> <index enabled="true"> <tokenised>TRUE</tokenised> <facetable>false</facetable> </index> </property>
This property is filled by external Java code and the values is different for every documents. For example:
DOC1 --> ["VAL1", "VAL2", "VAL3"]
DOC2 --> ["VAL2", "VAL4", "VAL5", "VAL6"]
I created a simple smart folder template that create two subfolders for two single possible values of property:
{ "name" : "Smart Folders Template", "nodes" : [{ "id":"1", "name" : "Values", "description" : "Values", "nodes" : [{ "id":"11", "name":"VAL1", "description":"VAL1", "search" : { "language" : "fts-alfresco", "query" : "(PATH:'/mypath//*') AND (=cm:content.mimetype:application/pdf) AND (=mytype:myprop:'VAL1')" } }, { "id":"12", "name":"VAL2", "description":"VAL2", "search" : { "language" : "fts-alfresco", "query" : "(PATH:'/mypath//*') AND (=cm:content.mimetype:application/pdf) AND (=mytype:myprop:'VAL2')" } } ] } }
But this property has lot of possible values, and increase every day.
I want to have a smart folder template that automatically create a subfolders for every possible value of this property.
How can i do?
Thanks
You would have to develop a custom behaviour / policy which reacts to any property update on nodes on which the propery can be set. This behavior / policy would have to parse your smart folder template JSON, check if the value(s) of the multivalued property are already contained in there, and if not, modify the JSON and save it back to the template node.
Apart from such custom logic, there is no way (no configuration / dynamic templating in the JSON) to achieve this.
There is no way to modify JSON template using Java OpenCMIS library or Alfresco API?
I could edit the template by an external Java code and automatically add new node..
Thank for the reply.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.