Archive for January, 2008

OpenReports – Flexible configuration and deployment using Spring

OpenReports 3.0 uses the Spring Framework to configure and wire together its components. For most users there is no need to modify this configuration because the most important properties can be modified in the openreports.properties file, but there are some cases where it can be useful to modify the Spring configuration itself.

The Spring configuration file, applicationContext.xml, is located in the WebRoot/WEB-INF directory of the OpenReports distribution. You will need to rebuild the OpenReports war file after making any changes to this file.

1) Moving openreports.properties outside the war file

The applicationContext.xml file can be modified to look for the openreports.properties file outside of the war file. This can be helpful if you would like to use one war file in multiple environments. In order to do this, you must modify the PropertyPlaceholderConfigurer

<bean id=”environment”    
    class=”org.springframework.beans.factory.config.PropertyPlaceholderConfigurer” lazy-init=”false”>                    <property name=”ignoreResourceNotFound” value=”true” />   
    <property name=”locations”>       
        <list>           
            <value>classpath:openreports.properties</value>
        </list>
    </property>
</bean>

The important part is the location, classpath:openreports.properties. This tells Spring to look for openreports.properties in the classpath. To look for the openreports.properties on the file system, change classpath to file.

<bean id=”environment”
    class=”org.springframework.beans.factory.config.PropertyPlaceholderConfigurer” lazy-init=”false”>           
    <property name=”ignoreResourceNotFound” value=”true” />
    <property name=”locations”>
        <list>
            <value>file:///usr/share/openreports/openreports.properties</value>
        </list>
    </property>
</bean>

2) Mail Session configuration

By default, the mail session used to send scheduled reports is configured from the Settings page of the OpenReports Administration UI. If you need a more advanced mail session configuration, for authentication or other purposes, you can override this mail session with one configured through Spring. Add the following xml to the applicationContext.xml file to create a mail session that will look for the mail.user, mail.password, and mail.smtp.host properties in the openreports.properties file.

<bean id=”mailAuthenticator” class=”org.efs.openreports.util.SMTPAuthenticator”>
    <constructor-arg index=”0″ value=”${mail.user}” />
    <constructor-arg index=”1″ value=”${mail.password}” />
</bean>

<bean id=”mailSession” class=”javax.mail.Session” factory-method=”getInstance”>
    <constructor-arg index=”0″>
            <props>
                <prop key=”mail.smtp.host”>${mail.smtp.host}</prop>               
            </props>
        </constructor-arg>
    <constructor-arg index=”1″ ref=”mailAuthenticator” />
</bean>

3) JNDI DataSources

The applicationContext.xml file can also be used to configure OpenReports to use JNDI DataSources. Just replace the hibernateDataSource and the quartDataSource beans with beans defined like the example below:

<bean id=”hibernateDataSource” class=”org.springframework.jndi.JndiObjectFactoryBean”>
    <property name=”jndiName” value=”java:comp/env/jdbc/myHibernateDs”/>
</bean>

2 comments January 31st, 2008

OpenReports – Help with OLAP examples

New to OpenReports 3.0 is the ability to create OLAP reports. I’ve noticed a few users have been having trouble getting the example OLAP reports to run on Linux.

A common problem occurs with the Catalog Definition in datasources.xml. This must contain the full path to your Mondrian schema. In the example, the path is:

c:\openreports-tomcat\reports\SampleData.mondrian.xml

If you are running OpenReports on Linux, you must add file:// to the path to indicate the resource is a File, for example:

file:///usr/share/openreports-tomcat/reports/SampleData.mondrian.xml

4 comments January 30th, 2008

OpenReports Updates: New release and demos, Free Admin Guide

OpenReports 3.0.1 is now available for download. This is a bug fix release that fixes a number of problems including JDK 1.6 compatibility.

Click here to download or here to view the release notes.

The OpenReports Administration Guide is now freely available for download from SourceForge. Click here to download.

Also available are new Flash and functional demos of OpenReports Professional 3.0.1. The functional demo includes all the features of the full Professional version but is limited to 25 reports, 5 alerts, and 2 users. Click here to view or download the demos.

1 comment January 6th, 2008


Calendar

January 2008
M T W T F S S
« Dec   Aug »
 123456
78910111213
14151617181920
21222324252627
28293031  

Posts by Month

Posts by Category

SourceForge.net Logo