On 27 Jul 2010, at 13:59, Ian Boston wrote:
>
> On 27 Jul 2010, at 13:38, Justin Edelson wrote:
>
>> Ian-
>> I'm not near a Sling working copy right now, but have you looked at using
>> the NodeNameGenerator interface? I added it to solve a similar use case.
>
> Will do,
> thanks for the pointer.
> Ian
>
>
Yes that generates a node where a post is performed to a URL ending / or *,
which would be Ok except that the SlingFileUploadServlet is hard bound to
creating a file of the name specified in the file upload field, rather than the
parent which the NodeNameGenerator can supply
eg
currently
multipart file upload to /pool/ or /pool/*
would generate a path of /pool/<generatedname>
and then SlingFileUploadServlet would create
/pool/<generatedname>
- jcr:primaryType = nt:folder
/<post-file-name>
- jcr:primaryType = nt:file
etc
I need
/pool/<generatedname>
- jcr:primaryType = nt:file
I have created a servlet at /system/pool/createfile which doesn't implement all
the the sling protocol, but will do for the moment. (its Ugly).
The alternative would be to modify the SlingFileUploadServlet to use a
NodeNameGenerator implementation to create a sub path rather than always
relying on the name provided in the file upload.
Ian