Latest Posts

Archives [+]

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.

 

COMMENTS

  • By Felix Meschberger - 12:08 PM on Jul 24, 2008   Reply
    Hi Lars,<br/><br/>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
  • By Renaud Richardet - 8:00 AM on Sep 05, 2008   Reply
    hi Lars,<br/>Thanks for the cheatsheet, very helpful!<br/>cheers, Renaud
  • By John - 4:23 PM on Nov 04, 2008   Reply
    Very nice cheat sheet Lars. <br/><br/> 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?<br/><br/>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. <br/><br/>Respectfully,<br/>John
  • By Jamie Moon - 6:38 AM on May 16, 2011   Reply
    I'm learning out Sling & JackRabbit(S&JR) for commerical project.
    I hope it will help me a lot to understand S&JR more.
  • By trx - 11:21 AM on May 13, 2013   Reply
    thank for your sharing,i like it very much!