cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Paul Friedman <pfried...@quoininc.com>
Subject Re: Help, Java Flow drives me crazy
Date Wed, 30 Mar 2005 14:04:54 GMT
gkrishna -

I believe (but I may be wrong here) that the only supported language for 
flow is javascript.

@see http://cocoon.apache.org/2.1/userdocs/flow/using.html

so to get your calculator method to be called

1) change the sitemap flow declaration

from:
 <map:flow language="java">
  <map:script src="CalculatorFlow"/>
 </map:flow>

to:
 <map:flow language="javascript">
  <map:script src="calculator.js"/>
 </map:flow>

2) create a file called calculator.js and declare a function

e.g.
importClass(Packages.com.foo.bar.CalculatorFlow);
function doCalculator() {
    var calculator = new CalculatorFlow().doCalculator();

    ... do something with the calculator ...
}

3) call the function from your sitemap

<map:call function="doCalculator"/>


In effect, use the flow to call a javascript function that in turn calls 
the Java method.

HTH.

- paul

p.s. Generally the calls to sendPage and sendPageAndWait are called from 
the javascript function and not from the java class. You might want to 
start anew and follow the tutorial here: 
http://cocoon.apache.org/2.1/userdocs/flow/tutor.html to see where the 
particular flow calls are made.


gkrishna wrote:

>Hello everybody,
>
>Using cocoon 2.1.6..
>
>i have attached a simple calculator java flow application. i am calling a function doCalculator
from CalculatorFlow in the sitemap.
>
>When i deploy the application in tomcat i always get,
>
>No method 'doCalculator' found. {calculator=public void CalculatorFlow.doCalculator()}
>
>though the method is mentioned in CalculatorFlow.java
>
>Can someone point me in correct direction here, please. It really drives me crazy.
>
>Hoping for your reply.
>thanks.
>



-- 
No virus found in this outgoing message.
Checked by AVG Anti-Virus.
Version: 7.0.308 / Virus Database: 266.8.4 - Release Date: 3/27/2005


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


Mime
View raw message