| <?xml version="1.0"?> |
| |
| <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0"> |
| |
| <map:components> |
| |
| <map:generators default="file"> |
| <map:generator name="woody" src="org.apache.cocoon.woody.generation.WoodyGenerator" logger="woody"/> |
| <map:generator name="jx" src="org.apache.cocoon.generation.JXTemplateGenerator" label="content" logger="sitemap.generator.jx"/> |
| </map:generators> |
| |
| <map:transformers default="xalan"> |
| <map:transformer name="woody" src="org.apache.cocoon.woody.transformation.WoodyTemplateTransformer" logger="woody"/> |
| <map:transformer name="i18n" src="org.apache.cocoon.transformation.I18nTransformer"> |
| <catalogues default="other"> |
| <catalogue id="other" name="OtherMessages" location="messages"/> |
| <catalogue id="woody" name="WoodyMessages" location="messages"/> |
| </catalogues> |
| <cache-at-startup>true</cache-at-startup> |
| </map:transformer> |
| </map:transformers> |
| |
| <map:selectors default="browser"> |
| <map:selector name="request-method" src="org.apache.cocoon.selection.RequestMethodSelector"/> |
| </map:selectors> |
| |
| <map:actions> |
| <map:action name="woody-make-form" src="org.apache.cocoon.woody.acting.MakeFormAction" logger="woody"/> |
| <map:action name="init-form1" src="org.apache.cocoon.woody.samples.InitForm1Action" logger="woody"/> |
| <map:action name="woody-handle-form-submit" src="org.apache.cocoon.woody.acting.HandleFormSubmitAction" logger="woody"/> |
| </map:actions> |
| |
| <map:pipes default="caching"> |
| </map:pipes> |
| |
| </map:components> |
| |
| <map:views> |
| <map:view name="content" from-label="content"> |
| <map:serialize type="xml"/> |
| </map:view> |
| |
| <map:view from-label="content" name="pretty-content"> |
| <map:transform src="context://stylesheets/system/xml2html.xslt"/> |
| <map:serialize type="html"/> |
| </map:view> |
| |
| <map:view name="links" from-position="last"> |
| <map:serialize type="links"/> |
| </map:view> |
| </map:views> |
| |
| <map:resources> |
| <!-- this will later become a virtual transformer --> |
| <map:resource name="simple-page2html"> |
| <map:transform src="context://samples/common/style/xsl/html/simple-page2html.xsl"> |
| <map:parameter name="contextPath" value="{request:contextPath}"/> |
| <map:parameter name="servletPath" value="{request:servletPath}"/> |
| <map:parameter name="sitemapURI" value="{request:sitemapURI}"/> |
| <map:parameter name="file" value="{file}"/> |
| <map:parameter name="remove" value="{../0}"/> |
| </map:transform> |
| </map:resource> |
| </map:resources> |
| |
| <!-- indicates what flowscript to attach to this sitemap --> |
| <map:flow language="javascript"> |
| <map:script src="flow/woody_flow_example.js"/> |
| <map:script src="flow/binding_example.js"/> |
| <map:script src="flow/upload_example.js"/> |
| <map:script src="flow/registration.js"/> |
| <map:script src="flow/customvalidationdemo.js"/> |
| <map:script src="flow/bindings.js"/> |
| <map:script src="flow/form_model_gui.js"/> |
| <map:script src="flow/htmlarea.js"/> |
| </map:flow> |
| |
| <map:pipelines> |
| <map:pipeline> |
| |
| <map:match pattern=""> |
| <map:generate src="welcome.xml"/> |
| <map:transform src="context://samples/common/style/xsl/html/simple-samples2html.xsl"> |
| <map:parameter name="contextPath" value="{request:contextPath}"/> |
| </map:transform> |
| <map:serialize/> |
| </map:match> |
| |
| <!-- |
| | "Form1" example, demonstrates all kinds of features |
| --> |
| <map:match pattern="form1"> |
| <!-- Here we use the HTTP method, GET or POST, to make distinction between |
| the initial form display and a form submit. In both cases the same publishing |
| pipeline will be used, which is below the selector. --> |
| <map:select type="request-method"> |
| <map:when test="GET"> |
| <!-- Here we use an action especially created for the "form1" example |
| which will initialise the form with some data. --> |
| <map:act type="init-form1"> |
| <map:parameter name="form-definition" value="forms/form1.xml"/> |
| <map:parameter name="attribute-name" value="form1"/> |
| </map:act> |
| </map:when> |
| <map:when test="POST"> |
| <map:act type="woody-handle-form-submit"> |
| <map:parameter name="form-definition" value="forms/form1.xml"/> |
| <map:parameter name="attribute-name" value="form1"/> |
| <map:parameter name="formhandler" value="org.apache.cocoon.woody.samples.Form1Handler"/> |
| |
| <!-- the content of this action is only executed in case validation |
| succeeded, thus if the form handling is completed --> |
| <map:generate type="serverpages" src="forms/form1_success.xsp"/> |
| <map:call resource="simple-page2html"> |
| <map:parameter name="file" value="forms/form1_success.xsp"/> |
| </map:call> |
| <map:serialize/> |
| </map:act> |
| </map:when> |
| <map:otherwise> |
| <!-- todo: do something here --> |
| </map:otherwise> |
| </map:select> |
| |
| <!-- pipeline to show the form --> |
| <map:generate src="forms/form1_template_action.xml"/> |
| <map:transform type="woody"> |
| <map:parameter name="attribute-name" value="form1"/> |
| </map:transform> |
| <map:transform type="i18n"> |
| <map:parameter name="locale" value="en-US"/> |
| </map:transform> |
| <map:call resource="simple-page2html"> |
| <map:parameter name="file" value="forms/form1_success.xsp"/> |
| </map:call> |
| <map:transform type="i18n"> |
| <map:parameter name="locale" value="en-US"/> |
| </map:transform> |
| <map:transform src="resources/woody-samples-styling.xsl"/> |
| <map:serialize/> |
| </map:match> |
| |
| <!-- Flowscript Sample --> |
| |
| <map:match pattern="form1.flow"> |
| <map:call function="woody"> |
| <map:parameter name="function" value="form1"/> |
| <map:parameter name="form-definition" value="forms/form1.xml"/> |
| </map:call> |
| </map:match> |
| |
| <map:match pattern="*.continue"> |
| <map:call continuation="{1}"/> |
| </map:match> |
| |
| <map:match pattern="*-display-pipeline"> |
| <!-- pipeline to show the form --> |
| <map:generate src="forms/{1}_template.xml"/> |
| <map:transform type="woody"/> |
| <map:transform type="i18n"> |
| <map:parameter name="locale" value="en-US"/> |
| </map:transform> |
| <map:call resource="simple-page2html"> |
| <map:parameter name="file" value="forms/{1}_template.xml"/> |
| </map:call> |
| <map:transform src="resources/woody-samples-styling.xsl"/> |
| <map:serialize/> |
| </map:match> |
| |
| <map:match pattern="*-success-pipeline.xsp"> |
| <map:generate type="serverpages" src="forms/{1}_success.xsp"/> |
| <map:call resource="simple-page2html"> |
| <map:parameter name="file" value="forms/{1}_template.xsp"/> |
| </map:call> |
| <map:serialize/> |
| </map:match> |
| |
| |
| <!-- Upload Widget Sample --> |
| |
| <map:match pattern="upload"> |
| <map:call function="upload"/> |
| </map:match> |
| |
| <map:match pattern="*.continue"> |
| <map:call continuation="{1}"/> |
| </map:match> |
| |
| |
| <map:match pattern="*-success-pipeline.jx"> |
| <map:generate type="jx" src="forms/{1}_success_jx.xml"/> |
| <map:call resource="simple-page2html"> |
| <map:parameter name="file" value="forms/{1}_success_jx.xml"/> |
| </map:call> |
| <map:serialize/> |
| </map:match> |
| |
| <!-- |
| | Binding form sample, using flowscript |
| --> |
| |
| <map:match pattern="form2xml.flow"> |
| <map:call function="woody"> |
| <map:parameter name="function" value="form2xml"/> |
| <map:parameter name="form-definition" value="forms/form2_model.xml"/> |
| <map:parameter name="documentURI" value="forms/form2_data.xml"/> |
| <map:parameter name="bindingURI" value="forms/form2_bind_xml.xml"/> |
| </map:call> |
| </map:match> |
| |
| <map:match pattern="form2bean.flow"> |
| <map:call function="woody"> |
| <map:parameter name="function" value="form2bean"/> |
| <map:parameter name="form-definition" value="forms/form2_model.xml"/> |
| <map:parameter name="bindingURI" value="forms/form2_bind_bean.xml"/> |
| </map:call> |
| </map:match> |
| |
| <map:match pattern="form2-success-pipeline"> |
| <map:generate src="forms/form2_data-result.xml"/> |
| <map:transform type="i18n"> |
| <map:parameter name="locale" value="en-US"/> |
| </map:transform> |
| <map:serialize type="xml"/> |
| </map:match> |
| |
| <map:match pattern="form2bean-success-pipeline"> |
| <map:generate type="jx" src="forms/form2_jx.xml"/> |
| <map:transform type="i18n"> |
| <map:parameter name="locale" value="en-US"/> |
| </map:transform> |
| <map:serialize/> |
| </map:match> |
| |
| <!-- |
| | Registration form example |
| --> |
| |
| <map:match pattern="registration"> |
| <map:call function="registration"/> |
| </map:match> |
| |
| <!-- |
| | Car selector sample. |
| --> |
| |
| <map:match pattern="cars"> |
| <map:generate src="forms/car-db.xml"/> |
| <map:transform src="xsl/carfilter.xsl"> |
| <map:parameter name="list" value="makes"/> |
| </map:transform> |
| <map:serialize type="xml"/> |
| </map:match> |
| |
| <map:match pattern="cars/*"> |
| <map:generate src="forms/car-db.xml"/> |
| <map:transform src="xsl/carfilter.xsl"> |
| <map:parameter name="list" value="types"/> |
| <map:parameter name="make" value="{1}"/> |
| </map:transform> |
| <map:serialize type="xml"/> |
| </map:match> |
| |
| <map:match pattern="cars/*/*"> |
| <map:generate src="forms/car-db.xml"/> |
| <map:transform src="xsl/carfilter.xsl"> |
| <map:parameter name="list" value="models"/> |
| <map:parameter name="make" value="{1}"/> |
| <map:parameter name="type" value="{2}"/> |
| </map:transform> |
| <map:serialize type="xml"/> |
| </map:match> |
| |
| <map:match pattern="carselector"> |
| <map:select type="request-method"> |
| <map:when test="POST"> |
| <map:call continuation="{request-param:continuation-id}"/> |
| </map:when> |
| <map:otherwise> |
| <map:call function="selectCar"> |
| <map:parameter name="defaultMake" value="Maserati"/> |
| </map:call> |
| </map:otherwise> |
| </map:select> |
| </map:match> |
| |
| <!-- |
| | Country selector sample. |
| --> |
| |
| <map:match pattern="countryselector"> |
| <map:select type="request-method"> |
| <map:when test="GET"> |
| <map:call function="selectCountry"/> |
| </map:when> |
| <map:when test="POST"> |
| <map:call continuation="{request-param:continuation-id}"/> |
| </map:when> |
| <map:otherwise> |
| <!-- todo: do something here --> |
| </map:otherwise> |
| </map:select> |
| </map:match> |
| |
| <!-- |
| | Custom validation example |
| --> |
| |
| <map:match pattern="customvalidationdemo"> |
| <map:call function="customValidationDemo"/> |
| </map:match> |
| |
| <!-- |
| | HTMLArea example |
| --> |
| |
| <map:match pattern="htmlarea"> |
| <map:call function="htmlarea"/> |
| </map:match> |
| |
| <map:match pattern="htmlarea/**"> |
| <map:read src="resources/{0}"/> |
| </map:match> |
| |
| <map:match pattern="htmlarea-display-pipeline"> |
| <map:generate src="forms/htmlarea_template.xml"/> |
| <map:transform type="woody"/> |
| <map:transform type="i18n"> |
| <map:parameter name="locale" value="en-US"/> |
| </map:transform> |
| <map:transform src="context://samples/common/style/xsl/html/simple-page2html.xsl"> |
| <map:parameter name="contextPath" value="{request:contextPath}"/> |
| <map:parameter name="servletPath" value="{request:servletPath}"/> |
| <map:parameter name="sitemapURI" value="{request:sitemapURI}"/> |
| <map:parameter name="file" value="forms/htmlarea_template.xml"/> |
| <map:parameter name="remove" value="{0}"/> |
| </map:transform> |
| <map:transform src="resources/woody-samples-styling.xsl"/> |
| <map:serialize/> |
| </map:match> |
| |
| <map:match pattern="htmlarea-success-pipeline"> |
| <map:generate type="jx" src="forms/htmlarea_success.jx"/> |
| <map:transform src="context://samples/common/style/xsl/html/simple-page2html.xsl"> |
| <map:parameter name="contextPath" value="{request:contextPath}"/> |
| <map:parameter name="servletPath" value="{request:servletPath}"/> |
| <map:parameter name="sitemapURI" value="{request:sitemapURI}"/> |
| <map:parameter name="file" value="forms/htmlarea_success.jx"/> |
| <map:parameter name="remove" value="{0}"/> |
| </map:transform> |
| <map:serialize/> |
| </map:match> |
| |
| <map:match pattern="resources/**"> |
| <map:read src="{0}"/> |
| </map:match> |
| |
| <!-- |
| | Sample building a woody-form-gui editor in woody |
| | Doubles as a showcase for class, new, struct, union widgets |
| --> |
| |
| <map:match pattern="form_model_gui.flow"> |
| <map:call function="woody"> |
| <map:parameter name="function" value="form_model_gui"/> |
| <map:parameter name="form-definition" value="forms/form_model_gui_model.xml"/> |
| <map:parameter name="attribute-name" value="form_model_gui"/> |
| <map:parameter name="documentURI" value="forms/form_model_gui_data.xml"/> |
| <map:parameter name="bindingURI" value="forms/form_model_gui_binding.xml"/> |
| </map:call> |
| </map:match> |
| |
| |
| <!-- |
| | Group of Binding feature samples... |
| --> |
| |
| <map:match pattern="binding-*-*.flow"> |
| <map:call function="bindingSample"> |
| <map:parameter name="sample-code" value="{1}" /> |
| <map:parameter name="backend-type" value="{2}" /> |
| </map:call> |
| </map:match> |
| |
| <map:match pattern="binding-*.flow"> |
| <map:redirect-to uri="binding-{1}-JS.flow" /> |
| </map:match> |
| |
| <map:match pattern="binding.form"> |
| <map:generate type="woody"> |
| <map:parameter name="form-action" value="#\{$continuation/id}.continue" /> |
| </map:generate> |
| <!--TODO: fix xsl for use with woody-generator --> |
| <map:transform src="resources/woody-samples-styling.xsl" /> |
| <map:serialize type="html" /> |
| </map:match> |
| |
| <map:match pattern="binding.done"> |
| <map:generate type="jx" src="forms/binding/done.jx"/> <!-- generic dump of flow env via jx? --> |
| <map:call resource="simple-page2html"> |
| <map:parameter name="file" value="forms/binding/done.jx"/> |
| </map:call> |
| <map:serialize /> |
| </map:match> |
| |
| <map:match pattern="*"> |
| <map:redirect-to uri="{1}/"/> |
| </map:match> |
| |
| <map:match pattern="*/**"> |
| <map:mount check-reload="yes" src="{1}/" uri-prefix="{1}"/> |
| </map:match> |
| |
| </map:pipeline> |
| </map:pipelines> |
| |
| </map:sitemap> |