Want to merge 2 Content Fragment and get JSON
Dear All,
I have one customized content fragment model called smartwidget as shown below.
************************************** START ***********************************************
<?xml version="1.0" encoding="UTF-8"?>
<jcr:root xmlns:sling="http://sling.apache.org/jcr/sling/1.0" xmlns:granite="http://www.adobe.com/jcr/granite/1.0" xmlns:cq="http://www.day.com/jcr/cq/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0" xmlns:nt="http://www.jcp.org/jcr/nt/1.0"
jcr:primaryType="cq:Template"
allowedPaths="[/content/entities(/.*)?]"
ranking="{Long}100">
<jcr:content
cq:lastModified="{Date}2020-05-11T10:51:40.812-05:00"
cq:lastModifiedBy="admin"
cq:scaffolding="/conf/content-fragment-models/settings/dam/cfm/models/smartWidget/jcr:content/model"
cq:templateType="/libs/settings/dam/cfm/model-types/fragment"
jcr:description="Author Landing Pages Content Pages"
jcr:primaryType="cq:PageContent"
jcr:title="Smart-Widget"
sling:resourceSuperType="dam/cfm/models/console/components/data/entity"
sling:resourceType="dam/cfm/models/console/components/data/entity/default">
<model
cq:targetPath="/content/entities"
jcr:primaryType="cq:PageContent"
sling:resourceType="wcm/scaffolding/components/scaffolding"
dataTypesConfig="/mnt/overlay/settings/dam/cfm/models/formbuilderconfig/datatypes"
maxGeneratedOrder="20">
<cq:dialog
jcr:primaryType="nt:unstructured"
sling:resourceType="cq/gui/components/authoring/dialog">
<content
jcr:lastModified="{Date}2020-05-11T10:51:40.812-05:00"
jcr:lastModifiedBy="admin"
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/fixedcolumns">
<items
jcr:primaryType="nt:unstructured"
maxGeneratedOrder="24">
<widgetSectionLabel
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
emptyText="Enter the Widget section label "
fieldDescription="Enter the Widget section label"
fieldLabel="Widget Section Label"
maxlength="40"
metaType="text-single"
name="widgetSectionLabel"
renderReadOnly="false"
showEmptyInReadOnly="true"
valueType="string"/>
<actionWidget
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/multifield"
composite="{Boolean}true"
fieldLabel="Action Widget"
metaType="text-single"
name="actionWidget"
renderReadOnly="false"
valueType="string[]">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/container"
name="./actionWidget">
<items jcr:primaryType="nt:unstructured">
<title
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
emptyText="Enter or update the title for Action Widget"
fieldDescription="Enter or update the title for Action Widget"
fieldLabel="Widget Title *"
name="title"
renderReadOnly="false"
showEmptyInReadOnly="true"
valueType="string"/>
<widgetName
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
emptyText="Enter the Name used for Action Widget"
fieldDescription="Enter the Name used for Action Widget"
fieldLabel="Widget Name"
name="widgetName"/>
<widgetId
jcr:primaryType="nt:unstructured"
sling:resourceType="granite/ui/components/coral/foundation/form/textfield"
emptyText="Enter the ID for Action Widget"
fieldDescription="Enter the ID for Action Widget"
fieldLabel="Widget ID"
name="widgetId"/>
</items>
</field>
</actionWidget>
<contentReference
jcr:primaryType="nt:unstructured"
sling:resourceType="dam/cfm/models/editor/components/fragmentreference/multifield"
fieldLabel="smartWidget Reference"
filter="hierarchy"
fragmentmodelreference="/conf/content-fragment-models/settings/dam/cfm/models/smartWidget"
listOrder="9"
metaType="fragment-reference"
name="smartwidgetcfreference"
nameSuffix="contentReference"
renderReadOnly="false"
rootPath="/content/dam/content-admin/static/global/en/todays/smartwidget"
showEmptyInReadOnly="true"
valueType="string/content-fragment[]">
<field
jcr:primaryType="nt:unstructured"
sling:resourceType="dam/cfm/models/editor/components/fragmentreference"
fragmentmodelreference="/conf/content-fragment-models/settings/dam/cfm/models/smartWidget"
name="smartwidgetcfreference"
renderReadOnly="false">
<granite:data
jcr:primaryType="nt:unstructured"
mvmaxitems="5"/>
</field>
</contentReference>
</items>
</content>
</cq:dialog>
</model>
</jcr:content>
</jcr:root>
************************************** END *******************************************
And I have created 2 CF by using above Model and below is the JSON
********************* First TESTING1 JSON *********************************************
{
"widgetSectionLabel": "testing1",
"actionWidget": [
{
"widgetName": "displayConditions1",
"widgetId": "display_Conditions1",
"title": "Testing1"
}
]
}
*********************** Second testwidget JSON *****************************************
{
"widgetSectionLabel": "testing1",
"actionWidget": [
{
"widgetName": "displayConditions1",
"widgetId": "display_Conditions1",
"title": "Testing1"
}
]
}
Now my requirement is that I want to merge the above 2 JSONS (means 2 content fragments) and want to make one JSON but when I am doing so I am not getting any JSON response as below

