I have registered a couple of custom nodetypes with corresponding
rendering scripts html.jsp in the appropriate folder. Now I'd like to
include a few simple forms to create that node type (re-using as much
existing functionality as possible). What is the best way to do this?
I had a few ideas: (assume I have a nodetype test:Widget with a display
script /apps/test/Widget/html.jsp)
1) Create "form" nodes (/forms/Widget/create)
a) use sling:resourceType="form:Widget"
b) register a script /apps/form/Widget/html.jsp that generates an
HTML form (and uses the SlingPostServlet to create the content)
2) Create an "empty" Widget node (/content/Widget/new)
a) use jcr:primaryResourceType="test:Widget"
b) register a script with a "create" selector
apps/test/Widget/create.html.jsp that generates the HTML form
I assume I could also register new servlets by paths, and then either
directly create content or somehow forward to the SlingPostServlet. In
all cases where I use the SlingPostServlet, what's the best way to
handle failures or errors?