You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Angelo Immediata <an...@libero.it> on 2005/07/21 13:03:25 UTC

Cocoon Form setSelectionList method

Hi all; i'm using cocoon 2.1.7; i need to put in a selection some values; these values are takne from a web service; i have this method that from the web service create a DOM XML:

function getDoc(theBuff){

  try{
  
    var fac = javax.xml.parsers.DocumentBuilderFactory.newInstance();
    var builder = fac.newDocumentBuilder();
    var theBytes = theBuff.toString().getBytes();
    var theStream = new java.io.ByteArrayInputStream(theBytes);
    var result = builder.parse(theStream);
    return result;
  }catch(x){
    print(x);
     x.printStackTrace();
  }
}

This method gives this result:

<?xml version="1.0" encoding="UTF-8"?>
<fd:selection-list>
 <fd-item value="000014">
   <fd:label>SAN PAOLO</fd:label>
  </fd-item>
  <fd-item value="005101">
    <fd:label>SAN PAOLO SOLBRITO</fd:label>
  </fd-item>
</fd:selection-list>
This is a org.w3c.dom.Document object... then i do this thing:

form.lookupWidget("codice").setSelectionList(theDoc);

Well i have this error:

org.apache.cocoon.ProcessingException: Failed to execute pipeline.: file:/C:/Documents%20and%20Settings/Mario/jbproject/PMM2/pmm/portal/coplets/S038/documents/ricPubblRito.jx:25:81:org.apache.cocoon.ResourceNotFoundException: Resource not found.: org.apache.excalibur.source.SourceNotFoundException: file:/C:/Documents and Settings/Mario/jbproject/PMM2/pmm/portal/coplets/S038/[#document: null] doesn't exist.

Can anybody tell me where i'm wrong?
Can anybody show me a working sample?
Thanks to all.
Angelo



____________________________________________________________
6X velocizzare la tua navigazione a 56k? 6X Web Accelerator di Libero!
Scaricalo su INTERNET GRATIS 6X http://www.libero.it



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


Re: Cocoon Form setSelectionList method

Posted by Antonio Gallardo <ag...@agssa.net>.
Angelo Immediata wrote:

>Hi all; i'm using cocoon 2.1.7; i need to put in a selection some values; these values are takne from a web service; i have this method that from the web service create a DOM XML:
>
>function getDoc(theBuff){
>
>  try{
>  
>    var fac = javax.xml.parsers.DocumentBuilderFactory.newInstance();
>    var builder = fac.newDocumentBuilder();
>    var theBytes = theBuff.toString().getBytes();
>    var theStream = new java.io.ByteArrayInputStream(theBytes);
>    var result = builder.parse(theStream);
>    return result;
>  }catch(x){
>    print(x);
>     x.printStackTrace();
>  }
>}
>
>This method gives this result:
>
><?xml version="1.0" encoding="UTF-8"?>
><fd:selection-list>
> <fd-item value="000014">
>   <fd:label>SAN PAOLO</fd:label>
>  </fd-item>
>  <fd-item value="005101">
>    <fd:label>SAN PAOLO SOLBRITO</fd:label>
>  </fd-item>
></fd:selection-list>
>This is a org.w3c.dom.Document object... then i do this thing:
>
>form.lookupWidget("codice").setSelectionList(theDoc);
>
>Well i have this error:
>
>org.apache.cocoon.ProcessingException: Failed to execute pipeline.: file:/C:/Documents%20and%20Settings/Mario/jbproject/PMM2/pmm/portal/coplets/S038/documents/ricPubblRito.jx:25:81:org.apache.cocoon.ResourceNotFoundException: Resource not found.: org.apache.excalibur.source.SourceNotFoundException: file:/C:/Documents and Settings/Mario/jbproject/PMM2/pmm/portal/coplets/S038/[#document: null] doesn't exist.
>  
>
"Resource not found" in "file:/C:/Documents%20and%20Settings"

I never used cocoon on windows. Please do a small test: Try to avoid 
spaces in dir and file names. Then see what happens. I am not sure if 
this can be the problem.

Best Regards,

Antonio Gallardo


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