Home » Archived » BIRT » Setting jdbc connection properties when embedding BIRT?
|
Re: Setting jdbc connection properties when embedding BIRT? [message #78244 is a reply to message #78228] |
Fri, 30 September 2005 21:28 |
|
Marko,
Why not just put it in script an have it access either environment variables
or a config file for the appropriate environment?
Jason Weathersby
BIRT PMC
"Marko" <mmilicevic@pssd.com> wrote in message
news:dhk6df$b5g$1@news.eclipse.org...
> Is it possible to set JDBC connection properties for a report (eg. url,
> user, password,..) when programmatically creating the report and rendering
> in an embedded scenario? I know i could achieve this by using scripting
> in
> the report, or by modifying the .rptdesign file before loading it. But
> after loading the report, but before running it, can i change the
> connection
> properties? I would like to do this to have the datasource reflect the
> environment the report will run against.
>
> Thank you.
>
>
|
|
|
Re: Setting jdbc connection properties when embedding BIRT? [message #78440 is a reply to message #78244] |
Mon, 03 October 2005 14:30 |
marko Messages: 39 Registered: July 2009 |
Member |
|
|
Thanks for responding Jason.
I would prefer to have general infrastructure that "injects" the correct
environment, rather than every report having to have the same broilerplate
script to set the correct environment. It's a matter of who should be
responsible and control this? Is this a container/environment
responsibility? Or a report responsibility? I would rather reports be a
clean as possible, sticking to rendering responsibilities only.
Marko.
..
"Jason Weathersby" <jweathersby@actuate.com> wrote in message
news:dhkala$gd8$1@news.eclipse.org...
> Marko,
>
> Why not just put it in script an have it access either environment
variables
> or a config file for the appropriate environment?
>
> Jason Weathersby
> BIRT PMC
>
> "Marko" <mmilicevic@pssd.com> wrote in message
> news:dhk6df$b5g$1@news.eclipse.org...
> > Is it possible to set JDBC connection properties for a report (eg. url,
> > user, password,..) when programmatically creating the report and
rendering
> > in an embedded scenario? I know i could achieve this by using scripting
> > in
> > the report, or by modifying the .rptdesign file before loading it. But
> > after loading the report, but before running it, can i change the
> > connection
> > properties? I would like to do this to have the datasource reflect the
> > environment the report will run against.
> >
> > Thank you.
> >
> >
>
>
|
|
|
Re: Setting jdbc connection properties when embedding BIRT? [message #78684 is a reply to message #78440] |
Tue, 04 October 2005 02:36 |
Scott Rosenbaum Messages: 425 Registered: July 2009 |
Senior Member |
|
|
Marko,
This would be some really great functionality to have. It would get
really tedious to have to modify every one of your connection objects to
achive this. In the 2.0 project, things will be a little better in the
sense that you will be able to share your connection objects through the
use of libraries, but injection of control would be a better pattern for
this.
Would you mind creating a bugzilla entry providing any use cases
scenarios that you can think of and any recommended mechanisms for the
injection of the control. Are you thinking something like Spring for this?
Thanks,
Scott Rosenbaum
BIRT PMC
Marko wrote:
>Thanks for responding Jason.
>
>I would prefer to have general infrastructure that "injects" the correct
>environment, rather than every report having to have the same broilerplate
>script to set the correct environment. It's a matter of who should be
>responsible and control this? Is this a container/environment
>responsibility? Or a report responsibility? I would rather reports be a
>clean as possible, sticking to rendering responsibilities only.
>
>Marko.
>..
>
>"Jason Weathersby" <jweathersby@actuate.com> wrote in message
>news:dhkala$gd8$1@news.eclipse.org...
>
>
>>Marko,
>>
>>Why not just put it in script an have it access either environment
>>
>>
>variables
>
>
>>or a config file for the appropriate environment?
>>
>>Jason Weathersby
>>BIRT PMC
>>
>>"Marko" <mmilicevic@pssd.com> wrote in message
>>news:dhk6df$b5g$1@news.eclipse.org...
>>
>>
>>>Is it possible to set JDBC connection properties for a report (eg. url,
>>>user, password,..) when programmatically creating the report and
>>>
>>>
>rendering
>
>
>>>in an embedded scenario? I know i could achieve this by using scripting
>>>in
>>>the report, or by modifying the .rptdesign file before loading it. But
>>>after loading the report, but before running it, can i change the
>>>connection
>>>properties? I would like to do this to have the datasource reflect the
>>>environment the report will run against.
>>>
>>>Thank you.
>>>
>>>
>>>
>>>
>>
>>
>
>
>
>
|
|
|
Re: Setting jdbc connection properties when embedding BIRT? [message #79380 is a reply to message #78684] |
Wed, 05 October 2005 18:07 |
marko Messages: 39 Registered: July 2009 |
Member |
|
|
Hi Scott. I was speaking about using injection (or IoC) as a general design
pattern. I was not implying any particular mechanism or framework like
Spring.
My use case is embedding BIRT to generate reports. In my case i use the
BIRT API to embed BIRT reports into our web application. Another related
use case would be embedding BIRT in a web app using the BIRT viewer
servlet.
In both cases how does one set environment specific report attributes,
especially datasource configuration?
The most simple solution for me is to just provide an API that allows me to
configure the datasource (from outside of the report).
eg.
IRunAndRenderTask task = engine.createRunAndRenderTask(report);
task.setParameterValues(params);
task.setRenderOption(options);
//
// now have some Java BIRT API similar to the Javascript ROM API.
task.extensionProperties.odaUser = "<user>";
task.extensionProperties.odaPassword = "<pw>";
task.extensionProperties.odaURL = "<url>";
task.extensionProperties.odaDriverClass = "<driver_class>";
....etc...
There may already be something like this, but i can not find it?
I'm not sure what is the best way to configure/customize the viewer servlet?
Probably the simplest design is to expect people to subclass the servlet.
The subclass could be responsible for configuring and customizing the viewer
using the BIRT Java API. I'm do not think that a more complicated design is
needed, but i'm sure you could also accomplish config/customization using
"extension points", callbacks, AOP, IoC, or some other similar mechanism.
I will add an entry to Bugzilla.
Thanks Scott.
"Scott Rosenbaum" <scottr@innoventsolutions.com> wrote in message
news:dhsprd$deh$2@news.eclipse.org...
> Marko,
>
> This would be some really great functionality to have. It would get
> really tedious to have to modify every one of your connection objects to
> achive this. In the 2.0 project, things will be a little better in the
> sense that you will be able to share your connection objects through the
> use of libraries, but injection of control would be a better pattern for
> this.
>
> Would you mind creating a bugzilla entry providing any use cases
> scenarios that you can think of and any recommended mechanisms for the
> injection of the control. Are you thinking something like Spring for
this?
>
> Thanks,
>
> Scott Rosenbaum
> BIRT PMC
>
> Marko wrote:
>
> >Thanks for responding Jason.
> >
> >I would prefer to have general infrastructure that "injects" the correct
> >environment, rather than every report having to have the same
broilerplate
> >script to set the correct environment. It's a matter of who should be
> >responsible and control this? Is this a container/environment
> >responsibility? Or a report responsibility? I would rather reports be a
> >clean as possible, sticking to rendering responsibilities only.
> >
> >Marko.
> >..
> >
> >"Jason Weathersby" <jweathersby@actuate.com> wrote in message
> >news:dhkala$gd8$1@news.eclipse.org...
> >
> >
> >>Marko,
> >>
> >>Why not just put it in script an have it access either environment
> >>
> >>
> >variables
> >
> >
> >>or a config file for the appropriate environment?
> >>
> >>Jason Weathersby
> >>BIRT PMC
> >>
> >>"Marko" <mmilicevic@pssd.com> wrote in message
> >>news:dhk6df$b5g$1@news.eclipse.org...
> >>
> >>
> >>>Is it possible to set JDBC connection properties for a report (eg. url,
> >>>user, password,..) when programmatically creating the report and
> >>>
> >>>
> >rendering
> >
> >
> >>>in an embedded scenario? I know i could achieve this by using
scripting
> >>>in
> >>>the report, or by modifying the .rptdesign file before loading it. But
> >>>after loading the report, but before running it, can i change the
> >>>connection
> >>>properties? I would like to do this to have the datasource reflect the
> >>>environment the report will run against.
> >>>
> >>>Thank you.
> >>>
> >>>
> >>>
> >>>
> >>
> >>
> >
> >
> >
> >
|
|
|
Re: Setting jdbc connection properties when embedding BIRT? [message #79575 is a reply to message #79380] |
Thu, 06 October 2005 17:32 |
floor Messages: 93 Registered: July 2009 |
Member |
|
|
This is functionality that I would like to see as well. My application uses
several different databases that all have the same structure. Our
application decides which database it needs to use, depending on which data
the user is looking at. I'm not sure why all this data was set up to be in
different databases, but that's how our application works. It would be nice
to have a simple way to use one report design file where I could change the
Database URL for a particular datasourse to point to any one of these
databases.
--floor
"Marko" <mmilicevic@pssd.com> wrote in message
news:di14jb$j24$1@news.eclipse.org...
> Hi Scott. I was speaking about using injection (or IoC) as a general
> design
> pattern. I was not implying any particular mechanism or framework like
> Spring.
>
> My use case is embedding BIRT to generate reports. In my case i use the
> BIRT API to embed BIRT reports into our web application. Another related
> use case would be embedding BIRT in a web app using the BIRT viewer
> servlet.
>
> In both cases how does one set environment specific report attributes,
> especially datasource configuration?
>
> The most simple solution for me is to just provide an API that allows me
> to
> configure the datasource (from outside of the report).
>
> eg.
> IRunAndRenderTask task = engine.createRunAndRenderTask(report);
> task.setParameterValues(params);
> task.setRenderOption(options);
>
> //
> // now have some Java BIRT API similar to the Javascript ROM API.
> task.extensionProperties.odaUser = "<user>";
> task.extensionProperties.odaPassword = "<pw>";
> task.extensionProperties.odaURL = "<url>";
> task.extensionProperties.odaDriverClass = "<driver_class>";
> ...etc...
>
> There may already be something like this, but i can not find it?
>
> I'm not sure what is the best way to configure/customize the viewer
> servlet?
> Probably the simplest design is to expect people to subclass the servlet.
> The subclass could be responsible for configuring and customizing the
> viewer
> using the BIRT Java API. I'm do not think that a more complicated design
> is
> needed, but i'm sure you could also accomplish config/customization using
> "extension points", callbacks, AOP, IoC, or some other similar mechanism.
>
> I will add an entry to Bugzilla.
>
> Thanks Scott.
>
>
> "Scott Rosenbaum" <scottr@innoventsolutions.com> wrote in message
> news:dhsprd$deh$2@news.eclipse.org...
>> Marko,
>>
>> This would be some really great functionality to have. It would get
>> really tedious to have to modify every one of your connection objects to
>> achive this. In the 2.0 project, things will be a little better in the
>> sense that you will be able to share your connection objects through the
>> use of libraries, but injection of control would be a better pattern for
>> this.
>>
>> Would you mind creating a bugzilla entry providing any use cases
>> scenarios that you can think of and any recommended mechanisms for the
>> injection of the control. Are you thinking something like Spring for
> this?
>>
>> Thanks,
>>
>> Scott Rosenbaum
>> BIRT PMC
>>
>> Marko wrote:
>>
>> >Thanks for responding Jason.
>> >
>> >I would prefer to have general infrastructure that "injects" the correct
>> >environment, rather than every report having to have the same
> broilerplate
>> >script to set the correct environment. It's a matter of who should be
>> >responsible and control this? Is this a container/environment
>> >responsibility? Or a report responsibility? I would rather reports be
>> >a
>> >clean as possible, sticking to rendering responsibilities only.
>> >
>> >Marko.
>> >..
>> >
>> >"Jason Weathersby" <jweathersby@actuate.com> wrote in message
>> >news:dhkala$gd8$1@news.eclipse.org...
>> >
>> >
>> >>Marko,
>> >>
>> >>Why not just put it in script an have it access either environment
>> >>
>> >>
>> >variables
>> >
>> >
>> >>or a config file for the appropriate environment?
>> >>
>> >>Jason Weathersby
>> >>BIRT PMC
>> >>
>> >>"Marko" <mmilicevic@pssd.com> wrote in message
>> >>news:dhk6df$b5g$1@news.eclipse.org...
>> >>
>> >>
>> >>>Is it possible to set JDBC connection properties for a report (eg.
>> >>>url,
>> >>>user, password,..) when programmatically creating the report and
>> >>>
>> >>>
>> >rendering
>> >
>> >
>> >>>in an embedded scenario? I know i could achieve this by using
> scripting
>> >>>in
>> >>>the report, or by modifying the .rptdesign file before loading it.
>> >>>But
>> >>>after loading the report, but before running it, can i change the
>> >>>connection
>> >>>properties? I would like to do this to have the datasource reflect
>> >>>the
>> >>>environment the report will run against.
>> >>>
>> >>>Thank you.
>> >>>
>> >>>
>> >>>
>> >>>
>> >>
>> >>
>> >
>> >
>> >
>> >
>
>
|
|
|
Goto Forum:
Current Time: Sat Dec 21 15:01:43 GMT 2024
Powered by FUDForum. Page generated in 0.03207 seconds
|