Can we load an .ftl file using <actions>

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

Can we load an .ftl file using <actions>

vijay Si
Hi,

I wanted to load an ftl file just to pull data from the .bsh script file.
This ftl file will not display anything directly...rather i wanted to
<#include> all of it's content {which includes the dynamically pulled data
from scripts} into an .xml file ....so that my xml file has all the static
data. I am not able to use dynamic data pulled by xml directly i.e cannot
use ${} inside my xml. So i thought of pulling all dynamic stuff into an
.ftl file and then <#include> this data in the xml file....

Here i am confronted with the problem of loading ftl file just like .bsh
file..........so.....can i put .ftl files in <actions></actions> and load it
in advance. Or please suggest some other way of loading the ftl file just
for the sake of pulling data from the script.

Regards
Reply | Threaded
Open this post in threaded view
|

Re: Can we load an .ftl file using <actions>

jonwimp
Hi Vijay,

What "dynamic data" are you talking about?

You can use bsh scripts to pull in data from database. Is that what you mean by "dynamic"?

What do you mean by "xml"?

You can actually use ${ } inside your widget screen definitions. Try <label>${someVariable}</label>.

While .ftl files can access static classes to perform some "dynamic data retrieval", it is not as
clean and easy as using .bsh.

In your .bsh, simply do: context.put("someVariable", "Whatever data you want to pull in");

Jonathon

vijay Si wrote:

> Hi,
>
> I wanted to load an ftl file just to pull data from the .bsh script file.
> This ftl file will not display anything directly...rather i wanted to
> <#include> all of it's content {which includes the dynamically pulled data
> from scripts} into an .xml file ....so that my xml file has all the static
> data. I am not able to use dynamic data pulled by xml directly i.e cannot
> use ${} inside my xml. So i thought of pulling all dynamic stuff into an
> .ftl file and then <#include> this data in the xml file....
>
> Here i am confronted with the problem of loading ftl file just like .bsh
> file..........so.....can i put .ftl files in <actions></actions> and load it
> in advance. Or please suggest some other way of loading the ftl file just
> for the sake of pulling data from the script.
>
> Regards
>
>
>
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.484 / Virus Database: 269.12.10/977 - Release Date: 8/28/2007 4:29 PM

Reply | Threaded
Open this post in threaded view
|

Re: Can we load an .ftl file using <actions>

vijay Si
Hi Jonathon,

My constraint is as follows.

I need to have an xml file. This xml file is supposed to have some data that
comes from the database.

The best way to do this is write a .bsh script and the use these results, in
xml file using ${variable}.

However the constraint is that i need to have this xml file as static
...because it is called by other application during runtime. The application
parses the data in xml file and is not able to recognize "${variable}" ...
So a possible solution i am thinking of is to store all the results in an
ftl file just give all the necessary formating to it and then just
<#include> it in my xml file..........so that when the application runs ,
xml files copies all the contents from the ftl file.....and before
application runs ...i need to load my data in the ftl file.

I hope now you get the problem statement better......please suggest me of
any ways to do this or better ideas

Regards

On 8/29/07, Jonathon -- Improov <[hidden email]> wrote:

>
> Hi Vijay,
>
> What "dynamic data" are you talking about?
>
> You can use bsh scripts to pull in data from database. Is that what you
> mean by "dynamic"?
>
> What do you mean by "xml"?
>
> You can actually use ${ } inside your widget screen definitions. Try
> <label>${someVariable}</label>.
>
> While .ftl files can access static classes to perform some "dynamic data
> retrieval", it is not as
> clean and easy as using .bsh.
>
> In your .bsh, simply do: context.put("someVariable", "Whatever data you
> want to pull in");
>
> Jonathon
>
> vijay Si wrote:
> > Hi,
> >
> > I wanted to load an ftl file just to pull data from the .bsh script
> file.
> > This ftl file will not display anything directly...rather i wanted to
> > <#include> all of it's content {which includes the dynamically pulled
> data
> > from scripts} into an .xml file ....so that my xml file has all the
> static
> > data. I am not able to use dynamic data pulled by xml directly i.ecannot
> > use ${} inside my xml. So i thought of pulling all dynamic stuff into an
> > .ftl file and then <#include> this data in the xml file....
> >
> > Here i am confronted with the problem of loading ftl file just like .bsh
> > file..........so.....can i put .ftl files in <actions></actions> and
> load it
> > in advance. Or please suggest some other way of loading the ftl file
> just
> > for the sake of pulling data from the script.
> >
> > Regards
> >
> >
> >
> > ------------------------------------------------------------------------
> >
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.5.484 / Virus Database: 269.12.10/977 - Release Date:
> 8/28/2007 4:29 PM
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Can we load an .ftl file using <actions>

jonwimp
Hi Vijay,

This xml file you're talking about, is it purely data in xml format? Or is it a display document
like HTML or xsl:fo?

Let's get your problem statement clear.

You have a application (not OFBiz) that reads an xml file. ("it is called by other application
during runtime").

This xml file contains data in xml format. ("The application parses the data in xml file").

What you need to do is to first generate the xml data dynamically, then dump the data into an xml
file.

Is my understanding correct?

Sorry if I misunderstood. Your problem description is not easy to understand. For eg, the term
"application" is used thrice, and I'm not sure what application you're talking about.

This doesn't sound like an OFBiz issue? If it is an application development effort, rather than an
issue/problem with OFBiz, would you mind paying one of the developers on this ML for a few hours'
consultation on implementation strategies?

Jonathon

vijay Si wrote:

> Hi Jonathon,
>
> My constraint is as follows.
>
> I need to have an xml file. This xml file is supposed to have some data that
> comes from the database.
>
> The best way to do this is write a .bsh script and the use these results, in
> xml file using ${variable}.
>
> However the constraint is that i need to have this xml file as static
> ...because it is called by other application during runtime. The application
> parses the data in xml file and is not able to recognize "${variable}" ...
> So a possible solution i am thinking of is to store all the results in an
> ftl file just give all the necessary formating to it and then just
> <#include> it in my xml file..........so that when the application runs ,
> xml files copies all the contents from the ftl file.....and before
> application runs ...i need to load my data in the ftl file.
>
> I hope now you get the problem statement better......please suggest me of
> any ways to do this or better ideas
>
> Regards
>
> On 8/29/07, Jonathon -- Improov <[hidden email]> wrote:
>> Hi Vijay,
>>
>> What "dynamic data" are you talking about?
>>
>> You can use bsh scripts to pull in data from database. Is that what you
>> mean by "dynamic"?
>>
>> What do you mean by "xml"?
>>
>> You can actually use ${ } inside your widget screen definitions. Try
>> <label>${someVariable}</label>.
>>
>> While .ftl files can access static classes to perform some "dynamic data
>> retrieval", it is not as
>> clean and easy as using .bsh.
>>
>> In your .bsh, simply do: context.put("someVariable", "Whatever data you
>> want to pull in");
>>
>> Jonathon
>>
>> vijay Si wrote:
>>> Hi,
>>>
>>> I wanted to load an ftl file just to pull data from the .bsh script
>> file.
>>> This ftl file will not display anything directly...rather i wanted to
>>> <#include> all of it's content {which includes the dynamically pulled
>> data
>>> from scripts} into an .xml file ....so that my xml file has all the
>> static
>>> data. I am not able to use dynamic data pulled by xml directly i.ecannot
>>> use ${} inside my xml. So i thought of pulling all dynamic stuff into an
>>> .ftl file and then <#include> this data in the xml file....
>>>
>>> Here i am confronted with the problem of loading ftl file just like .bsh
>>> file..........so.....can i put .ftl files in <actions></actions> and
>> load it
>>> in advance. Or please suggest some other way of loading the ftl file
>> just
>>> for the sake of pulling data from the script.
>>>
>>> Regards
>>>
>>>
>>>
>>> ------------------------------------------------------------------------
>>>
>>> No virus found in this incoming message.
>>> Checked by AVG Free Edition.
>>> Version: 7.5.484 / Virus Database: 269.12.10/977 - Release Date:
>> 8/28/2007 4:29 PM
>>
>>
>
>
> ------------------------------------------------------------------------
>
> No virus found in this incoming message.
> Checked by AVG Free Edition.
> Version: 7.5.484 / Virus Database: 269.12.10/977 - Release Date: 8/28/2007 4:29 PM

Reply | Threaded
Open this post in threaded view
|

Re: Can we load an .ftl file using <actions>

vijay Si
Hi Jonathon,

"What you need to do is to first generate the xml data dynamically, then
dump the data into an xml
file."

This is exactly my requirement.
The problem i am facing is with rules of the framework......whether i can
load an ftl just like bsh inside <actions>tag

Regards
Vijay

On 8/29/07, Jonathon -- Improov <[hidden email]> wrote:

>
> Hi Vijay,
>
> This xml file you're talking about, is it purely data in xml format? Or is
> it a display document
> like HTML or xsl:fo?
>
> Let's get your problem statement clear.
>
> You have a application (not OFBiz) that reads an xml file. ("it is called
> by other application
> during runtime").
>
> This xml file contains data in xml format. ("The application parses the
> data in xml file").
>
> What you need to do is to first generate the xml data dynamically, then
> dump the data into an xml
> file.
>
> Is my understanding correct?
>
> Sorry if I misunderstood. Your problem description is not easy to
> understand. For eg, the term
> "application" is used thrice, and I'm not sure what application you're
> talking about.
>
> This doesn't sound like an OFBiz issue? If it is an application
> development effort, rather than an
> issue/problem with OFBiz, would you mind paying one of the developers on
> this ML for a few hours'
> consultation on implementation strategies?
>
> Jonathon
>
> vijay Si wrote:
> > Hi Jonathon,
> >
> > My constraint is as follows.
> >
> > I need to have an xml file. This xml file is supposed to have some data
> that
> > comes from the database.
> >
> > The best way to do this is write a .bsh script and the use these
> results, in
> > xml file using ${variable}.
> >
> > However the constraint is that i need to have this xml file as static
> > ...because it is called by other application during runtime. The
> application
> > parses the data in xml file and is not able to recognize "${variable}"
> ...
> > So a possible solution i am thinking of is to store all the results in
> an
> > ftl file just give all the necessary formating to it and then just
> > <#include> it in my xml file..........so that when the application runs
> ,
> > xml files copies all the contents from the ftl file.....and before
> > application runs ...i need to load my data in the ftl file.
> >
> > I hope now you get the problem statement better......please suggest me
> of
> > any ways to do this or better ideas
> >
> > Regards
> >
> > On 8/29/07, Jonathon -- Improov <[hidden email]> wrote:
> >> Hi Vijay,
> >>
> >> What "dynamic data" are you talking about?
> >>
> >> You can use bsh scripts to pull in data from database. Is that what you
> >> mean by "dynamic"?
> >>
> >> What do you mean by "xml"?
> >>
> >> You can actually use ${ } inside your widget screen definitions. Try
> >> <label>${someVariable}</label>.
> >>
> >> While .ftl files can access static classes to perform some "dynamic
> data
> >> retrieval", it is not as
> >> clean and easy as using .bsh.
> >>
> >> In your .bsh, simply do: context.put("someVariable", "Whatever data you
> >> want to pull in");
> >>
> >> Jonathon
> >>
> >> vijay Si wrote:
> >>> Hi,
> >>>
> >>> I wanted to load an ftl file just to pull data from the .bsh script
> >> file.
> >>> This ftl file will not display anything directly...rather i wanted to
> >>> <#include> all of it's content {which includes the dynamically pulled
> >> data
> >>> from scripts} into an .xml file ....so that my xml file has all the
> >> static
> >>> data. I am not able to use dynamic data pulled by xml directly
> i.ecannot
> >>> use ${} inside my xml. So i thought of pulling all dynamic stuff into
> an
> >>> .ftl file and then <#include> this data in the xml file....
> >>>
> >>> Here i am confronted with the problem of loading ftl file just like
> .bsh
> >>> file..........so.....can i put .ftl files in <actions></actions> and
> >> load it
> >>> in advance. Or please suggest some other way of loading the ftl file
> >> just
> >>> for the sake of pulling data from the script.
> >>>
> >>> Regards
> >>>
> >>>
> >>>
> >>>
> ------------------------------------------------------------------------
> >>>
> >>> No virus found in this incoming message.
> >>> Checked by AVG Free Edition.
> >>> Version: 7.5.484 / Virus Database: 269.12.10/977 - Release Date:
> >> 8/28/2007 4:29 PM
> >>
> >>
> >
> >
> > ------------------------------------------------------------------------
> >
> > No virus found in this incoming message.
> > Checked by AVG Free Edition.
> > Version: 7.5.484 / Virus Database: 269.12.10/977 - Release Date:
> 8/28/2007 4:29 PM
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Can we load an .ftl file using <actions>

Scott Gray
Hi Vijay

I only skimmed over this, but I can't help feeling that your not following
the established best practices that exist within OFBiz.  Also note that
there is no reason why you can't use ftl to generate xml, it would just be a
*.xml.ftl I think (I've never tried it).

Regards
Scott

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

>
> Hi Jonathon,
>
> "What you need to do is to first generate the xml data dynamically, then
> dump the data into an xml
> file."
>
> This is exactly my requirement.
> The problem i am facing is with rules of the framework......whether i can
> load an ftl just like bsh inside <actions>tag
>
> Regards
> Vijay
>
> On 8/29/07, Jonathon -- Improov <[hidden email]> wrote:
> >
> > Hi Vijay,
> >
> > This xml file you're talking about, is it purely data in xml format? Or
> is
> > it a display document
> > like HTML or xsl:fo?
> >
> > Let's get your problem statement clear.
> >
> > You have a application (not OFBiz) that reads an xml file. ("it is
> called
> > by other application
> > during runtime").
> >
> > This xml file contains data in xml format. ("The application parses the
> > data in xml file").
> >
> > What you need to do is to first generate the xml data dynamically, then
> > dump the data into an xml
> > file.
> >
> > Is my understanding correct?
> >
> > Sorry if I misunderstood. Your problem description is not easy to
> > understand. For eg, the term
> > "application" is used thrice, and I'm not sure what application you're
> > talking about.
> >
> > This doesn't sound like an OFBiz issue? If it is an application
> > development effort, rather than an
> > issue/problem with OFBiz, would you mind paying one of the developers on
> > this ML for a few hours'
> > consultation on implementation strategies?
> >
> > Jonathon
> >
> > vijay Si wrote:
> > > Hi Jonathon,
> > >
> > > My constraint is as follows.
> > >
> > > I need to have an xml file. This xml file is supposed to have some
> data
> > that
> > > comes from the database.
> > >
> > > The best way to do this is write a .bsh script and the use these
> > results, in
> > > xml file using ${variable}.
> > >
> > > However the constraint is that i need to have this xml file as static
> > > ...because it is called by other application during runtime. The
> > application
> > > parses the data in xml file and is not able to recognize "${variable}"
> > ...
> > > So a possible solution i am thinking of is to store all the results in
> > an
> > > ftl file just give all the necessary formating to it and then just
> > > <#include> it in my xml file..........so that when the application
> runs
> > ,
> > > xml files copies all the contents from the ftl file.....and before
> > > application runs ...i need to load my data in the ftl file.
> > >
> > > I hope now you get the problem statement better......please suggest me
> > of
> > > any ways to do this or better ideas
> > >
> > > Regards
> > >
> > > On 8/29/07, Jonathon -- Improov <[hidden email]> wrote:
> > >> Hi Vijay,
> > >>
> > >> What "dynamic data" are you talking about?
> > >>
> > >> You can use bsh scripts to pull in data from database. Is that what
> you
> > >> mean by "dynamic"?
> > >>
> > >> What do you mean by "xml"?
> > >>
> > >> You can actually use ${ } inside your widget screen definitions. Try
> > >> <label>${someVariable}</label>.
> > >>
> > >> While .ftl files can access static classes to perform some "dynamic
> > data
> > >> retrieval", it is not as
> > >> clean and easy as using .bsh.
> > >>
> > >> In your .bsh, simply do: context.put("someVariable", "Whatever data
> you
> > >> want to pull in");
> > >>
> > >> Jonathon
> > >>
> > >> vijay Si wrote:
> > >>> Hi,
> > >>>
> > >>> I wanted to load an ftl file just to pull data from the .bsh script
> > >> file.
> > >>> This ftl file will not display anything directly...rather i wanted
> to
> > >>> <#include> all of it's content {which includes the dynamically
> pulled
> > >> data
> > >>> from scripts} into an .xml file ....so that my xml file has all the
> > >> static
> > >>> data. I am not able to use dynamic data pulled by xml directly
> > i.ecannot
> > >>> use ${} inside my xml. So i thought of pulling all dynamic stuff
> into
> > an
> > >>> .ftl file and then <#include> this data in the xml file....
> > >>>
> > >>> Here i am confronted with the problem of loading ftl file just like
> > .bsh
> > >>> file..........so.....can i put .ftl files in <actions></actions> and
> > >> load it
> > >>> in advance. Or please suggest some other way of loading the ftl file
> > >> just
> > >>> for the sake of pulling data from the script.
> > >>>
> > >>> Regards
> > >>>
> > >>>
> > >>>
> > >>>
> > ------------------------------------------------------------------------
> > >>>
> > >>> No virus found in this incoming message.
> > >>> Checked by AVG Free Edition.
> > >>> Version: 7.5.484 / Virus Database: 269.12.10/977 - Release Date:
> > >> 8/28/2007 4:29 PM
> > >>
> > >>
> > >
> > >
> > >
> ------------------------------------------------------------------------
> > >
> > > No virus found in this incoming message.
> > > Checked by AVG Free Edition.
> > > Version: 7.5.484 / Virus Database: 269.12.10/977 - Release Date:
> > 8/28/2007 4:29 PM
> >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Can we load an .ftl file using <actions>

Anil Patel-3
Recently done Oagis component has example of generating XML using ftl
templates.

Regards
Anil Patel


Scott Gray wrote:

> Hi Vijay
>
> I only skimmed over this, but I can't help feeling that your not following
> the established best practices that exist within OFBiz.  Also note that
> there is no reason why you can't use ftl to generate xml, it would just be a
> *.xml.ftl I think (I've never tried it).
>
> Regards
> Scott
>
> On 29/08/2007, vijay Si <[hidden email]> wrote:
>  
>> Hi Jonathon,
>>
>> "What you need to do is to first generate the xml data dynamically, then
>> dump the data into an xml
>> file."
>>
>> This is exactly my requirement.
>> The problem i am facing is with rules of the framework......whether i can
>> load an ftl just like bsh inside <actions>tag
>>
>> Regards
>> Vijay
>>
>> On 8/29/07, Jonathon -- Improov <[hidden email]> wrote:
>>    
>>> Hi Vijay,
>>>
>>> This xml file you're talking about, is it purely data in xml format? Or
>>>      
>> is
>>    
>>> it a display document
>>> like HTML or xsl:fo?
>>>
>>> Let's get your problem statement clear.
>>>
>>> You have a application (not OFBiz) that reads an xml file. ("it is
>>>      
>> called
>>    
>>> by other application
>>> during runtime").
>>>
>>> This xml file contains data in xml format. ("The application parses the
>>> data in xml file").
>>>
>>> What you need to do is to first generate the xml data dynamically, then
>>> dump the data into an xml
>>> file.
>>>
>>> Is my understanding correct?
>>>
>>> Sorry if I misunderstood. Your problem description is not easy to
>>> understand. For eg, the term
>>> "application" is used thrice, and I'm not sure what application you're
>>> talking about.
>>>
>>> This doesn't sound like an OFBiz issue? If it is an application
>>> development effort, rather than an
>>> issue/problem with OFBiz, would you mind paying one of the developers on
>>> this ML for a few hours'
>>> consultation on implementation strategies?
>>>
>>> Jonathon
>>>
>>> vijay Si wrote:
>>>      
>>>> Hi Jonathon,
>>>>
>>>> My constraint is as follows.
>>>>
>>>> I need to have an xml file. This xml file is supposed to have some
>>>>        
>> data
>>    
>>> that
>>>      
>>>> comes from the database.
>>>>
>>>> The best way to do this is write a .bsh script and the use these
>>>>        
>>> results, in
>>>      
>>>> xml file using ${variable}.
>>>>
>>>> However the constraint is that i need to have this xml file as static
>>>> ...because it is called by other application during runtime. The
>>>>        
>>> application
>>>      
>>>> parses the data in xml file and is not able to recognize "${variable}"
>>>>        
>>> ...
>>>      
>>>> So a possible solution i am thinking of is to store all the results in
>>>>        
>>> an
>>>      
>>>> ftl file just give all the necessary formating to it and then just
>>>> <#include> it in my xml file..........so that when the application
>>>>        
>> runs
>>    
>>> ,
>>>      
>>>> xml files copies all the contents from the ftl file.....and before
>>>> application runs ...i need to load my data in the ftl file.
>>>>
>>>> I hope now you get the problem statement better......please suggest me
>>>>        
>>> of
>>>      
>>>> any ways to do this or better ideas
>>>>
>>>> Regards
>>>>
>>>> On 8/29/07, Jonathon -- Improov <[hidden email]> wrote:
>>>>        
>>>>> Hi Vijay,
>>>>>
>>>>> What "dynamic data" are you talking about?
>>>>>
>>>>> You can use bsh scripts to pull in data from database. Is that what
>>>>>          
>> you
>>    
>>>>> mean by "dynamic"?
>>>>>
>>>>> What do you mean by "xml"?
>>>>>
>>>>> You can actually use ${ } inside your widget screen definitions. Try
>>>>> <label>${someVariable}</label>.
>>>>>
>>>>> While .ftl files can access static classes to perform some "dynamic
>>>>>          
>>> data
>>>      
>>>>> retrieval", it is not as
>>>>> clean and easy as using .bsh.
>>>>>
>>>>> In your .bsh, simply do: context.put("someVariable", "Whatever data
>>>>>          
>> you
>>    
>>>>> want to pull in");
>>>>>
>>>>> Jonathon
>>>>>
>>>>> vijay Si wrote:
>>>>>          
>>>>>> Hi,
>>>>>>
>>>>>> I wanted to load an ftl file just to pull data from the .bsh script
>>>>>>            
>>>>> file.
>>>>>          
>>>>>> This ftl file will not display anything directly...rather i wanted
>>>>>>            
>> to
>>    
>>>>>> <#include> all of it's content {which includes the dynamically
>>>>>>            
>> pulled
>>    
>>>>> data
>>>>>          
>>>>>> from scripts} into an .xml file ....so that my xml file has all the
>>>>>>            
>>>>> static
>>>>>          
>>>>>> data. I am not able to use dynamic data pulled by xml directly
>>>>>>            
>>> i.ecannot
>>>      
>>>>>> use ${} inside my xml. So i thought of pulling all dynamic stuff
>>>>>>            
>> into
>>    
>>> an
>>>      
>>>>>> .ftl file and then <#include> this data in the xml file....
>>>>>>
>>>>>> Here i am confronted with the problem of loading ftl file just like
>>>>>>            
>>> .bsh
>>>      
>>>>>> file..........so.....can i put .ftl files in <actions></actions> and
>>>>>>            
>>>>> load it
>>>>>          
>>>>>> in advance. Or please suggest some other way of loading the ftl file
>>>>>>            
>>>>> just
>>>>>          
>>>>>> for the sake of pulling data from the script.
>>>>>>
>>>>>> Regards
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>            
>>> ------------------------------------------------------------------------
>>>      
>>>>>> No virus found in this incoming message.
>>>>>> Checked by AVG Free Edition.
>>>>>> Version: 7.5.484 / Virus Database: 269.12.10/977 - Release Date:
>>>>>>            
>>>>> 8/28/2007 4:29 PM
>>>>>
>>>>>
>>>>>          
>>>>
>>>>        
>> ------------------------------------------------------------------------
>>    
>>>> No virus found in this incoming message.
>>>> Checked by AVG Free Edition.
>>>> Version: 7.5.484 / Virus Database: 269.12.10/977 - Release Date:
>>>>        
>>> 8/28/2007 4:29 PM
>>>
>>>
>>>      
>
>  
Reply | Threaded
Open this post in threaded view
|

Re: Can we load an .ftl file using <actions>

vijay Si
Hi anil
can u share the ftl code.

On 8/29/07, Anil K Patel <[hidden email]> wrote:

>
> Recently done Oagis component has example of generating XML using ftl
> templates.
>
> Regards
> Anil Patel
>
>
> Scott Gray wrote:
> > Hi Vijay
> >
> > I only skimmed over this, but I can't help feeling that your not
> following
> > the established best practices that exist within OFBiz.  Also note that
> > there is no reason why you can't use ftl to generate xml, it would just
> be a
> > *.xml.ftl I think (I've never tried it).
> >
> > Regards
> > Scott
> >
> > On 29/08/2007, vijay Si <[hidden email]> wrote:
> >
> >> Hi Jonathon,
> >>
> >> "What you need to do is to first generate the xml data dynamically,
> then
> >> dump the data into an xml
> >> file."
> >>
> >> This is exactly my requirement.
> >> The problem i am facing is with rules of the framework......whether i
> can
> >> load an ftl just like bsh inside <actions>tag
> >>
> >> Regards
> >> Vijay
> >>
> >> On 8/29/07, Jonathon -- Improov <[hidden email]> wrote:
> >>
> >>> Hi Vijay,
> >>>
> >>> This xml file you're talking about, is it purely data in xml format?
> Or
> >>>
> >> is
> >>
> >>> it a display document
> >>> like HTML or xsl:fo?
> >>>
> >>> Let's get your problem statement clear.
> >>>
> >>> You have a application (not OFBiz) that reads an xml file. ("it is
> >>>
> >> called
> >>
> >>> by other application
> >>> during runtime").
> >>>
> >>> This xml file contains data in xml format. ("The application parses
> the
> >>> data in xml file").
> >>>
> >>> What you need to do is to first generate the xml data dynamically,
> then
> >>> dump the data into an xml
> >>> file.
> >>>
> >>> Is my understanding correct?
> >>>
> >>> Sorry if I misunderstood. Your problem description is not easy to
> >>> understand. For eg, the term
> >>> "application" is used thrice, and I'm not sure what application you're
> >>> talking about.
> >>>
> >>> This doesn't sound like an OFBiz issue? If it is an application
> >>> development effort, rather than an
> >>> issue/problem with OFBiz, would you mind paying one of the developers
> on
> >>> this ML for a few hours'
> >>> consultation on implementation strategies?
> >>>
> >>> Jonathon
> >>>
> >>> vijay Si wrote:
> >>>
> >>>> Hi Jonathon,
> >>>>
> >>>> My constraint is as follows.
> >>>>
> >>>> I need to have an xml file. This xml file is supposed to have some
> >>>>
> >> data
> >>
> >>> that
> >>>
> >>>> comes from the database.
> >>>>
> >>>> The best way to do this is write a .bsh script and the use these
> >>>>
> >>> results, in
> >>>
> >>>> xml file using ${variable}.
> >>>>
> >>>> However the constraint is that i need to have this xml file as static
> >>>> ...because it is called by other application during runtime. The
> >>>>
> >>> application
> >>>
> >>>> parses the data in xml file and is not able to recognize
> "${variable}"
> >>>>
> >>> ...
> >>>
> >>>> So a possible solution i am thinking of is to store all the results
> in
> >>>>
> >>> an
> >>>
> >>>> ftl file just give all the necessary formating to it and then just
> >>>> <#include> it in my xml file..........so that when the application
> >>>>
> >> runs
> >>
> >>> ,
> >>>
> >>>> xml files copies all the contents from the ftl file.....and before
> >>>> application runs ...i need to load my data in the ftl file.
> >>>>
> >>>> I hope now you get the problem statement better......please suggest
> me
> >>>>
> >>> of
> >>>
> >>>> any ways to do this or better ideas
> >>>>
> >>>> Regards
> >>>>
> >>>> On 8/29/07, Jonathon -- Improov <[hidden email]> wrote:
> >>>>
> >>>>> Hi Vijay,
> >>>>>
> >>>>> What "dynamic data" are you talking about?
> >>>>>
> >>>>> You can use bsh scripts to pull in data from database. Is that what
> >>>>>
> >> you
> >>
> >>>>> mean by "dynamic"?
> >>>>>
> >>>>> What do you mean by "xml"?
> >>>>>
> >>>>> You can actually use ${ } inside your widget screen definitions. Try
> >>>>> <label>${someVariable}</label>.
> >>>>>
> >>>>> While .ftl files can access static classes to perform some "dynamic
> >>>>>
> >>> data
> >>>
> >>>>> retrieval", it is not as
> >>>>> clean and easy as using .bsh.
> >>>>>
> >>>>> In your .bsh, simply do: context.put("someVariable", "Whatever data
> >>>>>
> >> you
> >>
> >>>>> want to pull in");
> >>>>>
> >>>>> Jonathon
> >>>>>
> >>>>> vijay Si wrote:
> >>>>>
> >>>>>> Hi,
> >>>>>>
> >>>>>> I wanted to load an ftl file just to pull data from the .bsh script
> >>>>>>
> >>>>> file.
> >>>>>
> >>>>>> This ftl file will not display anything directly...rather i wanted
> >>>>>>
> >> to
> >>
> >>>>>> <#include> all of it's content {which includes the dynamically
> >>>>>>
> >> pulled
> >>
> >>>>> data
> >>>>>
> >>>>>> from scripts} into an .xml file ....so that my xml file has all the
> >>>>>>
> >>>>> static
> >>>>>
> >>>>>> data. I am not able to use dynamic data pulled by xml directly
> >>>>>>
> >>> i.ecannot
> >>>
> >>>>>> use ${} inside my xml. So i thought of pulling all dynamic stuff
> >>>>>>
> >> into
> >>
> >>> an
> >>>
> >>>>>> .ftl file and then <#include> this data in the xml file....
> >>>>>>
> >>>>>> Here i am confronted with the problem of loading ftl file just like
> >>>>>>
> >>> .bsh
> >>>
> >>>>>> file..........so.....can i put .ftl files in <actions></actions>
> and
> >>>>>>
> >>>>> load it
> >>>>>
> >>>>>> in advance. Or please suggest some other way of loading the ftl
> file
> >>>>>>
> >>>>> just
> >>>>>
> >>>>>> for the sake of pulling data from the script.
> >>>>>>
> >>>>>> Regards
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>
> ------------------------------------------------------------------------
> >>>
> >>>>>> No virus found in this incoming message.
> >>>>>> Checked by AVG Free Edition.
> >>>>>> Version: 7.5.484 / Virus Database: 269.12.10/977 - Release Date:
> >>>>>>
> >>>>> 8/28/2007 4:29 PM
> >>>>>
> >>>>>
> >>>>>
> >>>>
> >>>>
> >>
> ------------------------------------------------------------------------
> >>
> >>>> No virus found in this incoming message.
> >>>> Checked by AVG Free Edition.
> >>>> Version: 7.5.484 / Virus Database: 269.12.10/977 - Release Date:
> >>>>
> >>> 8/28/2007 4:29 PM
> >>>
> >>>
> >>>
> >
> >
>
Reply | Threaded
Open this post in threaded view
|

Re: Can we load an .ftl file using <actions>

Vikas Mayur-2
Vijay,

You can look at the simple service "oagisSendReceiveDelivery" in
OagisShipmentServices and the related template "ReceiveDelivery.ftl" under
the oagis component.


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

>
> Hi anil
> can u share the ftl code.
>
> On 8/29/07, Anil K Patel <[hidden email]> wrote:
> >
> > Recently done Oagis component has example of generating XML using ftl
> > templates.
> >
> > Regards
> > Anil Patel
> >
> >
> > Scott Gray wrote:
> > > Hi Vijay
> > >
> > > I only skimmed over this, but I can't help feeling that your not
> > following
> > > the established best practices that exist within OFBiz.  Also note
> that
> > > there is no reason why you can't use ftl to generate xml, it would
> just
> > be a
> > > *.xml.ftl I think (I've never tried it).
> > >
> > > Regards
> > > Scott
> > >
> > > On 29/08/2007, vijay Si <[hidden email]> wrote:
> > >
> > >> Hi Jonathon,
> > >>
> > >> "What you need to do is to first generate the xml data dynamically,
> > then
> > >> dump the data into an xml
> > >> file."
> > >>
> > >> This is exactly my requirement.
> > >> The problem i am facing is with rules of the framework......whether i
> > can
> > >> load an ftl just like bsh inside <actions>tag
> > >>
> > >> Regards
> > >> Vijay
> > >>
> > >> On 8/29/07, Jonathon -- Improov <[hidden email]> wrote:
> > >>
> > >>> Hi Vijay,
> > >>>
> > >>> This xml file you're talking about, is it purely data in xml format?
> > Or
> > >>>
> > >> is
> > >>
> > >>> it a display document
> > >>> like HTML or xsl:fo?
> > >>>
> > >>> Let's get your problem statement clear.
> > >>>
> > >>> You have a application (not OFBiz) that reads an xml file. ("it is
> > >>>
> > >> called
> > >>
> > >>> by other application
> > >>> during runtime").
> > >>>
> > >>> This xml file contains data in xml format. ("The application parses
> > the
> > >>> data in xml file").
> > >>>
> > >>> What you need to do is to first generate the xml data dynamically,
> > then
> > >>> dump the data into an xml
> > >>> file.
> > >>>
> > >>> Is my understanding correct?
> > >>>
> > >>> Sorry if I misunderstood. Your problem description is not easy to
> > >>> understand. For eg, the term
> > >>> "application" is used thrice, and I'm not sure what application
> you're
> > >>> talking about.
> > >>>
> > >>> This doesn't sound like an OFBiz issue? If it is an application
> > >>> development effort, rather than an
> > >>> issue/problem with OFBiz, would you mind paying one of the
> developers
> > on
> > >>> this ML for a few hours'
> > >>> consultation on implementation strategies?
> > >>>
> > >>> Jonathon
> > >>>
> > >>> vijay Si wrote:
> > >>>
> > >>>> Hi Jonathon,
> > >>>>
> > >>>> My constraint is as follows.
> > >>>>
> > >>>> I need to have an xml file. This xml file is supposed to have some
> > >>>>
> > >> data
> > >>
> > >>> that
> > >>>
> > >>>> comes from the database.
> > >>>>
> > >>>> The best way to do this is write a .bsh script and the use these
> > >>>>
> > >>> results, in
> > >>>
> > >>>> xml file using ${variable}.
> > >>>>
> > >>>> However the constraint is that i need to have this xml file as
> static
> > >>>> ...because it is called by other application during runtime. The
> > >>>>
> > >>> application
> > >>>
> > >>>> parses the data in xml file and is not able to recognize
> > "${variable}"
> > >>>>
> > >>> ...
> > >>>
> > >>>> So a possible solution i am thinking of is to store all the results
> > in
> > >>>>
> > >>> an
> > >>>
> > >>>> ftl file just give all the necessary formating to it and then just
> > >>>> <#include> it in my xml file..........so that when the application
> > >>>>
> > >> runs
> > >>
> > >>> ,
> > >>>
> > >>>> xml files copies all the contents from the ftl file.....and before
> > >>>> application runs ...i need to load my data in the ftl file.
> > >>>>
> > >>>> I hope now you get the problem statement better......please suggest
> > me
> > >>>>
> > >>> of
> > >>>
> > >>>> any ways to do this or better ideas
> > >>>>
> > >>>> Regards
> > >>>>
> > >>>> On 8/29/07, Jonathon -- Improov <[hidden email]> wrote:
> > >>>>
> > >>>>> Hi Vijay,
> > >>>>>
> > >>>>> What "dynamic data" are you talking about?
> > >>>>>
> > >>>>> You can use bsh scripts to pull in data from database. Is that
> what
> > >>>>>
> > >> you
> > >>
> > >>>>> mean by "dynamic"?
> > >>>>>
> > >>>>> What do you mean by "xml"?
> > >>>>>
> > >>>>> You can actually use ${ } inside your widget screen definitions.
> Try
> > >>>>> <label>${someVariable}</label>.
> > >>>>>
> > >>>>> While .ftl files can access static classes to perform some
> "dynamic
> > >>>>>
> > >>> data
> > >>>
> > >>>>> retrieval", it is not as
> > >>>>> clean and easy as using .bsh.
> > >>>>>
> > >>>>> In your .bsh, simply do: context.put("someVariable", "Whatever
> data
> > >>>>>
> > >> you
> > >>
> > >>>>> want to pull in");
> > >>>>>
> > >>>>> Jonathon
> > >>>>>
> > >>>>> vijay Si wrote:
> > >>>>>
> > >>>>>> Hi,
> > >>>>>>
> > >>>>>> I wanted to load an ftl file just to pull data from the .bsh
> script
> > >>>>>>
> > >>>>> file.
> > >>>>>
> > >>>>>> This ftl file will not display anything directly...rather i
> wanted
> > >>>>>>
> > >> to
> > >>
> > >>>>>> <#include> all of it's content {which includes the dynamically
> > >>>>>>
> > >> pulled
> > >>
> > >>>>> data
> > >>>>>
> > >>>>>> from scripts} into an .xml file ....so that my xml file has all
> the
> > >>>>>>
> > >>>>> static
> > >>>>>
> > >>>>>> data. I am not able to use dynamic data pulled by xml directly
> > >>>>>>
> > >>> i.ecannot
> > >>>
> > >>>>>> use ${} inside my xml. So i thought of pulling all dynamic stuff
> > >>>>>>
> > >> into
> > >>
> > >>> an
> > >>>
> > >>>>>> .ftl file and then <#include> this data in the xml file....
> > >>>>>>
> > >>>>>> Here i am confronted with the problem of loading ftl file just
> like
> > >>>>>>
> > >>> .bsh
> > >>>
> > >>>>>> file..........so.....can i put .ftl files in <actions></actions>
> > and
> > >>>>>>
> > >>>>> load it
> > >>>>>
> > >>>>>> in advance. Or please suggest some other way of loading the ftl
> > file
> > >>>>>>
> > >>>>> just
> > >>>>>
> > >>>>>> for the sake of pulling data from the script.
> > >>>>>>
> > >>>>>> Regards
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>>>>
> > >>>
> > ------------------------------------------------------------------------
> > >>>
> > >>>>>> No virus found in this incoming message.
> > >>>>>> Checked by AVG Free Edition.
> > >>>>>> Version: 7.5.484 / Virus Database: 269.12.10/977 - Release Date:
> > >>>>>>
> > >>>>> 8/28/2007 4:29 PM
> > >>>>>
> > >>>>>
> > >>>>>
> > >>>>
> > >>>>
> > >>
> > ------------------------------------------------------------------------
> > >>
> > >>>> No virus found in this incoming message.
> > >>>> Checked by AVG Free Edition.
> > >>>> Version: 7.5.484 / Virus Database: 269.12.10/977 - Release Date:
> > >>>>
> > >>> 8/28/2007 4:29 PM
> > >>>
> > >>>
> > >>>
> > >
> > >
> >
>



--
Vikas Mayur