In Touch UI, Coral2 multifield with ACS common allow multifield data to stored as JSON but when you are going to migrate to Coral3/Granite type, new Granite type store multifield data in nodes not in JSON.
If the dialogs are already authored and if you convert them to Granite type then multifield dialogs fields would not be prepopulated without already authored data.
There are multiple solutions to pre-populate multifield fields with json data, the one is to create node structure from json.
In this article, I will show one of the approaches, to convert json data to node data.
Suppose if the dialog has a multifield item like below :
https://github.com/arunpatidar02/aem63app-repo/blob/master/packages/tmp/dialog-snippet1.xml
after dailog authored the values are stored in a json format.
To make the above dialog compatible with coral3, the data should be stored in a node under iItems. like below:
Note: The dialog fields should be changed separately from coral2 to coral3 resourcetype.
The below servlet runs SQL2 query and look for the touchmulti component and convert json data to nodes, so it will be compatible with coarl3 multifield and prepopulate the authored data.
Code :
https://github.com/arunpatidar02/aem63app-repo/blob/master/java/MultifieldConvertCoral2to3Servlet.java
This comment has been removed by a blog administrator.
ReplyDelete