Moved Birt demos in the Example application. (OFBIZ-3352)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@892633 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Bruno Busco
2009-12-20 18:22:09 +00:00
parent bfeb62aada
commit 63ebc81a33
18 changed files with 1393 additions and 2846 deletions
@@ -41,6 +41,15 @@
<value xml:lang="th">ตัวอย่างโปรแกรมคอมพิวเตอร์</value>
<value xml:lang="zh">样例应用</value>
</property>
<property key="ExampleBirtReport">
<value xml:lang="en">HTML</value>
</property>
<property key="ExampleBirtMail">
<value xml:lang="en">Send any format through Mail</value>
</property>
<property key="ExampleBirtViewHandler">
<value xml:lang="en">PDF</value>
</property>
<property key="ExampleCompanyName">
<value xml:lang="en">OFBiz: Example</value>
<value xml:lang="fr">OFBiz : Exemple</value>
+30
View File
@@ -0,0 +1,30 @@
<#--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<#assign birt = JspTaglibs["/WEB-INF/birt.tld"]/>
<@birt.report id="birtReport"
reportDesign="component://example/webapp/birt/report/product.rptdesign"
baseURL="/birt"
height="700"
width="900"
format="html"
isHostPage="false"
pageNum="2">
</@birt.report>
@@ -0,0 +1,212 @@
<?xml version="1.0" encoding="UTF-8"?>
<report xmlns="http://www.eclipse.org/birt/2005/design" version="3.2.20" id="1">
<property name="createdBy">Eclipse BIRT Designer Version 2.5.1.v20090903 Build &lt;2.5.1.v20090917-1447></property>
<property name="units">in</property>
<method name="initialize"><![CDATA[importPackage(Packages.org.ofbiz.base.util)
module = "product.rptdesign";]]></method>
<property name="iconFile">/templates/blank_report.gif</property>
<property name="bidiLayoutOrientation">ltr</property>
<data-sources>
<script-data-source name="OFBiz" id="8"/>
</data-sources>
<data-sets>
<script-data-set name="Product" id="9">
<list-property name="resultSetHints">
<structure>
<property name="position">0</property>
<property name="name">productId</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">1</property>
<property name="name">productTypeId</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">internalName</property>
<property name="dataType">string</property>
</structure>
</list-property>
<list-property name="columnHints">
<structure>
<property name="columnName">productId</property>
<text-property name="displayName">productId</text-property>
</structure>
<structure>
<property name="columnName">productTypeId</property>
<text-property name="displayName">productTypeId</text-property>
</structure>
<structure>
<property name="columnName">internalName</property>
<text-property name="displayName">internalName</text-property>
</structure>
</list-property>
<structure name="cachedMetaData">
<list-property name="resultSet">
<structure>
<property name="position">1</property>
<property name="name">productId</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">2</property>
<property name="name">productTypeId</property>
<property name="dataType">string</property>
</structure>
<structure>
<property name="position">3</property>
<property name="name">internalName</property>
<property name="dataType">string</property>
</structure>
</list-property>
</structure>
<property name="dataSource">OFBiz</property>
<method name="open"><![CDATA[products = null;
try {
products = delegator.findAll("Product");
} catch (e) {
Debug.logError(e, module);
}
totalRow = 0;
countOfRow = 0;
if (products) {
totalRow = products.size();
}]]></method>
<method name="fetch"><![CDATA[if (countOfRow == totalRow - 1) return false;
product = products.get(countOfRow);
productId = product.getString("productId");
productTypeId = product.getString("productTypeId");
internalName = product.getString("internalName");
row["productId"] = productId;
row["productTypeId"] = productTypeId;
row["internalName"] = internalName;
countOfRow ++;
return true;]]></method>
</script-data-set>
</data-sets>
<styles>
<style name="report" id="4">
<property name="fontFamily">sans-serif</property>
<property name="fontSize">10pt</property>
</style>
<style name="crosstab-cell" id="5">
<property name="borderBottomColor">#CCCCCC</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">1pt</property>
<property name="borderLeftColor">#CCCCCC</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">1pt</property>
<property name="borderRightColor">#CCCCCC</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">1pt</property>
<property name="borderTopColor">#CCCCCC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">1pt</property>
</style>
<style name="crosstab" id="6">
<property name="borderBottomColor">#CCCCCC</property>
<property name="borderBottomStyle">solid</property>
<property name="borderBottomWidth">1pt</property>
<property name="borderLeftColor">#CCCCCC</property>
<property name="borderLeftStyle">solid</property>
<property name="borderLeftWidth">1pt</property>
<property name="borderRightColor">#CCCCCC</property>
<property name="borderRightStyle">solid</property>
<property name="borderRightWidth">1pt</property>
<property name="borderTopColor">#CCCCCC</property>
<property name="borderTopStyle">solid</property>
<property name="borderTopWidth">1pt</property>
</style>
</styles>
<page-setup>
<simple-master-page name="Simple MasterPage" id="2">
<page-footer>
<text id="3">
<property name="contentType">html</property>
<text-property name="content"><![CDATA[<value-of>new Date()</value-of>]]></text-property>
</text>
</page-footer>
</simple-master-page>
</page-setup>
<body>
<table id="10">
<property name="dataSet">Product</property>
<list-property name="boundDataColumns">
<structure>
<property name="name">productId</property>
<text-property name="displayName">productId</text-property>
<expression name="expression">dataSetRow["productId"]</expression>
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">productTypeId</property>
<text-property name="displayName">productTypeId</text-property>
<expression name="expression">dataSetRow["productTypeId"]</expression>
<property name="dataType">string</property>
</structure>
<structure>
<property name="name">internalName</property>
<text-property name="displayName">internalName</text-property>
<expression name="expression">dataSetRow["internalName"]</expression>
<property name="dataType">string</property>
</structure>
</list-property>
<column id="29"/>
<column id="30"/>
<column id="31"/>
<header>
<row id="11">
<property name="backgroundColor">#BFBFBF</property>
<property name="fontWeight">bold</property>
<property name="textAlign">center</property>
<cell id="12">
<label id="13">
<text-property name="text">productId</text-property>
</label>
</cell>
<cell id="14">
<label id="15">
<text-property name="text">productTypeId</text-property>
</label>
</cell>
<cell id="16">
<label id="17">
<text-property name="text">internalName</text-property>
</label>
</cell>
</row>
</header>
<detail>
<row id="18">
<cell id="19">
<data id="20">
<property name="resultSetColumn">productId</property>
</data>
</cell>
<cell id="21">
<data id="22">
<property name="resultSetColumn">productTypeId</property>
</data>
</cell>
<cell id="23">
<data id="24">
<property name="resultSetColumn">internalName</property>
</data>
</cell>
</row>
</detail>
<footer>
<row id="25">
<cell id="26"/>
<cell id="27"/>
<cell id="28"/>
</row>
</footer>
</table>
</body>
</report>
File diff suppressed because it is too large Load Diff
@@ -216,6 +216,29 @@ under the License.
<request-map uri="ExampleGeoLocationPointSet3"><security https="true" auth="true"/><response name="success" type="view" value="ExampleGeoLocationPointSet3"/></request-map>
<request-map uri="ExampleGeoLocationPointSet4"><security https="true" auth="true"/><response name="success" type="view" value="ExampleGeoLocationPointSet4"/></request-map>
<!-- Birt example Requests -->
<request-map uri="BirtMain">
<security https="true" auth="true"/>
<response name="success" type="view" value="BirtMain"/>
</request-map>
<request-map uri="Report">
<security https="true" auth="true"/>
<response name="success" type="view" value="Report"/>
</request-map>
<request-map uri="Mail">
<security https="true" auth="true"/>
<response name="success" type="view" value="Mail"/>
</request-map>
<request-map uri="sendBirtMail">
<security https="true" auth="true"/>
<event type="service" invoke="sendBirtMail"/>
<response name="success" type="view" value="Mail"/>
<response name="error" type="view" value="Mail"/>
</request-map>
<request-map uri="ViewHandler">
<security https="true" auth="true"/>
<response name="success" type="view" value="ViewHandler"/>
</request-map>
<!-- end of request mappings -->
<!-- View Mappings -->
@@ -248,5 +271,21 @@ under the License.
<view-map name="ExampleGeoLocationPointSet2" type="screen" page="component://example/widget/example/ExampleScreens.xml#ExampleGeoLocationPointSet2"/>
<view-map name="ExampleGeoLocationPointSet3" type="screen" page="component://example/widget/example/ExampleScreens.xml#ExampleGeoLocationPointSet3"/>
<view-map name="ExampleGeoLocationPointSet4" type="screen" page="component://example/widget/example/ExampleScreens.xml#ExampleGeoLocationPointSet4"/>
<!-- end of view mappings -->
<!-- Birt example View Mappings -->
<view-map name="BirtMain" type="screen" page="component://example/widget/example/BirtScreens.xml#main"/>
<view-map name="Viewer" type="screen" page="component://example/widget/example/BirtScreens.xml#Viewer"/>
<view-map name="Report" type="screen" page="component://example/widget/example/BirtScreens.xml#Report"/>
<view-map name="Mail" type="screen" page="component://example/widget/example/BirtScreens.xml#EditMail"/>
<view-map name="ViewHandler" type="birt" page="component://example/webapp/birt/report/product.rptdesign" content-type="application/pdf"/>
<!-- Supported Content Types -->
<!--
text/html
application/pdf
application/vnd.ms-excel
application/vnd.ms-word
application/vnd.ms-powerpoint
-->
<!-- end of view mappings -->
</site-conf>
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
-->
<forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd">
<form name="EditMail" type="single" target="sendBirtMail">
<field name="sendFrom"><text/></field>
<field name="sendTo"><text/></field>
<field name="subject"><text/></field>
<field name="birtReportLocation" tooltip="Example is component://example/webapp/birt/report/product.rptdesign"><text/></field>
<field name="birtContentType">
<drop-down>
<option key="text/html" description="text/html"/>
<option key="application/pdf" description="application/pdf"/>
<option key="application/vnd.ms-excel" description="application/vnd.ms-excel"/>
<option key="application/vnd.ms-word" description="application/vnd.ms-word"/>
<option key="application/vnd.ms-powerpoint" description="application/vnd.ms-powerpoint"/>
</drop-down>
</field>
<field name="attachmentName"><text/></field>
<field name="sendButton" widget-style="smallSubmit"><submit button-type="button"/></field>
</form>
</forms>
@@ -0,0 +1,71 @@
<?xml version="1.0" encoding="UTF-8"?>
<screens xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-screen.xsd">
<screen name="main">
<section>
<actions>
</actions>
<widgets>
<decorator-screen name="CommonBirtDecorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<section>
<widgets>
<label style="h3" text="BIRT is an open source Eclipse-based reporting system that integrates with any OFBiz application to produce compelling reports including graphical presentations like pie and bar charts."/>
<label style="h3" text="This application provides you with a sample product report."/>
<label style="h3" text="See the help option how to create your own OFBiz intergrated reports."/>
<link style="h3" text="or see the Birt home for more information" target="http://eclipse.org/birt/phoenix/intro/" url-mode="plain" target-window="_blank_"/>
</widgets>
</section>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
<screen name="Report">
<section>
<actions>
<set field="tabButtonItem" value="Report"/>
</actions>
<widgets>
<decorator-screen name="CommonBirtDecorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<section>
<widgets>
<screenlet title="Using report tag">
<platform-specific>
<html>
<html-template location="component://example/webapp/birt/report.ftl"/>
</html>
</platform-specific>
</screenlet>
</widgets>
</section>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
<screen name="EditMail">
<section>
<actions>
<set field="tabButtonItem" value="Mail"/>
</actions>
<widgets>
<decorator-screen name="CommonBirtDecorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="body">
<section>
<widgets>
<screenlet title="Send BIRT report by mail">
<include-form location="component://example/widget/example/BirtForms.xml" name="EditMail"/>
</screenlet>
</widgets>
</section>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
</screens>
@@ -202,6 +202,43 @@ under the License.
</section>
</screen>
<screen name="CommonBirtDecorator">
<section>
<actions>
<set field="headerItem" value="Birt"/>
</actions>
<widgets>
<decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
<decorator-section name="pre-body">
<section>
<!-- do check for WEBTOOLS, _VIEW permission -->
<condition>
<if-has-permission permission="ENTITY_MAINT"/>
</condition>
<widgets>
<include-menu name="BirtTabBar" location="component://example/widget/example/ExampleMenus.xml"/>
</widgets>
</section>
</decorator-section>
<decorator-section name="body">
<section>
<!-- do check for WEBTOOLS, _VIEW permission -->
<condition>
<if-has-permission permission="ENTITY_MAINT"/>
</condition>
<widgets>
<decorator-section-include name="body"/>
</widgets>
<fail-widgets>
<label style="h3">${uiLabelMap.WebtoolsPermissionError}</label>
</fail-widgets>
</section>
</decorator-section>
</decorator-screen>
</widgets>
</section>
</screen>
<screen name="main">
<!-- This is the screen for the Main page in the Example component. A common pattern
in OFBiz is to have each component include a Main page as a starting point for
@@ -36,6 +36,10 @@ under the License.
<link target="ExampleGeoLocationPointSet1">
</link>
</menu-item>
<menu-item name="Birt" title="${uiLabelMap.Birt}">
<link target="BirtMain">
</link>
</menu-item>
</menu>
<menu name="EditExample" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
@@ -87,4 +91,11 @@ under the License.
</link>
</menu-item>
</menu>
<menu name="BirtTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
<menu-item name="Report" title="${uiLabelMap.ExampleBirtReport}"><link target="Report"/></menu-item>
<menu-item name="Export" title="${uiLabelMap.ExampleBirtViewHandler}"><link target="ViewHandler"/></menu-item>
<menu-item name="Mail" title="${uiLabelMap.ExampleBirtMail}"><link target="Mail"/></menu-item>
</menu>
</menus>