Re: script selector when resource has no resourceType property

2009-01-07 Thread Bertrand Delacretaz
Hi,

On Sat, Jan 3, 2009 at 5:21 AM, Torgeir Veimo torg...@pobox.com wrote:
 ...Ok, I found the configuration for DefaultResourceTypeProvider. However,
 looking at the source for this component, it seem to be used only for node
 types of type nt:unstructured?...

That's correct, and maybe that check is not really needed - I don't
remember off the top of my head if that check really takes place after
all other possibilities for defining the resource type have been
exhausted.

You might want to try removing that check for nt:unstructured, and see
if the launchpad/testing tests still pass.

-Bertrand

 ...
 http://svn.apache.org/repos/asf/incubator/sling/trunk/samples/path-based-rtp/src/main/java/org/apache/sling/samples/pathbasedrtp/DefaultResourceTypeProvider.java...


Re: script selector when resource has no resourceType property

2009-01-07 Thread Felix Meschberger
Hmm, I should not write mails too fast 

Felix Meschberger schrieb:
 I have created https://issues.apache.org/jira/browse/SLING-815 to track
 this.

This issue is not related to this thrad. Sorry for the confusion.

Regards
Felix

 
 Regards
 Felix
 
 Bertrand Delacretaz schrieb:
 Hi,

 On Sat, Jan 3, 2009 at 5:21 AM, Torgeir Veimo torg...@pobox.com wrote:
 ...Ok, I found the configuration for DefaultResourceTypeProvider. However,
 looking at the source for this component, it seem to be used only for node
 types of type nt:unstructured?...
 That's correct, and maybe that check is not really needed - I don't
 remember off the top of my head if that check really takes place after
 all other possibilities for defining the resource type have been
 exhausted.

 You might want to try removing that check for nt:unstructured, and see
 if the launchpad/testing tests still pass.

 -Bertrand

 ...
 http://svn.apache.org/repos/asf/incubator/sling/trunk/samples/path-based-rtp/src/main/java/org/apache/sling/samples/pathbasedrtp/DefaultResourceTypeProvider.java...
 


Re: script selector when resource has no resourceType property

2009-01-07 Thread Bertrand Delacretaz
On Wed, Jan 7, 2009 at 2:00 PM, Torgeir Veimo torg...@pobox.com wrote:
 On 7 Jan 2009, at 22:25, Felix Meschberger wrote:
  * otherwise use primary node type
 Shouldn't node type determination be scriptable like other things in sling?

You could implement that in a custom JcrResourceTypeProvider that uses scripts.

That might be useful for legacy applications, but I'm not sure about
making that standard in Sling, that might make things much harder to
follow.

-Bertrand


Re: script selector when resource has no resourceType property

2009-01-02 Thread Torgeir Veimo


On 2 Jan 2009, at 18:44, Torgeir Veimo wrote:

Is it possible to use non-default scripts for resources that have no  
resourceType property?



According to http://dev.day.com/microsling/content/blogs/main/slingrequestprocessrevisited.html 
, requesting /content/notes.html should end up in executing the  
script /apps/notes/html.esp? It doesn't seem to happen in my setup  
with current sling trunk. (I get a Resource dumped by  
HtmlRendererServlet page).


If the selected resource has no special resource type a script will  
be looked up based on the content path. For example, the script for / 
content/corporate/jobs.html will be searched in /apps/corporate.


That sentence, if still correct, should probably be added to 
http://cwiki.apache.org/SLING/url-to-script-resolution.html

--
Torgeir Veimo
torg...@pobox.com






Re: script selector when resource has no resourceType property

2009-01-02 Thread Felix Meschberger
Hi,

Torgeir Veimo schrieb:
 
 On 2 Jan 2009, at 18:44, Torgeir Veimo wrote:
 
 Is it possible to use non-default scripts for resources that have no
 resourceType property?
 
 
 According to
 http://dev.day.com/microsling/content/blogs/main/slingrequestprocessrevisited.html,
 requesting /content/notes.html should end up in executing the script
 /apps/notes/html.esp? It doesn't seem to happen in my setup with current
 sling trunk. (I get a Resource dumped by HtmlRendererServlet page).
 
 If the selected resource has no special resource type a script will be
 looked up based on the content path. For example, the script for
 /content/corporate/jobs.html will be searched in /apps/corporate.

You have to make sure, the Sample Path Based Resource Type Provider
(samples/path-based-rtp) is installed.

 
 That sentence, if still correct, should probably be added to
 http://cwiki.apache.org/SLING/url-to-script-resolution.html
 

Yes, this is true.

Regards
Felix


Re: script selector when resource has no resourceType property

2009-01-02 Thread Torgeir Veimo


On 3 Jan 2009, at 05:07, Felix Meschberger wrote:

If the selected resource has no special resource type a script  
will be

looked up based on the content path. For example, the script for
/content/corporate/jobs.html will be searched in /apps/corporate.


You have to make sure, the Sample Path Based Resource Type Provider
(samples/path-based-rtp) is installed.


Ok, I found the configuration for DefaultResourceTypeProvider.  
However, looking at the source for this component, it seem to be used  
only for node types of type nt:unstructured?


http://svn.apache.org/repos/asf/incubator/sling/trunk/samples/path-based-rtp/src/main/java/org/apache/sling/samples/pathbasedrtp/DefaultResourceTypeProvider.java


--
Torgeir Veimo
torg...@pobox.com