You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@cocoon.apache.org by do...@cocoon.apache.org on 2004/07/09 13:13:10 UTC
[Cocoon Wiki] Updated: FlowHelloWorld
Date: 2004-07-09T04:13:10
Editor: DerekLastname <dh...@csir.co.za>
Wiki: Cocoon Wiki
Page: FlowHelloWorld
URL: http://wiki.apache.org/cocoon/FlowHelloWorld
no comment
Change Log:
------------------------------------------------------------------------------
@@ -24,90 +24,90 @@
=== The Sitemap ===
The following code should be saved in a {{{sitemap.xmap}}} file in the {{{HelloFlow}}} directory.
-{{{
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- "Hello World" - a simple flow and jxt sample -->
-<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
-<map:components>
- <map:generators default="file">
-
- <!-- use JXTemplateGenerator to insert flow variables into page content -->
- <map:generator label="content,data" logger="sitemap.generator.jxt"
- name="jxt" src="org.apache.cocoon.generation.JXTemplateGenerator"/>
-
- </map:generators>
-
- <!-- handle the processing of any javascript -->
- <map:flow-interpreters default="JavaScript"/>
-
- <map:transformers default="xslt"/>
-
- <map:serializers default="html"/>
- <map:matchers default="wildcard"/>
- <map:selectors default="browser"/>
-
- <map:actions/>
- <map:pipes default="caching"/>
-</map:components>
-
-<map:views/>
-<map:resources/>
-<map:action-sets/>
-
-<map:flow language="javascript">
- <!-- Hello World will use the javascript functions defined in flow/hello.js -->
- <map:script src="flow/hello.js"/>
-</map:flow>
-
-<map:pipelines>
- <map:component-configurations>
- <global-variables/>
- </map:component-configurations>
-
- <map:pipeline>
-
- <!-- call the function hello() in flow/hello.js -->
- <map:match pattern="">
- <map:call function="hello"/>
- </map:match>
- <map:match pattern="hello">
- <map:call function="hello"/>
- </map:match>
-
- <!-- use JXtemplate to generate page content -->
- <map:match pattern="*.jxt">
- <map:generate type="jxt" src="documents/{1}.jxt"/>
- <map:serialize type="xhtml"/>
- </map:match>
-
- </map:pipeline>
-</map:pipelines>
-</map:sitemap>
+{{{
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- "Hello World" - a simple flow and jxt sample -->
+<map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
+<map:components>
+ <map:generators default="file">
+
+ <!-- use JXTemplateGenerator to insert flow variables into page content -->
+ <map:generator label="content,data" logger="sitemap.generator.jxt"
+ name="jxt" src="org.apache.cocoon.generation.JXTemplateGenerator"/>
+
+ </map:generators>
+
+ <!-- handle the processing of any javascript -->
+ <map:flow-interpreters default="JavaScript"/>
+
+ <map:transformers default="xslt"/>
+
+ <map:serializers default="html"/>
+ <map:matchers default="wildcard"/>
+ <map:selectors default="browser"/>
+
+ <map:actions/>
+ <map:pipes default="caching"/>
+</map:components>
+
+<map:views/>
+<map:resources/>
+<map:action-sets/>
+
+<map:flow language="javascript">
+ <!-- Hello World will use the javascript functions defined in flow/hello.js -->
+ <map:script src="flow/hello.js"/>
+</map:flow>
+
+<map:pipelines>
+ <map:component-configurations>
+ <global-variables/>
+ </map:component-configurations>
+
+ <map:pipeline>
+
+ <!-- call the function hello() in flow/hello.js -->
+ <map:match pattern="">
+ <map:call function="hello"/>
+ </map:match>
+ <map:match pattern="hello">
+ <map:call function="hello"/>
+ </map:match>
+
+ <!-- use JXtemplate to generate page content -->
+ <map:match pattern="*.jxt">
+ <map:generate type="jxt" src="documents/{1}.jxt"/>
+ <map:serialize type="xhtml"/>
+ </map:match>
+
+ </map:pipeline>
+</map:pipelines>
+</map:sitemap>
}}}
=== The Flow Script ===
The following code should be saved in a {{{hello.js}}} file in the {{{flow}}} directory.
-{{{
-function hello() {
- var name = "World";
- cocoon.sendPage("hello.jxt", {"name" : name} );
-}
+{{{
+function hello() {
+ var name = "World";
+ cocoon.sendPage("hello.jxt", {"name" : name} );
+}
}}}
=== The Generated Page ===
The following code should be saved in a {{{hello.jxt}}} file in the {{{documents}}} directory.
-{{{
-<?xml version="1.0"?>
-<html xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
-<head>
- <title>Cocoon Flow Hello World</title>
-</head>
-<body>
- <h1>Hello ${name}!</h1>
-</body>
-</html>
+{{{
+<?xml version="1.0"?>
+<html xmlns:jx="http://apache.org/cocoon/templates/jx/1.0">
+<head>
+ <title>Cocoon Flow Hello World</title>
+</head>
+<body>
+ <h1>Hello ${name}!</h1>
+</body>
+</html>
}}}
== What did we achieve? ==
@@ -120,8 +120,8 @@
== Links to other information sources ==
- * WhatisFlow?
- * GettingStartedwithFlow
+ * [:WhatIsFlow]?
+ * [:GettingStartedWithFlow]
----
=== page metadata ===