You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Nicolás Lichtmaier <ni...@reloco.com.ar> on 2006/03/21 16:31:31 UTC

Where are the JavaScript functions?

I'm trying to create an automatic form system (from some data we have) 
and thought cocoon was ideal (since it's all about automatically 
creating things). But it's sooo complex...

The form I've created has references to JavaScript functions, but I 
can't see anywhere in the docs where there's some hint to get them! Am I 
missing something?

The generated page has:

<body onload="forms_onload();">


and...

<form action="/prueba/fastbranch/1c1b4137606d593f404a7d6a3a43396549498509.continue"
ajax="false" method="POST" onsubmit="forms_onsubmit(); ">


Where are these functions? What is the clean way to get the proper 
script files included?

Thanks!


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


Re: Where are the JavaScript functions?

Posted by Bruno Dumon <br...@outerthought.org>.
On Wed, 2006-03-22 at 10:45 -0300, Nicolás Lichtmaier wrote:
> > In your sitemap.xmap, you need to include a matcher for the 
> > client-side javascript files. You should write something like this:
> >
> > <map:match pattern="resources/*/**">
> >  <map:read src="resource://org/apache/cocoon/{1}/resources/{2}"/>
> > </map:match>
> 
> I already have that in the sitemap. But there's no inclussion, no 
> <script src=""> tag. And there's no documentation about what I should 
> add and I can't find any such tag in the samples.
> 
> Should I add an inclussion of forms-lib.js by hand?

You need to have a <head> element in the XML that is processed by the
XSL (forms-samples-styling.xsl or equivalent). Otherwise the script and
css links won't be added.

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


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


Re: Where are the JavaScript functions?

Posted by Bruno Dumon <br...@outerthought.org>.
On Wed, 2006-03-22 at 10:45 -0300, Nicolás Lichtmaier wrote:
> > In your sitemap.xmap, you need to include a matcher for the 
> > client-side javascript files. You should write something like this:
> >
> > <map:match pattern="resources/*/**">
> >  <map:read src="resource://org/apache/cocoon/{1}/resources/{2}"/>
> > </map:match>
> 
> I already have that in the sitemap. But there's no inclussion, no 
> <script src=""> tag. And there's no documentation about what I should 
> add and I can't find any such tag in the samples.
> 
> Should I add an inclussion of forms-lib.js by hand?
> 
> Isn't all this very poorly documented? =/

BTW, I don't know if this covers your problem, but I just added a FAQ
for this:
http://cocoon.zones.apache.org/daisy/documentation/g4/1065.html

see also the new FAQ page on
http://cocoon.zones.apache.org/daisy/documentation/856.html
to which everyone's welcome to contribute

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


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


Re: Where are the JavaScript functions?

Posted by Jason Johnston <co...@lojjic.net>.
Nicolás Lichtmaier wrote:
> 
>> In your sitemap.xmap, you need to include a matcher for the
>> client-side javascript files. You should write something like this:
>>
>> <map:match pattern="resources/*/**">
>>  <map:read src="resource://org/apache/cocoon/{1}/resources/{2}"/>
>> </map:match>
> 
> I already have that in the sitemap. But there's no inclussion, no
> <script src=""> tag. And there's no documentation about what I should
> add and I can't find any such tag in the samples.

You'll notice that in all of the samples, they use a
forms-samples-styling.xsl stylesheet to convert the fi: elements to
HTML.  If you look at this stylesheet it delegates out to
forms-field-styling.xsl and forms-page-styling.xsl, calling templates
matching <head> and <body> with special modes.  It is in those templates
where the appropriate <script> elements are inserted.

> 
> Should I add an inclussion of forms-lib.js by hand?
> 
> Isn't all this very poorly documented? =/

Agreed.  It has gotten better though.
http://cocoon.apache.org/2.1/userdocs/publishing/xslt.html at least
describes the XSLT files and how to use them now, whereas you used to
have to just guess it from looking at the samples.

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


Re: Where are the JavaScript functions?

Posted by Nicolás Lichtmaier <ni...@reloco.com.ar>.
> In your sitemap.xmap, you need to include a matcher for the 
> client-side javascript files. You should write something like this:
>
> <map:match pattern="resources/*/**">
>  <map:read src="resource://org/apache/cocoon/{1}/resources/{2}"/>
> </map:match>

I already have that in the sitemap. But there's no inclussion, no 
<script src=""> tag. And there's no documentation about what I should 
add and I can't find any such tag in the samples.

Should I add an inclussion of forms-lib.js by hand?

Isn't all this very poorly documented? =/


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


Re: Where are the JavaScript functions?

Posted by Antonio Gallardo <ag...@agssa.net>.
Hello Nicolás,

In your sitemap.xmap, you need to include a matcher for the client-side 
javascript files. You should write something like this:

<map:match pattern="resources/*/**">
  <map:read src="resource://org/apache/cocoon/{1}/resources/{2}"/>
</map:match>


If you want to look at the source of this files:

http://svn.apache.org/viewcvs.cgi/cocoon/trunk/cocoon-forms/cocoon-forms-impl/src/main/java/org/apache/cocoon/forms/resources/js/

Best Regards,

Antonio Gallardo

Nicolás Lichtmaier wrote:

> I'm trying to create an automatic form system (from some data we have) 
> and thought cocoon was ideal (since it's all about automatically 
> creating things). But it's sooo complex...
>
> The form I've created has references to JavaScript functions, but I 
> can't see anywhere in the docs where there's some hint to get them! Am 
> I missing something?
>
> The generated page has:
>
> <body onload="forms_onload();">
>
>
> and...
>
> <form 
> action="/prueba/fastbranch/1c1b4137606d593f404a7d6a3a43396549498509.continue" 
>
> ajax="false" method="POST" onsubmit="forms_onsubmit(); ">
>
>
> Where are these functions? What is the clean way to get the proper 
> script files included?
>
> Thanks!
>
>
> ---------------------------------------------------------------------
> 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