diff --git a/.classpath b/.classpath index ccfb057f07..25bbf566b6 100644 --- a/.classpath +++ b/.classpath @@ -25,7 +25,6 @@ under the License. - @@ -41,6 +40,7 @@ under the License. + diff --git a/applications/accounting/build.xml b/applications/accounting/build.xml index 25cd63e85b..dc0131c126 100644 --- a/applications/accounting/build.xml +++ b/applications/accounting/build.xml @@ -50,6 +50,7 @@ under the License. + @@ -59,7 +60,7 @@ under the License. - + diff --git a/specialpurpose/bi/entitydef/entitygroup_accounting_olap.xml b/applications/accounting/entitydef/entitygroup_olap.xml similarity index 100% rename from specialpurpose/bi/entitydef/entitygroup_accounting_olap.xml rename to applications/accounting/entitydef/entitygroup_olap.xml diff --git a/specialpurpose/bi/entitydef/entitymodel_accounting_olap.xml b/applications/accounting/entitydef/entitymodel_olap.xml similarity index 100% rename from specialpurpose/bi/entitydef/entitymodel_accounting_olap.xml rename to applications/accounting/entitydef/entitymodel_olap.xml diff --git a/applications/accounting/ofbiz-component.xml b/applications/accounting/ofbiz-component.xml index 6eb627ce21..f23fa7479c 100644 --- a/applications/accounting/ofbiz-component.xml +++ b/applications/accounting/ofbiz-component.xml @@ -33,6 +33,8 @@ under the License. + + @@ -54,6 +56,7 @@ under the License. + @@ -68,6 +71,7 @@ under the License. + diff --git a/specialpurpose/bi/script/org/ofbiz/bi/FactServices.xml b/applications/accounting/script/org/ofbiz/accounting/olap/FactServices.xml similarity index 100% rename from specialpurpose/bi/script/org/ofbiz/bi/FactServices.xml rename to applications/accounting/script/org/ofbiz/accounting/olap/FactServices.xml diff --git a/specialpurpose/bi/servicedef/secas_accounting_olap.xml b/applications/accounting/servicedef/secas_olap.xml similarity index 100% rename from specialpurpose/bi/servicedef/secas_accounting_olap.xml rename to applications/accounting/servicedef/secas_olap.xml diff --git a/specialpurpose/bi/servicedef/services_accounting_olap.xml b/applications/accounting/servicedef/services_olap.xml similarity index 91% rename from specialpurpose/bi/servicedef/services_accounting_olap.xml rename to applications/accounting/servicedef/services_olap.xml index 1763cc0c72..6d8d39f667 100644 --- a/specialpurpose/bi/servicedef/services_accounting_olap.xml +++ b/applications/accounting/servicedef/services_olap.xml @@ -23,7 +23,7 @@ under the License. + location="org/ofbiz/accounting/olap/FactServices.xml" invoke="loadSalesInvoiceItemFact"> Pulls information from the Invoice* entities and stores them in the SalesInvoiceItem entity (olap entity). One of invoiceId/invoiceItemSeqId or invoice/invoiceItem must be passed or an error is returned. @@ -34,7 +34,7 @@ under the License. + location="org/ofbiz/accounting/olap/FactServices.xml" invoke="loadSalesInvoiceFact"> Calls the loadSalesInvoiceItemFact service for all the invoice items. diff --git a/specialpurpose/bi/data/DimensionTypeData_product.xml b/applications/product/data/DimensionTypeData.xml similarity index 100% rename from specialpurpose/bi/data/DimensionTypeData_product.xml rename to applications/product/data/DimensionTypeData.xml diff --git a/specialpurpose/bi/entitydef/entitygroup_product_olap.xml b/applications/product/entitydef/entitygroup_olap.xml similarity index 100% rename from specialpurpose/bi/entitydef/entitygroup_product_olap.xml rename to applications/product/entitydef/entitygroup_olap.xml diff --git a/specialpurpose/bi/entitydef/entitymodel_product_olap.xml b/applications/product/entitydef/entitymodel_olap.xml similarity index 100% rename from specialpurpose/bi/entitydef/entitymodel_product_olap.xml rename to applications/product/entitydef/entitymodel_olap.xml diff --git a/applications/product/ofbiz-component.xml b/applications/product/ofbiz-component.xml index ba10ec058a..9b1ebfa586 100644 --- a/applications/product/ofbiz-component.xml +++ b/applications/product/ofbiz-component.xml @@ -28,6 +28,8 @@ under the License. + + @@ -35,7 +37,8 @@ under the License. - + + @@ -53,8 +56,10 @@ under the License. + + diff --git a/specialpurpose/bi/script/org/ofbiz/bi/DimensionServices.xml b/applications/product/script/org/ofbiz/product/olap/ProductDimensionServices.xml similarity index 52% rename from specialpurpose/bi/script/org/ofbiz/bi/DimensionServices.xml rename to applications/product/script/org/ofbiz/product/olap/ProductDimensionServices.xml index 99ece626a4..86eca5d3b8 100644 --- a/specialpurpose/bi/script/org/ofbiz/bi/DimensionServices.xml +++ b/applications/product/script/org/ofbiz/product/olap/ProductDimensionServices.xml @@ -21,30 +21,6 @@ under the License. - - - - - - - - - - - - - - - - - - - - - - - - @@ -80,33 +56,4 @@ under the License. - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/specialpurpose/bi/servicedef/secas_product_olap.xml b/applications/product/servicedef/secas_olap.xml similarity index 100% rename from specialpurpose/bi/servicedef/secas_product_olap.xml rename to applications/product/servicedef/secas_olap.xml diff --git a/specialpurpose/bi/servicedef/services_product_olap.xml b/applications/product/servicedef/services_olap.xml similarity index 83% rename from specialpurpose/bi/servicedef/services_product_olap.xml rename to applications/product/servicedef/services_olap.xml index ca668c5c5a..77275f2fe5 100644 --- a/specialpurpose/bi/servicedef/services_product_olap.xml +++ b/applications/product/servicedef/services_olap.xml @@ -23,32 +23,32 @@ under the License. + location="org/ofbiz/product/olap/ProductDimensionServices.xml" invoke="prepareProductDimensionData"> Pulls information from the Product* entities (oltp entities) and prepares data for the ProductDimension entity (olap entity) + location="org/ofbiz/product/olap/ProductDimensionServices.xml" invoke="loadProductInProductDimension"> Pulls information from the Product* entities and stores them in the ProductDimension entity (olap entity) + location="org/ofbiz/product/olap/ProductDimensionServices.xml" invoke="loadProductInProductDimension"> Same as loadProductInProductDimension; the update strategy is 'type 1': overwrite the values of the attributes + location="org/ofbiz/product/olap/ProductDimensionServices.xml" invoke="loadProductInProductDimension"> Same as loadProductInProductDimension; the update strategy is 'type 2': add a dimension row + location="org/ofbiz/product/olap/ProductDimensionServices.xml" invoke="loadAllProductsInProductDimension"> Calls the loadProductInProductDimension service for all the products. - + diff --git a/specialpurpose/bi/build.xml b/framework/bi/build.xml similarity index 88% rename from specialpurpose/bi/build.xml rename to framework/bi/build.xml index 3bac21d114..f0d52c499d 100644 --- a/specialpurpose/bi/build.xml +++ b/framework/bi/build.xml @@ -39,12 +39,6 @@ under the License. - - - - - - diff --git a/specialpurpose/bi/config/BiUiLabels.xml b/framework/bi/config/BiUiLabels.xml similarity index 100% rename from specialpurpose/bi/config/BiUiLabels.xml rename to framework/bi/config/BiUiLabels.xml diff --git a/specialpurpose/bi/ofbiz-component.xml b/framework/bi/ofbiz-component.xml similarity index 51% rename from specialpurpose/bi/ofbiz-component.xml rename to framework/bi/ofbiz-component.xml index fb87760741..8487c76ed1 100644 --- a/specialpurpose/bi/ofbiz-component.xml +++ b/framework/bi/ofbiz-component.xml @@ -25,23 +25,8 @@ under the License. - - - - - - - - - - - + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/specialpurpose/bi/servicedef/services.xml b/framework/bi/servicedef/services.xml similarity index 100% rename from specialpurpose/bi/servicedef/services.xml rename to framework/bi/servicedef/services.xml diff --git a/specialpurpose/bi/src/org/ofbiz/bi/util/DimensionServices.java b/framework/bi/src/org/ofbiz/bi/util/DimensionServices.java similarity index 60% rename from specialpurpose/bi/src/org/ofbiz/bi/util/DimensionServices.java rename to framework/bi/src/org/ofbiz/bi/util/DimensionServices.java index e3593ed207..1371fbb7c8 100644 --- a/specialpurpose/bi/src/org/ofbiz/bi/util/DimensionServices.java +++ b/framework/bi/src/org/ofbiz/bi/util/DimensionServices.java @@ -120,72 +120,4 @@ public class DimensionServices { return ServiceUtil.returnSuccess(); } - /* - * Service used to initialize the Date dimension (DateDimension). - * The DateDimension entity is a nearly constant dimension ("Slowly Changing Dimension" or SCD): - * the default strategy to handle data change is "Type 1" (i.e. overwrite the values). - */ - public static Map loadDateDimension(DispatchContext ctx, Map context) { - GenericDelegator delegator = ctx.getDelegator(); - LocalDispatcher dispatcher = ctx.getDispatcher(); - - Date fromDate = (Date) context.get("fromDate"); - Date thruDate = (Date) context.get("thruDate"); - - SimpleDateFormat monthNameFormat = new SimpleDateFormat("MMMM"); - SimpleDateFormat dayNameFormat = new SimpleDateFormat("EEEE"); - SimpleDateFormat dayDescriptionFormat = new SimpleDateFormat("MMMM d, yyyy"); - SimpleDateFormat yearMonthDayFormat = new SimpleDateFormat("yyyy-MM-dd"); - SimpleDateFormat yearMonthFormat = new SimpleDateFormat("yyyy-MM"); - - Calendar calendar = Calendar.getInstance(); - calendar.setTime(fromDate); - calendar.set(Calendar.HOUR, 0); - calendar.set(Calendar.MINUTE, 0); - calendar.set(Calendar.SECOND, 0); - calendar.set(Calendar.MILLISECOND, 0); - Date currentDate = calendar.getTime(); - while (currentDate.compareTo(thruDate) <= 0) { - GenericValue dateValue = null; - try { - dateValue = EntityUtil.getFirst(delegator.findByAnd("DateDimension", UtilMisc.toMap("dateValue", currentDate))); - } catch(GenericEntityException gee) { - return ServiceUtil.returnError(gee.getMessage()); - } - boolean newValue = (dateValue == null); - if (newValue) { - dateValue = delegator.makeValue("DateDimension"); - dateValue.set("dimensionId", delegator.getNextSeqId("DateDimension")); - dateValue.set("dateValue", new java.sql.Date(currentDate.getTime())); - } - dateValue.set("description", dayDescriptionFormat.format(currentDate)); - int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK); - dateValue.set("dayName", dayNameFormat.format(currentDate)); - dateValue.set("dayOfMonth", new Long(calendar.get(Calendar.DAY_OF_MONTH))); - dateValue.set("dayOfYear", new Long(calendar.get(Calendar.DAY_OF_YEAR))); - dateValue.set("monthName", monthNameFormat.format(currentDate)); - - dateValue.set("monthOfYear", new Long(calendar.get(Calendar.MONTH) + 1)); - dateValue.set("yearName", new Long(calendar.get(Calendar.YEAR))); - dateValue.set("weekOfMonth", new Long(calendar.get(Calendar.WEEK_OF_MONTH))); - dateValue.set("weekOfYear", new Long(calendar.get(Calendar.WEEK_OF_YEAR))); - dateValue.set("weekdayType", (dayOfWeek == 1 || dayOfWeek == 7? "Weekend": "Weekday")); - dateValue.set("yearMonthDay", yearMonthDayFormat.format(currentDate)); - dateValue.set("yearAndMonth", yearMonthFormat.format(currentDate)); - - try { - if (newValue) { - dateValue.create(); - } else { - dateValue.store(); - } - } catch(GenericEntityException gee) { - return ServiceUtil.returnError(gee.getMessage()); - } - calendar.add(Calendar.DATE, 1); - currentDate = calendar.getTime(); - } - return ServiceUtil.returnSuccess(); - } - } diff --git a/specialpurpose/bi/webapp/bi/WEB-INF/actions/reportbuilder/getStarSchemaFields.bsh b/framework/bi/webapp/bi/WEB-INF/actions/reportbuilder/getStarSchemaFields.bsh similarity index 100% rename from specialpurpose/bi/webapp/bi/WEB-INF/actions/reportbuilder/getStarSchemaFields.bsh rename to framework/bi/webapp/bi/WEB-INF/actions/reportbuilder/getStarSchemaFields.bsh diff --git a/specialpurpose/bi/webapp/bi/WEB-INF/actions/reportbuilder/getStarSchemas.bsh b/framework/bi/webapp/bi/WEB-INF/actions/reportbuilder/getStarSchemas.bsh similarity index 100% rename from specialpurpose/bi/webapp/bi/WEB-INF/actions/reportbuilder/getStarSchemas.bsh rename to framework/bi/webapp/bi/WEB-INF/actions/reportbuilder/getStarSchemas.bsh diff --git a/specialpurpose/bi/webapp/bi/WEB-INF/actions/reportbuilder/runStarSchemaQuery.bsh b/framework/bi/webapp/bi/WEB-INF/actions/reportbuilder/runStarSchemaQuery.bsh similarity index 100% rename from specialpurpose/bi/webapp/bi/WEB-INF/actions/reportbuilder/runStarSchemaQuery.bsh rename to framework/bi/webapp/bi/WEB-INF/actions/reportbuilder/runStarSchemaQuery.bsh diff --git a/specialpurpose/bi/webapp/bi/WEB-INF/controller.xml b/framework/bi/webapp/bi/WEB-INF/controller.xml similarity index 100% rename from specialpurpose/bi/webapp/bi/WEB-INF/controller.xml rename to framework/bi/webapp/bi/WEB-INF/controller.xml diff --git a/specialpurpose/bi/webapp/bi/WEB-INF/web.xml b/framework/bi/webapp/bi/WEB-INF/web.xml similarity index 100% rename from specialpurpose/bi/webapp/bi/WEB-INF/web.xml rename to framework/bi/webapp/bi/WEB-INF/web.xml diff --git a/specialpurpose/bi/webapp/bi/reportbuilder/RenderStarSchemaReport.ftl b/framework/bi/webapp/bi/reportbuilder/RenderStarSchemaReport.ftl similarity index 100% rename from specialpurpose/bi/webapp/bi/reportbuilder/RenderStarSchemaReport.ftl rename to framework/bi/webapp/bi/reportbuilder/RenderStarSchemaReport.ftl diff --git a/specialpurpose/bi/webapp/bi/reportbuilder/SelectStarSchemaFields.ftl b/framework/bi/webapp/bi/reportbuilder/SelectStarSchemaFields.ftl similarity index 100% rename from specialpurpose/bi/webapp/bi/reportbuilder/SelectStarSchemaFields.ftl rename to framework/bi/webapp/bi/reportbuilder/SelectStarSchemaFields.ftl diff --git a/specialpurpose/bi/widget/BiForms.xml b/framework/bi/widget/BiForms.xml similarity index 100% rename from specialpurpose/bi/widget/BiForms.xml rename to framework/bi/widget/BiForms.xml diff --git a/specialpurpose/bi/widget/BiMenus.xml b/framework/bi/widget/BiMenus.xml similarity index 100% rename from specialpurpose/bi/widget/BiMenus.xml rename to framework/bi/widget/BiMenus.xml diff --git a/specialpurpose/bi/widget/BiScreens.xml b/framework/bi/widget/BiScreens.xml similarity index 100% rename from specialpurpose/bi/widget/BiScreens.xml rename to framework/bi/widget/BiScreens.xml diff --git a/framework/build.xml b/framework/build.xml index cb5e708dbc..067fd8eaa2 100644 --- a/framework/build.xml +++ b/framework/build.xml @@ -26,7 +26,7 @@ under the License. entity/build.xml,geronimo/build.xml, catalina/build.xml,jetty/build.xml, security/build.xml,service/build.xml,entityext/build.xml, - datafile/build.xml,minilang/build.xml, + bi/build.xml,datafile/build.xml,minilang/build.xml, common/build.xml, webapp/build.xml,guiapp/build.xml,widget/build.xml, testtools/build.xml, diff --git a/specialpurpose/bi/data/DimensionTypeData_common.xml b/framework/common/data/DimensionTypeData.xml similarity index 100% rename from specialpurpose/bi/data/DimensionTypeData_common.xml rename to framework/common/data/DimensionTypeData.xml diff --git a/specialpurpose/bi/entitydef/entitygroup_common_olap.xml b/framework/common/entitydef/entitygroup_olap.xml similarity index 100% rename from specialpurpose/bi/entitydef/entitygroup_common_olap.xml rename to framework/common/entitydef/entitygroup_olap.xml diff --git a/specialpurpose/bi/entitydef/entitymodel_common_olap.xml b/framework/common/entitydef/entitymodel_olap.xml similarity index 100% rename from specialpurpose/bi/entitydef/entitymodel_common_olap.xml rename to framework/common/entitydef/entitymodel_olap.xml diff --git a/framework/common/ofbiz-component.xml b/framework/common/ofbiz-component.xml index 3e890eb2b6..ffdc646783 100644 --- a/framework/common/ofbiz-component.xml +++ b/framework/common/ofbiz-component.xml @@ -26,6 +26,8 @@ under the License. + + @@ -49,9 +51,11 @@ under the License. + + diff --git a/framework/common/script/org/ofbiz/common/olap/CommonDimensionServices.xml b/framework/common/script/org/ofbiz/common/olap/CommonDimensionServices.xml new file mode 100644 index 0000000000..24edb9fd95 --- /dev/null +++ b/framework/common/script/org/ofbiz/common/olap/CommonDimensionServices.xml @@ -0,0 +1,48 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/specialpurpose/bi/servicedef/services_common_olap.xml b/framework/common/servicedef/services_olap.xml similarity index 88% rename from specialpurpose/bi/servicedef/services_common_olap.xml rename to framework/common/servicedef/services_olap.xml index e367368502..2dcb8d0381 100644 --- a/specialpurpose/bi/servicedef/services_common_olap.xml +++ b/framework/common/servicedef/services_olap.xml @@ -23,13 +23,13 @@ under the License. + location="org.ofbiz.common.olap.CommonDimensionServices" invoke="loadDateDimension" auth="true"> Loads data in the DateDimension entity (olap entity) using the update strategy of 'type 1': overwrite the values of the attributes + location="org/ofbiz/common/olap/CommonDimensionServices.xml" invoke="loadCurrencyDimension"> Loads data in the CurrencyDimension entity (olap entity) using the update strategy of 'type 1': overwrite the values of the attributes diff --git a/framework/common/src/org/ofbiz/common/CommonServices.java b/framework/common/src/org/ofbiz/common/CommonServices.java index c79a8e28bf..8f8d50997a 100644 --- a/framework/common/src/org/ofbiz/common/CommonServices.java +++ b/framework/common/src/org/ofbiz/common/CommonServices.java @@ -21,6 +21,7 @@ package org.ofbiz.common; import java.io.*; import java.nio.ByteBuffer; import java.sql.Timestamp; +import java.text.SimpleDateFormat; import java.util.*; import javax.mail.internet.MimeMessage; @@ -40,6 +41,7 @@ import org.ofbiz.entity.GenericEntityException; import org.ofbiz.entity.GenericValue; import org.ofbiz.entity.model.ModelEntity; import org.ofbiz.entity.transaction.TransactionUtil; +import org.ofbiz.entity.util.EntityUtil; import org.ofbiz.service.DispatchContext; import org.ofbiz.service.GenericServiceException; import org.ofbiz.service.LocalDispatcher; @@ -497,6 +499,5 @@ public class CommonServices { return ServiceUtil.returnError("Invalid count returned from database"); } } + } - - diff --git a/framework/common/src/org/ofbiz/common/olap/CommonDimensionServices.java b/framework/common/src/org/ofbiz/common/olap/CommonDimensionServices.java new file mode 100644 index 0000000000..c8722d097d --- /dev/null +++ b/framework/common/src/org/ofbiz/common/olap/CommonDimensionServices.java @@ -0,0 +1,129 @@ +/******************************************************************************* + * 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. + *******************************************************************************/ +package org.ofbiz.common.olap; + +import java.io.*; +import java.nio.ByteBuffer; +import java.sql.Timestamp; +import java.text.SimpleDateFormat; +import java.util.*; + +import javax.mail.internet.MimeMessage; +import javax.transaction.xa.XAException; + +import javolution.util.FastMap; + +import org.apache.log4j.Level; +import org.apache.log4j.Logger; +import org.ofbiz.base.util.Debug; +import org.ofbiz.base.util.UtilDateTime; +import static org.ofbiz.base.util.UtilGenerics.checkList; +import static org.ofbiz.base.util.UtilGenerics.checkMap; +import org.ofbiz.base.util.UtilMisc; +import org.ofbiz.entity.GenericDelegator; +import org.ofbiz.entity.GenericEntityException; +import org.ofbiz.entity.GenericValue; +import org.ofbiz.entity.model.ModelEntity; +import org.ofbiz.entity.transaction.TransactionUtil; +import org.ofbiz.entity.util.EntityUtil; +import org.ofbiz.service.DispatchContext; +import org.ofbiz.service.GenericServiceException; +import org.ofbiz.service.LocalDispatcher; +import org.ofbiz.service.ModelService; +import org.ofbiz.service.ServiceUtil; +import org.ofbiz.service.ServiceXaWrapper; +import org.ofbiz.service.mail.MimeMessageWrapper; + +/** + * Common Services + */ +public class CommonDimensionServices { + + public final static String module = CommonDimensionServices.class.getName(); + + /* + * OLAP Dimension + * Service used to initialize the Date dimension (DateDimension). + * The DateDimension entity is a nearly constant dimension ("Slowly Changing Dimension" or SCD): + * the default strategy to handle data change is "Type 1" (i.e. overwrite the values). + */ + public static Map loadDateDimension(DispatchContext ctx, Map context) { + GenericDelegator delegator = ctx.getDelegator(); + LocalDispatcher dispatcher = ctx.getDispatcher(); + + Date fromDate = (Date) context.get("fromDate"); + Date thruDate = (Date) context.get("thruDate"); + + SimpleDateFormat monthNameFormat = new SimpleDateFormat("MMMM"); + SimpleDateFormat dayNameFormat = new SimpleDateFormat("EEEE"); + SimpleDateFormat dayDescriptionFormat = new SimpleDateFormat("MMMM d, yyyy"); + SimpleDateFormat yearMonthDayFormat = new SimpleDateFormat("yyyy-MM-dd"); + SimpleDateFormat yearMonthFormat = new SimpleDateFormat("yyyy-MM"); + + Calendar calendar = Calendar.getInstance(); + calendar.setTime(fromDate); + calendar.set(Calendar.HOUR, 0); + calendar.set(Calendar.MINUTE, 0); + calendar.set(Calendar.SECOND, 0); + calendar.set(Calendar.MILLISECOND, 0); + Date currentDate = calendar.getTime(); + while (currentDate.compareTo(thruDate) <= 0) { + GenericValue dateValue = null; + try { + dateValue = EntityUtil.getFirst(delegator.findByAnd("DateDimension", UtilMisc.toMap("dateValue", currentDate))); + } catch(GenericEntityException gee) { + return ServiceUtil.returnError(gee.getMessage()); + } + boolean newValue = (dateValue == null); + if (newValue) { + dateValue = delegator.makeValue("DateDimension"); + dateValue.set("dimensionId", delegator.getNextSeqId("DateDimension")); + dateValue.set("dateValue", new java.sql.Date(currentDate.getTime())); + } + dateValue.set("description", dayDescriptionFormat.format(currentDate)); + int dayOfWeek = calendar.get(Calendar.DAY_OF_WEEK); + dateValue.set("dayName", dayNameFormat.format(currentDate)); + dateValue.set("dayOfMonth", new Long(calendar.get(Calendar.DAY_OF_MONTH))); + dateValue.set("dayOfYear", new Long(calendar.get(Calendar.DAY_OF_YEAR))); + dateValue.set("monthName", monthNameFormat.format(currentDate)); + + dateValue.set("monthOfYear", new Long(calendar.get(Calendar.MONTH) + 1)); + dateValue.set("yearName", new Long(calendar.get(Calendar.YEAR))); + dateValue.set("weekOfMonth", new Long(calendar.get(Calendar.WEEK_OF_MONTH))); + dateValue.set("weekOfYear", new Long(calendar.get(Calendar.WEEK_OF_YEAR))); + dateValue.set("weekdayType", (dayOfWeek == 1 || dayOfWeek == 7? "Weekend": "Weekday")); + dateValue.set("yearMonthDay", yearMonthDayFormat.format(currentDate)); + dateValue.set("yearAndMonth", yearMonthFormat.format(currentDate)); + + try { + if (newValue) { + dateValue.create(); + } else { + dateValue.store(); + } + } catch(GenericEntityException gee) { + return ServiceUtil.returnError(gee.getMessage()); + } + calendar.add(Calendar.DATE, 1); + currentDate = calendar.getTime(); + } + return ServiceUtil.returnSuccess(); + } + +} diff --git a/framework/component-load.xml b/framework/component-load.xml index 2d9270e540..c1a1de28d8 100644 --- a/framework/component-load.xml +++ b/framework/component-load.xml @@ -30,6 +30,7 @@ under the License. + diff --git a/specialpurpose/build.xml b/specialpurpose/build.xml index 7e81b0c974..b605b5afeb 100644 --- a/specialpurpose/build.xml +++ b/specialpurpose/build.xml @@ -26,7 +26,6 @@ hhfacility/build.xml, assetmaint/build.xml, oagis/build.xml, - bi/build.xml, googlebase/build.xml, ebay/build.xml, projectmgr/build.xml"/> diff --git a/specialpurpose/component-load.xml b/specialpurpose/component-load.xml index 71c1091792..037f43e46d 100644 --- a/specialpurpose/component-load.xml +++ b/specialpurpose/component-load.xml @@ -26,7 +26,6 @@ under the License. -