You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@cocoon.apache.org by fe...@apache.org on 2007/07/22 17:45:16 UTC

svn commit: r558499 - in /cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF: flow/xinha.js forms/xinha.xml forms/xinha_success.jx forms/xinha_template.xml sitemap.xmap welcome.xml

Author: felixk
Date: Sun Jul 22 08:45:16 2007
New Revision: 558499

URL: http://svn.apache.org/viewvc?view=rev&rev=558499
Log:
Add sample using Xinha as online html editor instead of HTMLArea

Added:
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/flow/xinha.js   (with props)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/xinha.xml   (with props)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/xinha_success.jx   (with props)
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/xinha_template.xml   (with props)
Modified:
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/sitemap.xmap
    cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/welcome.xml

Added: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/flow/xinha.js
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/flow/xinha.js?view=auto&rev=558499
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/flow/xinha.js (added)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/flow/xinha.js Sun Jul 22 08:45:16 2007
@@ -0,0 +1,30 @@
+/*
+* Licensed to the Apache Software Foundation (ASF) under one or more
+* contributor license agreements.  See the NOTICE file distributed with
+* this work for additional information regarding copyright ownership.
+* The ASF licenses this file to You under the Apache License, Version 2.0
+* (the "License"); you may not use this file except in compliance with
+* the License.  You may obtain a copy of the License at
+*
+*     http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+cocoon.load("servlet:forms:/resource/internal/flow/javascript/Form.js");
+
+function xinha() {
+    var form = new Form("forms/xinha.xml");
+
+    form.showForm("xinha-display-pipeline");
+
+    var model = form.getModel();
+    var htmldata = { 
+                      "data1" : model.data1,
+                      "data2" : new Packages.org.apache.cocoon.xml.StringXMLizable(model.data2)
+                   }
+    cocoon.sendPage("xinha-success-pipeline", htmldata);
+}

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/flow/xinha.js
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/xinha.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/xinha.xml?view=auto&rev=558499
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/xinha.xml (added)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/xinha.xml Sun Jul 22 08:45:16 2007
@@ -0,0 +1,34 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<fd:form
+  xmlns:fd="http://apache.org/cocoon/forms/1.0#definition"
+  xmlns:i18n="http://apache.org/cocoon/i18n/2.1">
+
+  <fd:widgets>
+    <fd:field id="data1">
+      <fd:label>in div; configuration within cForms template</fd:label>
+      <fd:datatype base="string"/>
+    </fd:field>    
+    <fd:field id="data2">
+      <fd:label>in a table</fd:label>
+      <fd:datatype base="string">
+        <fd:convertor type="htmlcleaner" config="resource://org/apache/cocoon/forms/datatype/convertor/HtmlCleanerConfiguration.xml"/>
+      </fd:datatype>
+    </fd:field>
+  </fd:widgets>
+</fd:form>

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/xinha.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/xinha_success.jx
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/xinha_success.jx?view=auto&rev=558499
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/xinha_success.jx (added)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/xinha_success.jx Sun Jul 22 08:45:16 2007
@@ -0,0 +1,21 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<result>
+  <data1>#{data1}</data1>
+  <data2>#{data2}</data2>
+</result>

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/xinha_success.jx
------------------------------------------------------------------------------
    svn:eol-style = native

Added: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/xinha_template.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/xinha_template.xml?view=auto&rev=558499
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/xinha_template.xml (added)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/xinha_template.xml Sun Jul 22 08:45:16 2007
@@ -0,0 +1,78 @@
+<?xml version="1.0"?>
+<!--
+  Licensed to the Apache Software Foundation (ASF) under one or more
+  contributor license agreements.  See the NOTICE file distributed with
+  this work for additional information regarding copyright ownership.
+  The ASF licenses this file to You under the Apache License, Version 2.0
+  (the "License"); you may not use this file except in compliance with
+  the License.  You may obtain a copy of the License at
+
+      http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+-->
+<page xmlns:ft="http://apache.org/cocoon/forms/1.0#template"
+      xmlns:fi="http://apache.org/cocoon/forms/1.0#instance">
+  <h4 class="samplesGroup">Xinha widget</h4>
+  <title>Xinha</title>
+  <content>
+    <ft:form-template action="#{$cocoon/continuation/id}.continue" method="POST">
+      <div style="width:500px">
+        <ft:widget-label id="data1"/><br/>
+        <ft:widget id="data1">
+          <fi:styling type="xinha" rows="8" style="width:100%">
+            <!-- at this place, the configuration property of the Xinha is under 'conf'
+                 available. Find more info about the available properties at
+                 http://xinha.python-hosting.com/wiki/Documentation/ConfigVariablesList -->
+            <conf>
+              conf.statusBar = false;
+              conf.sizeIncludesBars = false;
+              conf.fullPage = false;
+              conf.toolbar = [
+                ["popupeditor"],
+                ["separator","formatblock","fontname","fontsize","bold","italic","underline","strikethrough"],
+                ["separator","forecolor","hilitecolor","textindicator"],
+                ["separator","subscript","superscript"],
+                ["linebreak","separator","justifyleft","justifycenter","justifyright","justifyfull"],
+                ["separator","insertorderedlist","insertunorderedlist","outdent","indent"],
+                ["separator","inserthorizontalrule","createlink","insertimage","inserttable"],
+                ["separator","htmlmode","showhelp","about"]
+              ];               
+              conf.fontsize = {
+                "&amp;mdash; size &amp;mdash;": "",
+                "1 (8 pt)" : "1",
+                "2 (10 pt)": "2",
+                "3 (12 pt)": "3"
+              };            
+            </conf>
+          </fi:styling>
+        </ft:widget>
+      </div>
+      <p/>
+      <table border="1">
+        <tr>
+          <td><ft:widget-label id="data2"/></td>
+        </tr>
+        <tr>
+          <td>
+            <ft:widget id="data2">
+              <fi:styling type="xinha" rows="8" cols="70">
+                <!-- if you add initFunction, make sure that it is available at the browser -->
+                <!--initFunction>myInit</initFunction-->
+              </fi:styling>
+            </ft:widget>
+          </td>
+        </tr>
+      </table>
+      <p/>
+      <input type="submit"/>      
+    </ft:form-template>
+    <p>
+      <a href="./">Back to Forms samples</a>
+    </p>
+  </content>
+</page>

Propchange: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/forms/xinha_template.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/sitemap.xmap
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/sitemap.xmap?view=diff&rev=558499&r1=558498&r2=558499
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/sitemap.xmap (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/sitemap.xmap Sun Jul 22 08:45:16 2007
@@ -100,6 +100,7 @@
     <map:script src="flow/bindings.js" />
     <map:script src="flow/form_model_gui.js" />
     <map:script src="flow/htmlarea.js" />
+    <map:script src="flow/xinha.js" />
   </map:flow>
 
   <!-- =========================== Pipelines =================================== -->
@@ -114,6 +115,10 @@
           <map:parameter name="service" value="servlet:style-default:/service/common/simple-samples2html" />
         </map:serialize>
       </map:match>
+      
+      <map:match pattern="sitemap.xmap">
+        <map:read src="sitemap.xmap"/>
+      </map:match>
 
       <!--
         | "Form1" example, demonstrates all kinds of features
@@ -501,6 +506,34 @@
 
       <map:match pattern="htmlarea-success-pipeline">
         <map:generate type="jx" src="forms/htmlarea_success.jx" />
+        <map:serialize type="xml" />
+      </map:match>
+
+      <!--
+        | XINHA example
+      -->
+
+      <map:match pattern="xinha">
+        <map:call function="xinha" />
+      </map:match>
+
+      <map:match pattern="xinha-display-pipeline">
+        <map:generate src="forms/xinha_template.xml" />
+        <map:transform type="forms" />
+        <map:transform type="i18n">
+          <!--map:parameter name="locale" value="en-US"/-->
+        </map:transform>
+        <map:transform src="servlet:style-default:/common/style/xsl/html/simple-page2html.xsl" />
+        <map:transform src="resources/forms-samples-styling.xsl">
+          <map:parameter name="dojo-resources" value="{servlet:ajax:/resource/external/dojo}" />
+          <map:parameter name="forms-resources" value="{servlet:forms:/resource/external/forms}" />
+        </map:transform>
+        <map:transform type="servletLinkRewriter" />
+        <map:serialize />
+      </map:match>
+
+      <map:match pattern="xinha-success-pipeline">
+        <map:generate type="jx" src="forms/xinha_success.jx" />
         <map:serialize type="xml" />
       </map:match>
 

Modified: cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/welcome.xml
URL: http://svn.apache.org/viewvc/cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/welcome.xml?view=diff&rev=558499&r1=558498&r2=558499
==============================================================================
--- cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/welcome.xml (original)
+++ cocoon/trunk/blocks/cocoon-forms/cocoon-forms-sample/src/main/resources/COB-INF/welcome.xml Sun Jul 22 08:45:16 2007
@@ -43,7 +43,8 @@
   <sample name="Country selector" href="countryselector">Illustrates programmatically changing flow-jxpath selectionlists.</sample>
   <sample name="Upload" href="upload">Shows an upload widget used with Flowscript</sample>
   <sample name="Form Model GUI" href="form_model_gui.flow">Illustrates the use of Class, New, Struct, and Union.</sample>
-  <sample name="HTMLArea" href="htmlarea">A simple form using the HTML editor widget.</sample>
+  <sample name="HTMLArea" href="htmlarea">A simple form using the HTML editor widget (deprecated, use <a href="xinha">Xinha</a> instead).</sample>
+  <sample name="Xinha" href="xinha">A simple form using the Xinha editor widget.</sample>
   <sample name="Aggregate" href="aggregate/example">Aggregate field examples</sample>
   <sample name="Multipage wizard" href="do-multipage.flow">(Ajax) A multipage wizard, using widget states and actions to move between pages.</sample>
   <sample name="CAPTCHA validation" href="captcha/">CAPTCHA validation (requires <a href="/samples/blocks/batik/">Batik block</a>)</sample>