Importing a JSON page in AEM using curl
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?
