You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Rice Yeh <ri...@gmail.com> on 2007/05/02 19:46:55 UTC

How to do dojo.registerModulePath without directly modifying forms-field-styling.xsl

Hi,
  I have a bock which provides some widgets based on dojo. Now, my problem
is how to do dojo.registerModulePath without directly modifying
forms-field-styling.xsl?

Regards,
Rice

Re: How to do dojo.registerModulePath without directly modifying forms-field-styling.xsl

Posted by Rice Yeh <ri...@gmail.com>.
On 5/4/07, Rice Yeh <ri...@gmail.com> wrote:
>
> On 5/3/07, Grzegorz Kossakowski <gk...@apache.org> wrote:
> >
> > Rice Yeh napisał(a):
> > > Your answer seems to be what I need. But I am confused with how
> > > 'servlet://' in dojo.registerModulePath("cocoon.ajax",
> > > "servlet://resource/external/ajax/js") in manifest.js is translated?
> >
> > It is translated by servletLinkRewriter reader. Take a look at this
> > sitemap to see how it's done:
> >
> > https://svn.apache.org/repos/asf/cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/COB-INF/sitemap.xmap
>
>
> What about a script statement in a .jx file like this one
>
> <script language="text/javascript" src="servlet:commons:xs/manifest.js"/>
>
> Is there a transformer for link rewriting?
>

Yes, there is one. I find an example at
https://svn.apache.org/repos/asf/cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-sample/src/main/resources/COB-INF/sitemap.xmap<https://svn.apache.org/repos/asf/cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/COB-INF/sitemap.xmap>

Rice

Rice
>
> Basically you don't need to bother what will be result of rewriting, all
> > you have to now that servlet://** link will be
> > seen by sitemap matching such a request as {1}.
> >
> > --
> > Grzegorz Kossakowski
> >
> >
>

Re: How to do dojo.registerModulePath without directly modifying forms-field-styling.xsl

Posted by Rice Yeh <ri...@gmail.com>.
On 5/3/07, Grzegorz Kossakowski <gk...@apache.org> wrote:
>
> Rice Yeh napisał(a):
> > Your answer seems to be what I need. But I am confused with how
> > 'servlet://' in dojo.registerModulePath("cocoon.ajax",
> > "servlet://resource/external/ajax/js") in manifest.js is translated?
>
> It is translated by servletLinkRewriter reader. Take a look at this
> sitemap to see how it's done:
>
> https://svn.apache.org/repos/asf/cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/COB-INF/sitemap.xmap


What about a script statement in a .jx file like this one

<script language="text/javascript" src="servlet:commons:xs/manifest.js"/>

Is there a transformer for link rewriting?

Rice

Basically you don't need to bother what will be result of rewriting, all you
> have to now that servlet://** link will be
> seen by sitemap matching such a request as {1}.
>
> --
> Grzegorz Kossakowski
>
>

Re: How to do dojo.registerModulePath without directly modifying forms-field-styling.xsl

Posted by Grzegorz Kossakowski <gk...@apache.org>.
Rice Yeh napisał(a):
> Your answer seems to be what I need. But I am confused with how
> 'servlet://' in dojo.registerModulePath("cocoon.ajax",
> "servlet://resource/external/ajax/js") in manifest.js is translated?

It is translated by servletLinkRewriter reader. Take a look at this sitemap to see how it's done:
https://svn.apache.org/repos/asf/cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/COB-INF/sitemap.xmap

Basically you don't need to bother what will be result of rewriting, all you have to now that servlet://** link will be
seen by sitemap matching such a request as {1}.

-- 
Grzegorz Kossakowski


Re: How to do dojo.registerModulePath without directly modifying forms-field-styling.xsl

Posted by Rice Yeh <ri...@gmail.com>.
Your answer seems to be what I need. But I am confused with how 'servlet://'
in dojo.registerModulePath("cocoon.ajax",
"servlet://resource/external/ajax/js") in manifest.js is translated?

Rice

On 5/3/07, Grzegorz Kossakowski <gk...@apache.org> wrote:
>
> Rice Yeh napisał(a):
> > Hi,
> > I have a bock which provides some widgets based on dojo. Now, my
> > problem is how to do dojo.registerModulePath without directly
> > modifying forms-field-styling.xsl?
> I do not understand your question. Why do you need to modify
> forms-field-styling.xsl? To register your widgets make manifest.js file
> for your own block and reference it from HTML file you produce. Here you
> have example manifest:
>
> http://svn.apache.org/repos/asf/cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/manifest.js
>
> --
> Grzegorz Kossakowski
>

Re: How to do dojo.registerModulePath without directly modifying forms-field-styling.xsl

Posted by Grzegorz Kossakowski <gk...@apache.org>.
Rice Yeh napisał(a):
> Hi,
> I have a bock which provides some widgets based on dojo. Now, my 
> problem is how to do dojo.registerModulePath without directly 
> modifying forms-field-styling.xsl?
I do not understand your question. Why do you need to modify 
forms-field-styling.xsl? To register your widgets make manifest.js file 
for your own block and reference it from HTML file you produce. Here you 
have example manifest:
http://svn.apache.org/repos/asf/cocoon/trunk/blocks/cocoon-ajax/cocoon-ajax-impl/src/main/resources/org/apache/cocoon/ajax/resources/manifest.js

-- 
Grzegorz Kossakowski