retrievercommunications / docker-jasperserver

Docker image for the community edition of JasperReports® Server.
https://hub.docker.com/r/retriever/jasperserver/
MIT License
46 stars 50 forks source link

Enable JSON Data Source #15

Open nottest opened 6 years ago

nottest commented 6 years ago

Hi,

I am trying to enable JSON data source as pointed out here: https://community.jaspersoft.com/documentation/tibco-jasperreports-server-administration-guide/v610/file-data-sources

Everytime I restart the container, the xml (config) file gets overwritten. Do you have any idea how I can change the config file and get it reflected in the jasper server container that is running?

Thanks & Regards, Nanthini

grange74 commented 6 years ago

Hi @nottest,

Sorry for the delay in responding.

I'd like a few clarifications so i can reproduce locally and work out a workable suggestion. Can i ask how are you trying to edit the "applicationContext-remote-services.xml" in the container? Are you just doing a docker exec? Are you editing "/usr/local/tomcat/webapps/ROOT/WEB-INF/applicationContext-remote-services.xml"?

When you say restart the container, do you mean stop and start again or recreate? The reason i ask is that normally if you edit files within the container it will remain after stopping and starting but obviously won't survive recreation. The entrypoint.sh is only meant to run once so it shouldn't override anything. The only thing i can think of is that JasperServer is re-saving the file on shutdown and that it only expects the editing to be done when the Jasperserver is not running. Not sure.

It is likely that we will have change the entrypoint.sh to modify the customDataSourcesToHide to enable all the data source types.

Current version seems to hide the following by default, not sure why:

<util:set id="customDataSourcesToHide">
        <value>remoteXmlDataSource2</value> <!-- Full domain support remote XML custom data source -->
        <value>remoteXmlDataSource</value>  <!-- Simple single table remote XML custom data source -->
        <value>mongoDBQueryDataSource2</value> <!-- Full domain support mongodb query custom data source -->
        <value>mongoDBQueryDataSource</value>  <!-- Simple single table remote XML custom data source -->
        <value>jsonDataSource2</value> <!-- Full domain support JSON custom data source -->
        <value>jsonDataSource</value>  <!-- Simple single table remote XML custom data source -->
        <value>jdbcQueryDataSource2</value> <!-- Full domain support jdbc query custom data source -->
        <value>jdbcQueryDataSource</value>  <!-- Simple single table remote XML custom data source -->
        <value>xlsDataSource</value> <!-- Full domain support XLS custom data source -->
        <value>xlsxDataSource</value> <!-- Full domain support XLSX custom data source -->
        <value>textDataSource</value> <!-- Full domain support TEXT/ CSV custom data source -->
        <value>JsonSeriesDataSource</value> <!-- Simple single table remote XML custom data source -->
        <value>xmlaQueryDataSource</value> <!-- Simple single table XMLA Query custom data source -->
        <value>cassandraQueryDataSource</value> <!-- Deprecated.  Please use cassandra SIMBA JDBC driver to run native CQL.  Append "QueryMode=1" in URL in order to run CQL  -->
        <value>HiveDataSource</value> <!-- Deprecated.  Please use Hive/ Impala JDBC drivers instead -->
    </util:set>
Adriien-M commented 5 years ago

I have the same issue, I tried to mount the file as a configMap in kubernetes but it's not possible because it trie to replace it during build process. Even if I mount the entire /usr/local/tomcat/webapps/ROOT/WEB-INF/ folder it doesn't work, it fails during build process too...

grange74 commented 5 years ago

@Adriien-M would changing the entrypoint.sh to modify the customDataSourcesToHide to enable all the data source types (or just the json ones) on bootstrap solve your use case? Any other suggestions are welcome too....

Adriien-M commented 5 years ago

Yes it should work, indeed we have to wait the deployment process before to edit the file... Maybe an environment variable to specify datasources to enable should do the trick?

grange74 commented 5 years ago

I agree that the current bootstrap process is less than ideal. One of my main considerations has been to try to reuse as much of the jasperserver built-in functionality as possible so that it minimises things breaking when a new version is released. Any ideas on improving the bootstrap process would be welcome, perhaps in a separate issue.

For the minimum change to fix this issue, can i confirm that enabling jsonDataSource2 and jsonDataSource would do it? is JsonSeriesDataSource also required?

<value>jsonDataSource2</value> <!-- Full domain support JSON custom data source -->
<value>jsonDataSource</value>  <!-- Simple single table remote XML custom data source -->        
<value>JsonSeriesDataSource</value> <!-- Simple single table remote XML custom data source -->

Here's the latest documentation for reference: https://community.jaspersoft.com/documentation/tibco-jasperreports-server-ultimate-guide/v710/pre-installed-data-source-types

I like the idea of moving to an environment variable and perhaps it should update the xml on every startup rather than just on bootstrap. Can you give an example of what the name/value could be?

canob commented 1 year ago

@Adriien-M would changing the entrypoint.sh to modify the customDataSourcesToHide to enable all the data source types (or just the json ones) on bootstrap solve your use case? Any other suggestions are welcome too....

Hi @grange74 . Do you know a simple way to do what you suggested, modify the customDataSourcesToHide to enable all the data source types (or just the json ones) on bootstrap? Because I review some of the available documentation but I didn't find how to do it. I'm trying to do that on https://hub.docker.com/r/bitnami/jasperreports, which is based on 8.x Jasper Reports Server Community Edition.

Thanks in advance for your help.