forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bart Guijt" <>
Subject Re: Generating .js resources using .js.xslt stylesheets...?
Date Tue, 08 Jun 2004 19:28:42 GMT
From: "Nicola Ken Barozzi" <>
> Bart Guijt wrote:
> > Hi all,
> >
> > I am building a skin for my current assignment, a large bank in the
> > netherlands. Theire UI guidelines are very specific, and they use a
> > javascript file containing all menu data instead of using just html.
> In fact it's a clever way of minimizing network traffic without using
> frames.

It sure is -- however, it does making a skin which complies to the bank's
rules quite difficult!

> > I tried creating a stylesheet menu.js.xslt, which unfortunately only
> > after adapting the sitemap context/resources.xmap. More unfortunately,
> > stylesheet's source document is just the skinconf.xml used by the
> > stylesheets just to be sort-of 'compatible'.
> >
> > In the end, I don't get my menu.js resource as I would like (which is
> > simple code which initializes a large array with @href and @label
> > information). Nor do I like to fiddle with the resources.xmap file to
> > what I want.
> >
> Your post comes in an incredibly precise moment... we are discussing
> about access to project presentation metadata in skinconf, and here it's
> about content metadata!  Cool! :-)
> A quick solution to your problem is simply to make a pipeline that calls
> the aggregated cocoon content and work on that.
> Something like:
>        <map:match pattern="*.xslt.js">
>          <map:generate src="cocoon://abs-menulinks"/>
>          <map:transform
>     src="{forrest:context}/skins/{forrest:skin}/scripts/{0}.js.xslt"/>
>           <map:serialize type="text"
>                          mime-type="application/x-javascript"/>
>        </map:match>

Thanks, I used the cocoon://abs-menulinks as the source for the *.js.xslt
transformer as you suggested, and it does the job sufficiently well.

> ...
> > Or is a "**.js.xslt" matcher useful in the resources.xmap (generally
> > speaking, as in out-of-the box supported by Forrest) which uses another
> > document source (same as used by document2html)?
> It seems that the use of this metadata has to be given to all styling
> resources, being it because of FOP or because of javascript or whatever
> else. It will have to be implemented, although I still don't know how...

Can you elaborate? I admit I didn't follow Forrest development for a long
time, so I might be ignorant about what you are trying to express. To me it
seems that the suggested solution does the job well -- perhaps aggregating
other singleton-like sources (e.g. skinconf.xml) would be sufficient for
other javascript files as well, so this could be a standard out-of-the-box
feature of Forrest for all skins...

Bart Guijt

Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
Version: 6.0.701 / Virus Database: 458 - Release Date: 7-6-2004

View raw message