Well the way I've been doing that is to add a hidden input field to the html
form that sets the jcr:primaryType property of the child node.  If the child
node doesn't exist it gets created automatically.

For example:
      <!-- also create child node for extra stuff -->
      <input type="hidden" name="widgets/jcr:primaryType"
value="nt:unstructured" />


On Tue, Aug 25, 2009 at 12:54 PM, Branden Visser <bran...@uwindsor.ca>wrote:

> Eric Norman wrote:
>
>> Can you just create the widgets node at the same time you create the page
>> node?  You can do that in the POST that creates the page or use a JCR
>> event
>> listener to listen for page creation events.
>>
>>
> How do I do that in the POST that creates the page?
>
> Thanks,
>
> Branden
>
>
>  On Aug 25, 2009 12:26 PM, "Branden Visser" <bran...@uwindsor.ca> wrote:
>>
>> Alexander Klimetschek wrote: > > On Tue, Aug 25, 2009 at 7:19 PM, Branden
>> Visser<bran...@uwindsor.ca...
>> Maybe this is would be bad design, but to me it makes sense to first and
>> foremost find the deepest resolvable resource before the first '.', rather
>> than rely on a dot or the full URL to tell it where the resource should
>> be.
>>
>> One use case I have (which is why I've been trying to extract a suffix
>> from
>> this) is that I have a content structure like so:
>>
>> .../pages/home/widgets/hello_world
>>
>> Where 'home' is of type 'portal/page', and was created by a user.
>>
>> When the 'home' page is created, somehow that 'widgets' directory needs to
>> be created. So, if I try and access the list of widgets that belong to the
>> 'home' page, I can do:
>>
>> .../pages/home/widgets.html
>>
>> If the /widgets folder doesn't exist yet, I have a GET.esp file that maps
>> to
>> 'portal/page' type that can create the subdirectory for me (verifying that
>> this is what the request is looking for, of course), then do a
>> sling.include(.../pages/home/widgets.html) to transparently fill in the
>> structure.
>>
>> If anyone has a better way to accomplish this without using suffix, I am
>> all
>> ears (eyes?) :-)
>>
>> Thanks,
>> Branden
>>
>>  c) the second part is separated into selectors (in between dots) > d)
>>> last
>>>
>> dot-separated part is...
>>
>>

Reply via email to