You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by JD Daniels <jd...@datatrio.com> on 2003/11/15 01:47:36 UTC

Woody repeater with flow

Say I have an xml document

<results>
	<itemOne>
		<name/>
		<email>
		<etc/>
	</itemOne>
	<itemOne>
		<name/>
		<email>
		<etc/>
	</itemOne>
	<itemOne>
		<name/>
		<email>
		<etc/>
	</itemOne>
</results>

How would I load this into a form, with repeater I have defined for itemOne.

Ie, I want to load a result set from a database, and display them all to the
user as a bunch of repaters with wd:output widgets, with a select widget to
remove them one by one before carrying on with an xsp to do something to the
ones left. I am sure binding will do this, but I am using flow, and kinda
lost as to how it actually will work. I have the template, definition, and
binding files done, kinda lost at the flow part.

JD


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Xindice-support in the latest snapshot of cocoon

Posted by Heiner Braun privat <h....@onlinehome.de>.
Till now I used Xindice in my cocoon applications.
But with the latest cvs-snapshot cocoon doesn't undestand  the 
pseudo-protocol any more.
I saw  some mails in the mailing list but no answers that the problem 
was solved.

>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: Woody repeater with flow

Posted by Bruno Dumon <br...@outerthought.org>.
On Fri, 2003-11-21 at 17:56, JD Daniels wrote:
> No.. sigh
> 
> I just don't get it :S
> 

Problem is in the binding:

> > Binding:
> >
> > <wb:context xmlns:wb="http://apache.org/cocoon/woody/binding/1.0"
> > xmlns:wd="http://apache.org/cocoon/woody/definition/1.0" path="/">
> > 	<wb:value id="ticket" path="results/ticket"/>
<snip/>

You can't bind a repeater using <wb:value>. wb:value binds the value of
a widget, but a repeater has no value, it contains rows which in turn
contain widgets. To bind a repeater you should use wb:repeater and
related elements. The woody samples show how to do this, and there's
also some basic documentation (not very educational right now, but
should at least make you aware of the existance of the tags).

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: Woody repeater with flow

Posted by JD Daniels <jd...@datatrio.com>.
No.. sigh

I just don't get it :S

My use case is That I have a time sheet system...

I want to be able to assign an invoice number to each time sheet that is
relevent. I thought that making the time sheets a repeater item from a
search form with the data fields as wd:output elements and a select box
would be the way to go.. but I can't seem to figure it out.

JD



-----Original Message-----
From: Bruno Dumon [mailto:bruno@outerthought.org]
Sent: Friday, November 21, 2003 7:18 AM
To: users@cocoon.apache.org
Subject: RE: Woody repeater with flow


JD, have you meanwhile succeeded in binding your repeater?

On Mon, 2003-11-17 at 16:53, JD Daniels wrote:
> Maybe a lil more info will get me some input :)
>
> this is my flow:
>
> function postInvoice(form) {
> 	var uri = "cocoon://xml.xsp";
> 	var resolver =
>
cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.ROLE
> );
> 	var source = resolver.resolveURI(uri);
> 	var parser =
> cocoon.getComponent(Packages.org.apache.excalibur.xml.dom.DOMParser.ROLE);
> 	var document =
>
parser.parseDocument(Packages.org.apache.cocoon.components.source.SourceUtil
> .getInputSource(source));
>
> 	form.load(document);
>
> 	form.showForm("display-pipeline");
> 	var model = form.getModel();
> 	cocoon.sendPage("success-pipeline");
> }
>
> I don't get an error, but the repeater rows do not show up either.
>
> Template:
> 	<wt:form-template action="#{$continuation/id}.continue" method="POST">
>       <!-- manual layout of fieldw, without use of a wi:group -->
>       <wt:widget-label id="ticket"/><br/>
>       <wt:repeater-size id="ticket"/>
>       <table border="1">
>         <tr>
>           <th><wt:repeater-widget-label id="ticket"
widget-id="hours"/></th>
>           <th><wt:repeater-widget-label id="ticket"
widget-id="user"/></th>
>           <th><wt:repeater-widget-label id="ticket"
> widget-id="client"/></th>
>           <th><wt:repeater-widget-label id="ticket"
> widget-id="project"/></th>
>           <th></th>
>         </tr>
>
>         <!-- The contents of the repeater-widget element is a template
that
> will
>         be applied to each row in the repeater. -->
>         <wt:repeater-widget id="ticket">
>           <tr>
>             <td><wt:widget id="hours"/></td>
>             <td><wt:widget id="user"/></td>
>             <td><wt:widget id="client"/></td>
>             <td><wt:widget id="project"/></td>
>             <td><wt:widget id="select"/></td>
>           </tr>
>         </wt:repeater-widget>
>
>         <tr>
>           <td colspan="5" align="right">
>             <wt:widget id="deleteticket"/>
>           </td>
>         </tr>
>       </table>
> </wt:form-template>
>
> Binding:
>
> <wb:context xmlns:wb="http://apache.org/cocoon/woody/binding/1.0"
> xmlns:wd="http://apache.org/cocoon/woody/definition/1.0" path="/">
> 	<wb:value id="ticket" path="results/ticket"/>
> 	<wb:value id="id" path="results/ticket/id"/>
> 	<wb:value id="select" path="results/ticket/id"/>
> 	<wb:value id="user" path="results/ticket/user"/>
> 	<wb:value id="project" path="results/ticket/project"/>
> 	<wb:value id="client" path="results/ticket/client"/>
> 	<wb:value id="hours" path="results/ticket/hours"/>
> </wb:context>
>
>
> JD
>
> -----Original Message-----
> From: JD Daniels [mailto:jd@datatrio.com]
> Sent: Friday, November 14, 2003 4:48 PM
> To: Cocoon Users
> Subject: Woody repeater with flow
>
>
> Say I have an xml document
>
> <results>
> 	<itemOne>
> 		<name/>
> 		<email>
> 		<etc/>
> 	</itemOne>
> 	<itemOne>
> 		<name/>
> 		<email>
> 		<etc/>
> 	</itemOne>
> 	<itemOne>
> 		<name/>
> 		<email>
> 		<etc/>
> 	</itemOne>
> </results>
>
> How would I load this into a form, with repeater I have defined for
itemOne.
>
> Ie, I want to load a result set from a database, and display them all to
the
> user as a bunch of repaters with wd:output widgets, with a select widget
to
> remove them one by one before carrying on with an xsp to do something to
the
> ones left. I am sure binding will do this, but I am using flow, and kinda
> lost as to how it actually will work. I have the template, definition, and
> binding files done, kinda lost at the flow part.
>
> JD

--
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: Woody repeater with flow

Posted by Bruno Dumon <br...@outerthought.org>.
JD, have you meanwhile succeeded in binding your repeater?

On Mon, 2003-11-17 at 16:53, JD Daniels wrote:
> Maybe a lil more info will get me some input :)
> 
> this is my flow:
> 
> function postInvoice(form) {
> 	var uri = "cocoon://xml.xsp";
> 	var resolver =
> cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.ROLE
> );
> 	var source = resolver.resolveURI(uri);
> 	var parser =
> cocoon.getComponent(Packages.org.apache.excalibur.xml.dom.DOMParser.ROLE);
> 	var document =
> parser.parseDocument(Packages.org.apache.cocoon.components.source.SourceUtil
> .getInputSource(source));
> 
> 	form.load(document);
> 
> 	form.showForm("display-pipeline");
> 	var model = form.getModel();
> 	cocoon.sendPage("success-pipeline");
> }
> 
> I don't get an error, but the repeater rows do not show up either.
> 
> Template:
> 	<wt:form-template action="#{$continuation/id}.continue" method="POST">
>       <!-- manual layout of fieldw, without use of a wi:group -->
>       <wt:widget-label id="ticket"/><br/>
>       <wt:repeater-size id="ticket"/>
>       <table border="1">
>         <tr>
>           <th><wt:repeater-widget-label id="ticket" widget-id="hours"/></th>
>           <th><wt:repeater-widget-label id="ticket" widget-id="user"/></th>
>           <th><wt:repeater-widget-label id="ticket"
> widget-id="client"/></th>
>           <th><wt:repeater-widget-label id="ticket"
> widget-id="project"/></th>
>           <th></th>
>         </tr>
> 
>         <!-- The contents of the repeater-widget element is a template that
> will
>         be applied to each row in the repeater. -->
>         <wt:repeater-widget id="ticket">
>           <tr>
>             <td><wt:widget id="hours"/></td>
>             <td><wt:widget id="user"/></td>
>             <td><wt:widget id="client"/></td>
>             <td><wt:widget id="project"/></td>
>             <td><wt:widget id="select"/></td>
>           </tr>
>         </wt:repeater-widget>
> 
>         <tr>
>           <td colspan="5" align="right">
>             <wt:widget id="deleteticket"/>
>           </td>
>         </tr>
>       </table>
> </wt:form-template>
> 
> Binding:
> 
> <wb:context xmlns:wb="http://apache.org/cocoon/woody/binding/1.0"
> xmlns:wd="http://apache.org/cocoon/woody/definition/1.0" path="/">
> 	<wb:value id="ticket" path="results/ticket"/>
> 	<wb:value id="id" path="results/ticket/id"/>
> 	<wb:value id="select" path="results/ticket/id"/>
> 	<wb:value id="user" path="results/ticket/user"/>
> 	<wb:value id="project" path="results/ticket/project"/>
> 	<wb:value id="client" path="results/ticket/client"/>
> 	<wb:value id="hours" path="results/ticket/hours"/>
> </wb:context>
> 
> 
> JD
> 
> -----Original Message-----
> From: JD Daniels [mailto:jd@datatrio.com]
> Sent: Friday, November 14, 2003 4:48 PM
> To: Cocoon Users
> Subject: Woody repeater with flow
> 
> 
> Say I have an xml document
> 
> <results>
> 	<itemOne>
> 		<name/>
> 		<email>
> 		<etc/>
> 	</itemOne>
> 	<itemOne>
> 		<name/>
> 		<email>
> 		<etc/>
> 	</itemOne>
> 	<itemOne>
> 		<name/>
> 		<email>
> 		<etc/>
> 	</itemOne>
> </results>
> 
> How would I load this into a form, with repeater I have defined for itemOne.
> 
> Ie, I want to load a result set from a database, and display them all to the
> user as a bunch of repaters with wd:output widgets, with a select widget to
> remove them one by one before carrying on with an xsp to do something to the
> ones left. I am sure binding will do this, but I am using flow, and kinda
> lost as to how it actually will work. I have the template, definition, and
> binding files done, kinda lost at the flow part.
> 
> JD

-- 
Bruno Dumon                             http://outerthought.org/
Outerthought - Open Source, Java & XML Competence Support Center
bruno@outerthought.org                          bruno@apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Woody repeater with flow

Posted by Joe Latty <jo...@tias.com.au>.
I confess I have not read your entire email, however I have had this problem
and this is what I did to fix it.

1) turn on the javacript debugger and check the Break On Exceptions box in
the Debug Menu. This will give you any JXPath errors.

2) I have had to use different binding files for binding my document to the
form and then from the form to bean e.g.
    the form binding <wb:value id="select" path="results/ticket/id"/>
    will be <wb:value id="select" path="id"/> for the bean.

3) also, I am not sure if this is needed, but I have the following inside my
repeater element in the binding xml file
    <wb:on-insert-row>
      <wb:insert-bean
        classname="org.apache.cocoon.woody.beans.MyBean"
        addmethod="addAnotherBean"/>
    </wb:on-insert-row>

Joe

----- Original Message ----- 
From: "JD Daniels" <jd...@datatrio.com>
To: <us...@cocoon.apache.org>
Sent: Tuesday, November 18, 2003 2:53 AM
Subject: RE: Woody repeater with flow


> Maybe a lil more info will get me some input :)
>
> this is my flow:
>
> function postInvoice(form) {
> var uri = "cocoon://xml.xsp";
> var resolver =
>
cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.ROLE
> );
> var source = resolver.resolveURI(uri);
> var parser =
> cocoon.getComponent(Packages.org.apache.excalibur.xml.dom.DOMParser.ROLE);
> var document =
>
parser.parseDocument(Packages.org.apache.cocoon.components.source.SourceUtil
> .getInputSource(source));
>
> form.load(document);
>
> form.showForm("display-pipeline");
> var model = form.getModel();
> cocoon.sendPage("success-pipeline");
> }
>
> I don't get an error, but the repeater rows do not show up either.
>
> Template:
> <wt:form-template action="#{$continuation/id}.continue" method="POST">
>       <!-- manual layout of fieldw, without use of a wi:group -->
>       <wt:widget-label id="ticket"/><br/>
>       <wt:repeater-size id="ticket"/>
>       <table border="1">
>         <tr>
>           <th><wt:repeater-widget-label id="ticket"
widget-id="hours"/></th>
>           <th><wt:repeater-widget-label id="ticket"
widget-id="user"/></th>
>           <th><wt:repeater-widget-label id="ticket"
> widget-id="client"/></th>
>           <th><wt:repeater-widget-label id="ticket"
> widget-id="project"/></th>
>           <th></th>
>         </tr>
>
>         <!-- The contents of the repeater-widget element is a template
that
> will
>         be applied to each row in the repeater. -->
>         <wt:repeater-widget id="ticket">
>           <tr>
>             <td><wt:widget id="hours"/></td>
>             <td><wt:widget id="user"/></td>
>             <td><wt:widget id="client"/></td>
>             <td><wt:widget id="project"/></td>
>             <td><wt:widget id="select"/></td>
>           </tr>
>         </wt:repeater-widget>
>
>         <tr>
>           <td colspan="5" align="right">
>             <wt:widget id="deleteticket"/>
>           </td>
>         </tr>
>       </table>
> </wt:form-template>
>
> Binding:
>
> <wb:context xmlns:wb="http://apache.org/cocoon/woody/binding/1.0"
> xmlns:wd="http://apache.org/cocoon/woody/definition/1.0" path="/">
> <wb:value id="ticket" path="results/ticket"/>
> <wb:value id="id" path="results/ticket/id"/>
> <wb:value id="select" path="results/ticket/id"/>
> <wb:value id="user" path="results/ticket/user"/>
> <wb:value id="project" path="results/ticket/project"/>
> <wb:value id="client" path="results/ticket/client"/>
> <wb:value id="hours" path="results/ticket/hours"/>
> </wb:context>
>
>
> JD
>
> -----Original Message-----
> From: JD Daniels [mailto:jd@datatrio.com]
> Sent: Friday, November 14, 2003 4:48 PM
> To: Cocoon Users
> Subject: Woody repeater with flow
>
>
> Say I have an xml document
>
> <results>
> <itemOne>
> <name/>
> <email>
> <etc/>
> </itemOne>
> <itemOne>
> <name/>
> <email>
> <etc/>
> </itemOne>
> <itemOne>
> <name/>
> <email>
> <etc/>
> </itemOne>
> </results>
>
> How would I load this into a form, with repeater I have defined for
itemOne.
>
> Ie, I want to load a result set from a database, and display them all to
the
> user as a bunch of repaters with wd:output widgets, with a select widget
to
> remove them one by one before carrying on with an xsp to do something to
the
> ones left. I am sure binding will do this, but I am using flow, and kinda
> lost as to how it actually will work. I have the template, definition, and
> binding files done, kinda lost at the flow part.
>
> JD
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


RE: Woody repeater with flow

Posted by JD Daniels <jd...@datatrio.com>.
Maybe a lil more info will get me some input :)

this is my flow:

function postInvoice(form) {
	var uri = "cocoon://xml.xsp";
	var resolver =
cocoon.getComponent(Packages.org.apache.excalibur.source.SourceResolver.ROLE
);
	var source = resolver.resolveURI(uri);
	var parser =
cocoon.getComponent(Packages.org.apache.excalibur.xml.dom.DOMParser.ROLE);
	var document =
parser.parseDocument(Packages.org.apache.cocoon.components.source.SourceUtil
.getInputSource(source));

	form.load(document);

	form.showForm("display-pipeline");
	var model = form.getModel();
	cocoon.sendPage("success-pipeline");
}

I don't get an error, but the repeater rows do not show up either.

Template:
	<wt:form-template action="#{$continuation/id}.continue" method="POST">
      <!-- manual layout of fieldw, without use of a wi:group -->
      <wt:widget-label id="ticket"/><br/>
      <wt:repeater-size id="ticket"/>
      <table border="1">
        <tr>
          <th><wt:repeater-widget-label id="ticket" widget-id="hours"/></th>
          <th><wt:repeater-widget-label id="ticket" widget-id="user"/></th>
          <th><wt:repeater-widget-label id="ticket"
widget-id="client"/></th>
          <th><wt:repeater-widget-label id="ticket"
widget-id="project"/></th>
          <th></th>
        </tr>

        <!-- The contents of the repeater-widget element is a template that
will
        be applied to each row in the repeater. -->
        <wt:repeater-widget id="ticket">
          <tr>
            <td><wt:widget id="hours"/></td>
            <td><wt:widget id="user"/></td>
            <td><wt:widget id="client"/></td>
            <td><wt:widget id="project"/></td>
            <td><wt:widget id="select"/></td>
          </tr>
        </wt:repeater-widget>

        <tr>
          <td colspan="5" align="right">
            <wt:widget id="deleteticket"/>
          </td>
        </tr>
      </table>
</wt:form-template>

Binding:

<wb:context xmlns:wb="http://apache.org/cocoon/woody/binding/1.0"
xmlns:wd="http://apache.org/cocoon/woody/definition/1.0" path="/">
	<wb:value id="ticket" path="results/ticket"/>
	<wb:value id="id" path="results/ticket/id"/>
	<wb:value id="select" path="results/ticket/id"/>
	<wb:value id="user" path="results/ticket/user"/>
	<wb:value id="project" path="results/ticket/project"/>
	<wb:value id="client" path="results/ticket/client"/>
	<wb:value id="hours" path="results/ticket/hours"/>
</wb:context>


JD

-----Original Message-----
From: JD Daniels [mailto:jd@datatrio.com]
Sent: Friday, November 14, 2003 4:48 PM
To: Cocoon Users
Subject: Woody repeater with flow


Say I have an xml document

<results>
	<itemOne>
		<name/>
		<email>
		<etc/>
	</itemOne>
	<itemOne>
		<name/>
		<email>
		<etc/>
	</itemOne>
	<itemOne>
		<name/>
		<email>
		<etc/>
	</itemOne>
</results>

How would I load this into a form, with repeater I have defined for itemOne.

Ie, I want to load a result set from a database, and display them all to the
user as a bunch of repaters with wd:output widgets, with a select widget to
remove them one by one before carrying on with an xsp to do something to the
ones left. I am sure binding will do this, but I am using flow, and kinda
lost as to how it actually will work. I have the template, definition, and
binding files done, kinda lost at the flow part.

JD


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org