Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » DTP » Custom ODA data source, want different behavior during preview vs. actual usage?
Custom ODA data source, want different behavior during preview vs. actual usage? [message #586682] Fri, 20 July 2007 23:08
Eclipse User
Originally posted by: allevato.vt.edu

I posted this message in the BIRT newsgroup, but perhaps it's more
appropriate here, so I'm hoping to increase my chances of getting a
response.

Summary:
Need a custom ODA plug-in to act differently in the BIRT designer than
it does when integrated on the server. Also need a way to pass
server-specific information to the plug-in when it's integrated, some
time shortly after the server initializes the BIRT platform.

Longer version:
I'm writing an ODA data source plug-in to encapsulate a custom data
source on our server -- it's a WebObjects application, so in a
nutshell, we'll pass in an array of objects (the rows) to BIRT, and the
columns that the user defines will be keypaths to access values from
these objects.

The catch is that to support previewing in the BIRT designer, the way
the objects are accessed must be vastly different than it is when
running under BIRT integrated on the server. The integrated instance
can just access the objects directly by making WebObjects fetch calls,
but from the designer, we'll likely just implement a simple HTTP
request handler on the server that sends back sample records for
previewing purposes. Furthermore, the plug-in when used at design-time
would require properties that aren't needed on the server, like the URL
to the server that should be used for previewing, as well as a
username/password for authentication. So I need some way of specifying
"design-time only" data source parameters that aren't saved in the
report template, which will eventually be uploaded to the server.

What is the best way to handle this? Should we maintain two different
plug-ins with the same IDs -- one to distribute for designing purposes
and one to run on the server? Or is there a way to get the same
plug-in to change its behavior depending on whether it's in design mode
or on the server?

And regardless of which approach I use, I'll need to be able to pass
information into the ODA plug-in from the server once the BIRT platform
is initialized -- such as which editing context to use to pull objects
from at report generation time. Is this as easy as adding the plug-in
JAR to the build path of the server and then calling
MyODAPlugin.getDefault() and other such methods once the platform is
initialized? Or are there other issues that arise from trying to
communicate from the server to the plug-in? Ideally, I think I would
like to do the following:

* Custom ODA plug-in contains a proxy interface that it calls to get
objects/data from the server
* A class on the server implements this interface and passes a
reference to this object into the ODA plug-in
* The plug-in calls these methods in the implementations of
IConnection, IQuery, IResultSet, etc., so that all access back to the
server occurs through this proxy and the ODA plug-in itself does not
need any WebObjects library dependencies

If I use this approach, then I could also implement an alternate
version of the interface for design-time, which would use the HTTP
method instead of the direct access method to obtain the data, as long
as I can detect whether I'm being used in the designer or on the
server. Is this likely to work?

Thanks!

- Tony Allevato
Previous Topic:Driver Definition uncompletable
Next Topic:DB2 zSeries
Goto Forum:
  


Current Time: Sun Oct 26 03:14:30 GMT 2014

Powered by FUDForum. Page generated in 0.01598 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software