You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Andre Juffer <aj...@sun3.oulu.fi> on 2008/02/19 21:52:51 UTC

dojo and ajax: missing resource

Hi all,

As cocoon offers support for Dojo, I have been trying to use some of the 
Dojo widgets (see http://dojotoolkit.org/book/dojo-book-1-0). I am 
encountering an exception of the form:

org.apache.excalibur.source.SourceNotFoundException: 
resource://org/apache/cocoon/dojo/resources/__package__.js

This is employed by a sitemap.xmap that is apparently generated on the 
fly (when running 'mvn jetty:run') and placed in 
../target/work/blocks/cocoon-ajax-impl/sitemap.xmap. This sitemap has a 
pipeline for the resource __package__.js that is requested for when the 
browser loads HTML containing

<script src="/cocoon-ajax-impl/resource/external/dojo/dojo.js" 
type="text/javascript"></script>

In the my own sitemap, I have somewhere

<map:match pattern="**dojo.js">
  <map:read mime-type="text/javascript" 
src="servlet:ajax:/resource/external/dojo/dojo.js" />
</map:match>

If I load dojo.js directly from 
"http://o.aolcdn.com/dojo/1.0.0/dojo/dojo.xd.js", the form works exactly 
right and there are no further problems. It is probably better you rely 
on the cocoon ajax/dojo framework, as I was trying.

Can somebody point out whether or not I need another jar (extra 
dependency in pom.xml). I was looking for something like 
cocoon-dojo-impl but could not immediately find it on 
http://repo1.maven.org/maven2/org/apache/cocoon/

Thanks,
Andre

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


Re: dojo and ajax: missing resource

Posted by Andre Juffer <An...@oulu.fi>.
Hi Jeroen,

thanks for your reply.

Jeroen Reijn wrote:
> Hi Andre,
> 
> Currently Cocoon 2.2 uses dojo-0.4.3. I guess that's where your problem
> comes from.

Actually, I just used whatever comes with cocoon. One can of course 
include Dojo directly from its source (at http://o.aolcdn.com/), but I 
get the exception when I do -not- use anything from o.aolcdn.com. So, 
this would be an internal problem with cocoon/dojo-0.4.3.

> There have been some discussion on how to upgrade cocoon
> forms to dojo 1.0, but this has not been realized yet. As far as I can
> see right now the dojo is encapsulated in the cocoon-ajax-impl jar.

If one is just interested in the widgets, one can still use cocoon's 
cform mechanism with a definition, binding, template, while using dojo 
1.0. I made a simple stylesheet to add dojoType attributes to input form 
types etc and this seems to work quite fine, as Dojo 1.0 is employed 
only on the client site and not used to call the server. I would need to 
do more testing of course. Whether or not this would go well cocoon's 
ajax implementation when doing an asynchronous call remains to be seen.

> 
> Sorry I could not have been of more help.

Thanks anyway,
Andre

> 
> Regards,
> 
> Jeroen Reijn
> 
> -----Original Message-----
> From: Andre Juffer [mailto:ajuffer@sun3.oulu.fi] 
> Sent: Tuesday, February 19, 2008 9:53 PM
> To: Cocoon Users
> Subject: dojo and ajax: missing resource
> 
> Hi all,
> 
> As cocoon offers support for Dojo, I have been trying to use some of the
> 
> Dojo widgets (see http://dojotoolkit.org/book/dojo-book-1-0). I am 
> encountering an exception of the form:
> 
> org.apache.excalibur.source.SourceNotFoundException: 
> resource://org/apache/cocoon/dojo/resources/__package__.js
> 
> This is employed by a sitemap.xmap that is apparently generated on the 
> fly (when running 'mvn jetty:run') and placed in 
> ../target/work/blocks/cocoon-ajax-impl/sitemap.xmap. This sitemap has a 
> pipeline for the resource __package__.js that is requested for when the 
> browser loads HTML containing
> 
> <script src="/cocoon-ajax-impl/resource/external/dojo/dojo.js" 
> type="text/javascript"></script>
> 
> In the my own sitemap, I have somewhere
> 
> <map:match pattern="**dojo.js">
>   <map:read mime-type="text/javascript" 
> src="servlet:ajax:/resource/external/dojo/dojo.js" />
> </map:match>
> 
> If I load dojo.js directly from 
> "http://o.aolcdn.com/dojo/1.0.0/dojo/dojo.xd.js", the form works exactly
> 
> right and there are no further problems. It is probably better you rely 
> on the cocoon ajax/dojo framework, as I was trying.
> 
> Can somebody point out whether or not I need another jar (extra 
> dependency in pom.xml). I was looking for something like 
> cocoon-dojo-impl but could not immediately find it on 
> http://repo1.maven.org/maven2/org/apache/cocoon/
> 
> Thanks,
> Andre
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 


-- 
Andre H. Juffer              | Phone: +358-8-553 1161
The Biocenter and            | Fax: +358-8-553-1141
     the Dep. of Biochemistry | Email: Andre.Juffer@oulu.fi
University of Oulu, Finland  | WWW: www.biochem.oulu.fi/Biocomputing/
NordProt                     | WWW: www.nordprot.org

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


RE: dojo and ajax: missing resource

Posted by Jeroen Reijn <j....@hippo.nl>.
Hi Andre,

Currently Cocoon 2.2 uses dojo-0.4.3. I guess that's where your problem
comes from. There have been some discussion on how to upgrade cocoon
forms to dojo 1.0, but this has not been realized yet. As far as I can
see right now the dojo is encapsulated in the cocoon-ajax-impl jar.

Sorry I could not have been of more help.

Regards,

Jeroen Reijn

-----Original Message-----
From: Andre Juffer [mailto:ajuffer@sun3.oulu.fi] 
Sent: Tuesday, February 19, 2008 9:53 PM
To: Cocoon Users
Subject: dojo and ajax: missing resource

Hi all,

As cocoon offers support for Dojo, I have been trying to use some of the

Dojo widgets (see http://dojotoolkit.org/book/dojo-book-1-0). I am 
encountering an exception of the form:

org.apache.excalibur.source.SourceNotFoundException: 
resource://org/apache/cocoon/dojo/resources/__package__.js

This is employed by a sitemap.xmap that is apparently generated on the 
fly (when running 'mvn jetty:run') and placed in 
../target/work/blocks/cocoon-ajax-impl/sitemap.xmap. This sitemap has a 
pipeline for the resource __package__.js that is requested for when the 
browser loads HTML containing

<script src="/cocoon-ajax-impl/resource/external/dojo/dojo.js" 
type="text/javascript"></script>

In the my own sitemap, I have somewhere

<map:match pattern="**dojo.js">
  <map:read mime-type="text/javascript" 
src="servlet:ajax:/resource/external/dojo/dojo.js" />
</map:match>

If I load dojo.js directly from 
"http://o.aolcdn.com/dojo/1.0.0/dojo/dojo.xd.js", the form works exactly

right and there are no further problems. It is probably better you rely 
on the cocoon ajax/dojo framework, as I was trying.

Can somebody point out whether or not I need another jar (extra 
dependency in pom.xml). I was looking for something like 
cocoon-dojo-impl but could not immediately find it on 
http://repo1.maven.org/maven2/org/apache/cocoon/

Thanks,
Andre

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


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