Adobe-Consulting-Services/curly

Cannot add "jcr:content" using "Create Node" Action

Closed this issue · 1 comments

The default "Create a node" action has the following command:
-F _charset_=utf-8 -F :nameHint=node -F jcr:primaryType=${primary type|nt:unstructured} -F sling:resourceType=${resource type|project-A/components/abc-definition} ${server}${jcr path|/content}/${node name|new node}/

I have a requirement where the node name and title must be different.
for example: Node name=8458; Node title=New Age

Using -F jcr:title=${jcr title|some title} i am able to add the "jcr:title" to the new node but this is being added a new node with name "node" and not a "jcr:content" node.

screen shot 2018-01-19 at 3 55 00 pm

If we look at the folder structure (after creating and downloading as a package from AEM)

Correct behavior when a folder is created from UI
screen shot 2018-01-19 at 3 57 48 pm

Folders being created when using curly:
screen shot 2018-01-19 at 4 00 19 pm

Summary of Issues:

  1. Allow to add the node "jcr:content"
  2. If i replace "node" in -F :nameHint=node with "jcr:content" as -F :nameHint=jcr:content then a node with name "jcr_content" is created instead of "jcr:content"
  3. Instead of a new folder level being added, add "jcr:content" to ".content.xml"

The solution for this is as follows:

  1. Remove -F :nameHint=node
  2. Add /jcr:content at the end of sever path

Here's the updated cURL Command for action "Create a node"
-F _charset_=utf-8 -F jcr:primaryType=${primary type|nt:unstructured} -F sling:resourceType=${resource type|project-A/components/abc-definition} -F jcr:title=${jcr title|suren} ${server}${jcr path|/content}/${node name|new node}/jcr:content

Using this, creates the "jcr:content" node under each folder.