Author: jacopoc
Date: Thu Nov 27 06:14:06 2014 New Revision: 1642027 URL: http://svn.apache.org/r1642027 Log: Moved the "bi" component from the framework to the specialpurpose folder; moved all the dependencies (client code) on the "bi" component from applications components to the "bi" component itself. Now the "bi" component contains all the dimensions/facts/star schemas and all the logic to populate them and can be easily enabled/disabled. Added: ofbiz/trunk/specialpurpose/bi/ - copied from r1641394, ofbiz/trunk/framework/bi/ ofbiz/trunk/specialpurpose/bi/entitydef/ ofbiz/trunk/specialpurpose/bi/entitydef/entitygroup.xml (with props) ofbiz/trunk/specialpurpose/bi/entitydef/entitymodel.xml (with props) ofbiz/trunk/specialpurpose/bi/script/org/ofbiz/bi/FactServices.xml (with props) ofbiz/trunk/specialpurpose/bi/servicedef/secas.xml (with props) Removed: ofbiz/trunk/applications/accounting/entitydef/entitygroup_olap.xml ofbiz/trunk/applications/accounting/entitydef/entitymodel_olap.xml ofbiz/trunk/applications/accounting/script/org/ofbiz/accounting/olap/ ofbiz/trunk/applications/accounting/servicedef/secas_olap.xml ofbiz/trunk/applications/accounting/servicedef/services_olap.xml ofbiz/trunk/applications/order/entitydef/entitygroup_olap.xml ofbiz/trunk/applications/order/entitydef/entitymodel_olap.xml ofbiz/trunk/applications/order/script/org/ofbiz/order/olap/ ofbiz/trunk/applications/order/servicedef/secas_olap.xml ofbiz/trunk/applications/order/servicedef/services_olap.xml ofbiz/trunk/applications/product/data/DimensionTypeData.xml ofbiz/trunk/applications/product/entitydef/entitygroup_olap.xml ofbiz/trunk/applications/product/entitydef/entitymodel_olap.xml ofbiz/trunk/applications/product/script/org/ofbiz/product/olap/ ofbiz/trunk/applications/product/servicedef/secas_olap.xml ofbiz/trunk/applications/product/servicedef/services_olap.xml ofbiz/trunk/framework/bi/ ofbiz/trunk/framework/common/data/DimensionTypeData.xml ofbiz/trunk/framework/common/entitydef/entitygroup_olap.xml ofbiz/trunk/framework/common/entitydef/entitymodel_olap.xml ofbiz/trunk/framework/common/script/org/ofbiz/common/olap/ ofbiz/trunk/framework/common/servicedef/services_olap.xml ofbiz/trunk/framework/common/src/org/ofbiz/common/olap/ Modified: ofbiz/trunk/applications/accounting/ofbiz-component.xml ofbiz/trunk/applications/order/ofbiz-component.xml ofbiz/trunk/applications/order/servicedef/secas.xml ofbiz/trunk/applications/order/servicedef/services.xml ofbiz/trunk/applications/product/ofbiz-component.xml ofbiz/trunk/framework/build.xml ofbiz/trunk/framework/common/ofbiz-component.xml ofbiz/trunk/framework/component-load.xml ofbiz/trunk/specialpurpose/bi/build.xml ofbiz/trunk/specialpurpose/bi/data/BiTypeData.xml ofbiz/trunk/specialpurpose/bi/ofbiz-component.xml ofbiz/trunk/specialpurpose/bi/script/org/ofbiz/bi/DimensionServices.xml ofbiz/trunk/specialpurpose/bi/servicedef/services.xml ofbiz/trunk/specialpurpose/bi/src/org/ofbiz/bi/util/DimensionServices.java ofbiz/trunk/specialpurpose/build.xml ofbiz/trunk/specialpurpose/component-load.xml Modified: ofbiz/trunk/applications/accounting/ofbiz-component.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/ofbiz-component.xml?rev=1642027&r1=1642026&r2=1642027&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/ofbiz-component.xml (original) +++ ofbiz/trunk/applications/accounting/ofbiz-component.xml Thu Nov 27 06:14:06 2014 @@ -29,8 +29,6 @@ under the License. <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel.xml"/> <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel_reports.xml"/> <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel_old.xml"/> - <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel_olap.xml"/> - <entity-resource type="group" reader-name="main" loader="main" location="entitydef/entitygroup_olap.xml"/> <entity-resource type="eca" reader-name="main" loader="main" location="entitydef/eecas.xml"/> <entity-resource type="data" reader-name="seed" loader="main" location="data/AccountingTypeData.xml"/> <entity-resource type="data" reader-name="seed" loader="main" location="data/AccountingHelpData.xml"/> @@ -66,7 +64,6 @@ under the License. <service-resource type="model" loader="main" location="servicedef/services_tax.xml"/> <service-resource type="model" loader="main" location="servicedef/services_rate.xml"/> <service-resource type="model" loader="main" location="servicedef/services_cost.xml"/> - <service-resource type="model" loader="main" location="servicedef/services_olap.xml"/> <!-- Payment Processor/Gateway Service Definitions --> <service-resource type="model" loader="main" location="servicedef/services_sagepay.xml"/> @@ -91,7 +88,6 @@ under the License. <service-resource type="eca" loader="main" location="servicedef/secas.xml"/> <service-resource type="eca" loader="main" location="servicedef/secas_payment.xml"/> <service-resource type="eca" loader="main" location="servicedef/secas_ledger.xml"/> - <service-resource type="eca" loader="main" location="servicedef/secas_olap.xml"/> <service-resource type="eca" loader="main" location="servicedef/secas_invoice.xml"/> <test-suite loader="main" location="testdef/accountingtests.xml"/> Modified: ofbiz/trunk/applications/order/ofbiz-component.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/ofbiz-component.xml?rev=1642027&r1=1642026&r2=1642027&view=diff ============================================================================== --- ofbiz/trunk/applications/order/ofbiz-component.xml (original) +++ ofbiz/trunk/applications/order/ofbiz-component.xml Thu Nov 27 06:14:06 2014 @@ -28,8 +28,6 @@ under the License. <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel.xml"/> <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel_old.xml"/> <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel_view.xml"/> - <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel_olap.xml"/> - <entity-resource type="group" reader-name="main" loader="main" location="entitydef/entitygroup_olap.xml"/> <entity-resource type="eca" reader-name="main" loader="main" location="entitydef/eecas.xml"/> <entity-resource type="data" reader-name="seed" loader="main" location="data/OrderTypeData.xml"/> <entity-resource type="data" reader-name="seed" loader="main" location="data/OrderPortletData.xml"/> @@ -49,7 +47,6 @@ under the License. <service-resource type="model" loader="main" location="servicedef/services_return.xml"/> <service-resource type="model" loader="main" location="servicedef/services_upgrade.xml"/> <service-resource type="model" loader="main" location="servicedef/services_checkout.xml"/> - <service-resource type="model" loader="main" location="servicedef/services_olap.xml"/> <service-resource type="eca" loader="main" location="servicedef/secas.xml"/> <test-suite loader="main" location="testdef/FinAccountTests.xml"/> Modified: ofbiz/trunk/applications/order/servicedef/secas.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/secas.xml?rev=1642027&r1=1642026&r2=1642027&view=diff ============================================================================== --- ofbiz/trunk/applications/order/servicedef/secas.xml (original) +++ ofbiz/trunk/applications/order/servicedef/secas.xml Thu Nov 27 06:14:06 2014 @@ -436,17 +436,10 @@ under the License. <action service="createReturnStatus" mode="sync"/> </eca> - <!-- fact entities --> - <!-- Load data into the SalesOrderItemFact olap entity when a sales order is set to ready --> - <eca service="changeOrderItemStatus" event="commit"> - <condition field-name="statusId" operator="equals" value="ITEM_APPROVED"/> - <condition-field field-name="statusId" operator="not-equals" to-field-name="oldStatusId"/> - <action service="loadSalesOrderFact" mode="sync" run-as-user="system"/> - </eca> <eca service="createUpdateCustomerAndShippingAddress" event="invoke"> <action service="setAnonUserLogin" mode="sync"/> </eca> - + <!-- Use for link the payment and the invoice When Received Payment --> <eca service="createPaymentFromPreference" event="commit"> <condition field-name="paymentId" operator="is-not-empty"/> Modified: ofbiz/trunk/applications/order/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services.xml?rev=1642027&r1=1642026&r2=1642027&view=diff ============================================================================== --- ofbiz/trunk/applications/order/servicedef/services.xml (original) +++ ofbiz/trunk/applications/order/servicedef/services.xml Thu Nov 27 06:14:06 2014 @@ -1069,25 +1069,6 @@ under the License. <attribute name="availabalityList" type="List" mode="OUT"/> </service> - <!-- Order Facts --> - <service name="loadSalesOrderFact" auth="true" engine="simple" - location="component://order/script/org/ofbiz/order/olap/FactServices.xml" invoke="loadSalesOrderFact"> - <description>Calls the loadSalesOrderItemFact service for all the order items.</description> - <attribute name="orderId" type="String" mode="IN" optional="false"/> - </service> - - <service name="loadSalesOrderItemFact" auth="true" engine="simple" - location="component://order/script/org/ofbiz/order/olap/FactServices.xml" invoke="loadSalesOrderItemFact"> - <description> - Pulls information from the OrderItem* entities and stores them in the SalesOrderItem entity (olap entity). - One of orderId/orderItemSeqId or order/orderItem must be passed or an error is returned. - </description> - <attribute name="orderId" type="String" mode="IN" optional="true"/> - <attribute name="orderItemSeqId" type="String" mode="IN" optional="true"/> - <attribute name="orderHeader" type="org.ofbiz.entity.GenericValue" mode="IN" optional="true"/> - <attribute name="orderItem" type="org.ofbiz.entity.GenericValue" mode="IN" optional="true"/> - <attribute name="orderAdjustment " type="org.ofbiz.entity.GenericValue" mode="IN" optional="true"/> - </service> <service name="createQuoteTerm" engine="simple" default-entity-name="QuoteTerm" location="component://order/script/org/ofbiz/order/quote/QuoteServices.xml" invoke="createQuoteTerm"> <description> Modified: ofbiz/trunk/applications/product/ofbiz-component.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/product/ofbiz-component.xml?rev=1642027&r1=1642026&r2=1642027&view=diff ============================================================================== --- ofbiz/trunk/applications/product/ofbiz-component.xml (original) +++ ofbiz/trunk/applications/product/ofbiz-component.xml Thu Nov 27 06:14:06 2014 @@ -30,8 +30,6 @@ under the License. <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel_view.xml"/> <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel_old.xml"/> <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel_shipment.xml"/> - <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel_olap.xml"/> - <entity-resource type="group" reader-name="main" loader="main" location="entitydef/entitygroup_olap.xml"/> <entity-resource type="eca" reader-name="main" loader="main" location="entitydef/eecas.xml"/> <entity-resource type="data" reader-name="seed-initial" loader="main" location="data/ProductScheduledServices.xml"/> <entity-resource type="data" reader-name="seed" loader="main" location="data/ProductTypeData.xml"/> @@ -43,7 +41,6 @@ under the License. <entity-resource type="data" reader-name="demo" loader="main" location="data/FacilitySecurityGroupDemoData.xml"/> <entity-resource type="data" reader-name="demo" loader="main" location="data/ProductDemoData.xml"/> <entity-resource type="data" reader-name="seed" loader="main" location="data/ApiSchemaDhl.xml"/> - <entity-resource type="data" reader-name="seed" loader="main" location="data/DimensionTypeData.xml"/> <entity-resource type="data" reader-name="seed" loader="main" location="data/ProductPortletData.xml"/> <service-resource type="model" loader="main" location="servicedef/services.xml"/> @@ -64,10 +61,8 @@ under the License. <service-resource type="model" loader="main" location="servicedef/services_view.xml"/> <service-resource type="model" loader="main" location="servicedef/services_cost.xml"/> <service-resource type="model" loader="main" location="servicedef/services_uom.xml"/> - <service-resource type="model" loader="main" location="servicedef/services_olap.xml"/> <service-resource type="eca" loader="main" location="servicedef/secas.xml"/> <service-resource type="eca" loader="main" location="servicedef/secas_shipment.xml"/> - <service-resource type="eca" loader="main" location="servicedef/secas_olap.xml"/> <service-resource type="model" loader="main" location="servicedef/services_upgrade.xml"/> <!-- test suite --> Modified: ofbiz/trunk/framework/build.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/build.xml?rev=1642027&r1=1642026&r2=1642027&view=diff ============================================================================== --- ofbiz/trunk/framework/build.xml (original) +++ ofbiz/trunk/framework/build.xml Thu Nov 27 06:14:06 2014 @@ -24,7 +24,7 @@ under the License. entity/build.xml,geronimo/build.xml, catalina/build.xml, security/build.xml,service/build.xml,entityext/build.xml, - bi/build.xml,minilang/build.xml, + minilang/build.xml, webapp/build.xml,widget/build.xml, common/build.xml,datafile/build.xml, testtools/build.xml, Modified: ofbiz/trunk/framework/common/ofbiz-component.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/ofbiz-component.xml?rev=1642027&r1=1642026&r2=1642027&view=diff ============================================================================== --- ofbiz/trunk/framework/common/ofbiz-component.xml (original) +++ ofbiz/trunk/framework/common/ofbiz-component.xml Thu Nov 27 06:14:06 2014 @@ -25,8 +25,6 @@ under the License. <classpath type="jar" location="build/lib/*"/> <classpath type="dir" location="config"/> <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel.xml"/> - <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel_olap.xml"/> - <entity-resource type="group" reader-name="main" loader="main" location="entitydef/entitygroup_olap.xml"/> <entity-resource type="data" reader-name="seed" loader="main" location="data/CommonSecurityPermissionSeedData.xml"/> <entity-resource type="data" reader-name="demo" loader="main" location="data/CommonSecurityGroupDemoData.xml"/> <entity-resource type="data" reader-name="seed" loader="main" location="data/CommonSystemPropertyData.xml"/> @@ -62,13 +60,11 @@ under the License. <entity-resource type="data" reader-name="seed" loader="main" location="data/LanguageData.xml"/> <entity-resource type="data" reader-name="seed" loader="main" location="data/UnitData.xml"/> <entity-resource type="data" reader-name="seed" loader="main" location="data/PeriodData.xml"/> - <entity-resource type="data" reader-name="seed" loader="main" location="data/DimensionTypeData.xml"/> <entity-resource type="data" reader-name="seed" loader="main" location="data/CommonPortletData.xml"/> <service-resource type="model" loader="main" location="servicedef/services.xml"/> <service-resource type="model" loader="main" location="servicedef/services_cdyne.xml"/> <service-resource type="model" loader="main" location="servicedef/services_email.xml"/> - <service-resource type="model" loader="main" location="servicedef/services_olap.xml"/> <service-resource type="model" loader="main" location="servicedef/services_security.xml"/> <service-resource type="model" loader="main" location="servicedef/services_test.xml"/> <service-resource type="group" loader="main" location="servicedef/groups_test.xml"/> Modified: ofbiz/trunk/framework/component-load.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/component-load.xml?rev=1642027&r1=1642026&r2=1642027&view=diff ============================================================================== --- ofbiz/trunk/framework/component-load.xml (original) +++ ofbiz/trunk/framework/component-load.xml Thu Nov 27 06:14:06 2014 @@ -31,7 +31,6 @@ under the License. <load-component component-location="service"/> <load-component component-location="catalina"/> <load-component component-location="entityext"/> - <load-component component-location="bi"/> <load-component component-location="webapp"/> <load-component component-location="widget"/> <load-component component-location="testtools"/> Modified: ofbiz/trunk/specialpurpose/bi/build.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/bi/build.xml?rev=1642027&r1=1641394&r2=1642027&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/bi/build.xml (original) +++ ofbiz/trunk/specialpurpose/bi/build.xml Thu Nov 27 06:14:06 2014 @@ -40,12 +40,4 @@ under the License. <fileset dir="../../framework/service/lib" includes="*.jar"/> <fileset dir="../../framework/service/build/lib" includes="*.jar"/> </path> - - <!-- ================================================================== --> - <!-- Compilation of the source files --> - <!-- ================================================================== --> - - <target name="classes" depends="prepare"> - <javac17 classpathref="local.class.path"/> - </target> </project> Modified: ofbiz/trunk/specialpurpose/bi/data/BiTypeData.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/bi/data/BiTypeData.xml?rev=1642027&r1=1641394&r2=1642027&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/bi/data/BiTypeData.xml (original) +++ ofbiz/trunk/specialpurpose/bi/data/BiTypeData.xml Thu Nov 27 06:14:06 2014 @@ -19,5 +19,12 @@ under the License. --> <entity-engine-xml> + <CurrencyDimension dimensionId="_NF_" description="Currency Not Found."/> + <CurrencyDimension dimensionId="_NA_" description="Currency Not Set."/> + <DateDimension dimensionId="_NF_" description="Date Not Found."/> + <DateDimension dimensionId="_NA_" description="Date Not Set."/> + + <ProductDimension dimensionId="_NF_"/> + <ProductDimension dimensionId="_NA_"/> </entity-engine-xml> Added: ofbiz/trunk/specialpurpose/bi/entitydef/entitygroup.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/bi/entitydef/entitygroup.xml?rev=1642027&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/bi/entitydef/entitygroup.xml (added) +++ ofbiz/trunk/specialpurpose/bi/entitydef/entitygroup.xml Thu Nov 27 06:14:06 2014 @@ -0,0 +1,46 @@ +<?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. +--> + +<entitygroup xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitygroup.xsd"> + + <!-- ========================================================= --> + <!-- Dimensions --> + <!-- ========================================================= --> + <entity-group group="org.ofbiz.olap" entity="CurrencyDimension"/> + <entity-group group="org.ofbiz.olap" entity="DateDimension"/> + <entity-group group="org.ofbiz.olap" entity="ProductDimension"/> + + <!-- ========================================================= --> + <!-- Facts --> + <!-- ========================================================= --> + <entity-group group="org.ofbiz.olap" entity="SalesInvoiceItemFact"/> + <entity-group group="org.ofbiz.olap" entity="SalesOrderItemFact"/> + <entity-group group="org.ofbiz.olap" entity="InventoryItemFact"/> + + <!-- ========================================================= --> + <!-- Star Schemas --> + <!-- ========================================================= --> + <entity-group group="org.ofbiz.olap" entity="SalesInvoiceItemStarSchema"/> + <entity-group group="org.ofbiz.olap" entity="SalesOrderItemStarSchema"/> + <entity-group group="org.ofbiz.olap" entity="InventoryItemSchema"/> + +</entitygroup> + Propchange: ofbiz/trunk/specialpurpose/bi/entitydef/entitygroup.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/bi/entitydef/entitygroup.xml ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/specialpurpose/bi/entitydef/entitygroup.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Added: ofbiz/trunk/specialpurpose/bi/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/bi/entitydef/entitymodel.xml?rev=1642027&view=auto ============================================================================== --- ofbiz/trunk/specialpurpose/bi/entitydef/entitymodel.xml (added) +++ ofbiz/trunk/specialpurpose/bi/entitydef/entitymodel.xml Thu Nov 27 06:14:06 2014 @@ -0,0 +1,468 @@ +<?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. +--> + +<entitymodel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/entitymodel.xsd"> + <!-- ========================================================= --> + <!-- ======================== Defaults ======================= --> + <!-- ========================================================= --> + <title>OLAP entities</title> + <description>None</description> + + <!-- ========================================================= --> + <!-- Dimensions --> + <!-- ========================================================= --> + <entity entity-name="DateDimension" package-name="org.ofbiz.bi.dimension" title="Date Dimension"> + <description>Date (days) dimension. The natural key is [dateValue]</description> + <field name="dimensionId" type="id-ne"> + <description>Unique identifier of the Date dimension record</description> + </field> + <field name="dateValue" type="date"> + <description>The date (day)</description> + </field> + <field name="description" type="description"> + <description>Full date description</description> + </field> + <field name="dayName" type="short-varchar"> + <description>The name of the day (Monday, Tuesday, etc...)</description> + </field> + <field name="dayOfMonth" type="numeric"> + <description>The number of the day in the month</description> + </field> + <field name="dayOfYear" type="numeric"> + <description>The number of the day in the year</description> + </field> + <field name="monthName" type="short-varchar"> + <description>The name of the month (January, February, etc...)</description> + </field> + <field name="monthOfYear" type="numeric"> + <description>The number of the month (1-12)</description> + </field> + <field name="yearName" type="numeric"> + <description>The year (2008, 2009, etc...)</description> + </field> + <field name="weekOfMonth" type="numeric"> + <description>The number of the week in the month</description> + </field> + <field name="weekOfYear" type="numeric"> + <description>The number of the week in the year</description> + </field> + <field name="yearMonthDay" type="short-varchar"> + <description>YYYY-MM-DD</description> + </field> + <field name="yearAndMonth" type="short-varchar"> + <description>YYYY-MM</description> + </field> + <field name="weekdayType" type="short-varchar"> + <description>Weekday indicator (Weekday or Weekend)</description> + </field> + <prim-key field="dimensionId"/> + </entity> + + <entity entity-name="CurrencyDimension" package-name="org.ofbiz.bi.dimension" title="Currency Dimension"> + <description>Currency dimension. The natural key is [currencyId]</description> + <field name="dimensionId" type="id-ne"> + <description>Unique identifier of the Currency dimension record</description> + </field> + <field name="currencyId" type="id-ne"> + <description>The currency id (natural key).</description> + </field> + <field name="description" type="description"> + <description>Full currency description</description> + </field> + <prim-key field="dimensionId"/> + </entity> + + <entity entity-name="ProductDimension" package-name="org.ofbiz.bi.dimension.product" title="Product Dimension"> + <description>Product dimension. The natural key is [productId]</description> + <field name="dimensionId" type="id-ne"> + <description>Unique identifier of the Product dimension record</description> + </field> + <field name="productId" type="id-ne"> + <description>The natural key. From Product.productId</description> + </field> + <field name="productType" type="description"> + <description>The product type. From ProductType.description</description> + </field> + <field name="brandName" type="name"></field> + <field name="internalName" type="description"></field> + <prim-key field="dimensionId"/> + </entity> + + <!-- ========================================================= --> + <!-- Facts --> + <!-- ========================================================= --> + <entity entity-name="SalesInvoiceItemFact" package-name="org.ofbiz.bi.fact.accounting" title="Sales Invoice Item Fact"> + <description>A transaction fact entity with invoice item grain.</description> + <field name="invoiceId" type="id-ne"></field> <!-- degenerate dimension --> + <field name="invoiceItemSeqId" type="id-ne"></field> <!-- degenerate dimension --> + <field name="orderId" type="id-ne"></field> <!-- degenerate dimension --> + <field name="invoiceDateDimId" type="id-ne"></field> + <field name="productDimId" type="id-ne"></field> + <field name="billToCustomerDimId" type="id-ne"></field> <!-- TODO: implement the dimension --> + <field name="origCurrencyDimId" type="id-ne"></field> + + <field name="quantity" type="fixed-point"> + <description>Quantity invoiced. From InvoiceItem.quantity</description> + </field> + + <field name="extGrossAmount" type="currency-precise"> + <description>Extended gross amount: quantity invoiced multiplied by the list unit price.</description> + </field> + <field name="extDiscountAmount" type="currency-precise"> + <description>Extended discount amount.</description> + </field> + <field name="extNetAmount" type="currency-precise"> + <description>Extended net amount: gross amount less discounts.</description> + </field> + <field name="extTaxAmount" type="currency-precise"> + <description>Extended tax amount.</description> + </field> + <field name="extManFixedCost" type="currency-precise"> + <description>Extended manufacturing fixed cost.</description> + </field> + <field name="extManVarCost" type="currency-precise"> + <description>Extended manufacturing variable cost.</description> + </field> + <field name="extStorageCost" type="currency-precise"> + <description>Extended storage cost.</description> + </field> + <field name="extDistributionCost" type="currency-precise"> + <description>Extended distribution cost.</description> + </field> + <field name="contributionAmount" type="currency-precise"> + <description>Extended net amount less all the costs.</description> + </field> + <!-- + TODO: implement multi-currency fields + <field name="extGrossAmountOrig" type="currency-precise"> + <description>Extended gross amount in the original currency: quantity invoiced multiplied by the list unit price.</description> + </field> + <field name="extDiscountAmountOrig" type="currency-precise"> + <description>Extended discount amount in the original currency.</description> + </field> + <field name="extNetAmountOrig" type="currency-precise"> + <description>Extended net amount in the original currency: gross amount less discounts.</description> + </field> + <field name="extManFixedCostOrig" type="currency-precise"> + <description>Extended manufacturing fixed cost in the original currency.</description> + </field> + <field name="extManVarCostOrig" type="currency-precise"> + <description>Extended manufacturing variable cost in the original currency.</description> + </field> + <field name="extStorageCostOrig" type="currency-precise"> + <description>Extended storage cost in the original currency.</description> + </field> + <field name="extDistributionCostOrig" type="currency-precise"> + <description>Extended distribution cost in the original currency.</description> + </field> + <field name="contributionAmountOrig" type="currency-precise"> + <description>Extended net amount less all the costs in the original currency.</description> + </field> + --> + + <prim-key field="invoiceId"/> + <prim-key field="invoiceItemSeqId"/> + + <relation type="one" fk-name="SIIF_INVDATE" rel-entity-name="DateDimension"> + <key-map field-name="invoiceDateDimId" rel-field-name="dimensionId"/> + </relation> + <relation type="one" fk-name="SIIF_CURRENCY" rel-entity-name="CurrencyDimension"> + <key-map field-name="origCurrencyDimId" rel-field-name="dimensionId"/> + </relation> + <relation type="one" fk-name="SIIF_PRODUCT" rel-entity-name="ProductDimension"> + <key-map field-name="productDimId" rel-field-name="dimensionId"/> + </relation> + + </entity> + + <entity entity-name="SalesOrderItemFact" package-name="org.ofbiz.bi.fact.order" title="Sales Order Item Fact"> + <description>A transaction fact entity with order item grain.</description> + <field name="orderId" type="id-ne"></field> <!-- degenerate dimension --> + <field name="orderItemSeqId" type="id-ne"></field> <!-- degenerate dimension --> + <field name="orderDateDimId" type="id-ne"></field> + <field name="productDimId" type="id-ne"></field> + <field name="origCurrencyDimId" type="id-ne"></field> + <field name="billToCustomerDimId" type="id-ne"></field> <!-- TODO: implement the dimension --> + + <field name="productCategoryId" type="id-ne"></field> + <field name="productStoreId" type="id-ne"></field> + <field name="salesChannelEnumId" type="id-ne"></field> + <field name="statusId" type="id-ne"></field> + + <field name="brand" type="name"></field> + <field name="pod" type="name"></field> + <field name="account" type="name"></field> + + <field name="quantity" type="fixed-point"> + <description>Quantity order. From OrderItem.quantity</description> + </field> + + <field name="extGrossAmount" type="currency-precise"> + <description>Extended gross amount: quantity item multiplied by the unit price.</description> + </field> + <field name="extGrossCost" type="currency-precise"> + <description>Extended gross cost: quantity item multiplied by the last price.</description> + </field> + <field name="extDiscountAmount" type="currency-precise"> + <description>Extended discount amount.</description> + </field> + <field name="extNetAmount" type="currency-precise"> + <description>Extended net amount: gross amount less discounts.</description> + </field> + <field name="extShippingAmount" type="currency-precise"> + <description>Extended shipping amount.</description> + </field> + <field name="extTaxAmount" type="currency-precise"> + <description>Extended tax amount.</description> + </field> + + <field name="GS" type="currency-precise"> + <description>Gross Sales: Gross Amount plus Shipping Amount.</description> + </field> + <field name="GMS" type="currency-precise"> + <description>Gross Merchandize Sales: Gross Amount.</description> + </field> + <field name="GMP" type="currency-precise"> + <description>Gross Merchandize Profit: Gross Merchandize Sales less Gross Cost.</description> + </field> + <field name="GSS" type="currency-precise"> + <description>Gross Shipping Sales: Shipping Amount</description> + </field> + <field name="GSC" type="currency-precise"> + <description>Gross Shipping Cost</description> + </field> + <field name="GSP" type="currency-precise"> + <description>Gross Shipping Profit: Gross Shipping Sales less Gross Shipping Cost.</description> + </field> + <field name="GP" type="currency-precise"> + <description>Gross Profit: Gross Merchandize Profit less Gross Shipping Profit.</description> + </field> + + <field name="countOrder" type="fixed-point"> + <description>Count of order.</description> + </field> + <field name="productPromoCode" type="id-ne"> + <description>Product promotion Code.</description> + </field> + + <prim-key field="orderId"/> + <prim-key field="orderItemSeqId"/> + + <relation type="one" fk-name="SOIF_ORDERDATE" rel-entity-name="DateDimension"> + <key-map field-name="orderDateDimId" rel-field-name="dimensionId"/> + </relation> + <relation type="one" fk-name="SOIF_CURRENCY" rel-entity-name="CurrencyDimension"> + <key-map field-name="origCurrencyDimId" rel-field-name="dimensionId"/> + </relation> + <relation type="one" fk-name="SOIF_PRODUCT" rel-entity-name="ProductDimension"> + <key-map field-name="productDimId" rel-field-name="dimensionId"/> + </relation> + + </entity> + + <entity entity-name="InventoryItemFact" package-name="org.ofbiz.bi.fact.product" title="Inventory Item Fact"> + <description>A transaction fact entity with inventory item.</description> + <field name="inventoryItemId" type="id-ne"></field> + <field name="facilityId" type="id-ne"></field> + <field name="productDimId" type="id-ne"></field> + <field name="origCurrencyDimId" type="id-ne"></field> + <field name="inventoryDateDimId" type="id-ne"></field> + + <field name="quantityOnHandTotal" type="fixed-point"></field> + <field name="availableToPromiseTotal" type="fixed-point"></field> + <field name="unitCost" type="fixed-point"></field> + <field name="soldoutAmount" type="fixed-point"></field> + <prim-key field="inventoryItemId"/> + <relation type="one" fk-name="IIF_INVPRODUCT" rel-entity-name="ProductDimension"> + <key-map field-name="productDimId" rel-field-name="dimensionId"/> + </relation> + <relation type="one" fk-name="IIF_INVCURRENCY" rel-entity-name="CurrencyDimension"> + <key-map field-name="origCurrencyDimId" rel-field-name="dimensionId"/> + </relation> + <relation type="one" fk-name="IIF_INVDATE" rel-entity-name="DateDimension"> + <key-map field-name="inventoryDateDimId" rel-field-name="dimensionId"/> + </relation> + </entity> + + <!-- ========================================================= --> + <!-- Star Schemas --> + <!-- ========================================================= --> + <view-entity entity-name="SalesInvoiceItemStarSchema" package-name="org.ofbiz.bi.starschema.accounting" title="Sales Invoice Item Star Schema"> + <description>Invoice Item star schema (Profit and Loss Statement).</description> + + <member-entity entity-alias="SIIF" entity-name="SalesInvoiceItemFact"/> + <member-entity entity-alias="IDD" entity-name="DateDimension"/> + <member-entity entity-alias="PD" entity-name="ProductDimension"/> + <member-entity entity-alias="CD" entity-name="CurrencyDimension"/> + + <alias-all entity-alias="IDD" prefix="invoiceDate" group-by="true"> + <exclude field="dimensionId"/> + </alias-all> + <alias-all entity-alias="PD" prefix="product" group-by="true"> + <exclude field="dimensionId"/> + </alias-all> + <alias-all entity-alias="CD" prefix="currency" group-by="true"> + <exclude field="dimensionId"/> + </alias-all> + <alias-all entity-alias="SIIF" function="sum"> + <exclude field="invoiceItemSeqId"/> + <exclude field="invoiceDateDimId"/> + <exclude field="productDimId"/> + <exclude field="billToCustomerDimId"/> + <exclude field="origCurrencyDimId"/> + <exclude field="orderId"/> + <exclude field="invoiceId"/> + <exclude field="invoiceItemSeqId"/> + </alias-all> + <alias entity-alias="SIIF" name="invoiceId" group-by="true"> + <description>Invoice id</description> + </alias> + <alias entity-alias="SIIF" name="invoiceItemSeqId" group-by="true"/> + <alias entity-alias="SIIF" name="orderId" group-by="true"/> + + <view-link entity-alias="SIIF" rel-entity-alias="IDD"> + <key-map field-name="invoiceDateDimId" rel-field-name="dimensionId"/> + </view-link> + <view-link entity-alias="SIIF" rel-entity-alias="PD"> + <key-map field-name="productDimId" rel-field-name="dimensionId"/> + </view-link> + <view-link entity-alias="SIIF" rel-entity-alias="CD"> + <key-map field-name="origCurrencyDimId" rel-field-name="dimensionId"/> + </view-link> + </view-entity> + + <view-entity entity-name="SalesOrderItemStarSchema" package-name="org.ofbiz.bi.starschema.order" title="Sales Order Item Star Schema"> + <description>Order Item star schema (Profit and Loss Statement).</description> + + <member-entity entity-alias="SOIF" entity-name="SalesOrderItemFact"/> + <member-entity entity-alias="ODD" entity-name="DateDimension"/> + <member-entity entity-alias="PD" entity-name="ProductDimension"/> + <member-entity entity-alias="CD" entity-name="CurrencyDimension"/> + + <alias-all entity-alias="ODD" prefix="orderDate" group-by="true"> + <exclude field="dimensionId"/> + </alias-all> + <alias-all entity-alias="PD" prefix="product" group-by="true"> + <exclude field="dimensionId"/> + </alias-all> + <alias-all entity-alias="CD" prefix="currency" group-by="true"> + <exclude field="dimensionId"/> + </alias-all> + <alias-all entity-alias="SOIF" function="sum"> + <exclude field="orderId"/> + <exclude field="orderItemSeqId"/> + <exclude field="orderDateDimId"/> + <exclude field="productDimId"/> + <exclude field="origCurrencyDimId"/> + <exclude field="billToCustomerDimId"/> + <exclude field="productCategoryId"/> + <exclude field="productStoreId"/> + <exclude field="salesChannelEnumId"/> + <exclude field="statusId"/> + <exclude field="brand"/> + <exclude field="pod"/> + <exclude field="account"/> + <exclude field="productPromoCode"/> + </alias-all> + <alias entity-alias="SOIF" name="orderId" group-by="true"> + <description>Order id</description> + </alias> + <alias entity-alias="SOIF" name="productPromoCode" group-by="true"/> + <alias entity-alias="SOIF" name="orderItemSeqId" group-by="true"/> + <alias entity-alias="SOIF" name="productCategoryId" group-by="true"/> + <alias entity-alias="SOIF" name="productStoreId" group-by="true"/> + <alias entity-alias="SOIF" name="salesChannelEnumId" group-by="true"/> + <alias entity-alias="SOIF" name="statusId" group-by="true"/> + <alias entity-alias="SOIF" name="brand" group-by="true"/> + <alias entity-alias="SOIF" name="pod" group-by="true"/> + <alias entity-alias="SOIF" name="account" group-by="true"/> + + <view-link entity-alias="SOIF" rel-entity-alias="ODD"> + <key-map field-name="orderDateDimId" rel-field-name="dimensionId"/> + </view-link> + <view-link entity-alias="SOIF" rel-entity-alias="PD"> + <key-map field-name="productDimId" rel-field-name="dimensionId"/> + </view-link> + <view-link entity-alias="SOIF" rel-entity-alias="CD"> + <key-map field-name="origCurrencyDimId" rel-field-name="dimensionId"/> + </view-link> + </view-entity> + + <view-entity entity-name="InventoryItemSchema" package-name="org.ofbiz.bi.starschema.product" title="Inventory Item Schema"> + <description>"Inventory Item Schema.</description> + <member-entity entity-alias="IIF" entity-name="InventoryItemFact"/> + <!--member-entity entity-alias="SIIF" entity-name="SalesOrderItemFact"/--> + <member-entity entity-alias="PD" entity-name="ProductDimension"/> + <member-entity entity-alias="IDD" entity-name="DateDimension"/> + <member-entity entity-alias="CD" entity-name="CurrencyDimension"/> + + <alias-all entity-alias="IIF" function="sum"> + <exclude field="inventoryItemId"/> + <exclude field="orderId"/> + <exclude field="facilityId"/> + <exclude field="inventoryDateDimId"/> + <exclude field="productDimId"/> + <exclude field="origCurrencyDimId"/> + </alias-all> + <!--alias-all entity-alias="SIIF" function="sum"> + <exclude field="orderItemSeqId"/> + <exclude field="orderDateDimId"/> + <exclude field="productDimId"/> + <exclude field="billToCustomerDimId"/> + <exclude field="origCurrencyDimId"/> + <exclude field="orderId"/> + <exclude field="orderItemSeqId"/> + <exclude field="orderStatus"/> + <exclude field="saleChanel"/> + </alias-all--> + <alias-all entity-alias="PD" prefix="product" group-by="true"> + <exclude field="dimensionId"/> + </alias-all> + <alias-all entity-alias="IDD" prefix="inventoryDate" group-by="true"> + <exclude field="dimensionId"/> + </alias-all> + <alias-all entity-alias="CD" prefix="currency" group-by="true"> + <exclude field="dimensionId"/> + </alias-all> + <alias entity-alias="IIF" name="inventoryItemId" group-by="true"> + <description>Inventory Item Id</description> + </alias> + <alias entity-alias="IIF" name="facilityId" group-by="true"> + <description>Facility Id</description> + </alias> + <alias entity-alias="PD" name="productId" group-by="true"> + <description>Product id</description> + </alias> + <view-link entity-alias="IIF" rel-entity-alias="PD" rel-optional="true"> + <key-map field-name="productDimId" rel-field-name="dimensionId"/> + </view-link> + <!--view-link entity-alias="PD" rel-entity-alias="SIIF" rel-optional="true"> + <key-map field-name="dimensionId" rel-field-name="productDimId"/> + </view-link--> + <view-link entity-alias="IIF" rel-entity-alias="IDD"> + <key-map field-name="inventoryDateDimId" rel-field-name="dimensionId"/> + </view-link> + <view-link entity-alias="IIF" rel-entity-alias="CD"> + <key-map field-name="origCurrencyDimId" rel-field-name="dimensionId"/> + </view-link> + </view-entity> + +</entitymodel> Propchange: ofbiz/trunk/specialpurpose/bi/entitydef/entitymodel.xml ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/specialpurpose/bi/entitydef/entitymodel.xml ------------------------------------------------------------------------------ svn:keywords = Date Rev Author URL Id Propchange: ofbiz/trunk/specialpurpose/bi/entitydef/entitymodel.xml ------------------------------------------------------------------------------ svn:mime-type = text/xml Modified: ofbiz/trunk/specialpurpose/bi/ofbiz-component.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/bi/ofbiz-component.xml?rev=1642027&r1=1641394&r2=1642027&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/bi/ofbiz-component.xml (original) +++ ofbiz/trunk/specialpurpose/bi/ofbiz-component.xml Thu Nov 27 06:14:06 2014 @@ -18,16 +18,21 @@ specific language governing permissions under the License. --> -<ofbiz-component name="bi" +<ofbiz-component name="bi" enabled="true" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/ofbiz-component.xsd"> <resource-loader name="main" type="component"/> <classpath type="dir" location="config"/> <classpath type="jar" location="build/lib/*"/> + + <entity-resource type="model" reader-name="main" loader="main" location="entitydef/entitymodel.xml"/> + <entity-resource type="group" reader-name="main" loader="main" location="entitydef/entitygroup.xml"/> + <entity-resource type="data" reader-name="seed" loader="main" location="data/BiTypeData.xml"/> <entity-resource type="data" reader-name="seed" loader="main" location="data/BiSecurityPermissionSeedData.xml"/> <entity-resource type="data" reader-name="demo" loader="main" location="data/BiSecurityGroupDemoData.xml"/> - + + <service-resource type="eca" loader="main" location="servicedef/secas.xml"/> <service-resource type="model" loader="main" location="servicedef/services.xml"/> <webapp name="bi" Modified: ofbiz/trunk/specialpurpose/bi/script/org/ofbiz/bi/DimensionServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/bi/script/org/ofbiz/bi/DimensionServices.xml?rev=1642027&r1=1641394&r2=1642027&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/bi/script/org/ofbiz/bi/DimensionServices.xml (original) +++ ofbiz/trunk/specialpurpose/bi/script/org/ofbiz/bi/DimensionServices.xml Thu Nov 27 06:14:06 2014 @@ -65,7 +65,6 @@ under the License. <check-errors/> </iterate> - <!-- loads the inventory items in the InventoryItemFact fact entity --> <entity-condition entity-name="InventoryItem" list="inventoryItems"> <condition-expr field-name="inventoryItemTypeId" operator="equals" value="NON_SERIAL_INV_ITEM"/> @@ -77,4 +76,67 @@ under the License. <check-errors/> </iterate> </simple-method> + + <simple-method method-name="loadCurrencyDimension" short-description="Initialize the CurrencyDimension using the update strategy of 'type 1'"> + <entity-and entity-name="Uom" list="currencies"> + <field-map field-name="uomTypeId" value="CURRENCY_MEASURE"/> + </entity-and> + <iterate list="currencies" entry="currency"> + <entity-and entity-name="CurrencyDimension" list="currencyDims"> + <field-map field-name="currencyId" from-field="currency.uomId"/> + </entity-and> + <if-not-empty field="currencyDims"> + <iterate list="currencyDims" entry="currencyDim"> + <set field="currencyDim.description" from-field="currency.description"/> + <store-value value-field="currencyDim"/> + </iterate> + <else> + <make-value value-field="currencyDim" entity-name="CurrencyDimension"/> + <sequenced-id sequence-name="CurrencyDimension" field="currencyDim.dimensionId"/> + <set field="currencyDim.currencyId" from-field="currency.uomId"/> + <set field="currencyDim.description" from-field="currency.description"/> + <create-value value-field="currencyDim"/> + </else> + </if-not-empty> + </iterate> + </simple-method> + + <simple-method method-name="prepareProductDimensionData" short-description=""> + <entity-one entity-name="Product" value-field="product"/> + <if-empty field="product"> + <add-error> + <fail-property resource="ProductUiLabels" property="ProductProductNotFoundWithProduct"/> + </add-error> + </if-empty> + <check-errors/> + <make-value value-field="productDimension" entity-name="ProductDimension"/> + <set-nonpk-fields map="product" value-field="productDimension"/> + + <get-related-one value-field="product" relation-name="ProductType" to-value-field="productType"/> + <set field="productDimension.productType" from-field="productType.description"/> + + <field-to-result field="productDimension"/> + </simple-method> + + <simple-method method-name="loadProductInProductDimension" short-description=""> + <set-service-fields service-name="prepareProductDimensionData" map="parameters" to-map="inMap"/> + <call-service service-name="prepareProductDimensionData" in-map-name="inMap"> + <result-to-field result-name="productDimension"/> + </call-service> + <clear-field field="inMap"/> + <set-service-fields service-name="storeGenericDimension" map="parameters" to-map="inMap"/> + <set field="inMap.naturalKeyFields[]" value="productId"/> + <set field="inMap.dimensionValue" from-field="productDimension"/> + <call-service service-name="storeGenericDimension" in-map-name="inMap"/> + </simple-method> + <simple-method method-name="loadAllProductsInProductDimension" short-description=""> + <entity-condition entity-name="Product" list="products"/> + <iterate list="products" entry="product"> + <set-service-fields service-name="loadProductInProductDimension" map="parameters" to-map="inMap"/> + <set field="inMap.productId" from-field="product.productId"/> + <call-service service-name="loadProductInProductDimension" in-map-name="inMap"/> + <clear-field field="inMap"/> + </iterate> + </simple-method> + </simple-methods> |
Free forum by Nabble | Edit this page |