Files
ofbiz-plugins/birt/servicedef/services.xml
T
Nicolas Malin 492772b40a Implemented: Birt Report Builder: an enhancement of the Birt component. Easier user possibility of report creation. (OFBIZ-6919)
The concept, you define a report domain related to an entity or a service through a master content (master report) and a master search form.
When a high level user create a report on a configured domain, OFBiz prepare an instantiation of the master content (flexible report) that permit
to surcharge the search form (recorded dynamically on the content as ElectronicText) and prepare a rptDesign skeleton.
The high level user can download the rptDesign to edit it trhough the birt editor, with all fields that ofbiz will be load as dataset and when is finish upload the result on the content instantiation.
For the end user, he selected the instantiation report, OFBiz display the report search from the content instantiation and the submission call birt with the search parameters and the linked rptDesign.

The rptDesign file is drive by OFBiz to build the data set by two methods :
 * call the performFind if the domain is related to an entity
 * call the a custom service if the domain is related to a service.
For the last case we need two services, a first who prepare and list available fields for search and display. And a second who realize the search.
By convention currently the first service as the same name that the second service suffixed by 'PrepareFields'

This commit contains :
 * useful UI to create a new content instance from a master content. List, edit, remove a content instance and a simple drop-down to list all instance published (ready to use by end user)
 * all services (with the work flexibleReport) to manage a flexible report, prepare the rptDesign skeleton, reanalyze the rptDesign uploaded, prepare the search form
 * Services interface to define you own search custom method
 * Two examples, one on the entity Exemple and one with the service flexibleReportTurnOver. Warning ! there are raw example without a beautiful rptDesign so you need to update the rptDesign with the birt editor to display something.
Thanks: François Wurmser for initialize this improvement, Jacques and Gil for their time to analyze, document and refactor the code


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk/plugins@1780683 13f79535-47bb-0310-9956-ffa450edef68
2017-01-28 13:22:55 +00:00

167 lines
11 KiB
XML

<?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.
-->
<services xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/services.xsd">
<description>OFBiz BIRT Services</description>
<vendor>OFBiz</vendor>
<version>1.0</version>
<!--BIRT Email Services -->
<service name="sendBirtMail" engine="java" location="org.apache.ofbiz.birt.email.BirtEmailServices" invoke="sendBirtMail">
<description>BIRT Email Service</description>
<implements service="sendMailInterface"/>
<attribute name="bodyText" type="String" mode="IN" optional="true"/>
<attribute name="bodyScreenUri" type="String" mode="IN" optional="true"/>
<attribute name="birtReportLocation" type="String" mode="IN" optional="false"/>
<attribute name="attachmentName" type="String" mode="IN" optional="false"/>
<attribute name="bodyParameters" type="Map" mode="IN" optional="true"/>
<attribute name="birtParameters" type="Map" mode="IN" optional="true"/>
<attribute name="birtLocale" type="Locale" mode="IN" optional="true"/>
<attribute name="birtContentType" type="String" mode="IN" optional="true"/>
<attribute name="webSiteId" type="String" mode="IN" optional="true"/>
<attribute name="body" type="String" mode="OUT" optional="false"/>
</service>
<!-- SERVICES FOR REPORTS -->
<service name="genericBirtPermission" engine="simple" auth="true"
location="component://birt/minilang/BirtPermissionServices.xml" invoke="genericBirtPermission">
<description>Generic Birt Permission Service; Takes mainAction to determine the mode.</description>
<implements service="permissionInterface"/>
</service>
<!-- Interfaces -->
<service name="createFlexibleReportFromMasterInterface" engine="interface">
<attribute name="reportName" type="String" mode="IN" optional="false" />
<attribute name="description" type="String" mode="IN" optional="true" />
<attribute name="writeFilters" type="String" mode="IN" optional="true" />
<attribute name="masterContentId" type="String" mode="IN" optional="false" />
<attribute name="contentId" type="String" mode="OUT" optional="false" />
</service>
<service name="prepareFieldsForFlexibleReportInterface" engine="interface">
<attribute name="dataMap" type="Map" mode="OUT" optional="false" />
<attribute name="fieldDisplayLabels" type="Map" mode="OUT" optional="true"/>
<attribute name="filterMap" type="Map" mode="OUT" optional="true" />
<attribute name="filterDisplayLabels" type="Map" mode="OUT" optional="true"/>
</service>
<service name="searchRecordsForFlexibleReportInterface" engine="interface">
<attribute name="reportContext" type="Object" mode="IN" optional="false" />
<attribute name="records" type="List" mode="OUT" />
</service>
<service name="createFlexibleReport" engine="java" auth="true" location="org.apache.ofbiz.birt.flexible.BirtServices" invoke="createFlexibleReport">
<description>BIRT report generation</description>
<required-permissions join-type="AND"><check-permission permission="BIRT_CREATE"/></required-permissions>
<attribute name="dataMap" type="Map" mode="IN" optional="false" />
<attribute name="fieldDisplayLabels" type="Map" mode="IN" optional="true" />
<attribute name="filterMap" type="Map" mode="IN" optional="true" />
<attribute name="filterDisplayLabels" type="Map" mode="IN" optional="true" />
<attribute name="writeFilters" type="String" mode="IN" optional="true" />
<attribute name="serviceName" type="String" mode="IN" optional="false" />
<attribute name="rptDesignName" type="String" mode="IN" optional="false" />
</service>
<service name="createFlexibleReportFromMaster" auth="true" engine="java" location="org.apache.ofbiz.birt.flexible.BirtServices" invoke="createFlexibleReportFromMaster">
<description>Call report generator with appropriate workflow required by the given master report</description>
<required-permissions join-type="AND"><check-permission permission="BIRT_CREATE"/></required-permissions>
<attribute name="contentId" type="String" mode="IN" optional="false" />
<attribute name="reportName" type="String" mode="IN" optional="false" />
<attribute name="description" type="String" mode="IN" optional="false" />
<attribute name="writeFilters" type="String" mode="IN" optional="true" />
<attribute name="reportContentId" type="String" mode="OUT" optional="false"/>
<attribute name="textForm" type="String" mode="OUT" optional="false" allow-html="any"/>
</service>
<service name="createFlexibleReportFromMasterEntityWorkflow" engine="java" location="org.apache.ofbiz.birt.flexible.BirtServices" invoke="createFlexibleReportFromMasterEntityWorkflow">
<description>Create and save in db content, a new report design following entity workflow</description>
<required-permissions join-type="AND"><check-permission permission="BIRT_CREATE"/></required-permissions>
<implements service="createFlexibleReportFromMasterInterface"/>
<attribute name="entityViewName" type="String" mode="IN" optional="false" />
</service>
<service name="createFlexibleReportFromMasterServiceWorkflow" engine="java" location="org.apache.ofbiz.birt.flexible.BirtServices" invoke="createFlexibleReportFromMasterServiceWorkflow">
<description>Create and save in db content, a new report following service workflow</description>
<required-permissions join-type="AND"><check-permission permission="BIRT_CREATE"/></required-permissions>
<implements service="createFlexibleReportFromMasterInterface"/>
<attribute name="serviceName" type="String" mode="IN" optional="false" />
</service>
<service name="deleteAllFlexibleReports" auth="true" engine="java" location="org.apache.ofbiz.birt.flexible.BirtServices" invoke="deleteAllReports">
<description>Delete all reports (admin purposes)</description>
<required-permissions join-type="AND"><check-permission permission="BIRT_DELETE"/></required-permissions>
</service>
<service name="deleteFlexibleReport" auth="true" engine="java" location="org.apache.ofbiz.birt.flexible.BirtServices" invoke="deleteFlexibleReport">
<description>Delete a report</description>
<required-permissions join-type="AND"><check-permission permission="BIRT_DELETE"/></required-permissions>
<attribute name="contentId" type="String" mode="IN" optional="false" />
</service>
<service name="prepareFlexibleReportOptionFieldsFromEntity" engine="java" location="org.apache.ofbiz.birt.flexible.BirtServices" invoke="prepareFlexibleReportOptionFieldsFromEntity">
<description>Get fields corresponding to an entity or view, including _op _value and so on depending on type.</description>
<required-permissions join-type="AND"><check-permission permission="BIRT_CREATE"/></required-permissions>
<attribute name="entityViewName" type="String" mode="IN" optional="false" />
<attribute name="listMultiFields" type="List" mode="OUT" optional="false" />
</service>
<service name="prepareFlexibleReportFieldsFromEntity" engine="java" location="org.apache.ofbiz.birt.flexible.BirtServices" invoke="prepareFlexibleReportFieldsFromEntity">
<description>prepare maps fields for ReportDesignGenerator</description>
<required-permissions join-type="AND"><check-permission permission="BIRT_CREATE"/></required-permissions>
<implements service="prepareFieldsForFlexibleReportInterface"/>
<attribute name="modelEntity" mode="IN" type="Object"/>
</service>
<service name="uploadFlexibleReportRptDesign" auth="true" engine="java" location="org.apache.ofbiz.birt.flexible.BirtServices" invoke="uploadRptDesign">
<description>Upload design-modified rptdesign file</description>
<required-permissions join-type="AND"><check-permission permission="BIRT_UPDATE"/></required-permissions>
<attribute name="dataResourceIdRpt" type="String" mode="IN" optional="false" />
<attribute name="uploadRptDesign" type="java.nio.ByteBuffer" mode="IN" optional="false" />
</service>
<service name="updateFlexibleReportSearchForm" auth="true" engine="java" location="org.apache.ofbiz.birt.flexible.BirtServices" invoke="overrideReportForm">
<description>Override report form</description>
<required-permissions join-type="OR">
<check-permission permission="BIRT_CREATE"/>
<check-permission permission="BIRT_UPDATE"/>
</required-permissions>
<attribute name="reportContentId" type="String" mode="IN" optional="false" />
<attribute name="overrideFilters" type="String" mode="IN" optional="true" allow-html="any"/>
</service>
<service name="prepareFlexibleReportSearchFormToEdit" auth="true" engine="java" location="org.apache.ofbiz.birt.flexible.BirtServices" invoke="createFormForDisplay">
<description>Prepare from DB report form for display</description>
<required-permissions join-type="OR">
<check-permission permission="BIRT_CREATE"/>
<check-permission permission="BIRT_UPDATE"/>
</required-permissions>
<attribute name="reportContentId" type="String" mode="IN" optional="false" />
<attribute name="textForm" type="String" mode="OUT" optional="false" allow-html="any"/>
</service>
<!-- Service example for flexible report-->
<service name="callPerformFindFromBirt" engine="java" auth="true" location="org.apache.ofbiz.birt.flexible.BirtServices" invoke="callPerformFindFromBirt" transaction-timeout="7200">
<description>Manages performFind calling from Birt. Flexible Report from entity workflow. (Default search service)</description>
<required-permissions join-type="AND"><check-permission permission="BIRT_VIEW"/></required-permissions>
<implements service="searchRecordsForFlexibleReportInterface"/>
</service>
<service name="flexibleReportTurnOver" auth="true" engine="java" location="org.apache.ofbiz.birt.flexible.BirtMasterReportServices" invoke="turnOver">
<description>Service getting data for report. Turnover report</description>
<implements service="searchRecordsForFlexibleReportInterface"/>
</service>
<service name="flexibleReportTurnOverPrepareFields" auth="true" engine="java" location="org.apache.ofbiz.birt.flexible.BirtMasterReportServices" invoke="turnOverPrepareFields">
<description>Service configuring data for report (works in duo!). Turnover report.</description>
<implements service="prepareFieldsForFlexibleReportInterface"/>
</service>
</services>