Latest Posts

Archives [+]

Categories [+]

Authors [+]

Sling Cheat Sheet

My approach to learning a new technology (or-relearning something that changed several times since I last spend time with it) is writing documentation. As I wanted to write a small Sling application using the newly released Apache Sling 1.0, I decided to create a one-page documentation of the Script-resolution process in Sling. This is the frontside of my cheat sheet. It shows you how to get from HTTP request to content node, from content node to resource type, from resource type to script and what scripting variables are available.

On the flipside of the cheat sheet I documented all the hidden, but powerful request parameters you can use when dealing with the SlingPostServlet, the default handler for all POST requests that gives you endless options for creating, modifying, deleting, copying and moving nodes in your repository.

Click on the thumbnails to get a high-resolution PDF version of either side (3,7 and 1,7 MB) or download the PDF version (300 KB) here.

 
(optional)
8 comments
Felix Meschberger
Felix Meschberger July 24, 2008 6:08 AM
Hi Lars,

Thanks for this ! Great thing. Just two things to note: (1) The resource type resolution does not fall back to sling:resourceSuperType if there is not sling:resourceType property. Instead it first tries a pluggable mechanism (nothing there by default) and finally uses the primary node type. The resource super type is only used in the next step of script resolution if the resource type is already known. (2) The functionality of the Sling POST Servlet is not really hidden. All the parameters are documented at http://incubator.apache.org/sling/site/manipulating-content-the-slingpostservlet.html
0 Replies » Reply
please find a CRX aware version here:

http://www.day.com/o.file/scriptrespatch.001-002.png?get=a5325cc3dba758c43d269a8b909c9028
0 Replies » Reply
hi Lars,
Thanks for the cheatsheet, very helpful!
cheers, Renaud
0 Replies » Reply
Very nice cheat sheet Lars.

I do have a question though... How would this defend against an attack? If a user were to say change some of the names of the fields in form then submit, would that in turn change your model that you expect in your repository?

Please understand that I haven't had a great deal to time to look into Sling, but it looks very interesting and would like to learn more.

Respectfully,
John
0 Replies » Reply
hi! Hello! i'm a beginner to work with all these things of the kind so i have lots of problems because all of my friends are not interested in it and i'm not a professional... but with your help i began to understand many things about how does it work! especially about this Sling. so thanx very much to you!
0 Replies » Reply
Loved the cheatsheet. Thamnks
0 Replies » Reply
Do a better accuracy.
0 Replies » Reply