You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Greg Weinger <gw...@mii.ucla.edu> on 2004/07/22 01:12:49 UTC

simple flowscript array question

Hi,

I am simply trying to create a javascript array in flowscript.  The wiki 
and docs are peppered with such examples:

   var array = ["one","two","three"];

Or:

    var array = Array(3);
    array[0] = "blah";

For me, trying to create the array throws a:

org.mozilla.javascript.EvaluatorException: 	
file:/home/knoppix/workspace/DataServer_v2_1/build/webapp/admin/flow/model.js", 
line 154: Java constructor for "java.lang.reflect.Array" with arguments 
"number" not found


It looks like it's trying to create a java array, instead of a 
javascript array.  Can I force it to create a javascript array?


What on earth am I doing wrong?  Has something changed?

Thanks,
Greg

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


Re: Catching java exception in flowscript?

Posted by Olivier Billard <ob...@jouve.fr>.
Hi Kranga,

This works :

try {
     ....
} catch (exception) {
     print(exception.message);
}

(http://devedge.netscape.com/library/manuals/2000/javascript/1.5/reference/stmt.html#1051663)


kranga wrote:

> Is it possible to catch java exceptions in flow scripts? If yes, can someone
> send me a snippet?
> 
> Thanks
> -K


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


Catching java exception in flowscript?

Posted by kranga <kr...@k2d2.org>.
Is it possible to catch java exceptions in flow scripts? If yes, can someone
send me a snippet?

Thanks
-K


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


Re: simple flowscript array question

Posted by Olivier Billard <ob...@jouve.fr>.
Hi Greg,

What about
var array = new Array(3);

http://devedge.netscape.com/library/manuals/2000/javascript/1.5/reference/array.html#1193137

--
Olivier Billard

Greg Weinger wrote:
> Hi,
> 
> I am simply trying to create a javascript array in flowscript.  The wiki 
> and docs are peppered with such examples:
> 
>   var array = ["one","two","three"];
> 
> Or:
> 
>    var array = Array(3);
>    array[0] = "blah";
> 
> For me, trying to create the array throws a:
> 
> org.mozilla.javascript.EvaluatorException:    
> file:/home/knoppix/workspace/DataServer_v2_1/build/webapp/admin/flow/model.js", 
> line 154: Java constructor for "java.lang.reflect.Array" with arguments 
> "number" not found
> 
> 
> It looks like it's trying to create a java array, instead of a 
> javascript array.  Can I force it to create a javascript array?
> 
> 
> What on earth am I doing wrong?  Has something changed?
> 
> Thanks,
> Greg


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


Re: Linking SQL Transformer and XSL Transformer

Posted by Olivier Billard <ob...@jouve.fr>.
Hi Matt,

Using XSP and the ESQL taglib is way simpler for your example.
see http://cocoon.apache.org/2.1/userdocs/xsp/esql.html

Matt Rich wrote:
> 
> Hello!
> 
> I'm currently trying to display sql request results in dropdown menus .
> 
> I think i must have three Transformers in my pipeline:
> 
> - I generate the requests from an XMl file through an XSL Transformer
> - Then I try to execute the generated requests through an SQL Transformer
> - Then I must rearrange the  results '  presentation with another XSL 
> Transformer
> 
> Is that correct ?
> 
> (As for now, the problem must be I don't manage to generate the <sql: 
> ...> tags so that they can be read by the transformer :
> I' ve tried this way :
>          <xsl:element name="sql:execute-query">
>         <xsl:attribute name="xmlns:sql" 
> namespace="http://apache.org/cocoon/SQL/2.0"/>)
> 
> Has anybody an idea?
> 
> Many thanks in advance!!!
> 
> Matt


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


Linking SQL Transformer and XSL Transformer

Posted by Matt Rich <ma...@pasteur.fr>.
Hello!

I'm currently trying to display sql request results in dropdown menus .

I think i must have three Transformers in my pipeline:

- I generate the requests from an XMl file through an XSL Transformer
- Then I try to execute the generated requests through an SQL 
Transformer
- Then I must rearrange the  results '  presentation with another XSL 
Transformer

Is that correct ?

(As for now, the problem must be I don't manage to generate the <sql: 
...> tags so that they can be read by the transformer :
I' ve tried this way :
          <xsl:element name="sql:execute-query">
         <xsl:attribute name="xmlns:sql" 
namespace="http://apache.org/cocoon/SQL/2.0"/>)

Has anybody an idea?

Many thanks in advance!!!

Matt


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


Re: simple flowscript array question

Posted by "John L. Webber" <Jo...@jentro.com>.
Hi Greg,

I'm not a javascript expert, but have you tried:

var array = new Array(3);

See:

http://devedge.netscape.com/library/manuals/2000/javascript/1.5/reference/array.html#1193137

Hope this helps,

John


Greg Weinger wrote:
> Hi,
> 
> I am simply trying to create a javascript array in flowscript.  The wiki 
> and docs are peppered with such examples:
> 
>   var array = ["one","two","three"];
> 
> Or:
> 
>    var array = Array(3);
>    array[0] = "blah";
> 
> For me, trying to create the array throws a:
> 
> org.mozilla.javascript.EvaluatorException:    
> file:/home/knoppix/workspace/DataServer_v2_1/build/webapp/admin/flow/model.js", 
> line 154: Java constructor for "java.lang.reflect.Array" with arguments 
> "number" not found
> 
> 
> It looks like it's trying to create a java array, instead of a 
> javascript array.  Can I force it to create a javascript array?
> 
> 
> What on earth am I doing wrong?  Has something changed?
> 
> Thanks,

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