RE: Sitemap: Error calling continuation

2013-01-14 Thread Laurent Medioni
Hi,
What exact version of Cocoon are you using ? 2.1.11 ?
If you want to share continuations between sitemaps you might have to activate 
the continuation-sharing-bug-compatible attribute of the continuations-manager 
component in cocoon.xconf.
Otherwise a continuation should only be used in the sitemap it has been created 
in.
Laurent

The information in this e-mail and any attachments is confidential and may be 
legally privileged. It is intended solely for the addressee or addressees. Any 
use or disclosure of the contents of this e-mail/attachments by a not intended 
recipient is unauthorized and may be unlawful. If you have received this e-mail 
in error please notify the sender. Please note that any views or opinions 
presented in this e-mail are solely those of the author and do not necessarily 
represent those of TEMENOS. We recommend that you check this e-mail and any 
attachments against viruses. TEMENOS accepts no liability for any damage caused 
by any malicious code or virus transmitted by this e-mail.

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



Multipage CForm using Ajax - Non ascii Characters

2013-01-14 Thread Peter Sparkes

Hi

Cocoon 2.11

I have implemented a multipage CForm which uses Ajax. The form is based on the 
example at

http://cocoon.zones.apache.org/cocoon21/samples/blocks/forms/do-multipage.flow

The  form works fine except that it does not save non ascii characters 
correctly eg.

É EUR  ç  £



If I use one very long form without Ajax the above characters are correctly 
saved

Help please, How can I fix this problem


Peter


RE: Multipage CForm using Ajax - Non ascii Characters

2013-01-14 Thread Robby Pelssers
You will probably need to encode the characters if you make an ajax call…

var  somevalue = encodeURIComponent(“this is a value to be encoded”);

Robby

From: Peter Sparkes [mailto:pe...@didm.co.uk]
Sent: Monday, January 14, 2013 3:18 PM
To: Cocoon users
Subject: Multipage CForm using Ajax - Non ascii Characters

Hi

Cocoon 2.11

I have implemented a multipage CForm which uses Ajax. The form is based on the 
example at


http://cocoon.zones.apache.org/cocoon21/samples/blocks/forms/do-multipage.flow

The  form works fine except that it does not save non ascii characters 
correctly eg.
É €  ç  £


If I use one very long form without Ajax the above characters are correctly 
saved

Help please, How can I fix this problem


Peter


Re: Multipage CForm using Ajax - Non ascii Characters

2013-01-14 Thread gelo1234
Ajax calls use default character encoding defined by HTTP 1.1 spec (which
iso-8859-1, not UTF-8). You have to encode BEFORE sending and decode AFTER
retrieving those strings.
Encode with encodeURIComponent, decode with decodeURIComponent (if
Javascript).

Greetings,
Greg


2013/1/14 Peter Sparkes pe...@didm.co.uk

  Hi

 Cocoon 2.11

 I have implemented a multipage CForm which uses Ajax. The form is based on
 the example at


 http://cocoon.zones.apache.org/cocoon21/samples/blocks/forms/do-multipage.flow

 The  form works fine except that it does not save non ascii characters
 correctly eg.

 É €  ç  £


 If I use one very long form without Ajax the above characters are
 correctly saved

 Help please, How can I fix this problem


 Peter



Re: Multipage CForm using Ajax - Non ascii Characters

2013-01-14 Thread Peter Sparkes

Thanks Greg and Robby for your replies.

Unfortunately I can't get it to work. I assume encodeURIComponent goes into the 
flowscript:

   function multipage() {
   var lodgeId = cocoon.parameters.lodgeId;
   cocoon.request.setAttribute(lodgeId, lodgeId);

   var documentURI = cocoon.parameters[documentURI];
   // parse the document to a DOM-tree
   var document = loadDocument(documentURI);

   //document = decodeURIComponent (document);

   // get the documentURI parameter from the sitemap which contains the 
location of the form
   definition (model)
   var definitionURI = cocoon.parameters[definitionURI];

   //create new form
   var form = new Form(definitionURI);

   // get the documentURI parameter from the sitemap which contains the 
location of the binding
   file
var bindingURI = cocoon.parameters[bindingURI];
   form.createBinding(bindingURI);

// bind the document data to the form
form.load(document);

// show the form to the user until it is validated successfully
   form.showForm(lodgemul-display-pipeline.jx);

// bind the form's data back to the document

form.save(document);

// save the DOM-tree back to an XML file,
   document = encodeURIComponent(document);
saveDocument(document, documentURI);

// show the xml generated from the form
var success ='/BB/England/Devon/Bideford/'+ lodgeId+'.html';
   //cocoon.redirectTo('/office/' + lodgeno+'.htm');
cocoon.sendPage(success);
   }

document = encodeURIComponent(document); produces the following error when I 
submit the completed form

Can't find method org.apache.cocoon.xml.dom.DOMStreamer.stream(string).

What am I doing wrong

Peter

On 14/01/2013 14:27, gelo1234 wrote:
Ajax calls use default character encoding defined by HTTP 1.1 spec (which iso-8859-1, not UTF-8). 
You have to encode BEFORE sending and decode AFTER retrieving those strings.

Encode with encodeURIComponent, decode with decodeURIComponent (if Javascript).

Greetings,
Greg 



On 14/01/2013 14:22, Robby Pelssers wrote:


You will probably need to encode the characters if you make an ajax call…

var  somevalue = encodeURIComponent(“this is a value to be encoded”);

Robby

*From:*Peter Sparkes [mailto:pe...@didm.co.uk]
*Sent:* Monday, January 14, 2013 3:18 PM
*To:* Cocoon users
*Subject:* Multipage CForm using Ajax - Non ascii Characters

Hi

Cocoon 2.11

I have implemented a multipage CForm which uses Ajax. The form is based on the 
example at

http://cocoon.zones.apache.org/cocoon21/samples/blocks/forms/do-multipage.flow

The  form works fine except that it does not save non ascii characters 
correctly eg.

É €  ç  £



If I use one very long form without Ajax the above characters are correctly 
saved

Help please, How can I fix this problem


Peter





RE: Multipage CForm using Ajax - Non ascii Characters

2013-01-14 Thread Robby Pelssers
Hi Peter,

No…encodeURIComponent should go in the client javascript.
And in flowscript you have to decode the parameter value again.

importClass(Packages.java.net.URLDecoder);

var decodedvalue = URLDecoder.decode(cocoon.request.getParameter(“someparam”);


Kind regards,
Robby



From: Peter Sparkes [mailto:pe...@didm.co.uk]
Sent: Monday, January 14, 2013 4:45 PM
To: users@cocoon.apache.org
Subject: Re: Multipage CForm using Ajax - Non ascii Characters

Thanks Greg and Robby for your replies.

Unfortunately I can't get it to work. I assume encodeURIComponent goes into the 
flowscript:
function multipage() {
   var lodgeId = cocoon.parameters.lodgeId;
   cocoon.request.setAttribute(lodgeId, lodgeId);

   var documentURI = cocoon.parameters[documentURI];
   // parse the document to a DOM-tree
   var document = loadDocument(documentURI);

   //document = decodeURIComponent (document);

   // get the documentURI parameter from the sitemap which contains the 
location of the form definition (model)
   var definitionURI = cocoon.parameters[definitionURI];

   //create new form
   var form = new Form(definitionURI);

   // get the documentURI parameter from the sitemap which contains the 
location of the binding file
var bindingURI = cocoon.parameters[bindingURI];
form.createBinding(bindingURI);

// bind the document data to the form
form.load(document);

// show the form to the user until it is validated successfully
form.showForm(lodgemul-display-pipeline.jx);

// bind the form's data back to the document

form.save(document);

// save the DOM-tree back to an XML file,
document = encodeURIComponent(document);
saveDocument(document, documentURI);

// show the xml generated from the form
var success ='/BB/England/Devon/Bideford/'+ lodgeId+'.html';
//cocoon.redirectTo('/office/' + lodgeno+'.htm');
cocoon.sendPage(success);
}
document = encodeURIComponent(document);  produces the following error when I 
submit the completed form

Can't find method org.apache.cocoon.xml.dom.DOMStreamer.stream(string).

What am I doing wrong

Peter

On 14/01/2013 14:27, gelo1234 wrote:
Ajax calls use default character encoding defined by HTTP 1.1 spec (which 
iso-8859-1, not UTF-8). You have to encode BEFORE sending and decode AFTER 
retrieving those strings.
Encode with encodeURIComponent, decode with decodeURIComponent (if Javascript).
Greetings,
Greg


On 14/01/2013 14:22, Robby Pelssers wrote:
You will probably need to encode the characters if you make an ajax call…

var  somevalue = encodeURIComponent(“this is a value to be encoded”);

Robby

From: Peter Sparkes [mailto:pe...@didm.co.uk]
Sent: Monday, January 14, 2013 3:18 PM
To: Cocoon users
Subject: Multipage CForm using Ajax - Non ascii Characters

Hi

Cocoon 2.11

I have implemented a multipage CForm which uses Ajax. The form is based on the 
example at


http://cocoon.zones.apache.org/cocoon21/samples/blocks/forms/do-multipage.flow

The  form works fine except that it does not save non ascii characters 
correctly eg.
É €  ç  £


If I use one very long form without Ajax the above characters are correctly 
saved

Help please, How can I fix this problem


Peter



Re: Multipage CForm using Ajax - Non ascii Characters

2013-01-14 Thread gelo1234
Have you tried google this ? e.g.
http://cocoon.10839.n7.nabble.com/Binding-Encoding-with-CForms-Dojo-td57359.html
http://cocoon.apache.org/2.2/1366_1_1.html

Those clues should fix your problem.

Greetings,
-Greg


2013/1/14 Peter Sparkes pe...@didm.co.uk

  Hi Robby,

 Thanks for your reply.

 The problem is that I don't have any client side scripting. I am using
 CForms to allow the site owner to populate a database. The data is then
 used in a number of different xhtml pages.

 Kind regards

 Peter


 On 14/01/2013 15:55, Robby Pelssers wrote:

  Hi Peter,

 ** **

 No…encodeURIComponent should go in the client javascript.  

 And in flowscript you have to decode the parameter value again.  

 ** **

 importClass(Packages.java.net.URLDecoder);

 ** **

 var decodedvalue =
 URLDecoder.decode(cocoon.request.getParameter(“someparam”);

 ** **

 ** **

 Kind regards,

 Robby

 ** **

 ** **

 ** **

 *From:* Peter Sparkes [mailto:pe...@didm.co.uk pe...@didm.co.uk]
 *Sent:* Monday, January 14, 2013 4:45 PM
 *To:* users@cocoon.apache.org
 *Subject:* Re: Multipage CForm using Ajax - Non ascii Characters

 ** **

 Thanks Greg and Robby for your replies.

 Unfortunately I can't get it to work. I assume encodeURIComponent goes
 into the flowscript:

 function multipage() {
var lodgeId = cocoon.parameters.lodgeId;
cocoon.request.setAttribute(lodgeId, lodgeId);

var documentURI = cocoon.parameters[documentURI];
// parse the document to a DOM-tree
var document = loadDocument(documentURI);

//document = decodeURIComponent (document);

// get the documentURI parameter from the sitemap which contains the
 location of the form definition (model)
var definitionURI = cocoon.parameters[definitionURI];

//create new form
var form = new Form(definitionURI);

// get the documentURI parameter from the sitemap which contains the
 location of the binding file
 var bindingURI = cocoon.parameters[bindingURI];
 form.createBinding(bindingURI);

 // bind the document data to the form
 form.load(document);

 // show the form to the user until it is validated successfully
 form.showForm(lodgemul-display-pipeline.jx);

 // bind the form's data back to the document

 form.save(document);

 // save the DOM-tree back to an XML file,
 document = encodeURIComponent(document);
 saveDocument(document, documentURI);

 // show the xml generated from the form
 var success ='/BB/England/Devon/Bideford/'+ lodgeId+'.html';
 //cocoon.redirectTo('/office/' + lodgeno+'.htm');
 cocoon.sendPage(success);
 }

 document = encodeURIComponent(document);  produces the following error
 when I submit the completed form

 Can't find method org.apache.cocoon.xml.dom.DOMStreamer.stream(string).

 What am I doing wrong

 Peter

 On 14/01/2013 14:27, gelo1234 wrote:

   Ajax calls use default character encoding defined by HTTP 1.1 spec
 (which iso-8859-1, not UTF-8). You have to encode BEFORE sending and decode
 AFTER retrieving those strings.

 Encode with encodeURIComponent, decode with decodeURIComponent (if
 Javascript).

 Greetings,

 Greg 



 On 14/01/2013 14:22, Robby Pelssers wrote:

 You will probably need to encode the characters if you make an ajax call…*
 ***

  

 var  somevalue = encodeURIComponent(“this is a value to be
 encoded”);

  

 Robby

  

 *From:* Peter Sparkes [mailto:pe...@didm.co.uk pe...@didm.co.uk]
 *Sent:* Monday, January 14, 2013 3:18 PM
 *To:* Cocoon users
 *Subject:* Multipage CForm using Ajax - Non ascii Characters

  

 Hi

 Cocoon 2.11

 I have implemented a multipage CForm which uses Ajax. The form is based on
 the example at


 http://cocoon.zones.apache.org/cocoon21/samples/blocks/forms/do-multipage.flow

 The  form works fine except that it does not save non ascii characters
 correctly eg.

 É €  ç  £



 If I use one very long form without Ajax the above characters are
 correctly saved

 Help please, How can I fix this problem


 Peter 

 ** **