On Wed, Jul 29, 2009 at 4:07 PM, Oliver Pfeiffer<oliver.pfeif...@icip.ch> wrote:
> 3. Now I want to add a new blog-entry:
> with "content/homepage/blog/*.edit.html" I would like to call
> "/apps/homepage/blog/edit.html.eps" as well. Unfortunately Sling will
> look for the "edit.html.eps"-script unter "apps/homepage" (which I don't
> know why exactly) and not "/apps/homepage/blog".
> How could I define the "sling:resourceType" for the new ressource, so that I
> can use the same "edit.html.eps"-file for edit and insert?

For non-existent resources the case is a bit different: as Sling
cannot know what the resource type is (and guessing by parent path is
too fragile), Sling will resolve the resource with the type
"sling:nonexisting" (NonExistingResource class). Therefore scripts or
servlets that should handle that must be registered under
/apps/sling/nonexisting/POST.esp. And note that this will be the same
script for all kinds of non-existent resources.  See [1] and [2] for
some ideas/manual solutions on how to improve that use case.

For content-creation (from a browser) the "standard" Sling way is to
use normal HTML forms + the Sling post servlet and a
SlingPostOperation or SlingPostProcessor for any additional
server-side handling of the post [3].

[1] https://issues.apache.org/jira/browse/SLING-1023
[2] http://markmail.org/message/52m32zh36ewo4xl2
[3] 
http://sling.apache.org/site/manipulating-content-the-slingpostservlet-servletspost.html

Regards,
Alex

-- 
Alexander Klimetschek
alexander.klimetsc...@day.com

Reply via email to