cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lars Huttar <lars_hut...@sil.org>
Subject Re: how to make DENG work in Cocoon?
Date Thu, 18 May 2006 15:37:18 GMT
james strong wrote:
> Hi Mr. Lars Huttar,
>
> I am a computer science student in Singapore, very interested in 
> Cocoon and XForms technology.
>
> After reading your article 
> http://wiki.apache.org/cocoon/XFormsInCocoon, i tried to make DENG 
> work in Cocoon, but it seemed that i failed to insert the two files: 
> deng_test.swf and .xhtml into the object section in a pipeline?
>
> You wrote: "Make sure you also put pipelines in your sitemap to serve 
> requests for (a) and (b).", could you please take a minute and explain 
> me how you did that? I would very appreciate any of your reply.
>
> best regards,
>
> James Wong
>
>
Hello,

Glad to hear of your interest in XForms in Cocoon.
The paragraph you're asking about says (I'll paste it here so I can see 
it):

    *

      It's pretty easy to generate the necessary code from Cocoon. You
      just generate an HTML page that contains an <object> tag; the
      latter has URLs for (a) the deng_test.swf renderer file on your
      server, and (b) the XForms XML document you want to use. Make sure
      you also put pipelines in your sitemap to serve requests for (a)
      and (b).

So, the <object> tag is in an HTML page. Let's look at the example 
http://claus.packts.net/deng/deng_test.php?f=examples/xforms/textarea.html&debug=1
Point your browser to it and View Source. You'll see the <object> tag, 
and inside, it has two references to (a):

	<param name="movie" value="deng_test.swf">
and	<EMBED src="deng_test.swf" ...>
So the URL for (a) is "deng_test.swf". Note this is relative to the URL of the HTML page that
the <object> appears in (so the full URL would be
"http://claus.packts.net/deng/deng_test.swf").

There are also two references to (b):
	<param name="FlashVars" value="d=0&filename=examples/xforms/textarea.html&debug=1">
	<EMBED ... FlashVars="d=0&filename=examples/xforms/textarea.html&debug=1" >
So the URL for (b) is "examples/xforms/textarea.html". Again, this is relative to the URL
of the HTML page that the <object> appears in, so the full URL would be "http://claus.packts.net/deng/examples/xforms/textarea.html"
(try it).


All of the above is generally true for Deng; now we get to the Cocoon-specific part. You need
to provide a pipeline to serve the URL "deng_test.swf" and a pipeline to serve the URL "examples/xforms/textarea.html".
The simplest way to do this is to copy deng_test.swf into the folder that your sitemap is
in, and add a match pattern to your sitemap like
			<map:match pattern="deng*.swf">
				<map:read src="deng{1}.swf" mime-type="application/x-shockwave-flash" />
			</map:match>

Then put your xform file on disk at examples\xform\textarea.html (relative to your sitemap),
and add a match pattern like:
			<map:match pattern="**.html">
				<map:read src="{1}.html" mime-type="text/html" />
			</map:match>


Hope this helps. If you have further questions, feel free to ask.
Lars



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


Mime
View raw message