You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Stefan Dehnert <st...@web.de> on 2003/12/17 16:49:18 UTC

flow javascript class variable

Hi,
I try to programme some Objecs in javascript using the MVC pattern, but 
have no idea how to implement and use class  variables
in Flow javascript ( i tried it in several ways but got only local 
variables)
thanks for help
stefan dehnert


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


Re: flow javascript class variable

Posted by Upayavira <uv...@upaya.co.uk>.
Stefan Dehnert wrote:

> Upayavira wrote:
>
>> Stefan Dehnert wrote:
>>
>>> Hi,
>>> I try to programme some Objecs in javascript using the MVC pattern, 
>>> but have no idea how to implement and use class  variables
>>> in Flow javascript ( i tried it in several ways but got only local 
>>> variables)
>>> thanks for help 
>>
>>
>>
>> The recommended way is to create Java classes for your business 
>> models, and access them from flow. I've been doing this lately, and 
>> adding unit tests to test my Java classes before I use them from 
>> flow, and finding it an absolutely delightful way to work.
>>
>> Regards, Upayavira 
>
>
> Thanks, I thought the same but from the Cocoon samples (Petstore) and 
> Documenation, I had the feeling JavaScript is the recommended way. 

No, no! Javascript is glue only. Business objects in Java.

> Is there a example or anything  else to start. 

Check out linotype, there's some java in there used from flow, I believe.

Regards, Upayavira

>
> Regards, stefan dehnert


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



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


Re: flow javascript class variable

Posted by Stefan Dehnert <st...@web.de>.
Upayavira wrote:

> Stefan Dehnert wrote:
>
>> Hi,
>> I try to programme some Objecs in javascript using the MVC pattern, 
>> but have no idea how to implement and use class  variables
>> in Flow javascript ( i tried it in several ways but got only local 
>> variables)
>> thanks for help 
>
>
> The recommended way is to create Java classes for your business 
> models, and access them from flow. I've been doing this lately, and 
> adding unit tests to test my Java classes before I use them from flow, 
> and finding it an absolutely delightful way to work.
>
> Regards, Upayavira 

Thanks, I thought the same but from the Cocoon samples (Petstore) and 
Documenation, I had the feeling JavaScript is the recommended way.
Is there a example or anything  else to start.
Regards, stefan dehnert


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


Re: flow javascript class variable

Posted by Upayavira <uv...@upaya.co.uk>.
gounis@osmosis.gr wrote:

>On Wed, 17 Dec 2003, Upayavira wrote:
>  
>
>>gounis@osmosis.gr wrote:
>>    
>>
>>>Upayavira
>>>
>>>talking about flowscrip, what method do you use to work with flowscript 
>>>and i'm talking about testin, debuging, .. etc
>>>
>>>i think that its terrible to work without some tools just using an editor
>>>thnx
>>>      
>>>
>>For flowscript itself, I just use a text editor and a browser, and 
>>print("xxxx") statements (that print to the servlet container console).
>>
>>But my flowscripts are relatively simple, calling methods on Java classes.
>>
>>Those Java classes I write within Eclipse. I also write unit tests 
>>within Eclipse that call all of the methods that I use from Flow. That 
>>    
>>
>i have never try eclipse .. i use to run whole cocoon servlet in netBeans 
>.. but in a 2.4 P4 laptop .. some time i need to wait more than a half 
>minute to reach a break point
>  
>
Note - I'm not running Cocoon within Eclipse, just my unit tests. So the 
applications that I'm using Eclipse for are absolutely tiny, and thus 
run pretty quickly.

Doing the same with NetBeans shouldn't be hard.

Regards, Upayavira

>>way, before I try to use the class from flow, I've seen the class work 
>>when running and debugging my unit tests (at which point I've got access 
>>to a full Java debugger). Also, running the test compiles the classes 
>>into the WEB-INF/classes folder, so that when I restart my servlet 
>>container, the classes are already there and waiting.
>>
>>As to debugging flow, there is a flowscript debugger, but I don't really 
>>use it. See this link for more info:
>>
>>http://wiki.cocoondev.org/Wiki.jsp?page=DebugFlowScripts
>>
>>Hope this helps.
>>
>>Upayavira
>>    
>>
>>>>etc......   
>>>>



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


Re: flow javascript class variable

Posted by go...@osmosis.gr.
On Wed, 17 Dec 2003, Upayavira wrote:

> gounis@osmosis.gr wrote:
> 
> >Upayavira
> >
> >talking about flowscrip, what method do you use to work with flowscript 
> >and i'm talking about testin, debuging, .. etc
> >
> >i think that its terrible to work without some tools just using an editor
> >thnx
> >  
> >
> For flowscript itself, I just use a text editor and a browser, and 
> print("xxxx") statements (that print to the servlet container console).
> 
> But my flowscripts are relatively simple, calling methods on Java classes.
> 
> Those Java classes I write within Eclipse. I also write unit tests 
> within Eclipse that call all of the methods that I use from Flow. That 


i have never try eclipse .. i use to run whole cocoon servlet in netBeans 
.. but in a 2.4 P4 laptop .. some time i need to wait more than a half 
minute to reach a break point

are things in eclipse better ?



> way, before I try to use the class from flow, I've seen the class work 
> when running and debugging my unit tests (at which point I've got access 
> to a full Java debugger). Also, running the test compiles the classes 
> into the WEB-INF/classes folder, so that when I restart my servlet 
> container, the classes are already there and waiting.
> 
> As to debugging flow, there is a flowscript debugger, but I don't really 
> use it. See this link for more info:
> 
> http://wiki.cocoondev.org/Wiki.jsp?page=DebugFlowScripts
> 
> Hope this helps.
> 
> Upayavira
> 
> >--stavros
> >
> >
> >On Wed, 17 Dec 2003, Upayavira wrote:
> >
> >  
> >
> >>Stefan Dehnert wrote:
> >>
> >>    
> >>
> >>>Hi,
> >>>I try to programme some Objecs in javascript using the MVC pattern, 
> >>>but have no idea how to implement and use class  variables
> >>>in Flow javascript ( i tried it in several ways but got only local 
> >>>variables)
> >>>thanks for help 
> >>>      
> >>>
> >>The recommended way is to create Java classes for your business models, 
> >>and access them from flow. I've been doing this lately, and adding unit 
> >>tests to test my Java classes before I use them from flow, and finding 
> >>it an absolutely delightful way to work.
> >>
> >>Regards, Upayavira
> >>
> >>
> >>
> >>---------------------------------------------------------------------
> >>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> >>For additional commands, e-mail: users-help@cocoon.apache.org
> >>
> >>
> >>    
> >>
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> >For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
> >  
> >
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 


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


Re: flow javascript class variable

Posted by Upayavira <uv...@upaya.co.uk>.
gounis@osmosis.gr wrote:

>Upayavira
>
>talking about flowscrip, what method do you use to work with flowscript 
>and i'm talking about testin, debuging, .. etc
>
>i think that its terrible to work without some tools just using an editor
>thnx
>  
>
For flowscript itself, I just use a text editor and a browser, and 
print("xxxx") statements (that print to the servlet container console).

But my flowscripts are relatively simple, calling methods on Java classes.

Those Java classes I write within Eclipse. I also write unit tests 
within Eclipse that call all of the methods that I use from Flow. That 
way, before I try to use the class from flow, I've seen the class work 
when running and debugging my unit tests (at which point I've got access 
to a full Java debugger). Also, running the test compiles the classes 
into the WEB-INF/classes folder, so that when I restart my servlet 
container, the classes are already there and waiting.

As to debugging flow, there is a flowscript debugger, but I don't really 
use it. See this link for more info:

http://wiki.cocoondev.org/Wiki.jsp?page=DebugFlowScripts

Hope this helps.

Upayavira

>--stavros
>
>
>On Wed, 17 Dec 2003, Upayavira wrote:
>
>  
>
>>Stefan Dehnert wrote:
>>
>>    
>>
>>>Hi,
>>>I try to programme some Objecs in javascript using the MVC pattern, 
>>>but have no idea how to implement and use class  variables
>>>in Flow javascript ( i tried it in several ways but got only local 
>>>variables)
>>>thanks for help 
>>>      
>>>
>>The recommended way is to create Java classes for your business models, 
>>and access them from flow. I've been doing this lately, and adding unit 
>>tests to test my Java classes before I use them from flow, and finding 
>>it an absolutely delightful way to work.
>>
>>Regards, Upayavira
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>>For additional commands, e-mail: users-help@cocoon.apache.org
>>
>>
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>For additional commands, e-mail: users-help@cocoon.apache.org
>
>
>  
>



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


Re: flow javascript class variable

Posted by go...@osmosis.gr.


Upayavira

talking about flowscrip, what method do you use to work with flowscript 
and i'm talking about testin, debuging, .. etc

i think that its terrible to work without some tools just using an editor
thnx

--stavros


On Wed, 17 Dec 2003, Upayavira wrote:

> Stefan Dehnert wrote:
> 
> > Hi,
> > I try to programme some Objecs in javascript using the MVC pattern, 
> > but have no idea how to implement and use class  variables
> > in Flow javascript ( i tried it in several ways but got only local 
> > variables)
> > thanks for help 
> 
> The recommended way is to create Java classes for your business models, 
> and access them from flow. I've been doing this lately, and adding unit 
> tests to test my Java classes before I use them from flow, and finding 
> it an absolutely delightful way to work.
> 
> Regards, Upayavira
> 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 


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


Re: flow javascript class variable

Posted by Upayavira <uv...@upaya.co.uk>.
Stefan Dehnert wrote:

> Hi,
> I try to programme some Objecs in javascript using the MVC pattern, 
> but have no idea how to implement and use class  variables
> in Flow javascript ( i tried it in several ways but got only local 
> variables)
> thanks for help 

The recommended way is to create Java classes for your business models, 
and access them from flow. I've been doing this lately, and adding unit 
tests to test my Java classes before I use them from flow, and finding 
it an absolutely delightful way to work.

Regards, Upayavira



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


Re: flow javascript class variable

Posted by David Hello <da...@fr.thalesgroup.com>.
Hello,
I think a way to do that is to define global variable in your js file.
Have a look on samples/petstore/flow/petstore.js and see how it is done.
It use VIEW as a class variable with getView and setView method.

David

Stefan Dehnert wrote:

> Hi,
> I try to programme some Objecs in javascript using the MVC pattern, 
> but have no idea how to implement and use class  variables
> in Flow javascript ( i tried it in several ways but got only local 
> variables)
> thanks for help
> stefan dehnert
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>



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