Intergrate own resource locator [message #244618] |
Mon, 25 June 2007 11:18  |
Eclipse User |
|
|
|
I am trying to integrate my own resource locator into the
BIRT Web application to be able to work with various libraries.
Therefore I implemented a class derived from IResourceLocator.
As far as I understand this class must be set in the EngineConfig
via setResourceLocator().
Could anyone point out how/where this is achieved in a web application?
Thanks a lot!
Peter Fopma
|
|
|
|
|
Re: Intergrate own resource locator [message #244957 is a reply to message #244914] |
Tue, 26 June 2007 16:21   |
Eclipse User |
|
|
|
Originally posted by: jasonweathersby.alltel.net
Peter,
Why not change it in the ReportEngineService.java where the output
format is checked? You will need to do this in a couple of places in
this file.
if ( format == null )
format = ParameterAccessor.getFormat( request );
if ( IBirtConstants.PDF_RENDER_FORMAT.equalsIgnoreCase( format )
|| IBirtConstants.POSTSCRIPT_RENDER_FORMAT
.equalsIgnoreCase( format ) )
{
renderOption = createPDFRenderOption( servletPath, request,
ParameterAccessor.isDesigner( request ) );
}
BTW did you try using 2 libs and then just use script to change the
namespace for the extends property?
Jason
Peter Fopma wrote:
> Thanks Jason,
>
> that's the place I choose to put it. I was just wondering whether there
> is a solution to integrate the resource locator without modifying the code.
>
> My aim is to be able to create two version of a report. A HTML for display
> in the browser and a PDF for printing. Since the formating for HTML and PDF
> differ quite a bit, I choose to create two libraries. One with the tables
> formatted in pixel-units and one with the tables formatted in point-units.
> The names for all the reportitems are identical in the two libraries.
> Therefore it is sufficient to replace the library in the report design and
> the report is formatted in HTML or PDF.
>
> To avoid changing the report design at all, I descided to implement a
> resource locator, check the parameter value for __format=pdf/html and
> return the URL for the accordant library.
>
> The problem is the resource locator does not know about parameter values
> and where I know the parameter values, I cannot influence the resource
> locator...
> I imagine there must be a code section where the parameter definitions
> from the design file are matched with the parameters passed in the
> HTTP-request. (I guess that's where __format is evaluated, too)
> Could that be the place to set the resource locator which either returns
> the pdf or the html library (i.e. I use two resource locators)?
> Could you help me find the code where this is done?
>
> Thanks
> Peter
>
|
|
|
|
|
|
Re: Intergrate own resource locator [message #245693 is a reply to message #245628] |
Sat, 30 June 2007 13:58  |
Eclipse User |
|
|
|
Originally posted by: jasonweathersby.alltel.net
Peter,
I did that in 2.2, but I would think it would work in 2.1.x.
Jason
Peter Fopma wrote:
> Jason, should this work in version 2.1 or is this only possible in
> version 2.2?
>
> Thanks
> Peter
>
|
|
|
Powered by
FUDForum. Page generated in 0.24766 seconds