Building BIRT ReportViewer Into Mifos

Enhancing Mifos to Support BIRT Reports (for the first time)

If you are using Mifos v1.1 or later, these steps are not needed, because the BIRT Report Viewer will be already integrated into Mifos at that time. If you do need to do it manually, here are the instructions.

  1. The first step: Declare variables for birt report. Use the following code in build.xml to declare:
    	<property name="birt.web.viewer.dir" value="${basedir}/BirtWebViewer"/>
    
    	<property name="birt.report.design.dir" value="${basedir}/BirtReportDesign"/>
    
    2. The second step: Integrate report viewer into Mifos.  Use the following code in build.xml to integrate:
    
    ::
    
      <target name="integrate_birt_web_viewer">
        <copy todir="${build.src.dir}">
          <fileset dir="${birt.web.viewer.dir}" excludes="*.jsp, *.rptdesign, **/web.xml"/>
        </copy>
        <concat destfile="${build.web-inf}/web.xml" append="no" force="yes" >
          <fileset dir="${src.dir}/org/mifos/META-INF" includes="web.xml"/>
          <fileset dir="${birt.web.viewer.dir}" includes="**/web.xml"/>
        </concat>
        <replaceregexp file="${build.web-inf}/web.xml" byline="no" flags="s" 
          match="&lt;/web-app&gt;.*&lt;/display-name&gt;" 
          replace="	&lt;!-- section: birt web viewer --&gt;" />
      </target>
    
    3. The third step: Copy designed report to correct folder also in build.xml:
    
    ::
    
      <target name="copy_birt_reports">
        <copy todir="${build.src.dir}/report">
          <fileset dir="${birt.report.design.dir}" />
        </copy>
      </target>
    
    4. The final step: Create a .war file. Before creating, we should have already finished the three steps above.
    
    ::
    
      <target name="war" 
        depends="clean,compile,copy_files,compile_test,copy_test_files,integrate_birt_web_viewer,copy_birt_reports">
        <delete file="${dist.dir}/${webapplication.name}.war"/>
        <war destfile="${dist.dir}/${webapplication.name}.war" 
          webxml="${build.web-inf}/web.xml">
          <fileset dir="${build.src.dir}" excludes="**/web.xml" />
        </war>
      </target>
    
    If you want an example, please refer to build.xml in SVN.