Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

It's time to make our "Hello world" in Apache Sling. 
Open a console and simply launch the next command:

curl -F"sling:resourceType=foo/bar" -F"title=Hello world" http://admin:admin@localhost:8080/content/myfirstnode

Code Block
curl -F"sling:resourceType=foo/bar" -F"title=Hello world" http://admin:admin@localhost:8080/content/myfirstnode

...

Content loading

You can setup some initial contents that can be used in your application. It is a useful thing, because with a simple configuration you have some nodes already created when your application starts.

In David there are two different nodes created when you deploy your application: /content/david and /content/tags .

These nodes are defined in the application folders, using a JSON format.

Let's examine the definition of /content/david node:

1 2 3 4 5 6

{
"name": "david",
"primaryNodeType": "nt:unstructured",
"sling:resourceType": "david",
"jcr:primaryType": "nt:unstructured"
}