cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeremy Quinn <>
Subject Re: Dojo paths problem
Date Wed, 07 Feb 2007 11:09:00 GMT

On 6 Feb 2007, at 13:06, Grzegorz Kossakowski wrote:

> Jeremy Quinn napisaƂ(a):
>> I think part of the problem is that I was unable to get the proper
>> sitemap glue working for Cocoon 2.2 as I was unable to run the  
>> samples.
>> This section in the root sitemap (same mechanism in 2.1.n) is  
>> designed
>> to handle dojo resources, allow you to register and serve your own
>> namespaces and override built-in libraries :
>> <snip/>
> The point is, while using servlet-service-fw there is *no* root  
> sitemap
> handling all request. Request are handled by dispatcher servlet,
> instead.

This is all news to me as I am not in a position ATM to even run 2.2

> Given that, resources of forms should be absolutely separated
> from ajax's ones.

They are separated ATM.

However the Forms block depends on the Ajax Block in terms of client- 
side resources.

There are two types of resource path :

Actual files (js, gif, css etc) that are served by a reader :
	_cocoon/resources/[namespace]/[file path]

And system resources that run a sitemap, accessing flowscript etc. :
	_cocoon/system/[namespace]/[url path]

> We should not assume there is some root context path
> and we can calculate all relative paths against it.

Dojo makes that assumption for you.
All paths in Dojo and 3rd party namespaces are relative to the  
location of dojo.js
This is going to be pretty complicated to work around, I suggest that  
you do not try as it will break at least 2.1.

2.2 and 2.1 may serve dojo.js from different paths, but all other  
resources must be /relative/ to those paths.

As you probably know, the client-side code for Forms and Ajax are  
shared between 2.1 and 2.2. Messing about with how Dojo generates  
paths for 2.2 will definitely break the client-side code for 2.1.

If you run FireBug while browsing the samples, you can easily see  
what paths are being requested.
If Dojo cannot find a resource the first time, it will start  
'hunting' for it using some basic rules (documented at their site).  
We ALWAYS want to supply a resource at the first location Dojo will  

> My latest patches remove this assumption but obviously breaks C2.1.
> Jemery, could you take a look at it and give your opinion if that
> changes could be incorporated into forms/ajax blocks and would not  
> break
> 2.1 somehow?
> Thanks.
> PS. Latest changes to servlet-service-fw break my patches (they  
> will not
> work anymore) but it could be easily fixed. I'm going to do it as soon
> as my Subclipse stops hanging on synchronization :(

I am sorry, but I have not had the time to review your patches.

That sitemap snippet I sent you hopefully gives you an idea about  
what paths need to be matched.
We should avoid changing the matched paths.
We should also provide the same mechanism for allowing local  
overrides of dojo, forms and ajax libs, as this is important during  
both development, testing and deployment.

Good Luck :)

regards Jeremy
View raw message