...
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 |
...
- https://cwiki.apache.org/SLING/scripting-variables.html
- https://cwiki.apache.org/SLING/url-to-script-resolution.html
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 | { |