Hi all,
I have exported a page from AEM like this:
curl https://myhost/content/prodprj/us/mypg.-1.json | jq > content.json
This gives me the page as JSON.
Now I have made a small change to this change (just changed some text) and I would like to push this change into AEM again.
I tried the following:
echo content.json | curl -v -F":operation=import" -F":contentType=json" -F":contentFile=@-" -F":nameHint=testing" https://myhost/content/prodprj/us/mypg
But that returns a 409 with the following message:
<td>Status</td>
<td><div id="Status">409</div></td>
</tr>
<tr>
<td>Message</td>
<td><div id="Message">repository state conflicting with request</div></td>
</tr>
<tr>
<td>Location</td>
<td><a href="/content/prodprj/us/mypg" id="Location">/content/prodprj/us/mypg</a></td>
</tr>
<tr>
<td>Parent Location</td>
<td><a href="/content/prodprj/us" id="ParentLocation">/content/prodprj/us</a></td>
</tr>
<tr>
<td>Path</td>
<td><div id="Path">/content/prodprj/us/mypg</div></td>
</tr>
<tr>
<td>Referer</td>
<td><div id="Referer"></div></td>
</tr>
<tr>
<td>ChangeLog</td>
<td><div id="ChangeLog"><pre></pre></div></td>
</tr>
</tbody>
</table>
<p><a href="/content/prodprj/us/mypg">Modified Resource</a></p>
<p><a href="/content/prodprj/us">Parent of Modified Resource</a></p>
Does anyone know how to do this? Just export a page in JSON out of AEM, make a small change and then upload it again?
Solved! Go to Solution.
Views
Replies
Total Likes
The JSON Exporter is a delivery url to read AEM content. It doesn't allow write operation. In your case, its easier to open the page in edit mode and directly edit the page instead of XML ways.
But still if you want an XML way of editing, use the content.xml. So you ll, package the page, download the package, unzip, edit the content.xml inside package, rezip, and ship the package back into AEM.
Refer here for curl commands. Steps ll be
/content/prodprj/us/mypg
Or is it easier to do this with a content.xml file?
The JSON Exporter is a delivery url to read AEM content. It doesn't allow write operation. In your case, its easier to open the page in edit mode and directly edit the page instead of XML ways.
But still if you want an XML way of editing, use the content.xml. So you ll, package the page, download the package, unzip, edit the content.xml inside package, rezip, and ship the package back into AEM.
Refer here for curl commands. Steps ll be
/content/prodprj/us/mypg
Hi @bosschaert
You can use the Sling Post Servlet or the content importer service to get the updated json loaded in AEM. Please refer this article - https://blogs.perficient.com/2021/08/16/loading-json-content-into-aem/ for details.
Hope this helps!
Thanks
Narendra
Hi @bosschaert
You must be pushing the non-editable properties to AEM since those are imported as part of json. Can you try removing the other properties and just push the content property?
@bosschaert Just checking in — were you able to resolve your issue?
We’d love to hear how things worked out. If the suggestions above helped, marking a response as correct can guide others with similar questions. And if you found another solution, feel free to share it — your insights could really benefit the community. Thanks again for being part of the conversation!
Views
Replies
Total Likes
Views
Likes
Replies