How to Invoke a function written in a Bsh script through FTL.

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

How to Invoke a function written in a Bsh script through FTL.

vijay Si
Hello friends,

I wanted to invoke a method (with parameters) from an ftl file .

The method needs to be written in a script file (to separate out
presentation from business logic).

I have read the ftl manual but it does not have an example of passing
arguments to a method which is defined in other script file.

What are the possible ways to do this?

Regards
Reply | Threaded
Open this post in threaded view
|

Re: How to Invoke a function written in a Bsh script through FTL.

Scott Gray
Why not just run the bsh script before the ftl like we do everywhere in
OFBiz?

Regards
Scott

On 08/08/07, vijay Si <[hidden email]> wrote:

>
> Hello friends,
>
> I wanted to invoke a method (with parameters) from an ftl file .
>
> The method needs to be written in a script file (to separate out
> presentation from business logic).
>
> I have read the ftl manual but it does not have an example of passing
> arguments to a method which is defined in other script file.
>
> What are the possible ways to do this?
>
> Regards
>
Reply | Threaded
Open this post in threaded view
|

Re: How to Invoke a function written in a Bsh script through FTL.

vijay Si
Hi Scott,
 I will explain the problem in  detail.
I have a function fnRT(int x1,int x2...........,float xc1,...)
The values of x1, x2 ..... will vary scince i will invoke fnRT() MORE Than
once with different parameter values.

I wanted that each time a fnRt() is invoked in FTL,    The method

gets invoked in BSH Script which does a necessary calculations and passes
out the results as a list to FTL.
FTL can then use the results for display.

My problem is to handle the runtime parameter passing bsh script and then
retrieving it in ftl...............If i run the bsh script before the
ftl.........then how am i supposed to get the function parameters in
advance...

Regards




On 8/8/07, Scott Gray <[hidden email]> wrote:

>
> Why not just run the bsh script before the ftl like we do everywhere in
> OFBiz?
>
> Regards
> Scott
>
> On 08/08/07, vijay Si <[hidden email]> wrote:
> >
> > Hello friends,
> >
> > I wanted to invoke a method (with parameters) from an ftl file .
> >
> > The method needs to be written in a script file (to separate out
> > presentation from business logic).
> >
> > I have read the ftl manual but it does not have an example of passing
> > arguments to a method which is defined in other script file.
> >
> > What are the possible ways to do this?
> >
> > Regards
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: How to Invoke a function written in a Bsh script through FTL.

Scott Gray
Hi Vijay

Everything that is available to the ftl is available to a bsh script running
beforehand, you just need to prepare all your data first then use the ftl to
lay it out.

Regards
Scott


On 08/08/07, vijay Si <[hidden email]> wrote:

>
> Hi Scott,
> I will explain the problem in  detail.
> I have a function fnRT(int x1,int x2...........,float xc1,...)
> The values of x1, x2 ..... will vary scince i will invoke fnRT() MORE Than
> once with different parameter values.
>
> I wanted that each time a fnRt() is invoked in FTL,    The method
>
> gets invoked in BSH Script which does a necessary calculations and passes
> out the results as a list to FTL.
> FTL can then use the results for display.
>
> My problem is to handle the runtime parameter passing bsh script and then
> retrieving it in ftl...............If i run the bsh script before the
> ftl.........then how am i supposed to get the function parameters in
> advance...
>
> Regards
>
>
>
>
> On 8/8/07, Scott Gray <[hidden email]> wrote:
> >
> > Why not just run the bsh script before the ftl like we do everywhere in
> > OFBiz?
> >
> > Regards
> > Scott
> >
> > On 08/08/07, vijay Si <[hidden email]> wrote:
> > >
> > > Hello friends,
> > >
> > > I wanted to invoke a method (with parameters) from an ftl file .
> > >
> > > The method needs to be written in a script file (to separate out
> > > presentation from business logic).
> > >
> > > I have read the ftl manual but it does not have an example of passing
> > > arguments to a method which is defined in other script file.
> > >
> > > What are the possible ways to do this?
> > >
> > > Regards
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: How to Invoke a function written in a Bsh script through FTL.

Rodrigo Lima-2
Other sugestion, call the method from .ftl:
i.e:
in .ftl file:

<#assign result = Static["package.ClassName"].yourMethod( par1,par2....) >


2007/8/8, Scott Gray <[hidden email]>:

>
> Hi Vijay
>
> Everything that is available to the ftl is available to a bsh script
> running
> beforehand, you just need to prepare all your data first then use the ftl
> to
> lay it out.
>
> Regards
> Scott
>
>
> On 08/08/07, vijay Si <[hidden email]> wrote:
> >
> > Hi Scott,
> > I will explain the problem in  detail.
> > I have a function fnRT(int x1,int x2...........,float xc1,...)
> > The values of x1, x2 ..... will vary scince i will invoke fnRT() MORE
> Than
> > once with different parameter values.
> >
> > I wanted that each time a fnRt() is invoked in FTL,    The method
> >
> > gets invoked in BSH Script which does a necessary calculations and
> passes
> > out the results as a list to FTL.
> > FTL can then use the results for display.
> >
> > My problem is to handle the runtime parameter passing bsh script and
> then
> > retrieving it in ftl...............If i run the bsh script before the
> > ftl.........then how am i supposed to get the function parameters in
> > advance...
> >
> > Regards
> >
> >
> >
> >
> > On 8/8/07, Scott Gray <[hidden email]> wrote:
> > >
> > > Why not just run the bsh script before the ftl like we do everywhere
> in
> > > OFBiz?
> > >
> > > Regards
> > > Scott
> > >
> > > On 08/08/07, vijay Si <[hidden email]> wrote:
> > > >
> > > > Hello friends,
> > > >
> > > > I wanted to invoke a method (with parameters) from an ftl file .
> > > >
> > > > The method needs to be written in a script file (to separate out
> > > > presentation from business logic).
> > > >
> > > > I have read the ftl manual but it does not have an example of
> passing
> > > > arguments to a method which is defined in other script file.
> > > >
> > > > What are the possible ways to do this?
> > > >
> > > > Regards
> > > >
> > >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: How to Invoke a function written in a Bsh script through FTL.

Scott Gray
I suppose that could work if you can find a way of executing the bsh through
a static call, but for anything other than simple data calls like
getNameForParty (i think it's called) it's really not the best way to go.

Regards
Scott

On 09/08/2007, Rodrigo Souza <[hidden email]> wrote:

>
> Other sugestion, call the method from .ftl:
> i.e:
> in .ftl file:
>
> <#assign result = Static["package.ClassName"].yourMethod( par1,par2....) >
>
>
> 2007/8/8, Scott Gray <[hidden email]>:
> >
> > Hi Vijay
> >
> > Everything that is available to the ftl is available to a bsh script
> > running
> > beforehand, you just need to prepare all your data first then use the
> ftl
> > to
> > lay it out.
> >
> > Regards
> > Scott
> >
> >
> > On 08/08/07, vijay Si <[hidden email]> wrote:
> > >
> > > Hi Scott,
> > > I will explain the problem in  detail.
> > > I have a function fnRT(int x1,int x2...........,float xc1,...)
> > > The values of x1, x2 ..... will vary scince i will invoke fnRT() MORE
> > Than
> > > once with different parameter values.
> > >
> > > I wanted that each time a fnRt() is invoked in FTL,    The method
> > >
> > > gets invoked in BSH Script which does a necessary calculations and
> > passes
> > > out the results as a list to FTL.
> > > FTL can then use the results for display.
> > >
> > > My problem is to handle the runtime parameter passing bsh script and
> > then
> > > retrieving it in ftl...............If i run the bsh script before the
> > > ftl.........then how am i supposed to get the function parameters in
> > > advance...
> > >
> > > Regards
> > >
> > >
> > >
> > >
> > > On 8/8/07, Scott Gray <[hidden email]> wrote:
> > > >
> > > > Why not just run the bsh script before the ftl like we do everywhere
> > in
> > > > OFBiz?
> > > >
> > > > Regards
> > > > Scott
> > > >
> > > > On 08/08/07, vijay Si <[hidden email]> wrote:
> > > > >
> > > > > Hello friends,
> > > > >
> > > > > I wanted to invoke a method (with parameters) from an ftl file .
> > > > >
> > > > > The method needs to be written in a script file (to separate out
> > > > > presentation from business logic).
> > > > >
> > > > > I have read the ftl manual but it does not have an example of
> > passing
> > > > > arguments to a method which is defined in other script file.
> > > > >
> > > > > What are the possible ways to do this?
> > > > >
> > > > > Regards
> > > > >
> > > >
> > >
> >
>