Return-Path: Delivered-To: apmail-cocoon-users-archive@www.apache.org Received: (qmail 68464 invoked from network); 18 May 2005 15:13:56 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 18 May 2005 15:13:56 -0000 Received: (qmail 95427 invoked by uid 500); 18 May 2005 14:57:35 -0000 Delivered-To: apmail-cocoon-users-archive@cocoon.apache.org Received: (qmail 95403 invoked by uid 500); 18 May 2005 14:57:34 -0000 Mailing-List: contact users-help@cocoon.apache.org; run by ezmlm Precedence: bulk list-help: list-unsubscribe: List-Post: Reply-To: users@cocoon.apache.org List-Id: Delivered-To: mailing list users@cocoon.apache.org Received: (qmail 95376 invoked by uid 99); 18 May 2005 14:57:33 -0000 X-ASF-Spam-Status: No, hits=0.0 required=10.0 tests=HTML_60_70,HTML_MESSAGE,SPF_HELO_PASS X-Spam-Check-By: apache.org Received-SPF: pass (hermes.apache.org: local policy) Received: from mx.ticino.com (HELO mail.ticino.com) (195.190.166.60) by apache.org (qpsmtpd/0.28) with ESMTP; Wed, 18 May 2005 07:57:27 -0700 Received: from sviluppo (unverified [62.48.115.6]) by ticino.com (Rockliffe SMTPRA 6.0.6) with SMTP id for ; Wed, 18 May 2005 16:47:25 +0200 Message-ID: <020e01c55bb8$4a81ae50$6400a8c0@sviluppo> From: "Roberto Marra" To: References: <020201c55bb3$f54ee870$6400a8c0@sviluppo> Subject: Re: CForms & value of field... Date: Wed, 18 May 2005 16:45:52 +0200 Organization: Montefiore MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_020B_01C55BC9.0DD51670" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1437 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1441 X-Virus-Checked: Checked X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N ------=_NextPart_000_020B_01C55BC9.0DD51670 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I mean... sorry if I didn't clarify myself... Im looking at the samples "../block/forms/flow/binding_example.js". This = is the flowscript: function form2bean(form) { var bean =3D new = Packages.org.apache.cocoon.forms.samples.Form2Bean(); //fill bean with some data to avoid users having to type to much bean.setEmail("yourname@yourdomain.com"); bean.setIpAddress("10.0.0.1"); bean.setPhoneCountry("32"); bean.setPhoneZone("2"); bean.setPhoneNumber("123456"); bean.setBirthday(new java.util.Date()); bean.setSex(Packages.org.apache.cocoon.forms.samples.Sex.MALE); =20 var contact =3D new = Packages.org.apache.cocoon.forms.samples.Contact(); contact.setId("1"); contact.setFirstName("Roberto"); contact.setLastName("Marra"); contact.setPhone("+41916104455"); contact.setEmail("rmarra@montefiore.ch"); =20 bean.addContact(contact); =20 form.load(bean); form.showForm("form2-display-pipeline"); form.save(bean); cocoon.sendPage("form2bean-success-pipeline", { "form2bean": bean = }); } The bean is used to fill-up the field of the form. What I need is = retrive the value of the field of the form. I already did something like = bean.setEmail("cocoon.parameters["email"]"); But as I wrote if I got 300field I would like to find another = solution... hope that I clarify.. ----- Original Message -----=20 From: Roberto Marra=20 To: users@cocoon.apache.org=20 Sent: Wednesday, May 18, 2005 4:14 PM Subject: Re: CForms & value of field... Hi Jeroen & thanx. I had a look of the OJB samples. Let say that now my main target is = not to write to db but to have the value of the CForm available in the = flowscript & I want to do that via binding. So in the sitemap I got that = now: & in the flowscript ... var bindingFile =3D cocoon.parameters["bindingURI"]; var bean =3D new Packages.org.mf.ContactBean(); form.createBinding(bindingFile); form.save(bean); System.out.println("test:"+form.lookupWidget("ragSoc").getValue()); ... but "test" return me null. So for sure I didn't understand = something...or more... Cheers ROberto ----- Original Message -----=20 From: Jeroen Reijn=20 To: users@cocoon.apache.org=20 Sent: Wednesday, May 18, 2005 9:52 AM Subject: RE: CForms & value of field... Hi Roberto, I think binding the form could be a great solution for your problem. = You could check out the OJB samples to see how to write to the DB. Greetz, Jeroen -----Original Message----- From: Roberto Marra [mailto:rmarra@montefiore.ch] Posted At: Wednesday, May 18, 2005 9:23 AM Posted To: Cocoon User List Conversation: CForms & value of field... Subject: CForms & value of field... Hi all, I guess I missed something about the process of get value from the = CForm to the flowscript. So hope somebody can clarify me it. I got a CForm definition file & a template. Then in my pipeline I = got a match pattern that call a function & pass the parameter of the = CForm in this way: then, in my flowscript I do that: ragSoc =3D cocoon.parameters["ragSoc"]; indirizzo =3D cocoon.parameters["indirizzo"]; cap =3D cocoon.parameters["cap"]; citta =3D cocoon.parameters["citta"]; nazione =3D cocoon.parameters["nazione"]; telefono =3D cocoon.parameters["telefono"]; email =3D cocoon.parameters["email"]; lingua =3D cocoon.parameters["lingua"]; pwd =3D cocoon.parameters["pwd"]; confpwd =3D cocoon.parameters["confpwd"]; & then I call a Java method & I do what I have to do (in this case = write the value in the db). So, that could be interesting for one CForm, = but Im making an application programm, with a lot of CForms with a lot = of field. Im sure I have not to send everytime all the field in this way = to flowscript, Im sure there is an elegant way to do that. Is the = binding file the solution? I saw different example of binding but in the = example the binding is used most of the time to write data in the = CForms.. Any suggestion? Thanx in advance Roberto ------=_NextPart_000_020B_01C55BC9.0DD51670 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
I mean... sorry if I = didn't clarify=20 myself...
Im looking at the = samples=20 "../block/forms/flow/binding_example.js". This is the = flowscript:
 
function = form2bean(form)=20 {
    var bean =3D new=20 Packages.org.apache.cocoon.forms.samples.Form2Bean();
 
    //fill=20 bean with some data to avoid users having to type to=20 much
      bean.setEmail("
yourname@yourdomain.com
");
     =20 bean.setIpAddress("10.0.0.1");
     =20 bean.setPhoneCountry("32");
     =20 bean.setPhoneZone("2");
     =20 bean.setPhoneNumber("123456");
     =20 bean.setBirthday(new = java.util.Date());
     =20 bean.setSex(Packages.org.apache.cocoon.forms.samples.Sex.MALE);
 =   =20
      var contact =3D new=20 Packages.org.apache.cocoon.forms.samples.Contact();
   =   =20 contact.setId("1");
     =20 contact.setFirstName("Roberto");
     =20 contact.setLastName("Marra");
     =20 contact.setPhone("+41916104455");
     =20 contact.setEmail("rmarra@montefiore.ch");
     
   =20 bean.addContact(contact);
 
   =20
    form.load(bean);
   =20 form.showForm("form2-display-pipeline");
   =20 form.save(bean);
 
   =20 cocoon.sendPage("form2bean-success-pipeline", { "form2bean": bean=20 });
}
 
The bean is used to = fill-up the=20 field of the form. What I need is retrive the value of the field of the = form. I=20 already did something like
 
bean.setEmail("cocoon.parameters["email"]");
 
But as I wrote if I got = 300field I=20 would like to find another solution...
 
hope that I = clarify..
 
----- Original Message -----
From:=20 Roberto=20 Marra
Sent: Wednesday, May 18, 2005 = 4:14=20 PM
Subject: Re: CForms & value = of=20 field...

Hi Jeroen &=20 thanx.
I had a look of the = OJB samples.=20 Let say that now my main target is not to write to db but to have the = value of=20 the CForm available in the flowscript & I want to do that via = binding. So=20 in the sitemap I got that now:
 
<map:match = pattern=3D"regContatti">
<map:call = function=3D"handleForm">
<map:parameter = name=3D"function" value=3D"storeContact"/>
<map:parameter = name=3D"form-definition" value=3D"forms/definitions/contatti.xml"/>
<map:parameter = name=3D"bindingURI" value=3D"binding/contatti/bindContatti.xml"/>
</map:call>
</map:match>
 
& in the=20 flowscript
...
   var bindingFile = =3D =20 cocoon.parameters["bindingURI"];
   var bean =3D new=20 Packages.org.mf.ContactBean();
 
  =20 form.createBinding(bindingFile);
   = form.save(bean);
 
  =20 = System.out.println("test:"+form.lookupWidget("ragSoc").getValue());
...
 
  but "test" = return me null.=20 So for sure I didn't understand something...or more...
 
Cheers
ROberto
 
 
 
 
----- Original Message -----
From:=20 Jeroen = Reijn=20
Sent: Wednesday, May 18, 2005 = 9:52=20 AM
Subject: RE: CForms & = value of=20 field...

Hi=20 Roberto,
 
I think binding the form could be a great solution for = your=20 problem. You could check out the OJB samples to see how to = write to the=20 DB.
 
Greetz,
 
Jeroen
-----Original Message-----
From: Roberto Marra=20 [mailto:rmarra@montefiore.ch]
Posted At: Wednesday, May = 18, 2005=20 9:23 AM
Posted To: Cocoon User = List
Conversation:=20 CForms & value of field...
Subject: CForms & = value of=20 field...

Hi = all,
I guess I missed = something=20 about the process of get value from the CForm to the flowscript. = So hope=20 somebody can clarify me it.
 
I got a CForm = definition file=20 & a template. Then in my pipeline I got a match pattern that = call a=20 function & pass the parameter of the CForm in this = way:
 
     <map:parameter = name=3D"ragSoc"=20 = value=3D"{request-param:ragSoc}"/>
     &l= t;map:parameter=20 name=3D"indirizzo"=20 = value=3D"{request-param:indirizzo}"/>
     = ;<map:parameter=20 name=3D"cap"=20 = value=3D"{request-param:cap}"/>
     <m= ap:parameter=20 name=3D"citta"=20 = value=3D"{request-param:citta}"/>
     <= ;map:parameter=20 name=3D"nazione"=20 = value=3D"{request-param:nazione}"/>
     &= lt;map:parameter=20 name=3D"telefono" = value=3D"{request-param:telefono}"/>
then, in my = flowscript I do=20 that:
 
   =20 ragSoc    =3D=20 cocoon.parameters["ragSoc"];
    indirizzo =3D=20 cocoon.parameters["indirizzo"];
   =20 cap       =3D=20 cocoon.parameters["cap"];
   =20 citta     =3D=20 cocoon.parameters["citta"];
    = nazione   =3D=20 cocoon.parameters["nazione"];
    telefono  = =3D=20 cocoon.parameters["telefono"];
   =20 email     =3D=20 cocoon.parameters["email"];
    = lingua   =20 =3D cocoon.parameters["lingua"];
   =20 pwd       =3D=20 cocoon.parameters["pwd"];
    = confpwd   =3D=20 cocoon.parameters["confpwd"];
& then I call a Java method & = I do what=20 I have to do (in this case write the value in the db). So, that = could be=20 interesting for one CForm, but Im making an application programm, = with a=20 lot of CForms with a lot of field. Im sure I have not to send = everytime=20 all the field in this way to flowscript, Im sure there is an = elegant way=20 to do that. Is the binding file the solution? I saw different = example of=20 binding but in the example the binding is used most of the time to = write=20 data in the CForms..
 
Any=20 suggestion?
 
Thanx in advance
Roberto
 
 
 
 
 
 
 
------=_NextPart_000_020B_01C55BC9.0DD51670--