Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change Webapp into Spring Boot Webapp #28

Open
lofidewanto opened this issue Apr 8, 2016 · 4 comments
Open

Change Webapp into Spring Boot Webapp #28

lofidewanto opened this issue Apr 8, 2016 · 4 comments
Assignees
Labels

Comments

@lofidewanto
Copy link
Contributor

We should use Spring Boot Webapp instead of the standard Webapp.

@lofidewanto lofidewanto self-assigned this Apr 8, 2016
@lofidewanto
Copy link
Contributor Author

@kentoj
Copy link

kentoj commented Oct 12, 2016

I may be able to help with this. I made a simple report runner and published a version of it on SO here.
The main challenge I am facing now is the implementation of the multiple JNDI resources feature.

The only good way that comes to mind is like so:

  1. Start with an XML document or other document in the application resources that is loaded onto the class path, like in src/main/resources/jndiResources.xml. This would have multiple JNDI resources declared in it just like the context.xml file when run as a WAR in Tomcat.
  2. On application bootstrap time load the list of available jndiResources, create the datasource objects, and add them to some in-memory JNDI connection store.
  3. When running a report parse the BIRT report XML to determine if a JNDI datasource was used.
  4. If a JNDI datasource was used then read the JNDI resource specified by the BIRT report.
  5. Search for the JNDI resource specified. If not there then throw an exception, if there then create or retrieve the JNDI datasource, set it in the report like shown here
  6. Run and Render the report as usual
  7. Return PDF

This could be improved by:

  1. Lazily creating the JNDI resources on the first time they are requested instead of at bootstrap time. However, it may be useful to fail startup if any JNDI resources are invalid.
  2. The JNDI resources could be loaded from a file on disk outside of the Spring Boot app so it would be easy to adjust things, like from /var/reporting/context.xml.
  3. We wouldn't have to use XML, we could use JSON.

@kentoj
Copy link

kentoj commented Oct 13, 2016

From an initial look at the API for an IReportRunnable it looks like there may not be a clear way to look up the datasource from the report. This is because the only way to get a dataSource is to look it up by name from the report like so IReportRunnable.getDesignInstance().getDataSource("");

Even if there was, the API docs say the IReportRunnable is immutable. I haven't tested anything with this yet.

What I am looking into now is a way to provide the JNDI resources in the EngineConfig or something like that.

@lofidewanto
Copy link
Contributor Author

Hmm sounds complicated for me... @idueppe: what is your opinion?

It would be really cool if we can run this webapp as Spring Boot...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants