I have two functions that handle two corresponding pipelines. They use the same form model, template and binding definitions and the same pipeline to show the form (please, see attached files for details). The frist function works almost as expected but the second one fails when it whants to display the form. The falure appears when cocoon executes the form displaying pipeline at forms transformation.
Here is the error message:
Failed to execute pipeline.
org.apache.cocoon.ProcessingException: Failed to execute pipeline.: org.xml.sax.SAXException: EffectFormTemplateTransformer: Widget with id "number" does not exist in the form container.
What's wrong? Please, help!
Timur
<?xml version="1.0"?> <map:sitemap xmlns:map="http://apache.org/cocoon/sitemap/1.0">
<!-- This should be reorganized in more optimal way. E.g. there should be a
resource for applying frequently used parametric transformation -->
<map:components>
<!--
<map:generators default="file">
<map:generator logger="forms" name="forms"
src="org.apache.cocoon.forms.generation.FormsGenerator" />
<map:generator name="jx"
src="org.apache.cocoon.generation.JXTemplateGenerator" label="content"
logger="sitemap.generator.jx" />
</map:generators>
-->
<map:serializers default="html">
<map:serializer logger="sitemap.serializer.xml" mime-type="text/xml"
name="xml" pool-grow="4" pool-max="32" pool-min="4"
src="org.apache.cocoon.serialization.XMLSerializer">
<encoding>UTF-8</encoding>
</map:serializer>
<map:serializer logger="sitemap.serializer.html" mime-type="text/html"
name="html" pool-grow="4" pool-max="32" pool-min="4"
src="org.apache.cocoon.serialization.HTMLSerializer">
<doctype-public>-//W3C//DTD HTML 4.01 Transitional//EN</doctype-public>
<doctype-system>http://www.w3.org/TR/html4/loose.dtd</doctype-system>
<encoding>UTF-8</encoding>
</map:serializer>
</map:serializers>
<map:transformers default="xalan">
<map:transformer logger="forms" name="forms"
src="org.apache.cocoon.forms.transformation.FormsTemplateTransformer" />
<!--
<map:transformer name="i18n"
src="org.apache.cocoon.transformation.I18nTransformer">
<catalogues default="other">
<catalogue id="other" name="OtherMessages" location="messages" />
<catalogue id="forms" name="FormsMessages" location="messages" />
</catalogues>
<cache-at-startup>true</cache-at-startup>
</map:transformer>
-->
</map:transformers>
</map:components>
<map:resources>
<!-- this will later become a virtual transformer -->
<map:resource name="simple-page2html">
<map:transform src="style/xsl/simple-page2html.xsl">
<map:parameter name="contextPath" value="{request:contextPath}" />
<map:parameter name="servletPath" value="{request:servletPath}" />
</map:transform>
</map:resource>
<map:resource name="page2html">
<map:transform src="style/xsl/page2html.xsl">
<map:parameter name="contextPath" value="{request:contextPath}" />
<map:parameter name="servletPath" value="{request:servletPath}" />
</map:transform>
</map:resource>
<map:resource name="show-client">
<map:transform src="style/xsl/client.xsl">
<map:parameter name="contextPath"
value="{request:contextPath}" />
</map:transform>
<map:call resource="page2html" />
<map:serialize />
</map:resource>
</map:resources>
<map:flow language="javascript">
<map:script src="flow/client.js" />
<map:script src="flow/client_new.js" />
</map:flow>
<map:pipelines>
<!-- Direct data access -->
<!-- FIXME: this pipeline should be internal in production version.
-->
<map:pipeline>
<map:match pattern="data/**">
<map:generate src="xmldb:xindice-embed:///db/caclient/{1}" />
<map:serialize type="xml" />
</map:match>
</map:pipeline>
<map:pipeline>
<map:match pattern="">
<map:redirect-to uri="home.html" />
</map:match>
<map:match pattern="*.html">
<map:generate src="data/{1}.xml" />
<map:call resource="page2html" />
<map:serialize />
</map:match>
<map:match pattern="browse/">
<map:redirect-to uri="../browse(1)" />
</map:match>
<map:match pattern="browse(*)">
<map:generate src="cocoon:/data/" />
<map:transform src="style/xsl/xmldb-clients2page.xsl">
<map:parameter name="contextPath" value="{request:contextPath}" />
</map:transform>
<!--
<map:transform src="pagesheets/clients.xml" type="paginate">
<map:parameter name="page" value="{1}" />
</map:transform>
-->
<map:call resource="page2html" />
<map:serialize />
</map:match>
<map:match pattern="new/">
<map:call function="createClient">
<map:parameter name="data-base"
value="xmldb:xindice-embed:///db/caclient/" />
</map:call>
</map:match>
<map:match pattern="**/*.continue">
<map:call continuation="{2}" />
</map:match>
<map:match pattern="edit/*">
<map:call function="editClient">
<map:parameter name="form-definition"
value="forms/select-docs_form.xml" />
<map:parameter name="data-base"
value="xmldb:xindice-embed:///db/caclient/" />
<map:parameter name="client-id"
value="{1}" />
</map:call>
</map:match>
<map:match pattern="edit-new/*">
<map:call function="editClientNew">
<map:parameter name="form-definition"
value="forms/select-docs_form.xml" />
<map:parameter name="data-base"
value="xmldb:xindice-embed:///db/caclient/" />
<map:parameter name="client-id"
value="{1}" />
</map:call>
</map:match>
<map:match pattern="*-client-success-pipeline">
<map:generate src="cocoon:/data/{1}" />
<map:serialize type="xml" />
</map:match>
<!-- overriding common pipeline -->
<map:match pattern="contract-display-pipeline">
<map:generate src="forms/contract_tmpl.xml" />
<map:transform type="forms" /> <!-- FAILS -->
<!--
<map:transform src="style/xsl/forms-samples-styling.xsl" />
<map:call resource="simple-page2html" />
-->
<map:serialize />
</map:match>
<map:match pattern="*-display-pipeline">
<!-- pipeline to show the form -->
<map:generate src="forms/{1}_tmpl.xml" />
<map:transform type="forms" />
<map:transform src="style/xsl/forms-samples-styling.xsl" />
<map:call resource="simple-page2html" />
<map:serialize />
</map:match>
<!--
FIXME: DEVELOPEMENT STUFF should be removed from production version
-->
<map:match pattern="populate.html">
<map:generate src="data/populate.xml" />
<map:transform type="cinclude" />
<map:transform type="xmldb" />
<map:serialize />
</map:match>
<map:match pattern="test-pipeline">
<map:generate type="jx" src="forms/select-docs-success_jx.xml">
<map:parameter name="lenient-xpath" value="true"/>
</map:generate>
<map:serialize />
</map:match>
</map:pipeline>
</map:pipelines>
</map:sitemap>
client.js
Description: JavaScript source
client_new.js
Description: JavaScript source
<?xml version="1.0" encoding="UTF-8"?> <fb:context xmlns:fb="http://apache.org/cocoon/forms/1.0#binding" xmlns:fd="http://apache.org/cocoon/forms/1.0#definition" path="/Client"> <fb:value id="number" path="number"></fb:value> <fb:value id="date" path="date"></fb:value> <fb:value id="organization-name" path="organization-name"></fb:value> <fb:value id="title" path="title"></fb:value> <fb:value id="person-name" path="person-name"></fb:value> <fb:value id="address" path="address"></fb:value> <fb:value id="phone" path="phone"></fb:value> <fb:value id="fax" path="fax"></fb:value> <fb:value id="INN" path="INN"></fb:value> <fb:value id="KPP" path="KPP"></fb:value> <fb:value id="settlement-account" path="settlement-account"></fb:value> <fb:value id="bank-name" path="bank-name"></fb:value> <fb:value id="correspondent-account" path="correspondent-account"></fb:value> <fb:value id="BIK" path="BIK"></fb:value> <fb:value id="OKPO" path="OKPO"></fb:value> <fb:value id="OKONH" path="OKONH"></fb:value> </fb:context>
<?xml version="1.0" encoding="UTF-8"?>
<fd:form
xmlns:fd="http://apache.org/cocoon/forms/1.0#definition">
<fd:widgets>
<fd:field id="number">
<fd:label>Номер договора</fd:label>
<fd:help></fd:help>
<fd:hint>Необходимо ввести номер договора</fd:hint>
<fd:datatype base="string"></fd:datatype>
<fd:validation><!-- <fd:value-count exact="2"/> --></fd:validation>
</fd:field>
<fd:field id="date">
<fd:label>Дата</fd:label>
<fd:help></fd:help>
<fd:hint></fd:hint>
<fd:datatype base="string"></fd:datatype>
<fd:validation><!-- <fd:value-count exact="2"/> --></fd:validation>
</fd:field>
<fd:field id="organization-name">
<fd:label>Название организации</fd:label>
<fd:help></fd:help>
<fd:hint></fd:hint>
<fd:datatype base="string"></fd:datatype>
<fd:validation><!-- <fd:value-count exact="2"/> --></fd:validation>
</fd:field>
<fd:field id="title">
<fd:label>Должность</fd:label>
<fd:help></fd:help>
<fd:hint></fd:hint>
<fd:datatype base="string"></fd:datatype>
<fd:validation><!-- <fd:value-count exact="2"/> --></fd:validation>
</fd:field>
<fd:field id="person-name">
<fd:label>Р¤Р?Рћ</fd:label>
<fd:help></fd:help>
<fd:hint></fd:hint>
<fd:datatype base="string"></fd:datatype>
<fd:validation><!-- <fd:value-count exact="2"/> --></fd:validation>
</fd:field>
<fd:field id="address">
<fd:label>Юридический адрес</fd:label>
<fd:help></fd:help>
<fd:hint></fd:hint>
<fd:datatype base="string"></fd:datatype>
<fd:validation><!-- <fd:value-count exact="2"/> --></fd:validation>
</fd:field>
<fd:field id="phone">
<fd:label>Телефон</fd:label>
<fd:help></fd:help>
<fd:hint></fd:hint>
<fd:datatype base="string"></fd:datatype>
<fd:validation><!-- <fd:value-count exact="2"/> --></fd:validation>
</fd:field>
<fd:field id="fax">
<fd:label>Номер факса</fd:label>
<fd:help></fd:help>
<fd:hint></fd:hint>
<fd:datatype base="string"></fd:datatype>
<fd:validation><!-- <fd:value-count exact="2"/> --></fd:validation>
</fd:field>
<fd:field id="INN">
<fd:label>Р?РќРќ</fd:label>
<fd:help></fd:help>
<fd:hint></fd:hint>
<fd:datatype base="string"></fd:datatype>
<fd:validation><!-- <fd:value-count exact="2"/> --></fd:validation>
</fd:field>
<fd:field id="KPP">
<fd:label>РљРџРџ</fd:label>
<fd:help></fd:help>
<fd:hint></fd:hint>
<fd:datatype base="string"></fd:datatype>
<fd:validation><!-- <fd:value-count exact="2"/> --></fd:validation>
</fd:field>
<fd:field id="settlement-account">
<fd:label>Расчетный счет</fd:label>
<fd:help></fd:help>
<fd:hint></fd:hint>
<fd:datatype base="string"></fd:datatype>
<fd:validation><!-- <fd:value-count exact="2"/> --></fd:validation>
</fd:field>
<fd:field id="bank-name">
<fd:label>Банк</fd:label>
<fd:help></fd:help>
<fd:hint></fd:hint>
<fd:datatype base="string"></fd:datatype>
<fd:validation><!-- <fd:value-count exact="2"/> --></fd:validation>
</fd:field>
<fd:field id="correspondent-account">
<fd:label>Корреспондентский счет</fd:label>
<fd:help></fd:help>
<fd:hint></fd:hint>
<fd:datatype base="string"></fd:datatype>
<fd:validation><!-- <fd:value-count exact="2"/> --></fd:validation>
</fd:field>
<fd:field id="BIK">
<fd:label>Р‘Р?Рљ</fd:label>
<fd:help></fd:help>
<fd:hint></fd:hint>
<fd:datatype base="string"></fd:datatype>
<fd:validation><!-- <fd:value-count exact="2"/> --></fd:validation>
</fd:field>
<fd:field id="OKPO">
<fd:label>РћРљРџРћ</fd:label>
<fd:help></fd:help>
<fd:hint></fd:hint>
<fd:datatype base="string"></fd:datatype>
<fd:validation><!-- <fd:value-count exact="2"/> --></fd:validation>
</fd:field>
<fd:field id="OKONH">
<fd:label>РћРљРћРќРҐ</fd:label>
<fd:help></fd:help>
<fd:hint></fd:hint>
<fd:datatype base="string"></fd:datatype>
<fd:validation><!-- <fd:value-count exact="2"/> --></fd:validation>
</fd:field>
</fd:widgets>
</fd:form>
<?xml version="1.0" encoding="UTF-8"?> <page xmlns:ft="http://apache.org/cocoon/forms/1.0#template" xmlns:fi="http://apache.org/cocoon/forms/1.0#instance"> <title>contract</title> <content> <ft:form-template action="#{$continuation/id}.continue" method="POST"> <ft:widget-label id="number" /> <ft:widget id="number"></ft:widget> <br /> <ft:widget-label id="date" /> <ft:widget id="date"></ft:widget> <br /> <ft:widget-label id="organization-name" /> <ft:widget id="organization-name"></ft:widget> <br /> <ft:widget-label id="title" /> <ft:widget id="title"></ft:widget> <br /> <ft:widget-label id="person-name" /> <ft:widget id="person-name"></ft:widget> <br /> <ft:widget-label id="address" /> <ft:widget id="address"></ft:widget> <br /> <ft:widget-label id="phone" /> <ft:widget id="phone"></ft:widget> <br /> <ft:widget-label id="fax" /> <ft:widget id="fax"></ft:widget> <br /> <ft:widget-label id="INN" /> <ft:widget id="INN"></ft:widget> <br /> <ft:widget-label id="KPP" /> <ft:widget id="KPP"></ft:widget> <br /> <ft:widget-label id="settlement-account" /> <ft:widget id="settlement-account"></ft:widget> <br /> <ft:widget-label id="bank-name" /> <ft:widget id="bank-name"></ft:widget> <br /> <ft:widget-label id="correspondent-account" /> <ft:widget id="correspondent-account"></ft:widget> <br /> <ft:widget-label id="BIK" /> <ft:widget id="BIK"></ft:widget> <br /> <ft:widget-label id="OKPO" /> <ft:widget id="OKPO"></ft:widget> <br /> <ft:widget-label id="OKONH" /> <ft:widget id="OKONH"></ft:widget> <br /> <input value="Далее >>" type="submit" /> </ft:form-template> </content> </page>
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
