Modifying Birt Engine
Options
<p>Hi, </p>
<p> </p>
<p>I am trying to get rid of 'read a row ' and 'read a cell' output that birt produces when generating the report.</p>
<pre class="_prettyXprint">
read a cell...
read a row...
read a cell...
read a row.</pre>
<p>I understand the lines that that are responsible for such output are </p>
<pre class="_prettyXprint">
protected void startContainer( IContainerArea container )
{
...
if ( container instanceof RowArea )
{
System.out.println("read a row...");
rowStyleStack.push( container.getBoxStyle( ) );
}
else if ( container instanceof CellArea )
{
System.out.println("read a cell...");
drawCell( (CellArea) container );
}
...</pre>
<p>I downloaded the birt source code but what do I do next to modify the actual birt engine? I tried looking for *.java files and there are only .jar files in the source code package and I am not too sure how to properly proceed. </p>
<p> </p>
<p>Could someone outline how to import birt source code procect into the eclipse for the development/modification purposes?</p>
<p> </p>
<p>Thanks!</p>
<p> </p>
<p> </p>
<p>I am trying to get rid of 'read a row ' and 'read a cell' output that birt produces when generating the report.</p>
<pre class="_prettyXprint">
read a cell...
read a row...
read a cell...
read a row.</pre>
<p>I understand the lines that that are responsible for such output are </p>
<pre class="_prettyXprint">
protected void startContainer( IContainerArea container )
{
...
if ( container instanceof RowArea )
{
System.out.println("read a row...");
rowStyleStack.push( container.getBoxStyle( ) );
}
else if ( container instanceof CellArea )
{
System.out.println("read a cell...");
drawCell( (CellArea) container );
}
...</pre>
<p>I downloaded the birt source code but what do I do next to modify the actual birt engine? I tried looking for *.java files and there are only .jar files in the source code package and I am not too sure how to properly proceed. </p>
<p> </p>
<p>Could someone outline how to import birt source code procect into the eclipse for the development/modification purposes?</p>
<p> </p>
<p>Thanks!</p>
<p> </p>
0
Comments
-
<p>These guides maybe out of date, or does not appy to BIRT 4.5.0:</p>
<p><a data-ipb='nomediaparse' href='http://www.eclipse.org/birt/build/build_instr.html'>How To Build BIRT from CVS</a></p>
<p><a data-ipb='nomediaparse' href='http://wiki.eclipse.org/BIRT/FAQ/Birt_Project#Q:_How_do_I_build_BIRT_using_the_PSF_File.3F'>http://wiki.eclipse.org/BIRT/FAQ/Birt_Project#Q:_How_do_I_build_BIRT_using_the_PSF_File.3F</a></p>
<p><a data-ipb='nomediaparse' href='http://developer.actuate.com/be/documentation/ihub31-dev/EBDInstall/index.html#page/EBDInstall/install-others.4.08.html'>http://developer.actuate.com/be/documentation/ihub31-dev/EBDInstall/index.html#page/EBDInstall/install-others.4.08.html</a></p>
<p><a data-ipb='nomediaparse' href='http://wiki.eclipse.org/BIRT/FAQ/Birt_Project#Q:_How_to_Build_BIRT_3.7.1.2B_from_GIT.3F'>http://wiki.eclipse.org/BIRT/FAQ/Birt_Project#Q:_How_to_Build_BIRT_3.7.1.2B_from_GIT.3F</a></p>
<p> </p>
<p> </p>
<p>Using Java 1.7, here's how I build OS BIRT 4.5.0:</p>
<p> </p>
<p>1. Downloaded Maven 3.3.9 (Binary zip archive)<br><a data-ipb='nomediaparse' href='https://maven.apache.org/download.cgi'>https://maven.apache.org/download.cgi</a><br><br>
2. Installed and configured Maven<br><a data-ipb='nomediaparse' href='https://maven.apache.org/install.html'>https://maven.apache.org/install.html</a><br><br>
(Make sure you can run "mvn" before proceeding.)<br><br>
3. Created a toolchains.xml under C:\Windows\Users/<name>/.m2<br>
Updated the jdkHome path for Java 1.7<br>
</p>
<pre class="_prettyXprint">
<?xml version="1.0" encoding="UTF8"?>
<toolchains>
<toolchain>
<type>jdk</type>
<provides>
<id>JavaSE-1.7</id>
<version>1.7</version>
<vender>sun</vender>
</provides>
<configuration>
<jdkHome>C:\Program Files\Java\jdk1.7.0_09\jre</jdkHome>
</configuration>
</toolchain>
</toolchains>
</pre>
<p>4. Downloaded OS BIRT source (for 4.5.0M7) from GitHub<br><a data-ipb='nomediaparse' href='https://github.com/eclipse/birt/tree/4.5.0M7'>https://github.com/eclipse/birt/tree/4.5.0M7</a><br><br>
5. Extracted ZIP to a directory<br><br>
6. In command prompt...<br>
A. Navigated to extracted directory from Step 4<br>
B. "mvn package -DskipTest -Pmars"</p>
<pre class="_prettyXprint">
(bunch of msgs)
[INFO]
[INFO] BUILD SUCCESS
[INFO]
[INFO] Total time: 32:04 min
[INFO] Finished at: 2016-03-03T15:40:15-08:00
[INFO] Final Memory: 652M/2024M
[INFO]
</pre>
<p>You'll find the various ZIPs under ...\build\birt-packages.</p>
<p> </p>
<p>For example:</p>
<p>...\build\birt-packages\birt-report-all-in-one\target</p>
<p>...\build\birt-packages\birt-runtime\target</p>
Warning No formatter is installed for the format ipb0 -
<p>Thanks, Clement!! </p>
<p> </p>
<p>Unfortunately, the steps above worked partially for me and at the end maven could not finish its job due to errors. I can post the output where the error happens, if needed.</p>
<p> </p>
<p>I want to ask couple general overview questions as far as building from source goes...</p>
<p> </p>
<p>1) On the official BIRT's website, the link to the source is different than than the one you gave me </p>
<p><a data-ipb='nomediaparse' href='http://www.eclipse.org/downloads/download.php?file=/birt/downloads/drops/R-R1-4_5_0-201506092134/birt-source-4.5.0-20150609.zip'>http://www.eclipse.org/downloads/download.php?file=/birt/downloads/drops/R-R1-4_5_0-201506092134/birt-source-4.5.0-20150609.zip</a></p>
<p> </p>
<p>Which source is the safest to use? above or from Git? if from Git, then which one: ..M7 or master? </p>
<p> </p>
<p>2) Also, what exactly am I supposed to see in Eclipse IDE when I import Birt project? .java files or something else? And speaking of the project... I was expecting to see .project file somewhere but donot seem to see it in the root of the downloaded zip. If you would not mind, could you please outline what is the Birt source project? is it a java project, a plugin project or something else? </p>
<p> </p>
<p>3) Also, going back to my original question/post, if I just want to update one .jar file, do I need to recompile the entire birt project or can I just recompile the needed jar and then just replace the old .jar with the newer one?</p>
<p> </p>
<p>Thanks!! </p>0 -
<p>I understand your request now because the messages that you are referring to are outputs from when a report is converted to a different format (e.g. PDF or Excel) using the emitter.</p>
<p> </p>
<p>Based on the GitHub History (<a data-ipb='nomediaparse' href='https://github.com/eclipse/birt/commits/81f25cc6099f758476737a59d1f59e21a6cc91d7/engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/layout/emitter/PageDeviceRender.java'>https://github.com/eclipse/birt/commits/81f25cc6099f758476737a59d1f59e21a6cc91d7/engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/layout/emitter/PageDeviceRender.java</a>), that debugging code was removed in a commit on October 16, 2015 <a>(https://github.com/eclipse/birt/blob/81f25cc6099f758476737a59d1f59e21a6cc91d7/engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/layout/emitter/PageDeviceRender.java).</a></p>
<p> </p>
<p>I would use the one from GitHub. Master is the latest code, so don't use this. Mars (<a data-ipb='nomediaparse' href='https://github.com/eclipse/birt/tree/Mars'>https://github.com/eclipse/birt/tree/Mars</a>) is the one that you should pull down.</p>
<p> </p>
<p>Now that I understand your request. You can just get the .java (@ <a data-ipb='nomediaparse' href='https://github.com/eclipse/birt/blob/Mars/engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/layout/emitter/PageDeviceRender.java),'>https://github.com/eclipse/birt/blob/Mars/engine/org.eclipse.birt.report.engine/src/org/eclipse/birt/report/engine/layout/emitter/PageDeviceRender.java),</a>and build it in Eclipse.</p>
<p> </p>
<p>In Eclipse, I built PageDeviceRender, based on the BIRT 4.5.0 release, for you with the two debug statements commented out.</p>
<p> </p>
<p>For reference, I created a new Java Project (*key* and pointed it to use Java 1.7), a new package (org.eclipse.birt.report.engine.layout.emitter) and one class (PageDeviceRender).</p>
<p> </p>
<p>Pointed the Java Build Path > Libraries > Add External JARs to:</p>
<p> </p>
<p style="margin-left:40px;">org.eclipse.birt.report.engine_4.5.0.v201506092134.jar<br>
org.eclipse.birt.report.model_4.5.0.v201506092134.jar</p>
<p> </p>
<p>After it was compiled and ensured that Tomcat was stopped, I navigated to my Tomcat's <em>webapps\birt\WEB-INF\lib</em> directory, and backed up <strong>org.eclipse.birt.runtime_4.5.0.jar </strong>(and renamed it to a different extension such as .bak).</p>
<p> </p>
<p>Using 7-Zip, opened <strong>org.eclipse.birt.runtime_4.5.0.jar </strong> and deleted PageDeviceRender.class under \org\eclipse\birt\report\engine\layout\emitter.</p>
<p> </p>
<p>Added the new PageDeviceRender.class into the .JAR.</p>
<p> </p>
<p>Restarted Tomcat, and tested the sample report by Printing Report.</p>
<p> </p>
<p> </p>
<p>Attached is the revised PageDeviceRender.class for BIRT 4.5.0. <em>(Legal blurb aka fine print: This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages arising from the use of this software.)</em></p>Warning No formatter is installed for the format ipb0
Categories
- All Categories
- 111 Developer Announcements
- 49 Articles
- 103 General Questions
- 123 IM Services
- 40 OpenText Hackathon
- 31 Developer Tools
- 20.6K Analytics
- 4.1K AppWorks
- 8.9K Extended ECM
- 897 Cloud Fax and Notifications
- 77 Digital Asset Management
- 9.3K Documentum
- 29 eDOCS
- 123 Exstream
- 39.8K TeamSite
- 1.7K Web Experience Management
- 1 XM Fax