You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by hussayn <hu...@saxess.com> on 2008/08/18 23:27:11 UTC

Howto use Dojo "standalone" with cocoon ? (does that make sense at all?)

Hi;

I working on a project, for which i want to use cocon-2.2. In parts of my
work, i want to utilize dojo. But i hesitate to also start learning
cocoon-forms in first place. So i consider to just use Dojo "besides" 
cocoon itself, but inside my cocoon-based application. So my questions are:

- Is it better to download Dojo and place it into a subdirectory inside my
cocon-block, 
or is it better to get it into my block via dependency entries in the .pom
file of my block ?
 
- Once the dojo-distribution is placed into a subfolder of my block, 
how can i then access the dojo components inside my cocoon-generated pages ? 
(How do i have to write the url's to the dojo-scripts?)

- Do i have to add a sitemap entry for the dojo-subfolder, which simply
returns erverything under the dojo-folder verbatim ? Or is there another
method available, e.g. tell cocoon to serve parts of the directory structure
like a web server wihtout further processing ?

I just am completely unsure, what would be the best practice approach. So
some hints would be very much appreciated. a small fully working example
would also help a lot.

thanks a lot for any hint.
regards,
hussayn
-- 
View this message in context: http://www.nabble.com/Howto-use-Dojo-%22standalone%22-with-cocoon---%28does-that-make-sense-at-all-%29-tp19040317p19040317.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Howto use Dojo "standalone" with cocoon ? (does that make senseat all?)

Posted by Derek Hohls <DH...@csir.co.za>.
Alessandro

Why not add this page to the Cocoon Wiki; its then
readily accessible (and findable) by all?

>>> On 2008/08/20 at 08:46, in message <48...@alessandro.vincelli.name>, Alessandro Vincelli <av...@alessandro.vincelli.name> wrote:
Hussayn i'm working on a similar task.
I created a simple block that contains the latest version of the dojo 
toolkit.
You can get the code and some simple documentation on this page:
http://devel.alessandro.vincelli.name/item/30.html 
Let me know
Alessandro

hussayn wrote:
> Hi, Grzegorz
>
> thank you for your in depth response. You have pointed me to a whole lot of
> information snippets,
> but now my central question is: Where do i have to place what ?
> It would already help to find something (tutorial/documentation/faq) that
> tells me in simple worlds,
> how i have to "add a ready made block to my application". From that i can
> then derive, how to add the ajax-features into my block (or besides it,
> whatever...)
>
> something like the following list... (just a guess, i might be completely
> wrong): 
>
> 1.) download the ajax-block and place it adjacent to your existing block
> 2.) install your new block in maven repository
> 3.) go to your block and add a dependency to the ajax-block there
> 4.) go to your application context file and ...
> 5.) ...
>
> Isn't there a document, that explains such thing ? i am overlooking it ?
> sorry for beeing so unknowing and not able to see, how it works. i am sure,
> it is trivial, i just dont see it... (maybe i have to look into the
> cocoon-2.1 docs ?)
> so, thank you  in advance for any further explanation. 
>
> best regards,
> hussayn
>   




-- 
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. 
The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, 
and is believed to be clean.  MailScanner thanks Transtec Computers for their support.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Howto use Dojo "standalone" with cocoon ? (does that make sense at all?)

Posted by Alessandro Vincelli <av...@alessandro.vincelli.name>.
hussayn wrote:
> Hi, Alessandro;
>
> Thank you very much for your hint. This was exactly what i needed in order
> to
> get one step further (ok, several steps further ;-)
> I just checked out your svn repository and tested your dojo-block.
> It all worked like a charm, except one small detail:
>
> The link you published on your description page seems to be incorrect in two
> ways:
>
> 1.) It looks like one additional "/dojo" is missing in the url? I got it to
> work with:
>
>      http://localhost:8888/dojo/resource/external/dojo/dojo/dojo.js
>
> 2.) When i click on the published link on your website (where you write
> ..."Point you browser on ..."), 
>      i get directed to http://localhost:8888/cocoon22-auth/
>      which is probably not, what you wanted ...
>
> One additional tip: If you point your browser to:
>
>    
> http://localhost:8888/dojo/resource/external/dojo/dojo/tests/runTests.html
>
> Then the dojo self test is called and executed. Maybe thats what you should
> publish
> instead of the link above ? What could you show better, than
> a 100% green dojo-self test page served by cocoon ;-)))))
>   
Thank for your tips, I changed the links.
> (Although cocoon complains about missing resources and actually there seems
> to be
> a language dependency in the tests, which causes some dojo tests to fail due
> to different
> number formats... but this is probably something unrelated with cocoon)
>
> I will now start integrating this block with my own block. Now i think,
> things are working
> for me ;-)))  thanks again (also to Grzegorz for the additional links!) BTW:
> i'd like to use all this 
> material for our next video tutorial... Any complains ?
>   
I published this code in order to share this kind of skills, no problem 
if you use this.

Bye, Alessandro
> regards,
> hussayn
>
>
> Alessandro Vincelli wrote:
>   
>> Hussayn i'm working on a similar task.
>> I created a simple block that contains the latest version of the dojo 
>> toolkit.
>> You can get the code and some simple documentation on this page:
>> http://devel.alessandro.vincelli.name/item/30.html
>> Let me know
>> Alessandro 
>>     
>
>   


Re: Howto use Dojo "standalone" with cocoon ? (does that make sense at all?)

Posted by hussayn <hu...@saxess.com>.
Hi, Alessandro;

Thank you very much for your hint. This was exactly what i needed in order
to
get one step further (ok, several steps further ;-)
I just checked out your svn repository and tested your dojo-block.
It all worked like a charm, except one small detail:

The link you published on your description page seems to be incorrect in two
ways:

1.) It looks like one additional "/dojo" is missing in the url? I got it to
work with:

     http://localhost:8888/dojo/resource/external/dojo/dojo/dojo.js

2.) When i click on the published link on your website (where you write
..."Point you browser on ..."), 
     i get directed to http://localhost:8888/cocoon22-auth/
     which is probably not, what you wanted ...

One additional tip: If you point your browser to:

   
http://localhost:8888/dojo/resource/external/dojo/dojo/tests/runTests.html

Then the dojo self test is called and executed. Maybe thats what you should
publish
instead of the link above ? What could you show better, than
a 100% green dojo-self test page served by cocoon ;-)))))

(Although cocoon complains about missing resources and actually there seems
to be
a language dependency in the tests, which causes some dojo tests to fail due
to different
number formats... but this is probably something unrelated with cocoon)

I will now start integrating this block with my own block. Now i think,
things are working
for me ;-)))  thanks again (also to Grzegorz for the additional links!) BTW:
i'd like to use all this 
material for our next video tutorial... Any complains ?

regards,
hussayn


Alessandro Vincelli wrote:
> 
> Hussayn i'm working on a similar task.
> I created a simple block that contains the latest version of the dojo 
> toolkit.
> You can get the code and some simple documentation on this page:
> http://devel.alessandro.vincelli.name/item/30.html
> Let me know
> Alessandro 

-- 
View this message in context: http://www.nabble.com/Howto-use-Dojo-%22standalone%22-with-cocoon---%28does-that-make-sense-at-all-%29-tp19040317p19077014.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Howto use Dojo "standalone" with cocoon ? (does that make sense at all?)

Posted by Alessandro Vincelli <av...@alessandro.vincelli.name>.
> Hi again;
>
> I just managed to connect your dojo block with my own block.
> It basically worked as you described. But there where two pitfalls,
> which missleaded me in first place:
>
> 1.) In order to use mvn, the dojo block must be installed, before it can be
> used from my own block.
> So i had to type the command   "mvn install". This installs the dojho block
> as jar-file into the local
> mvn repository, so that the dependency entry in my pom.xml can be
> resolved...
>   
It' correct, I added this step to the document page.
> 2.) Somewhere on your webpage you say:
> ...
> Then create a connection on your servlet  as below, see the file
> block-servlet-service.xml:
> ...
>
> There you present a bean snippet. In first place it is not obvious to a
> beginner, that 
> it is only necessary to add the <servlet:connections> subsnippet right into
> the allready existing 
> <servlet:context>. So i had to explicitly copy the following snippet into my
> bloock-servlet-service.xml:
>
> <servlet:connections>
>     <entry key="dojo" value-ref="org.deals.cocoon.dojo.service"/>
> </servlet:connections>
>   
Strange, In the web page I have already posted the complete bean definition.

> After i understood that detail, i could again "mvn jetty:run" my own block
> and now both blocks live together in perfect harmony ;-)
>
> thanks again for your very valuable input!
> regards,
> Hussayn
>   

You welcome. But i think that in Cocoon 2.2 it's really easy share and 
use applications. The use of spring, maven together with the cocoon 
architecture is really formidable.
We can do a very good software with cocoon 2.2.
Alessandro

Re: Howto use Dojo "standalone" with cocoon ? (does that make sense at all?)

Posted by Tak-po Li <ta...@gmail.com>.
Problem was raised by Hussayn's email:
*how can i force a serialiser to generate a </close>-tag even if the body is
empty ?*
2 days ago.  I am sorry I did not notice it.

Tak



On 8/28/08, Tak-po Li <ta...@gmail.com> wrote:
>
>
> Alessandro, I found that your work on dojo block is quite useful.  Thank
> you.  I believe both cocoon-ajex and cocoon-form are not yet released
> blocks.  Please put your work into wiki that can benefit more people.
>
> Hussayn, thank you for posting your experience of "pitfalls" fixing that
> helps me put dojo into cocoon.  Following your (and Alessandro's)
> instructions, I can run both dojo test and welcome screen (from myBlock1
> of getting-start-tutorial) independently.  However, when I put the <script
> ... /> into welcome.xstl, nothing shows up.  The following is from
> view/source of Firefox:
>
> <?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
> <html><head><title>Apache Cocoon: Welcome!</title><script src="servlet:dojo:/resource/external/dojo/dojo/dojo.js" type="text/javascript" /></head><body><h1>Apache Cocoon: Welcome</h1><p>This block <strong>com.mycompany:myBlock1</strong> was created by the Cocoon block archetype.</p><p /><p><a href="spring-bean">Link</a> to the output of a simple Flowscript that accesses a Spring bean.</p></body></html>
>
> Could anyone help?  Thanks,
>
> Tak
>
>
>
>
>
> On 8/25/08, hussayn <hu...@saxess.com> wrote:
>>
>>
>>
>>
>> Alessandro Vincelli wrote:
>> >
>> > Hussayn i'm working on a similar task.
>> > I created a simple block that contains the latest version of the dojo
>> > toolkit.
>> > You can get the code and some simple documentation on this page:
>> > http://devel.alessandro.vincelli.name/item/30.html
>> > Let me know
>> > Alessandro
>> >
>>
>> Hi again;
>>
>> I just managed to connect your dojo block with my own block.
>> It basically worked as you described. But there where two pitfalls,
>> which missleaded me in first place:
>>
>> 1.) In order to use mvn, the dojo block must be installed, before it can
>> be
>> used from my own block.
>> So i had to type the command   "mvn install". This installs the dojho
>> block
>> as jar-file into the local
>> mvn repository, so that the dependency entry in my pom.xml can be
>> resolved...
>>
>> 2.) Somewhere on your webpage you say:
>> ...
>> Then create a connection on your servlet  as below, see the file
>> block-servlet-service.xml:
>> ...
>>
>> There you present a bean snippet. In first place it is not obvious to a
>> beginner, that
>> it is only necessary to add the <servlet:connections> subsnippet right
>> into
>> the allready existing
>> <servlet:context>. So i had to explicitly copy the following snippet into
>> my
>> bloock-servlet-service.xml:
>>
>> <servlet:connections>
>>    <entry key="dojo" value-ref="org.deals.cocoon.dojo.service"/>
>> </servlet:connections>
>>
>> After i understood that detail, i could again "mvn jetty:run" my own block
>> and now both blocks live together in perfect harmony ;-)
>>
>> thanks again for your very valuable input!
>> regards,
>> Hussayn
>> --
>> View this message in context:
>> http://www.nabble.com/Howto-use-Dojo-%22standalone%22-with-cocoon---%28does-that-make-sense-at-all-%29-tp19040317p19149913.html
>> Sent from the Cocoon - Users mailing list archive at Nabble.com.
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>> For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>

Re: Howto use Dojo "standalone" with cocoon ? (does that make sense at all?)

Posted by Alessandro Vincelli <av...@alessandro.vincelli.name>.
Tak-po Li wrote:
>  
> Alessandro, I found that your work on dojo block is quite useful.  
> Thank you.  I believe both cocoon-ajex and cocoon-form are not yet 
> released blocks.  Please put your work into wiki that can benefit more 
> people.
>  

You are not the first that ask this. Ok, I will put this work in the 
wiki in the next days.
Alessandro

Re: Howto use Dojo "standalone" with cocoon ? (does that make sense at all?)

Posted by Tak-po Li <ta...@gmail.com>.
Alessandro, I found that your work on dojo block is quite useful.  Thank
you.  I believe both cocoon-ajex and cocoon-form are not yet released
blocks.  Please put your work into wiki that can benefit more people.

Hussayn, thank you for posting your experience of "pitfalls" fixing that
helps me put dojo into cocoon.  Following your (and Alessandro's)
instructions, I can run both dojo test and welcome screen (from myBlock1 of
getting-start-tutorial) independently.  However, when I put the <script ...
/> into welcome.xstl, nothing shows up.  The following is from view/source
of Firefox:

<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC
"-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html><head><title>Apache Cocoon: Welcome!</title><script
src="servlet:dojo:/resource/external/dojo/dojo/dojo.js"
type="text/javascript" /></head><body><h1>Apache Cocoon:
Welcome</h1><p>This block <strong>com.mycompany:myBlock1</strong> was
created by the Cocoon block archetype.</p><p /><p><a
href="spring-bean">Link</a> to the output of a simple Flowscript that
accesses a Spring bean.</p></body></html>

Could anyone help?  Thanks,

Tak





On 8/25/08, hussayn <hu...@saxess.com> wrote:
>
>
>
>
> Alessandro Vincelli wrote:
> >
> > Hussayn i'm working on a similar task.
> > I created a simple block that contains the latest version of the dojo
> > toolkit.
> > You can get the code and some simple documentation on this page:
> > http://devel.alessandro.vincelli.name/item/30.html
> > Let me know
> > Alessandro
> >
>
> Hi again;
>
> I just managed to connect your dojo block with my own block.
> It basically worked as you described. But there where two pitfalls,
> which missleaded me in first place:
>
> 1.) In order to use mvn, the dojo block must be installed, before it can be
> used from my own block.
> So i had to type the command   "mvn install". This installs the dojho block
> as jar-file into the local
> mvn repository, so that the dependency entry in my pom.xml can be
> resolved...
>
> 2.) Somewhere on your webpage you say:
> ...
> Then create a connection on your servlet  as below, see the file
> block-servlet-service.xml:
> ...
>
> There you present a bean snippet. In first place it is not obvious to a
> beginner, that
> it is only necessary to add the <servlet:connections> subsnippet right into
> the allready existing
> <servlet:context>. So i had to explicitly copy the following snippet into
> my
> bloock-servlet-service.xml:
>
> <servlet:connections>
>    <entry key="dojo" value-ref="org.deals.cocoon.dojo.service"/>
> </servlet:connections>
>
> After i understood that detail, i could again "mvn jetty:run" my own block
> and now both blocks live together in perfect harmony ;-)
>
> thanks again for your very valuable input!
> regards,
> Hussayn
> --
> View this message in context:
> http://www.nabble.com/Howto-use-Dojo-%22standalone%22-with-cocoon---%28does-that-make-sense-at-all-%29-tp19040317p19149913.html
> Sent from the Cocoon - Users mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Re: Howto use Dojo "standalone" with cocoon ? (does that make sense at all?)

Posted by hussayn <hu...@saxess.com>.


Alessandro Vincelli wrote:
> 
> Hussayn i'm working on a similar task.
> I created a simple block that contains the latest version of the dojo 
> toolkit.
> You can get the code and some simple documentation on this page:
> http://devel.alessandro.vincelli.name/item/30.html
> Let me know
> Alessandro
> 

Hi again;

I just managed to connect your dojo block with my own block.
It basically worked as you described. But there where two pitfalls,
which missleaded me in first place:

1.) In order to use mvn, the dojo block must be installed, before it can be
used from my own block.
So i had to type the command   "mvn install". This installs the dojho block
as jar-file into the local
mvn repository, so that the dependency entry in my pom.xml can be
resolved...

2.) Somewhere on your webpage you say:
...
Then create a connection on your servlet  as below, see the file
block-servlet-service.xml:
...

There you present a bean snippet. In first place it is not obvious to a
beginner, that 
it is only necessary to add the <servlet:connections> subsnippet right into
the allready existing 
<servlet:context>. So i had to explicitly copy the following snippet into my
bloock-servlet-service.xml:

<servlet:connections>
    <entry key="dojo" value-ref="org.deals.cocoon.dojo.service"/>
</servlet:connections>

After i understood that detail, i could again "mvn jetty:run" my own block
and now both blocks live together in perfect harmony ;-)

thanks again for your very valuable input!
regards,
Hussayn
-- 
View this message in context: http://www.nabble.com/Howto-use-Dojo-%22standalone%22-with-cocoon---%28does-that-make-sense-at-all-%29-tp19040317p19149913.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Howto use Dojo "standalone" with cocoon ? (does that make sense at all?)

Posted by Alessandro Vincelli <av...@alessandro.vincelli.name>.
Hussayn i'm working on a similar task.
I created a simple block that contains the latest version of the dojo 
toolkit.
You can get the code and some simple documentation on this page:
http://devel.alessandro.vincelli.name/item/30.html
Let me know
Alessandro

hussayn wrote:
> Hi, Grzegorz
>
> thank you for your in depth response. You have pointed me to a whole lot of
> information snippets,
> but now my central question is: Where do i have to place what ?
> It would already help to find something (tutorial/documentation/faq) that
> tells me in simple worlds,
> how i have to "add a ready made block to my application". From that i can
> then derive, how to add the ajax-features into my block (or besides it,
> whatever...)
>
> something like the following list... (just a guess, i might be completely
> wrong): 
>
> 1.) download the ajax-block and place it adjacent to your existing block
> 2.) install your new block in maven repository
> 3.) go to your block and add a dependency to the ajax-block there
> 4.) go to your application context file and ...
> 5.) ...
>
> Isn't there a document, that explains such thing ? i am overlooking it ?
> sorry for beeing so unknowing and not able to see, how it works. i am sure,
> it is trivial, i just dont see it... (maybe i have to look into the
> cocoon-2.1 docs ?)
> so, thank you  in advance for any further explanation. 
>
> best regards,
> hussayn
>   



Re: Howto use Dojo "standalone" with cocoon ? (does that make sense at all?)

Posted by hussayn <hu...@saxess.com>.
Hi, Grzegorz

thank you for your in depth response. You have pointed me to a whole lot of
information snippets,
but now my central question is: Where do i have to place what ?
It would already help to find something (tutorial/documentation/faq) that
tells me in simple worlds,
how i have to "add a ready made block to my application". From that i can
then derive, how to add the ajax-features into my block (or besides it,
whatever...)

something like the following list... (just a guess, i might be completely
wrong): 

1.) download the ajax-block and place it adjacent to your existing block
2.) install your new block in maven repository
3.) go to your block and add a dependency to the ajax-block there
4.) go to your application context file and ...
5.) ...

Isn't there a document, that explains such thing ? i am overlooking it ?
sorry for beeing so unknowing and not able to see, how it works. i am sure,
it is trivial, i just dont see it... (maybe i have to look into the
cocoon-2.1 docs ?)
so, thank you  in advance for any further explanation. 

best regards,
hussayn
-- 
View this message in context: http://www.nabble.com/Howto-use-Dojo-%22standalone%22-with-cocoon---%28does-that-make-sense-at-all-%29-tp19040317p19074757.html
Sent from the Cocoon - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Howto use Dojo "standalone" with cocoon ? (does that make sense at all?)

Posted by Grzegorz Kossakowski <gr...@tuffmail.com>.
hussayn pisze:
> Hi;
> 
> I working on a project, for which i want to use cocon-2.2. In parts of my
> work, i want to utilize dojo. But i hesitate to also start learning
> cocoon-forms in first place. So i consider to just use Dojo "besides" 
> cocoon itself, but inside my cocoon-based application. So my questions are:
> 
> - Is it better to download Dojo and place it into a subdirectory inside my
> cocon-block, 
> or is it better to get it into my block via dependency entries in the .pom
> file of my block ?

The best would be probably to create separate block that will contain Dojo distribution and serve 
dojo resources from there.

Then you could depend on that block from your main block and have things separated nicely.

Actually, this is already done in Cocoon, we have cocoon-ajax-block[1].

> - Once the dojo-distribution is placed into a subfolder of my block, 
> how can i then access the dojo components inside my cocoon-generated pages ? 
> (How do i have to write the url's to the dojo-scripts?)

The best idea would be to use servlet: protocol for this purpose the same way as Ajax block samples 
are doing it.

For example, there is a page[2] in Ajax samples that wants to reference dojo.js, then it will use 
following construct:
<script type="text/javascript" src="servlet:ajax:/resource/external/dojo/dojo.js"/>

This should be read as "I want resource from servlet (thus servlet: protocol is used) that I'm 
connected to using connection name "ajax" and resources path is /resource/external/dojo/dojo.js".

Now let's have a look at connections definitions[3]:
   <bean name="org.apache.cocoon.ajax.sample.servlet" class="org.apache.cocoon.sitemap.SitemapServlet">
     <servlet:context mount-path="/samples/ajax" context-path="blockcontext:/cocoon-ajax-sample/">
       <servlet:connections>
         <entry key="ajax" value-ref="org.apache.cocoon.ajax.impl.servlet"/>
         <entry key="style-default" value-ref="org.apache.cocoon.samples.style.default.servlet"/>
       </servlet:connections>
     </servlet:context>
   </bean>

As you can see, "ajax" connection refers to org.apache.cocoon.ajax.impl.servlet which is defined in 
cocoon-ajax-impl block. Let's have a look at it's definition[4]:
   <bean name="org.apache.cocoon.ajax.impl.servlet" class="org.apache.cocoon.sitemap.SitemapServlet">
     <servlet:context mount-path="/cocoon-ajax-impl" context-path="blockcontext:/cocoon-ajax-impl/"/>
   </bean>

The most important thing here is that this servlet is instance of SitemapServlet which means that 
resources loading is handled by sitemap in cocoon-ajax-impl block.

So to summarize: when you say servlet:ajax:/resource/external/dojo/dojo.js you ask sitemap defined 
in cocoon-ajax-impl block to serve this resource.

Of course, browsers don't understand servlet: protocol so it must be resolved to proper URL. This is 
done by servletLinkRewriter transformer in sitemap[5] of Ajax sample block:
       <map:match pattern="*.html">
         <map:generate type="jx" src="{1}.xml" />
         <map:call resource="simple-page2html" />
         <map:transform type="servletLinkRewriter" label="content" />
         <map:serialize type="html" />
       </map:match>

This is the cleanest way to do it even if at the beginning may sound little bit complicated but 
using this technique you can be sure that URLs are always correct.

> - Do i have to add a sitemap entry for the dojo-subfolder, which simply
> returns erverything under the dojo-folder verbatim ? Or is there another
> method available, e.g. tell cocoon to serve parts of the directory structure
> like a web server wihtout further processing ?

Look at cocoon-ajax-impl block. It uses map:read along with pattern matching. This way you can serve 
everything from the folder you choose.

Actually, in cocoon-ajax-impl resources are being served using resource: protocol (so they are read 
from classpath). I suggest to just put Dojo resources into resource/external directory of your block 
so you can use already defined pipeline for serving this resources.

> I just am completely unsure, what would be the best practice approach. So
> some hints would be very much appreciated. a small fully working example
> would also help a lot.

I hope that my explanation help you a little bit.

[1] http://svn.eu.apache.org/viewvc/cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/
[2] 
http://svn.eu.apache.org/viewvc/cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-sample/src/main/resources/COB-INF/linked-updater.xml?view=markup
[3] 
http://svn.eu.apache.org/viewvc/cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-sample/src/main/resources/META-INF/cocoon/spring/cocoon-ajax-sample-blockServlet.xml?view=markup
[4] 
http://svn.eu.apache.org/viewvc/cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/META-INF/cocoon/spring/cocoon-ajax-impl-blockServlet.xml?view=markup
[5] 
http://svn.eu.apache.org/viewvc/cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-sample/src/main/resources/COB-INF/sitemap.xmap?view=markup

-- 
Grzegorz Kossakowski

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org