Author: erwan
Date: Tue May 18 07:14:50 2010 New Revision: 945523 URL: http://svn.apache.org/viewvc?rev=945523&view=rev Log: As suggested by Bruno in this thread, refactoring in charts http://ofbiz.135035.n4.nabble.com/Charting-in-OFBiz-td2219378.html#a2219378 Modified: ofbiz/trunk/framework/example/webapp/example/WEB-INF/controller.xml ofbiz/trunk/framework/example/widget/example/CommonScreens.xml ofbiz/trunk/framework/example/widget/example/ExampleForms.xml ofbiz/trunk/framework/example/widget/example/ExampleMenus.xml ofbiz/trunk/framework/example/widget/example/ExampleScreens.xml Modified: ofbiz/trunk/framework/example/webapp/example/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/webapp/example/WEB-INF/controller.xml?rev=945523&r1=945522&r2=945523&view=diff ============================================================================== --- ofbiz/trunk/framework/example/webapp/example/WEB-INF/controller.xml (original) +++ ofbiz/trunk/framework/example/webapp/example/WEB-INF/controller.xml Tue May 18 07:14:50 2010 @@ -238,13 +238,13 @@ under the License. <security https="true" auth="true"/> <response name="success" type="view" value="ViewHandler"/> </request-map> - <request-map uri="BarChart"> + <request-map uri="ExampleBarChart"> <security https="true" auth="true"/> - <response name="success" type="view" value="BarChart"/> + <response name="success" type="view" value="ExampleBarChart"/> </request-map> - <request-map uri="PieChart"> + <request-map uri="ExamplePieChart"> <security https="true" auth="true"/> - <response name="success" type="view" value="PieChart"/> + <response name="success" type="view" value="ExamplePieChart"/> </request-map> <!-- end of request mappings --> @@ -287,8 +287,8 @@ under the License. <view-map name="ViewHandler" type="birt" page="component://example/webapp/birt/report/product.rptdesign" content-type="application/pdf"/> <!-- Flotr view mapping --> - <view-map name="BarChart" page="component://example/widget/example/ExampleScreens.xml#BarChart" type="screen"/> - <view-map name="PieChart" page="component://example/widget/example/ExampleScreens.xml#PieChart" type="screen"/> + <view-map name="ExampleBarChart" page="component://example/widget/example/ExampleScreens.xml#ExampleBarChart" type="screen"/> + <view-map name="ExamplePieChart" page="component://example/widget/example/ExampleScreens.xml#ExamplePieChart" type="screen"/> <!-- Supported Content Types --> <!-- Modified: ofbiz/trunk/framework/example/widget/example/CommonScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/widget/example/CommonScreens.xml?rev=945523&r1=945522&r2=945523&view=diff ============================================================================== --- ofbiz/trunk/framework/example/widget/example/CommonScreens.xml (original) +++ ofbiz/trunk/framework/example/widget/example/CommonScreens.xml Tue May 18 07:14:50 2010 @@ -252,7 +252,31 @@ under the License. </widgets> </section> </screen> - + + <screen name="CommonExampleChartsDecorator"> + <section> + <actions> + <set field="headerItem" value="ExampleCharts"/> + <entity-condition entity-name="ExampleCountByType" list="chartData"> + <order-by field-name="exampleTypeId"/> + </entity-condition> + <set field="labelFieldName" value="exampleTypeId"/> + <set field="dataFieldName" value="total"/> + </actions> + <widgets> + <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> + <decorator-section name="pre-body"> + <include-menu name="ExampleCharts" location="component://example/widget/example/ExampleMenus.xml"/> + </decorator-section> + <decorator-section name="body"> + <container style="clear" /> + <include-screen name="FlotrChart" location="component://common/widget/flotrScreens.xml"/> + </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 Modified: ofbiz/trunk/framework/example/widget/example/ExampleForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/widget/example/ExampleForms.xml?rev=945523&r1=945522&r2=945523&view=diff ============================================================================== --- ofbiz/trunk/framework/example/widget/example/ExampleForms.xml (original) +++ ofbiz/trunk/framework/example/widget/example/ExampleForms.xml Tue May 18 07:14:50 2010 @@ -270,8 +270,4 @@ under the License. </field> <field name="submitButton" title="${uiLabelMap.CommonAdd}"><submit button-type="button"/></field> </form> - <form name="ChartDataList" type="list" list-name="chartData"> - <field name="exampleTypeId"><display/></field> - <field name="total"><display/></field> - </form> </forms> Modified: ofbiz/trunk/framework/example/widget/example/ExampleMenus.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/widget/example/ExampleMenus.xml?rev=945523&r1=945522&r2=945523&view=diff ============================================================================== --- ofbiz/trunk/framework/example/widget/example/ExampleMenus.xml (original) +++ ofbiz/trunk/framework/example/widget/example/ExampleMenus.xml Tue May 18 07:14:50 2010 @@ -34,8 +34,7 @@ under the License. </menu-item> <menu-item name="ExampleGeoLocation" title="${uiLabelMap.CommonGeoLocation}"><link target="ExampleGeoLocationPointSet1"/></menu-item> <menu-item name="Birt" title="${uiLabelMap.Birt}"><link target="BirtMain"/></menu-item> - <menu-item name="Barchart" title="Flotr : Bar Chart"><link target="BarChart"/></menu-item> - <menu-item name="Piechart" title="Flotr : Pie Chart"><link target="PieChart"/></menu-item> + <menu-item name="ExampleCharts" title="Chart examples"><link target="ExampleBarChart"/></menu-item> </menu> <menu name="EditExample" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml"> @@ -83,4 +82,8 @@ under the License. <menu-item name="Mail" title="${uiLabelMap.ExampleBirtMail}"><link target="Mail"/></menu-item> </menu> + <menu name="ExampleCharts" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml"> + <menu-item name="ExampleBarChart" title="Bar chart"><link target="ExampleBarChart"/></menu-item> + <menu-item name="ExamplePieChart" title="Pie chart"><link target="ExamplePieChart"/></menu-item> + </menu> </menus> Modified: ofbiz/trunk/framework/example/widget/example/ExampleScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/example/widget/example/ExampleScreens.xml?rev=945523&r1=945522&r2=945523&view=diff ============================================================================== --- ofbiz/trunk/framework/example/widget/example/ExampleScreens.xml (original) +++ ofbiz/trunk/framework/example/widget/example/ExampleScreens.xml Tue May 18 07:14:50 2010 @@ -312,62 +312,27 @@ under the License. </section> </screen> - <screen name="ChartDataList"> - <section> - <widgets> - <include-form name="ChartDataList" location="component://example/widget/example/ExampleForms.xml" /> - </widgets> - </section> - </screen> - <screen name="PieChart"> + <screen name="ExamplePieChart"> <section> <actions> - <set field="headerItem" value="Piecharts"/> - <entity-condition entity-name="ExampleCountByType" list="chartData"> - <order-by field-name="exampleTypeId"/> - </entity-condition> + <set field="tabButtonItem" value="ExamplePieChart"/> <set field="chartType" value="Pie"/> - <set field="labelFieldName" value="exampleTypeId"/> - <set field="dataFieldName" value="total"/> <set field="chartId" value="pieChartDiv"/> </actions> <widgets> - <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> - <decorator-section name="body"> - <screenlet title="Chart Data"> - <include-screen name="ChartDataList"/> - </screenlet> - <screenlet title="Flotr Pie Chart representing above data"> - <include-screen name="FlotrChart" location="component://common/widget/flotrScreens.xml"/> - </screenlet> - </decorator-section> - </decorator-screen> + <include-screen name="CommonExampleChartsDecorator" location="${parameters.mainDecoratorLocation}"/> </widgets> </section> </screen> - <screen name="BarChart"> + <screen name="ExampleBarChart"> <section> <actions> - <set field="headerItem" value="Barcharts"/> - <entity-condition entity-name="ExampleCountByType" list="chartData"> - <order-by field-name="exampleTypeId"/> - </entity-condition> + <set field="tabButtonItem" value="ExampleBarChart"/> <set field="chartType" value="Bars"/> - <set field="labelFieldName" value="exampleTypeId"/> - <set field="dataFieldName" value="total"/> <set field="chartId" value="barChartDiv"/> </actions> <widgets> - <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> - <decorator-section name="body"> - <screenlet title="Chart Data"> - <include-screen name="ChartDataList"/> - </screenlet> - <screenlet title="Flotr Bar Chart representing above data"> - <include-screen name="FlotrChart" location="component://common/widget/flotrScreens.xml"/> - </screenlet> - </decorator-section> - </decorator-screen> + <include-screen name="CommonExampleChartsDecorator" location="${parameters.mainDecoratorLocation}"/> </widgets> </section> </screen> |
Free forum by Nabble | Edit this page |