I should add that [1] is certainly not finalized as a patch since it
has some major issues with the way it needs to change core api's in a
non compatible way
I have been trying on and off to eliminate those problems (using a
SyntheticResource)... but at the moment so the best way of delivering
what is in 1023 at the moment is to use the /apps/sling/nonexisting/
POST.esp mechanism.
---------------------
Looking at [3], 2 things jump out.
1. On post @typeHint gives a hint for the type of a property, If when
posting to a non existing resource you could pick up the resource type
from the post sling:resourceType POST parameter would it be possible
to perform the servlet resolution appropriately. Ie its still a non
existing resource, but it gets routed to the correct servlet ?
2. (slightly off track) when posting to /content/new/* a path
generation algorithm kicks in, being able to configure that algorithm
might help with some of the virtual cases (probably should talk about
this in another thread)
Ian
On 29 Jul 2009, at 23:36, Alexander Klimetschek wrote:
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