Author: mcaspers
Date: 2011-03-08 17:59:51 -0500 (Tue, 08 Mar 2011)
New Revision: 29631
Modified:
trunk/birt/docs/en-US/birt_integration_with_seam.xml
trunk/birt/docs/en-US/birt_reports_deployment.xml
trunk/birt/docs/en-US/hibernate_datasource.xml
trunk/birt/docs/en-US/images/hibernate_datasource/finalReport.png
Log:
"General editing and screenshot updates"
Modified: trunk/birt/docs/en-US/birt_integration_with_seam.xml
===================================================================
--- trunk/birt/docs/en-US/birt_integration_with_seam.xml 2011-03-08 22:56:35 UTC (rev
29630)
+++ trunk/birt/docs/en-US/birt_integration_with_seam.xml 2011-03-08 22:59:51 UTC (rev
29631)
@@ -219,8 +219,7 @@
<para>Create the <filename>helloBirt.xhtml</filename> file in the
<filename>WebContent</filename> folder with the following content:
</para>
- <programlisting role="XML"><![CDATA[...
-<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ <programlisting role="XML"><![CDATA[<!DOCTYPE composition
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
xmlns:s="http://jboss.com/products/seam/taglib"
@@ -236,8 +235,7 @@
</b:birt>
</rich:panel>
</ui:define>
-</ui:composition>
-...]]></programlisting>
+</ui:composition>]]></programlisting>
<para>
From this listing above you see that the title of the report is set via
<code><b:param></code> by setting the parameter name and
defining the <code>value</code> attribute with the <code>Customers
Contacts</code> value.
Modified: trunk/birt/docs/en-US/birt_reports_deployment.xml
===================================================================
--- trunk/birt/docs/en-US/birt_reports_deployment.xml 2011-03-08 22:56:35 UTC (rev 29630)
+++ trunk/birt/docs/en-US/birt_reports_deployment.xml 2011-03-08 22:59:51 UTC (rev 29631)
@@ -1,51 +1,53 @@
<?xml version='1.0' encoding='UTF-8'?>
<section id="birt_reports_deployment">
- <title>Creating a Dynamic BIRT Report</title>
-
- <para>The <link linkend="birt_integration_with_seam">Adding
BIRT Functionality to Standard Seam Web Project</link>
- and <link linkend="hibernate_datasource">Using Hibernate ODA Data
Sourc</link> sections tell how to integrate a BIRT report into
- a Seam web project and how to use Hibernate data source to generate a dynamic
report.
- In this section we will create a Seam web project that can make a dynamic report
using the parameters that are defined on a web page.</para>
+ <title>Creating a Dynamic BIRT Report</title>
+ <para>
+ <xref linkend="birt_integration_with_seam"/> and <xref
linkend="hibernate_datasource"/> describe how to integrate a BIRT report into
a Seam web project and how to use Hibernate data source to generate a dynamic report. In
this section we will create a Seam web project that can make a dynamic report using the
parameters that are defined on a web page.
+ </para>
- <para>We will use the <property>PRODUCTS</property> table of
<property>DATAMODELS</property> database for the purpose of this demo
project.
- In the first place, you need to generate Seam entities like we did in the
previous chapter (<link linkend="hibernate_datasource">Hibernate ODA Data
Source</link> ). The demo application will generate a report about the company's
products, whereas it will allow to specify a product line. </para>
-<orderedlist>
- <listitem>
- <para>The next step is to create a Java class that will store the
<code>sortOrder</code> variable and its assessors, register the class in
faces.config.xml.
- The variable will be needed to pass dynamic data to the report via report parameters,
therefore it has to be of session scope.</para>
- </listitem>
+ <para>
+ We will use the <emphasis>PRODUCTS</emphasis> table of
<emphasis>DATAMODELS</emphasis> database for the purpose of this demo project.
The demo application will generate a report about the company's products, and allow
the user to specify a product line. To begin with, we need to generate Seam entities like
we did in the previous <xref linkend="hibernate_datasource"/>.
+ </para>
- <listitem>
- <para>
+ <orderedlist>
+ <listitem>
+ <para>
+ The next step is to create a Java class that will store the
<code>sortOrder</code> variable and its assessors, and register the class in
the <filename>faces.config.xml</filename> file. The variable will be required
to pass dynamic data to the report via report parameters; therefore it has to be of
session scope.
+ </para>
+ </listitem>
+
+ <listitem>
+ <para>
+ The report will print the data from the <emphasis>Products</emphasis>
table. Create a new report file file called
<filename>ProductsReport.rptdesign</filename> in the
<filename>WebContent</filename> folder. You can use either the
<property>BIRT JDBC Data Source</property> or <property>Hibernate Data
Source</property> data source to create the data set for this project. If you want
to use the latter please read the previous <xref
linkend="hibernate_datasource"/>.
+ </para>
+ <para>
+ The data set should have at least the following data set items: product vendor,
product name, quantity in stock and buy price. The data is retrieved from the database
with this query :
+ </para>
- The report will print the data from the <code>Products</code> table,
hence you need to create a report file first.
- You can use either the <property>BIRT JDBC Data Source</property> or
<property>Hibernate Data Source</property> data source to create the data set
for this project. If you want to use the latter please read the previous chapter <link
linkend="hibernate_datasource">Hibernate ODA Data Source</link>.
-</para>
-
-
- <para>
- The data set should have at least the following data set items: product vendor,
product name, quantity in stock and buy price. The data is retrieved from the database
with this query :
- </para>
-
-
- <programlisting role="XML"><![CDATA[
-SELECT productvedor,
-productname,
-quantityinstock,
-buyprice
-FROM Products as products
-]]></programlisting>
- </listitem>
- <listitem>
- <para>Make a table in the report and put each data set item into a
column.</para>
- </listitem>
- <listitem>
- <para>As it was stated in the beginning of the chapter the report will be
dynamic, therefore you need to declare a report parameter first, let it be
<code>sortOrder</code> and to add the parameter to the query. BIRT offers rich
JavaScript API, so you can modify the query programmatically like this:</para>
-<programlisting role="XML">
+ <programlisting role="XML"><![CDATA[SELECT productvendor,
productname, quantityinstock, buyprice
+FROM Products as products]]></programlisting>
+ </listitem>
+ <listitem>
+ <para>Make a table in the report and put each data set item into a
column.</para>
+ </listitem>
+ <listitem>
+ <para>As it was stated in the beginning of the chapter the report will be
dynamic, therefore you need to declare a report parameter first, let it be
<code>sortOrder</code> and to add the parameter to the query.
+ </para>
+ <figure>
+ <title>Report Parameter</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/birt_reports_deployment/reportParameter.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ <para>
+ BIRT offers rich JavaScript API, so you can modify the query programmatically like
this:</para>
+ <programlisting role="XML">
<xml-property name="queryText"><![CDATA[
SELECT productvedor,
@@ -59,18 +61,54 @@
this.queryText = this.queryText+queryString;
]]></method>
-</programlisting>
- </listitem>
- <listitem>
-<para>The report is ready. You can preview it to make sure it works properly.
</para>
- </listitem>
- <listitem> <para>To set the report parameter you should create
an <property>.xhtml</property> view page, call it
<property>Products.xhtml</property>. On the page you can set the value of the
<code>sortOrder</code> Java bean variable and press the
<property>Generate Report</property> button to open another view page that
will display the resulted report.
+</programlisting>
+ </listitem>
+ <listitem>
+ <para>The report is ready. You can preview it to make sure it works properly.
</para>
+ </listitem>
+ <listitem>
+ <para>
+ Create a JavaBean class called <code>ReportJB</code>, and populate it
with the following code.
+ </para>
+ <programlisting role="Java">
+import java.io.Serializable;
+
+import org.jboss.seam.ScopeType;
+import org.jboss.seam.annotations.Name;
+import org.jboss.seam.annotations.Scope;
+
+@Name("ReportJB")
+(a)Scope(ScopeType.SESSION)
+public class ReportJB implements Serializable
+{
+ private static final long serialVersionUID = 1L;
+ protected String sortOrder = "buyprice";
+
+ public String getSortOrder()
+ {
+ return sortOrder;
+ }
+
+ public void setSortOrder(String value)
+ {
+ sortOrder = value;
+ }
+
+ public ReportJB()
+ {
+
+ }
+}
+</programlisting>
+ </listitem>
+ <listitem>
+ <para>To set the report parameter you should create an
<filename>XHTML</filename> view page, call it
<filename>ProductForm.xhtml</filename>, and place it in the
<filename>WebContent</filename> folder. On the page you can set the value of
the <code>sortOrder</code> Java bean variable and press the
<guibutton>Generate Report</guibutton> button to open another view page that
will display the resulted report.
</para>
-
- <para>The source code of the <property>Products.xhtml</property>
should be the following:</para>
-
- <programlisting role="XML"><![CDATA[
+
+ <para>The source code of the <filename>ProductForm.xhtml</filename>
should be the following:</para>
+
+ <programlisting role="XML"><![CDATA[
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
@@ -88,7 +126,7 @@
<tr>
<td>Select sort order criterion:</td>
<td><h:selectOneMenu onchange="submit()"
- value="#{yourJavaBean.sortOrder}"> <!-- Bind to your Java Bean
-->
+ value="#{ReportJB.sortOrder}"> <!-- Bind to your Java Bean -->
<f:selectItem itemValue="buyprice" itemLabel="buy price"
/>
<f:selectItem itemValue="quantityinstock" itemLabel="quantity in
stock" />
</h:selectOneMenu>
@@ -101,15 +139,16 @@
</rich:panel>
</ui:define>
</ui:composition>
-]]></programlisting>
- <para>The logic of the file is quite simple, when the sort order criterion is
select the value of <code>yourJavaBean.sortOrder</code>
- is set automatically via Ajax and the report is ready to be generated.</para>
- </listitem>
- <listitem>
- <para>Now you need to create the web page that will print the report, name the
file <property>ProductsReport.xhtml</property>.
+]]></programlisting>
+ <para>
+ The logic of the file is quite simple: when the sort order criterion is selected the
value of <code>yourJavaBean.sortOrder</code> is set automatically via Ajax,
and the report is ready to be generated.
+ </para>
+ </listitem>
+ <listitem>
+ <para>Now you need to create the web page that will print the report, name the
file <filename>ProductsReport.xhtml</filename>.
The file to output the report should have the following content:</para>
-
-<programlisting role="XML"><![CDATA[
+
+ <programlisting role="XML"><![CDATA[
<!DOCTYPE composition PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<ui:composition
xmlns="http://www.w3.org/1999/xhtml"
@@ -124,97 +163,98 @@
<f:facet name="header">Products Report</f:facet>
<b:birt designType="embed" designName="products.rptdesign"
embeddable="true" masterpage="true">
- <b:param name="sortOrder" value="#{yourJavaBean.sortOrder}"
/>
+ <b:param name="sortOrder" value="#{ReportJB.sortOrder}" />
</b:birt>
</rich:panel>
</ui:define>
</ui:composition>
-]]></programlisting>
- <para>
- As you know from the <link
linkend="birt_integration_with_seam">Adding BIRT Functionality to Standard
Seam Web Project</link> chapter, before using the BIRT Integration framework tags
on the page you need to declare the tag library and specify the name space with this
line:
- </para>
-
- <programlisting role="XML"><![CDATA[
+]]></programlisting>
+
+ <para>
+ As you know from <xref linkend="birt_integration_with_seam"/>,
before using the BIRT Integration framework tags on the page you need to declare the tag
library and specify the name space with this line:
+ </para>
+
+ <programlisting role="XML"><![CDATA[
xmlns:b="http://jboss.com/products/seam/birt"
-]]></programlisting>
- <para>
+]]></programlisting>
+ <para>
The dynamics to the report adds this line:
- </para>
- <programlisting role="XML"><![CDATA[
+ </para>
+ <programlisting role="XML"><![CDATA[
<b:param name="sortOrder" value="#{yourJavaBean.sortOrder}" />
-]]></programlisting>
-
- <para>We bound the <code>sortOrder</code> report parameter to Java
Bean variable <code>value="#{yourJavaBean.sortOrder}"</code>
using EL expression, and the value to the variable is assigned in the
<property>Products.xhtml</property> file. </para>
- <para>By default if you embed a report into HTML page the HTML-format report
contains the <html>,
+]]></programlisting>
+
+ <para>We bound the <code>sortOrder</code> report parameter to Java
Bean variable <code>value="#{ReportJB.sortOrder}"</code>
using EL expression, and the value to the variable is assigned in the
<property>Products.xhtml</property> file. </para>
+ <para>By default if you embed a report into HTML page the HTML-format report
contains the <html>,
<head>, <body> etc., tags. However if your HTML page
already has those tags, you can rid of them using the
<code>embeddable="true"</code> attribute of
- the <emphasis
role="bold"><property><b:birt></property></emphasis>
component.</para>
- </listitem>
- <listitem>
- <para>Deploy the project onto the server and open your browser to see the
report is successfully generated. You should navigate to
+ the <emphasis
role="bold"><property><b:birt></property>
+ </emphasis> component.</para>
+ </listitem>
+ <listitem>
+ <para>Deploy the project onto the server and open your browser to see the report
is successfully generated. You should navigate to
- <code>http://localhost:8080/yourProjectName/Products.seam</code> to
select the criterion and press the <property>Generate Report</property>
button. You will be redirected to the
<code>http://localhost:8080/HelloBirt/ProductsReport.seam</code>
-
- </para>
- <figure>
- <title>Dynamic Report</title>
- <mediaobject>
- <imageobject>
- <imagedata
fileref="images/birt_reports_deployment/productReport.png"/>
- </imageobject>
- </mediaobject>
- </figure>
- </listitem>
-</orderedlist>
- <para>Thus, a Seam project that includes the BIRT facet can be deployed as any
project. If you
+ <ulink
url="http://localhost:8080/yourProjectName/ProductForm.seam">http://localhost:8080/yourProjectName/ProductForm.seam</ulink>
to select the criterion and press the <property>Generate Report</property>
button. You will be redirected to the <ulink
url="http://localhost:8080/HelloBirt/ProductsReport.seam">http://localhost:8080/HelloBirt/ProductsReport.seam</ulink>
+
+ </para>
+ <figure>
+ <title>Dynamic Report</title>
+ <mediaobject>
+ <imageobject>
+ <imagedata
fileref="images/birt_reports_deployment/productReport.png"/>
+ </imageobject>
+ </mediaobject>
+ </figure>
+ </listitem>
+ </orderedlist>
+ <para>Thus, a Seam project that includes the BIRT facet can be deployed as any
project. If you
define the Hibernate ODA driver, the JBoss BIRT engine will use JNDI URL that has
to be bound
to either Hibernate Session Factory or Hibernate Entity Manager Factory. If you
don't specify the JNDI URL property, our engine will try the following
JNDI
URLs:</para>
- <itemizedlist>
- <listitem>
- <para>
- <emphasis>java:/<project_name></emphasis>
- </para>
- </listitem>
- <listitem>
- <para>
-
<emphasis>java:/<project_name>EntityManagerFactory</emphasis>
- </para>
- </listitem>
- </itemizedlist>
+ <itemizedlist>
+ <listitem>
+ <para>
+ <emphasis>java:/<project_name></emphasis>
+ </para>
+ </listitem>
+ <listitem>
+ <para>
+ <emphasis>java:/<project_name>EntityManagerFactory</emphasis>
+ </para>
+ </listitem>
+ </itemizedlist>
- <para>When creating a Seam EAR project, Hibernate Entity Manager Factory is
bound to
+ <para>When creating a Seam EAR project, Hibernate Entity Manager Factory is bound
to
<emphasis>java:/{projectName}EntityManagerFactory</emphasis>. All
you need to do is
to use the Hibernate Configuration created automatically. You can use default
values for the
Hibernate Configuration and JNDI URL within the BIRT Hibernate Data
Source.</para>
- <para>When using a Seam WAR project, neither HSF nor HEMF aren't bound
to JNDI by
+ <para>When using a Seam WAR project, neither HSF nor HEMF aren't bound to
JNDI by
default. You have to do this manually. For instance, HSF can be bound to JNDI by
adding the
following property to the <emphasis>
- <property>persistence.xml</property></emphasis>
file:</para>
+ <property>persistence.xml</property>
+ </emphasis> file:</para>
- <programlisting role="XHTML"><![CDATA[<property
name="hibernate.session_factory_name" value="java:/projectname"/>
+ <programlisting role="XHTML"><![CDATA[<property
name="hibernate.session_factory_name" value="java:/projectname"/>
]]></programlisting>
- <para>And you can use <emphasis>java:/projectname</emphasis> as the
JNDI URL property when creating a BIRT
+ <para>And you can use <emphasis>java:/projectname</emphasis> as the
JNDI URL property when creating a BIRT
Hibernate Data Source.</para>
- <note>
- <title>Note:</title>
- <para>If you want to test this feature using PDE Runtime, you need to add
<emphasis>
+ <note>
+ <title>Note:</title>
+ <para>If you want to test this feature using PDE Runtime, you need to add
<emphasis>
<property>osgi.dev=bin</property>
- </emphasis> to the <emphasis>
+ </emphasis> to the <emphasis>
<property>WebContent/WEB-INF/platform/configuration/config.ini</property>
- </emphasis> file.</para>
- </note>
-
- <para>In conclusion, the main goal of this document is to get you to know with
a full feature set
+ </emphasis> file.</para>
+ </note>
+
+ <para>In conclusion, the main goal of this document is to get you to know with a
full feature set
that <property>JBoss BIRT Tools</property> provide. Thus if you have
some questions,
- comments or suggestions on the topic, please feel free to ask in the <ulink
-
url="http://www.jboss.org/index.html?module=bb&op=viewforum&...
+ comments or suggestions on the topic, please feel free to ask in the <ulink
url="http://www.jboss.org/index.html?module=bb&op=viewforum&...
Tools Forum</ulink>. You can also influence on how you want to see
JBoss Tools docs in
- future leaving your vote on the article <ulink
-
url="http://www.jboss.org/community/docs/DOC-10795">Overview of
the improvements required by JBossTools/JBDS Docs users</ulink>.</para>
+ future leaving your vote on the article <ulink
url="http://www.jboss.org/community/docs/DOC-10795">Overview of the
improvements required by JBossTools/JBDS Docs users</ulink>.</para>
</section>
Modified: trunk/birt/docs/en-US/hibernate_datasource.xml
===================================================================
--- trunk/birt/docs/en-US/hibernate_datasource.xml 2011-03-08 22:56:35 UTC (rev 29630)
+++ trunk/birt/docs/en-US/hibernate_datasource.xml 2011-03-08 22:59:51 UTC (rev 29631)
@@ -15,13 +15,13 @@
First, you need to reverse engineer from the database to generate Seam entities.
You can perform this operation going to
<menuchoice><guimenuitem>File</guimenuitem>
<guimenuitem>New</guimenuitem>
<guimenuitem>Seam Generate Entities</guimenuitem>
- </menuchoice> in the <property>Seam perspective</property>. More
details on the Seam Generate Entities please read <ulink
url="http://download.jboss.org/jbosstools/nightly-docs/en/seam/html_...
Dev Tools Reference guide</ulink>). In this guide we will use the
<property>Employees</property> table of the
<property>DATAMODELS</property> database.
+ </menuchoice> in the <guilabel>Seam</guilabel> perspective. More
details on the Seam Generate Entities please read <ulink
url="http://download.jboss.org/jbosstools/nightly-docs/en/seam/html_...
Developers Tools Reference guide</ulink>). In this guide we will use the
<emphasis>Employees</emphasis> table of the
<emphasis>DATAMODELS</emphasis> database, which can be downloaded from the
<ulink
url="http://docs.redhat.com/docs/en-US/JBoss_Developer_Studio/4.0/ht...
Started Guide</ulink>.
</para>
<note>
<title>Tip:</title>
<para>
- Before performing Seam Generate Entities, you should have a connection profile
adjusted and connected to a database. For information on how to do this see the <ulink
url="http://download.jboss.org/jbosstools/nightly-docs/en/seam/html_...
Database Application</ulink> chapter of the Seam Dev Tools Reference guide.
+ Before performing Seam Generate Entities, you should have a connection profile
adjusted and connected to a database. For information on how to do this see the <ulink
url="http://download.jboss.org/jbosstools/nightly-docs/en/seam/html_...
Database Application</ulink> chapter of the Seam Developer Tools Reference guide.
</para>
</note>
</listitem>
@@ -98,8 +98,8 @@
</listitem>
<listitem>
- <para>Select <property>HibernateDataSource</property> as target data
source and type in the new data set name.
- Call it <property>HibernateDataSet</property>.</para>
+ <para>Select <guilabel>HibernateDataSource</guilabel> as target data
source and type in the new data set name.
+ Call it <guilabel>HibernateDataSet</guilabel>.</para>
@@ -118,10 +118,8 @@
<para>The next dialog of the wizard will help you compose a query for the new
data set.</para>
<para>We will make a report that will print all employees in the database who
has Sales Rep job title.</para>
- <programlisting role="SQL"><![CDATA[...
-select jobtitle, firstname, lastname, email
-from Employees as employees where employees.jobtitle = 'Sales Rep'
-...]]></programlisting>
+ <programlisting role="SQL"><![CDATA[select jobtitle, firstname,
lastname, email
+from Employees as employees where employees.jobtitle = 'Sales
Rep']]></programlisting>
Modified: trunk/birt/docs/en-US/images/hibernate_datasource/finalReport.png
===================================================================
(Binary files differ)