Hi
============
Question/Problem
============
Does anyone have an example using the JXFormsTransformer?
My best attempt, described below fails with:
Exception: org.apache.cocoon.ProcessingException: Failed to execute
pipeline.:
file:/home/henrysbb/src/webapps/admin/view/supplier.xml:4:84:org.xml.sax.SAXParserException:Form
not found: supplier
The quoted line (4:84) refers to the line <xf:form id="supplier" .... > as
shown below.
I am very fuzzy as to how the transformer, XForm and model get connected
when using the transformer - I have used the generator with success.
===============
Flow Aside
===============
I can't help feeling that I'm using the flow in a twisted way. Here's what
I'm doing
1. Requests of the form *.do invokes a function
2. Function loads/modifies beans
3. Function invokes an view in the form **.html with cocoon.SendPage or
cocoon.SendPageAndWait, passing relevant beans
4. The html pipeline generates a view starting with a JXTemplate, then
5. The document is passed through the JXForms transformer to fill in any
form fields
6. The document is passed through the two JXForms stylesheets
7. The document is passed through a 'skin' stylesheet that adds menus, etc.
8. Serialize to html
9. Continuation invoked, flow updates beans (Hibernate-2.0.2) and SendPages
the next template (typically a *.do)
If I do stick with this pattern then I will have a boolean in the model
indicating whether the form processing stage is required for the given html
page.
Any help greatly appreciated!
Regards,
Richard Hoberman
============
Relevant Bits
============
I have the pipline:
<map:match pattern="**.html">
<map:generate type="jxt" src="view/{1}.xml" />
<map:transform type="jxforms">
<map:parameter name="id" value="{1}" />
</map:transform>
<map:transform type="xslt" src="stylesheets/jxforms-default.xsl" />
<map:transform type="xslt" src="stylesheets/jxforms2html.xsl" />
<map:transform type="xslt" src="skins/basic/stylesheets/site2html.xsl" />
<map:serialize type="html" />
</map:pattern>
This is invoked with a link to supplier.do?supplierID=1, which invokes
<map:match pattern="*.do">
<map:call function="{1}" />
<map:serialize type="xml" />
</map:match>
The function, defined in my flow file:
function supplier() {
var supplierID = cocoon.request.getParameter("supplierID");
var supplier = ... hibernate code ... log show this to be correctly loaded
...
...
cocoon.sendPageAndWait("supplier.html", { "supplier" : supplier } );
....
...
}
Just prior to the invocation of the JXFormsTransformer I have (captured with
a view):
<document>
-
<xf:form id="supplier" view="edit-supplier" action="supplier.html"
method="POST">
-
<xf:select1 ref="/status">
<xf:label>Status:</xf:label>
-
<xf:item>
<xf:label>inactive</xf:label>
<xf:value>inactive</xf:value>
</xf:item>
-
<xf:item>
<xf:label>active</xf:label>
<xf:value>active</xf:value>
</xf:item>
-
<xf:item>
<xf:label>forthcoming</xf:label>
<xf:value>forthcoming</xf:value>
</xf:item>
</xf:select1>
-
<xf:input ref="/alias">
<xf:label>Alias:</xf:label>
</xf:input>
-
<xf:input ref="/label">
<xf:label>Label:</xf:label>
</xf:input>
-
<xf:textarea ref="/description">
<xf:label>Description:</xf:label>
</xf:textarea>
-
<xf:submit id="next" continuation="forward" class="button">
<xf:label>Save</xf:label>
</xf:submit>
-
<!--
xf:submit id="back" class="button">
<xf:label>Revert</xf:label>
</xf:submit
-->
</xf:form>
</document>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]