Bug 237845 - Troubles with java filters with report viewer
Summary: Troubles with java filters with report viewer
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: BIRT (show other bugs)
Version: 2.3.0   Edit
Hardware: PC Linux
: P3 enhancement (vote)
Target Milestone: Future   Edit
Assignee: Vincent Petry CLA
QA Contact:
URL:
Whiteboard:
Keywords: plan
Depends on:
Blocks:
 
Reported: 2008-06-19 16:26 EDT by Nicola CLA
Modified: 2009-06-24 17:40 EDT (History)
7 users (show)

See Also:


Attachments
Security Filter (852 bytes, text/x-java)
2008-06-19 16:26 EDT, Nicola CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nicola CLA 2008-06-19 16:26:58 EDT
Created attachment 105447 [details]
Security Filter

I am trying to integrate BIRT viewer into an application (created with
SEAM, but it could be any JAVAEE application).

I just wanted to put a filter before the servlet request:

my filter in described in BirtSecurityFilter.java


And in web.xml I modified the following (adding /aaa/ before frameset):

------------------------------------------
<servlet-mapping>
        <servlet-name>ViewerServlet</servlet-name>
        <url-pattern>/aaa/frameset</url-pattern>
</servlet-mapping>
------------------------------------------


and added the filter configuration:

------------------------------------------
<filter>
    <filter-name>BIRT Security Filter</filter-name>
    <filter-class>BirtSecurityFilter</filter-class>
</filter>

<filter-mapping>
    <filter-name>BIRT Security Filter</filter-name>
    <url-pattern>/aaa/*</url-pattern>
</filter-mapping>
------------------------------------------


The concept is that under a determined path (in my case /aaa/) everything is under security and it's intercepted by the filter for a verify.

But calling  the  /aaa/frameset?__report=test.rptdesign     in the browser I get an empty page and the console shows the message contained in the filter (so it entered).

And if I mistake the name of the report (adding _error): /aaa/frameset?__report=test.rptdesign_error

I get file not found error (it's correct that the report does not exist):
-------------------------------
- The report file : /opt/jboss-4.2.2.GA/server/default/./deploy/viewer.war/test.rptdesign_error does not exist or contains errors.

org.eclipse.birt.report.exception.ViewerException: The report file : /opt/jboss-4.2.2.GA/server/default/./deploy/viewer.war/test.rptdesign_error does not exist or contains errors.
    at org.eclipse.birt.report.context.ViewerAttributeBean.getDesignHandle(ViewerAttributeBean.java:632)
    at org.eclipse.birt.report.context.ViewerAttributeBean.__init(ViewerAttributeBean.java:211)
-------------------------------


I don't understand this behaviour. It looks like that Birt has some problem with filter (maybe ajax call???).

If I map my filter before preview servlet, everything goes well, I enter the filter and the report is displayed.
So I think the problem is with frameset's ajax.

Bye
Comment 1 Vincent Petry CLA 2008-07-16 03:29:45 EDT
Currently, the BIRT servlets expect the servlet path to be exactly "/frameset" not "/aaa/frameset". This test is done by the ViewerServlet to differentiate between "frameset" and "run". So changing the servlet path is currently not supported.
Comment 2 Nicola CLA 2008-07-16 06:23:19 EDT
I think that's a very high limitation for BIRT integration in other applications.
Shouldn't be the ViewerServlet agnostic against its servlet-mapping configuration?

Regards,
N
Comment 3 Vincent Petry CLA 2008-07-16 21:42:44 EDT
Yes, I agree. But to make it more flexible, it might need more changes, as the servlet names and paths are fixed in many places in the code.

I think that allowing the user to add a prefix to the servlet name would still be feasible without too many code changes (and less regression risks).
So we could allow something like "/mypath/frameset", but not "/mypath/myframesetservletname".
Comment 4 Nicola CLA 2008-07-17 03:12:20 EDT
From my user/developer point of view the problem was only the filter:  frameset doesn't work when working with a filter before of it. So the intergration of the viewer is not possible.
Changing the servlet name is not so important.
Comment 5 Vincent Petry CLA 2008-08-27 01:55:34 EDT
Needs more investigation for a more complete and integrated solution.
Comment 6 Wenfeng Li CLA 2009-05-27 21:22:46 EDT
add plan keyword to consider this enh for future release.
Comment 7 julien CLA 2009-06-24 10:20:06 EDT
Hello,

I would to integrate birt in our web application j2ee , and I'm also interested about this development.
I would to add a prefix in the mapping, like '/birt/run'.
Thank you for considering that this is an important improvement for us.
Comment 8 Krishna Venkatraman CLA 2009-06-24 17:40:53 EDT
Hello Nicola and Julien,

I would like to encourage you to take a look at the Actuate BIRT Viewer which already addresses this feature request. More information about this is available at:

http://www.birt-exchange.com/be/products/birt-report-viewers/actuate-viewer/features/?articleid=17179

Thanks!

Krishna Venkatraman