cocoon-docs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@cocoon.apache.org
Subject [Cocoon Wiki] Updated: GroovyGetFormsParameters
Date Fri, 28 Jan 2005 09:57:35 GMT
   Date: 2005-01-28T01:57:35
   Editor: OlviierDemah
   Wiki: Cocoon Wiki
   Page: GroovyGetFormsParameters
   URL: http://wiki.apache.org/cocoon/GroovyGetFormsParameters

   no comment

Change Log:

------------------------------------------------------------------------------
@@ -3,78 +3,78 @@
 my form will be composed only with one field ; a select multiple ; to see how to get the
choosen values.
 
 the little piece of xsl :
-{{{
-<form action="fox.xml" method="post">
-   <fieldset><legend>Players</legend>
-       <select name="player_url_name[]" multiple="multiple">
-            <option value="Player1">The is the Player1</option><br/>
-            <option value="Player2">The is the Player2</option><br/>
-            <option value="Player3">The is the Player3</option><br/>
-            </select>
-    </fieldset>
-    <fieldset><legend>Valid</legend
-        <input type="submit" value="ok" name="valid"/>
-     </fieldset>
-</form>
+{{{
+<form action="fox.xml" method="post">
+   <fieldset><legend>Players</legend>
+       <select name="player_url_name[]" multiple="multiple">
+            <option value="Player1">The is the Player1</option><br/>
+            <option value="Player2">The is the Player2</option><br/>
+            <option value="Player3">The is the Player3</option><br/>
+            </select>
+    </fieldset>
+    <fieldset><legend>Valid</legend
+        <input type="submit" value="ok" name="valid"/>
+     </fieldset>
+</form>
 }}}
 
 
 the '''pipeline''' in the '''sitemap.xmap''' :
-{{{
-    <map:match pattern="fox.xml">
-        <map:generate type="script" src="fox.groovy"/>
-        <map:serialize type="xml"/>
-    </map:match>
+{{{
+    <map:match pattern="fox.xml">
+        <map:generate type="script" src="fox.groovy"/>
+        <map:serialize type="xml"/>
+    </map:match>
 }}}
 
 
 
 the groovy script '''fox.groovy''' : 
 
-{{{
-
-import org.apache.cocoon.environment.ObjectModelHelper
-
-import groovy.xml.SAXBuilder
-
-// get the parameters from the form
-objectModel = bsf.lookupBean("objectModel");
-request = ObjectModelHelper.getRequest(objectModel);
-
-player_url_name = request.getParameterValues("player_url_name[]");
-
-// Create a Groovy Builder which writes directly to
-// the Cocoon pipeline
-contentHandler = bsf.lookupBean("contentHandler")
-xml = new SAXBuilder(contentHandler)
-
-// Builder does not seem to call this
-contentHandler.startDocument()
-
-xml.root() {
-    foxyz() {
-        // loop in the array and make my appropriate node
-       for ( i in player_url_name ) {
-               player("${i}")
-
-        }
-    }
-}
-
-contentHandler.endDocument()
+{{{
+
+import org.apache.cocoon.environment.ObjectModelHelper
+
+import groovy.xml.SAXBuilder
+
+// get the parameters from the form
+objectModel = bsf.lookupBean("objectModel");
+request = ObjectModelHelper.getRequest(objectModel);
+
+player_url_name = request.getParameterValues("player_url_name[]");
+
+// Create a Groovy Builder which writes directly to
+// the Cocoon pipeline
+contentHandler = bsf.lookupBean("contentHandler")
+xml = new SAXBuilder(contentHandler)
+
+// Builder does not seem to call this
+contentHandler.startDocument()
+
+xml.root() {
+    foxyz() {
+        // loop in the array and make my appropriate node
+       for ( i in player_url_name ) {
+               player("${i}")
+
+        }
+    }
+}
+
+contentHandler.endDocument()
 }}}
 
 the generating '''xml output''' after choosing all the players :
 
-{{{
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<root>
- <foxyz>
-   <player>Player1</player>
-   <player>Player2</player>
-   <player>Player3</player>
- </foxyz>
-</root>
+{{{
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<root>
+ <foxyz>
+   <player>Player1</player>
+   <player>Player2</player>
+   <player>Player3</player>
+ </foxyz>
+</root>
 }}}
 
 ----
@@ -83,4 +83,4 @@
 
 -- [http://wiki.cocoondev.org/Wiki.jsp?page=OlivierDemah olivier demah] -- 
 
-[http://wiki.cocoondev.org/Wiki.jsp?page=GroovyWithSQLDatabaseAccess how to use Groovy with
SQL database access ?]
+[http://wiki.apache.org/cocoon/GroovyWithSQLDatabaseAccess how to use Groovy with SQL database
access ?]

Mime
View raw message