You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ofbiz.apache.org by vijay Si <st...@gmail.com> on 2007/08/08 10:19:47 UTC

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

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

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

Posted by Scott Gray <le...@gmail.com>.
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 <ac...@gmail.com> 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 <le...@gmail.com>:
> >
> > 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 <st...@gmail.com> 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 <le...@gmail.com> 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 <st...@gmail.com> 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
> > > > >
> > > >
> > >
> >
>

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

Posted by Rodrigo Souza <ac...@gmail.com>.
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 <le...@gmail.com>:
>
> 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 <st...@gmail.com> 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 <le...@gmail.com> 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 <st...@gmail.com> 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
> > > >
> > >
> >
>

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

Posted by Scott Gray <le...@gmail.com>.
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 <st...@gmail.com> 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 <le...@gmail.com> 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 <st...@gmail.com> 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
> > >
> >
>

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

Posted by vijay Si <st...@gmail.com>.
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 <le...@gmail.com> 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 <st...@gmail.com> 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
> >
>

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

Posted by Scott Gray <le...@gmail.com>.
Why not just run the bsh script before the ftl like we do everywhere in
OFBiz?

Regards
Scott

On 08/08/07, vijay Si <st...@gmail.com> 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
>