svn commit: r1780683 [3/3] - in /ofbiz/trunk/plugins/birt: ./ config/ data/ groovyScripts/report/ minilang/ servicedef/ src/main/java/org/apache/ofbiz/birt/ src/main/java/org/apache/ofbiz/birt/flexible/ src/main/java/org/apache/ofbiz/birt/report/servle...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r1780683 [3/3] - in /ofbiz/trunk/plugins/birt: ./ config/ data/ groovyScripts/report/ minilang/ servicedef/ src/main/java/org/apache/ofbiz/birt/ src/main/java/org/apache/ofbiz/birt/flexible/ src/main/java/org/apache/ofbiz/birt/report/servle...

nmalin
Modified: ofbiz/trunk/plugins/birt/webapp/birt/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/plugins/birt/webapp/birt/WEB-INF/controller.xml?rev=1780683&r1=1780682&r2=1780683&view=diff
==============================================================================
--- ofbiz/trunk/plugins/birt/webapp/birt/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/plugins/birt/webapp/birt/WEB-INF/controller.xml Sat Jan 28 13:22:55 2017
@@ -28,6 +28,7 @@ under the License.
     <description>BIRT Component Site Configuration File</description>
 
     <handler name="birt" type="view" class="org.apache.ofbiz.birt.webapp.view.BirtViewHandler"/>
+    <handler name="simplecontent" type="view" class="org.apache.ofbiz.content.view.SimpleContentViewHandler"/>
 
     <!-- Events to run on every request before security (chains exempt) -->
     <!--
@@ -80,6 +81,59 @@ under the License.
         <response name="success" type="view" value="chartViewHandler"/>
     </request-map>
 
+    <!--Flexible Report Request-->
+    <request-map uri="UseFlexibleReport"><security https="true" auth="true" /><response name="success" type="view" value="UseFlexibleReport"/></request-map>
+    <request-map uri="ListFlexibleReport"><security https="true" auth="true" /><response name="success" type="view" value="ListFlexibleReport" /></request-map>
+    <request-map uri="SelectMasterFlexibleReport"><security https="true" auth="true" /><response name="success" type="view" value="CreateFlexibleReport" /></request-map>
+    <request-map uri="EditFlexibleReport"><security https="true" auth="true" /><response name="success" type="view" value="EditFlexibleReport" /></request-map>
+    <request-map uri="PreviewReportSearchForm"><security https="true" auth="true" /><response name="success" type="view" value="PreviewReportSearchForm" /></request-map>
+    <request-map uri="DisplayFlexibleReportSearchForm"><security https="true" auth="true" /><response name="success" type="view" value="DisplayFlexibleReportSearchForm" /></request-map>
+    <request-map uri="ViewBinaryDataResource"><security auth="true" https="true" /><response name="success" type="view" value="ViewBinaryDataResource" /></request-map>
+
+    <request-map uri="ExecuteFlexibleReport">
+        <security https="true" auth="true" />
+        <event type="groovy" path="component://birt/groovyScripts/report/PrepareBirtCall.groovy" />
+        <response name="success" type="view" value="ExecuteFlexibleReport" />
+        <response name="error" type="request" value="viewLast" />
+    </request-map>
+    <request-map uri="CreateFlexibleReport">
+        <security https="true" auth="true" />
+        <event type="service" invoke="createFlexibleReportFromMaster" />
+        <response name="error" type="view" value="CreateFlexibleReport" />
+        <response name="success" type="view" value="EditFlexibleReport" />
+    </request-map>
+    <request-map uri="EditFlexibleReportSearchForm">
+        <security https="true" auth="true" />
+        <event type="service" invoke="updateFlexibleReportSearchForm" />
+        <response name="error" type="view" value="DisplayFlexibleReportSearchForm" />
+        <response name="success" type="view" value="DisplayFlexibleReportSearchForm" />
+    </request-map>
+
+    <request-map uri="DeleteAllFlexibleReports">
+        <security https="true" auth="true" />
+        <event type="service" invoke="deleteAllFlexibleReports" />
+        <response name="success" type="view" value="main" />
+        <response name="error" type="view" value="main" />
+    </request-map>
+    <request-map uri="DeleteFlexibleReport">
+        <security https="true" auth="true" />
+        <event type="service" invoke="deleteFlexibleReport" />
+        <response name="success" type="view" value="ListFlexibleReport" />
+        <response name="error" type="view" value="ListFlexibleReport" />
+    </request-map>
+
+    <request-map uri="UpdateFlexibleReport">
+        <security https="true" auth="true" />
+        <event type="service" invoke="updateContent" />
+        <response name="success" type="view" value="ListFlexibleReport" />
+        <response name="error" type="view" value="ListFlexibleReport" />
+    </request-map>
+    <request-map uri="UploadRptDesign">
+        <security https="true" auth="true" />
+        <event type="service" invoke="uploadFlexibleReportRptDesign" />
+        <response name="success" type="view" value="EditFlexibleReport" />
+        <response name="error" type="view" value="EditFlexibleReport" />
+    </request-map>
     <!-- end of request mappings -->
 
     <!-- View Mappings -->
@@ -105,5 +159,14 @@ under the License.
      -->
     <view-map name="ViewHandler" type="birt" page="component://birt/webapp/birt/report/example.rptdesign" content-type="application/pdf"/>
     <view-map name="chartViewHandler" type="birt" page="component://birt/webapp/birt/report/chart.rptdesign" content-type="application/pdf"/>
+    <view-map name="UseFlexibleReport" type="screen" page="component://birt/widget/birt/BirtScreens.xml#UseFlexibleReport"/>
+    <view-map name="EditFlexibleReportSearchForm" type="screen" page="component://birt/widget/birt/BirtScreens.xml#EditFlexibleReportSearchForm"/>
+    <view-map name="CreateFlexibleReport" type="screen" page="component://birt/widget/birt/BirtScreens.xml#CreateFlexibleReport"/>
+    <view-map name="DisplayFlexibleReportSearchForm" type="screen" page="component://birt/widget/birt/BirtScreens.xml#DisplayFlexibleReportSearchForm"/>
+    <view-map name="ListFlexibleReport" type="screen" page="component://birt/widget/birt/BirtScreens.xml#ListFlexibleReport"/>
+    <view-map name="EditFlexibleReport" type="screen" page="component://birt/widget/birt/BirtScreens.xml#EditFlexibleReport"/>
+    <view-map name="PreviewReportSearchForm" type="screen" page="component://birt/widget/birt/BirtScreens.xml#PreviewReportSearchForm"/>
+    <view-map name="ExecuteFlexibleReport" type="birt" />
+    <view-map name="ViewBinaryDataResource" page="" type="simplecontent"/>
     <!-- end of view mappings -->
 </site-conf>

Modified: ofbiz/trunk/plugins/birt/widget/birt/BirtForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/plugins/birt/widget/birt/BirtForms.xml?rev=1780683&r1=1780682&r2=1780683&view=diff
==============================================================================
--- ofbiz/trunk/plugins/birt/widget/birt/BirtForms.xml (original)
+++ ofbiz/trunk/plugins/birt/widget/birt/BirtForms.xml Sat Jan 28 13:22:55 2017
@@ -25,21 +25,121 @@ under the License.
         <field name="sendFrom"><text/></field>
         <field name="sendTo"><text/></field>
         <field name="subject"><text/></field>
-        <field name="birtReportLocation" tooltip="Example is component://birt/webapp/birt/report/example.rptdesign" required-field="true"><text/></field>
         <field name="birtContentType">
             <drop-down>
-                <option key="text/html" description="text/html"/>
-                <option key="application/pdf" description="application/pdf"/>
-                <option key="application/postscript" description="application/postscript"/>
-                <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"/>
-                <option key="application/vnd.oasis.opendocument.text" description="application/vnd.oasis.opendocument.text"/>
-                <option key="application/vnd.oasis.opendocument.spreadsheet" description="application/vnd.oasis.opendocument.spreadsheet"/>
-                <option key="application/vnd.oasis.opendocument.presentation" description="application/vnd.oasis.opendocument.presentation"/>
+                <entity-options entity-name="Enumeration" description="${enumCode}" key-field-name="description">
+                    <entity-constraint name="enumTypeId" value="FLEXIBLE_BIRT"/>
+                    <entity-order-by field-name="sequenceId"/>
+                </entity-options>
             </drop-down>
         </field>
         <field name="attachmentName" required-field="true"><text/></field>
-        <field name="sendButton" widget-style="smallSubmit"><submit button-type="button"/></field>
+        <field name="birtReportLocation" tooltip="Example is component://birt/webapp/birt/report/example.rptdesign" required-field="true"><text/></field>
+        <field name="sendButton"><submit/></field>
+    </form>
+
+    <!-- Flexible Report Form -->
+    <form name="CreateFlexibleReport" type="single" target="CreateFlexibleReport">
+        <field name="contentId" title="${uiLabelMap.BirtSelectMasterFlexibleReport}" >
+            <drop-down>
+                <entity-options description="${description}" entity-name="Content" key-field-name="contentId">
+                    <entity-constraint name="contentTypeId" value="REPORT_MASTER" />
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="reportName" required-field="true"><text/></field>
+        <field name="description" required-field="true"><text /></field>
+        <field name="writeFilters"><check/></field>
+        <field name="sendButton"><submit/></field>
+    </form>
+    <form name="ListPublishFlexibleReport" type="single" target="DisplayFlexibleReportSearchForm">
+        <field name="contentId" title="${uiLabelMap.BirtSelectFlexibleReport}" >
+            <drop-down>
+                <entity-options description="[${contentName}] ${description}" entity-name="ContentAssocViewTo" key-field-name="contentId">
+                    <entity-constraint name="contentTypeId" value="FLEXIBLE_REPORT" />
+                    <entity-constraint name="statusId" value="CTNT_PUBLISHED"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="sendButton"><submit /></field>
+    </form>
+
+    <form name="EditFlexibleReport" type="single" target="UpdateFlexibleReport" default-map-name="content">
+        <field name="contentId"><hidden/></field>
+        <field name="contentName" title="${uiLabelMap.FormFieldTitle_reportName}"><display/></field>
+        <field name="description"><text/></field>
+        <field name="statusId">
+            <drop-down>
+                <entity-options description="${description}" entity-name="StatusItem">
+                    <entity-constraint name="statusId" operator="in" value="CTNT_PUBLISHED,CTNT_IN_PROGRESS"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="submit" title="${uiLabelMap.CommonSubmit}"><submit/></field>
+    </form>
+    <form name="UploadRptDesign" type="upload" target="UploadRptDesign">
+        <actions>
+            <entity-and entity-name="ContentAssoc" use-cache="true" list="contentAssocs">
+                <field-map field-name="contentId" from-field="content.contentId"/>
+            </entity-and>
+            <set field="contentAssoc" from-field="contentAssocs[0]" type="Object"/>
+            <entity-one entity-name="Content" value-field="contentRpt">
+                <field-map from-field="contentAssoc.contentIdTo" field-name="contentId"/>
+            </entity-one>
+        </actions>
+        <field name="contentId"><hidden value="${content.contentId}"/></field>
+        <field name="dataResourceIdRpt"><hidden value="${contentRpt.dataResourceId}"/></field>
+        <field name="downloadRptDesignLink" title=" " widget-style="buttontext">
+            <hyperlink also-hidden="false" description="${uiLabelMap.BirtDownloadRptDesign}" target="ViewBinaryDataResource" target-window="_blank">
+                <parameter param-name="dataResourceId" from-field="contentRpt.dataResourceId"/>
+            </hyperlink>
+        </field>
+        <field name="uploadRptDesign" title=" "><file/></field>
+        <field name="upload" title="${uiLabelMap.CommonUpload}" position="2"><submit/></field>
+    </form>
+
+    <form name="EditFlexibleReportSearchForm" type="single" target="EditFlexibleReportSearchForm">
+        <actions>
+            <set field="statusId" from-field="content.statusId"/>
+            <set field="reportContentId" from-field="content.contentId"/>
+            <entity-and entity-name="ContentAssoc" list="masterContent">
+                <field-map field-name="contentIdTo" from-field="contentId"/>
+                <field-map field-name="contentAssocTypeId" value="SUB_CONTENT"/>
+            </entity-and>
+            <service service-name="prepareFlexibleReportSearchFormToEdit" auto-field-map="true" result-map="displayFormMap"/>
+        </actions>
+        <field name="overrideFilters" title=" "><textarea cols="90" rows="20" default-value="${displayFormMap.textForm}"/></field>
+        <field name="reportContentId"><hidden/></field>
+        <field name="previewButton" title="${uiLabelMap.CommonSave}"><submit/></field>
+        <on-event-update-area event-type="submit" area-id="preview-column" area-target="PreviewReportSearchForm">
+            <parameter param-name="contentId" value="${contentId}"/>
+        </on-event-update-area>
     </form>
+
+    <form name="ListFlexibleReport" type="list" target="" odd-row-style="alternate-row" list-name="contentTypeReport" header-row-style="header-row-2" default-table-style="basic-table hover-bar">
+        <row-actions>
+            <entity-one entity-name="Content" value-field="content" />
+            <set field="contentId" from-field="content.contentId"/>
+            <entity-and entity-name="ContentAssoc" use-cache="true" list="contentAssocs">
+                <field-map field-name="contentId"/>
+            </entity-and>
+            <set field="contentAssoc" from-field="contentAssocs[0]" type="Object"/>
+            <entity-one entity-name="Content" value-field="contentRpt">
+                <field-map from-field="contentAssoc.contentIdTo" field-name="contentId"/>
+            </entity-one>
+            <entity-and entity-name="ContentAssoc" use-cache="true" list="masterContentAssocs">
+                <field-map field-name="contentIdTo" from-field="contentId"/>
+            </entity-and>
+            <set field="masterContentAssoc" from-field="masterContentAssocs[0]" type="Object"/>
+            <entity-one entity-name="Content" value-field="masterContent">
+                <field-map from-field="masterContentAssoc.contentId" field-name="contentId"/>
+            </entity-one>
+        </row-actions>
+        <field name="contentName" sort-field="true"><display/></field>
+        <field name="masterContentName" sort-field="true" map-name="masterContent" entry-name="contentName"><display /></field>
+        <field name="statusId" sort-field="true"><display-entity entity-name="StatusItem" /></field>
+        <field name="description" sort-field="true"><display/></field>
+        <field name="manageLink"><include-menu name="ListFlexibleBirtAction" location="component://birt/widget/birt/BirtMenus.xml"/></field>
+  </form>
+
 </forms>

Added: ofbiz/trunk/plugins/birt/widget/birt/BirtMasterForms.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/plugins/birt/widget/birt/BirtMasterForms.xml?rev=1780683&view=auto
==============================================================================
--- ofbiz/trunk/plugins/birt/widget/birt/BirtMasterForms.xml (added)
+++ ofbiz/trunk/plugins/birt/widget/birt/BirtMasterForms.xml Sat Jan 28 13:22:55 2017
@@ -0,0 +1,70 @@
+<?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"
+       xmlns="http://ofbiz.apache.org/Widget-Form"
+       xsi:schemaLocation="http://ofbiz.apache.org/Widget-Form http://ofbiz.apache.org/dtds/widget-form.xsd">
+
+    <!--This form present std field for the flexible birt engine, you need to heritate it for each domain
+        with an auto attribute or something like that to use cache system
+    -->
+    <form name="AbstractFlexibleReportSearchForm" type="single" target="ExecuteFlexibleReport">
+        <actions>
+            <entity-one entity-name="Content" value-field="content"/>
+            <entity-condition entity-name="ContentAttribute" list="contentAttrs">
+                <condition-list>
+                    <condition-expr field-name="contentId" from-field="content.contentId"/>
+                    <condition-list combine="or">
+                        <condition-expr field-name="attrName" value="Service"/>
+                        <condition-expr field-name="attrName" value="Entity"/>
+                    </condition-list>
+                </condition-list>
+            </entity-condition>
+            <set field="rptDesignFile" value="${groovy: org.apache.ofbiz.birt.flexible.BirtUtil.resolveRptDesignFilePathFromContent(delegator, content.contentId)}"/>
+        </actions>
+        <field name="birtContentType">
+            <drop-down>
+                <entity-options entity-name="Enumeration" description="${enumCode}" key-field-name="description">
+                    <entity-constraint name="enumTypeId" value="FLEXIBLE_BIRT"/>
+                    <entity-order-by field-name="sequenceId"/>
+                </entity-options>
+            </drop-down>
+        </field>
+        <field name="rptDesignFile"><hidden/></field>
+        <field name="birtOutputFileName"><hidden value="${content.contentName}"/></field>
+        <field name="modelElementName"><hidden value="${contentAttrs[0].attrValue}"/></field>
+        <field name="sendButton"><submit/></field>
+        <sort-order>
+            <last-field name="birtContentType"/>
+            <last-field name="sendButton"/>
+        </sort-order>
+    </form>
+
+    <form name="CTNT_MASTER_EXAMPLE" type="single" extends="AbstractFlexibleReportSearchForm">
+        <auto-fields-entity entity-name="Example" default-field-type="find"/>
+    </form>
+    <form name="CTNT_MASTER_TURNOVER" type="single" extends="AbstractFlexibleReportSearchForm">
+        <field name="fromDate"><date-time type="date"/></field>
+        <field name="thruDate"><date-time type="date"/></field>
+        <field name="productCategoryId"><lookup target-form-name="LookupProductCategory"/></field>
+        <field name="productStoreId"><lookup target-form-name="LookupProductStore"/></field>
+    </form>
+
+</forms>
\ No newline at end of file

Modified: ofbiz/trunk/plugins/birt/widget/birt/BirtMenus.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/plugins/birt/widget/birt/BirtMenus.xml?rev=1780683&r1=1780682&r2=1780683&view=diff
==============================================================================
--- ofbiz/trunk/plugins/birt/widget/birt/BirtMenus.xml (original)
+++ ofbiz/trunk/plugins/birt/widget/birt/BirtMenus.xml Sat Jan 28 13:22:55 2017
@@ -22,6 +22,9 @@ under the License.
        xmlns="http://ofbiz.apache.org/Widget-Menu" xsi:schemaLocation="http://ofbiz.apache.org/Widget-Menu http://ofbiz.apache.org/dtds/widget-menu.xsd">
 
     <menu name="BirtAppBar" title="${uiLabelMap.BirtApplication}" extends="CommonAppBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
+        <menu-item name="FlexibleReport" title="${uiLabelMap.BirtFlexibleReport}">
+            <link target="ListFlexibleReport" />
+        </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>
@@ -31,4 +34,57 @@ under the License.
         <menu-item name="chartReport" title="${uiLabelMap.ExampleBirtChartReport}"><link target="chartReport"/></menu-item>
         <menu-item name="chartExport" title="${uiLabelMap.ExampleBirtChartViewHandler}"><link target="chartViewHandler" target-window="_BLANK"/></menu-item>
     </menu>
+    <menu name="FlexibleBirtTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
+        <menu-item name="ListFlexibleReport" title="${uiLabelMap.BirtManageReports}">
+            <condition>
+                <if-has-permission permission="BIRT_UPDATE"/>
+            </condition>
+            <link target="ListFlexibleReport"/>
+        </menu-item>
+        <menu-item name="UseFlexibleReport" title="${uiLabelMap.BirtGenericReport}"><link target="UseFlexibleReport"/></menu-item>
+        <!-- enable this onl for test
+        <menu-item name="deleteReports" title="${uiLabelMap.BirtDeleteFlexibeReports}">
+            <condition>
+                <if-has-permission permission="BIRT_DELETE"/>
+            </condition>
+            <link target="DeleteAllFlexibleReports" confirmation-message="${uiLabelMap.BirtConfirmDeleteFlexibleReports}" request-confirmation="true"/>
+        </menu-item>
+        -->
+    </menu>
+    <menu name="ListFlexibleBirtAction" extends="CommonInlineBarMenu" extends-resource="component://common/widget/CommonMenus.xml">
+        <menu-item name="publishLink" title="${uiLabelMap.CommonPublish}">
+            <condition>
+                <if-compare field="content.statusId" operator="not-equals" value="CTNT_PUBLISHED"/>
+            </condition>
+            <link target="UpdateFlexibleReport">
+                <parameter param-name="contentId" from-field="content.contentId"/>
+                <parameter param-name="statusId" value="CTNT_PUBLISHED"/>
+            </link>
+        </menu-item>
+        <menu-item name="updateLink" title="${uiLabelMap.CommonOpen}">
+            <condition>
+                <if-compare field="content.statusId" operator="not-equals" value="CTNT_IN_PROGRESS"/>
+            </condition>
+            <link target="UpdateFlexibleReport">
+                <parameter param-name="statusId" value="CTNT_IN_PROGRESS"/>
+                <parameter param-name="contentId" from-field="content.contentId"/>
+            </link>
+        </menu-item>
+        <menu-item name="editLink" title="${uiLabelMap.CommonEdit}">
+            <condition>
+                <if-compare field="content.statusId" operator="equals" value="CTNT_IN_PROGRESS"/>
+            </condition>
+            <link target="EditFlexibleReport">
+                <parameter param-name="contentId" from-field="content.contentId"/>
+            </link>
+        </menu-item>
+        <menu-item name="deleteLink" title="${uiLabelMap.CommonDelete}">
+            <condition>
+                <if-compare field="content.statusId" operator="equals" value="CTNT_IN_PROGRESS"/>
+            </condition>
+            <link target="DeleteFlexibleReport">
+                <parameter param-name="contentId" from-field="content.contentId"/>
+            </link>
+        </menu-item>
+    </menu>
 </menus>

Modified: ofbiz/trunk/plugins/birt/widget/birt/BirtScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/plugins/birt/widget/birt/BirtScreens.xml?rev=1780683&r1=1780682&r2=1780683&view=diff
==============================================================================
--- ofbiz/trunk/plugins/birt/widget/birt/BirtScreens.xml (original)
+++ ofbiz/trunk/plugins/birt/widget/birt/BirtScreens.xml Sat Jan 28 13:22:55 2017
@@ -53,6 +53,8 @@ under the License.
         <section>
             <actions>
                 <set field="headerItem" value="Birt"/>
+                <set field="subcomponentMenuName" from-field="subcomponentMenuName" default-value="BirtTabBar" />
+                <set field="subcomponentMenuLocation" from-field="subcomponentMenuLocation" default-value="component://birt/widget/birt/BirtMenus.xml" />
             </actions>
             <widgets>
                 <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}">
@@ -63,7 +65,7 @@ under the License.
                                 <if-has-permission permission="ENTITY_MAINT"/>
                             </condition>
                             <widgets>
-                                <include-menu name="BirtTabBar" location="component://birt/widget/birt/BirtMenus.xml"/>
+                                <include-menu name="${subcomponentMenuName}" location="${subcomponentMenuLocation}"/>
                             </widgets>
                         </section>
                     </decorator-section>
@@ -86,6 +88,17 @@ under the License.
             </widgets>
         </section>
     </screen>
+    <screen name="CommonBirtMinimalDecorator">
+        <section>
+            <actions>
+                <property-map resource="BirtUiLabels" map-name="uiLabelMap" global="true"/>
+                <property-map resource="CommonUiLabels" map-name="uiLabelMap" global="true"/>
+            </actions>
+            <widgets>
+                <decorator-section-include name="body"/>
+            </widgets>
+        </section>
+    </screen>
 
     <screen name="main">
         <section>
@@ -174,6 +187,231 @@ under the License.
                     </decorator-section>
                 </decorator-screen>
             </widgets>
+        </section>
+    </screen>
+
+    <!--=========================-->
+    <!--  Flexible Birt Screen   -->
+    <!--=========================-->
+    <screen name="CommonFlexibleBirtDecorator">
+        <section>
+            <actions>
+                <set field="subcomponentMenuLocation" value="component://birt/widget/birt/BirtMenus.xml"/>
+                <set field="subcomponentMenuName" value="FlexibleBirtTabBar"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonBirtDecorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <decorator-section-include name="body"/>
+                    </decorator-section>
+                </decorator-screen>
+
+            </widgets>
+        </section>
+    </screen>
+    <screen name="UseFlexibleReport">
+        <section>
+            <actions>
+               <set field="tabButtonItem" value="UseFlexibleReport" />
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonFlexibleBirtDecorator">
+                    <decorator-section name="body">
+                        <section>
+                            <condition>
+                                <if-has-permission permission="BIRT" action="_VIEW"/>
+                            </condition>
+                            <widgets>
+                                <include-screen name="SelectFlexibleReport"/>
+                            </widgets>
+                            <fail-widgets>
+                                <label style="h3">${uiLabelMap.BirtPermissionError}</label>
+                            </fail-widgets>
+                        </section>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+
+    <screen name="SelectFlexibleReport">
+        <section>
+            <condition>
+                <if-has-permission permission="BIRT" action="_VIEW"/>
+<!--                 <if-service-permission service-name="genericBirtPermission" main-action="VIEW"/> -->
+            </condition>
+            <actions>
+                <property-map resource="BirtUiLabels" map-name="uiLabelMap" global="true" />
+                <set field="contentEntityNameView" from-field="contentEntityNameView" default-value=""/>
+            </actions>
+            <widgets>
+                <screenlet title="${uiLabelMap.BirtSelectFlexibleReport}">
+                    <include-form location="component://birt/widget/birt/BirtForms.xml" name="ListPublishFlexibleReport" />
+                </screenlet>
+            </widgets>
+            <fail-widgets>
+                <label style="h3">${uiLabelMap.BirtPermissionError}</label>
+            </fail-widgets>
+        </section>
+    </screen>
+
+    <screen name="ListFlexibleReport">
+        <section>
+            <actions>
+                <set field="tabButtonItem" value="ListFlexibleReport" />
+                <set field="sortField" from-field="parameters.sortField" default-value="contentName"/>
+                <entity-and entity-name="Content" use-cache="true" list="contentTypeReport">
+                    <field-map field-name="contentTypeId" value="FLEXIBLE_REPORT"/>
+                    <order-by field-name="${sortField}"/>
+                </entity-and>
+                <service service-name="genericBirtPermission" result-map="permCreateResult">
+                    <field-map field-name="mainAction" value="CREATE"/>
+                </service>
+                <set field="hasCreatePermission" from-field="permCreateResult.hasPermission"/>
+    
+                <service service-name="genericBirtPermission" result-map="permDeleteResult">
+                    <field-map field-name="mainAction" value="DELETE"/>
+                </service>
+                <set field="hasDeletePermission" from-field="permDeleteResult.hasPermission"/>
+    
+                <service service-name="genericBirtPermission" result-map="permUpdateResult">
+                    <field-map field-name="mainAction" value="UPDATE"/>
+                </service>
+                <set field="hasUpdatePermission" from-field="permUpdateResult.hasPermission"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonFlexibleBirtDecorator">
+                    <decorator-section name="body">
+                        <section>
+                            <condition>
+                                <or>
+                                    <if-has-permission permission="BIRT" action="_DELETE"/>
+                                    <if-has-permission permission="BIRT" action="_CREATE"/>
+                                    <if-has-permission permission="BIRT" action="_UPDATE"/>
+                                </or>
+                            </condition>
+                            <widgets>
+                                <container style="button-bar">
+                                    <link target="SelectMasterFlexibleReport" text="${uiLabelMap.BirtFlexibleReportGeneration}" style="buttontext create"/>
+                                </container>
+                                <screenlet title="${uiLabelMap.BirtFlexibleReportManagement}">
+                                    <section>
+                                        <condition>
+                                            <not><if-empty field="contentTypeReport"/></not>
+                                        </condition>
+                                        <widgets>
+                                            <include-form location="component://birt/widget/birt/BirtForms.xml" name="ListFlexibleReport" />
+                                        </widgets>
+                                        <fail-widgets>
+                                            <label text="${uiLabelMap.BirtNoKnownFlexibleReport}"/>
+                                        </fail-widgets>
+                                    </section>
+                                </screenlet>
+                            </widgets>
+                            <fail-widgets>
+                                <label style="h3">${uiLabelMap.BirtPermissionError}</label>
+                            </fail-widgets>
+                        </section>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+
+    <screen name="CreateFlexibleReport">
+        <section>
+            <actions>
+                <set field="tabButtonItem" value="SelectMasterFlexibleReport" />
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonFlexibleBirtDecorator">
+                    <decorator-section name="body">
+                        <section>
+                            <condition>
+                                <if-has-permission permission="BIRT" action="_CREATE"/>
+                            </condition>
+                            <widgets>
+                                <screenlet title="${uiLabelMap.BirtSelectMasterFlexibleReport}">
+                                    <include-form location="component://birt/widget/birt/BirtForms.xml" name="CreateFlexibleReport" />
+                                </screenlet>
+                            </widgets>
+                            <fail-widgets>
+                                <label style="h3">${uiLabelMap.BirtPermissionError}</label>
+                            </fail-widgets>
+                        </section>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+    <screen name="EditFlexibleReport">
+        <section>
+            <actions>
+                <set field="tabButtonItem" value="manageReport" />
+                <set field="contentId" from-field="parameters.reportContentId" default-value="${parameters.contentId}"/>
+                <entity-one entity-name="Content" value-field="content"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonFlexibleBirtDecorator">
+                    <decorator-section name="body">
+                        <section>
+                            <condition>
+                                <or>
+                                    <if-has-permission permission="BIRT" action="_CREATE"/>
+                                    <if-has-permission permission="BIRT" action="_UPDATE"/>
+                                </or>
+                            </condition>
+                            <widgets>
+                                <container id="edit-column" style="lefthalf">
+                                    <screenlet title="${uiLabelMap.BirtEditFlexibleReport}">
+                                        <label style="h2">${uiLabelMap.BirtFlexibleReportInformation}</label>
+                                        <include-form name="EditFlexibleReport" location="component://birt/widget/birt/BirtForms.xml"/>
+                                        <label style="h2">${uiLabelMap.BirtUploadRptDesign}</label>
+                                        <include-form name="UploadRptDesign" location="component://birt/widget/birt/BirtForms.xml" />
+                                        <label style="h2">${uiLabelMap.overrideFilters}</label>
+                                        <include-form name="EditFlexibleReportSearchForm" location="component://birt/widget/birt/BirtForms.xml"/>
+                                    </screenlet>
+                                </container>
+                                <container id="preview-column" style="righthalf">
+                                    <include-screen name="PreviewReportSearchForm"/>
+                                </container>
+                            </widgets>
+                            <fail-widgets>
+                                <label style="h3">${uiLabelMap.BirtPermissionError}</label>
+                            </fail-widgets>
+                        </section>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+
+    <screen name="DisplayFlexibleReportSearchForm">
+        <section>
+            <widgets>
+                <decorator-screen name="CommonFlexibleBirtDecorator">
+                    <decorator-section name="body">
+                        <include-screen name="PreviewReportSearchForm"/>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
+        </section>
+    </screen>
+
+    <screen name="PreviewReportSearchForm">
+        <section>
+            <actions>
+                <entity-one entity-name="Content" value-field="content" use-cache="true"/>
+            </actions>
+            <widgets>
+                <decorator-screen name="CommonBirtMinimalDecorator" location="${parameters.mainDecoratorLocation}">
+                    <decorator-section name="body">
+                        <screenlet title="${uiLabelMap.CommonPreview}" id="content-form-preview">
+                            <content content-id="${content.contentId}"/>
+                        </screenlet>
+                    </decorator-section>
+                </decorator-screen>
+            </widgets>
         </section>
     </screen>
 </screens>