You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ofbiz.apache.org by de...@apache.org on 2017/07/24 06:13:12 UTC

svn commit: r1802753 - in /ofbiz/ofbiz-framework/trunk/applications: accounting/groovyScripts/admin/ accounting/groovyScripts/payment/ accounting/groovyScripts/rate/ workeffort/groovyScripts/workeffort/calendar/

Author: deepak
Date: Mon Jul 24 06:13:11 2017
New Revision: 1802753

URL: http://svn.apache.org/viewvc?rev=1802753&view=rev
Log:
Improved: Used ModelService.IN_PARAM instead of hard coded "IN" in groovy file.

Modified:
    ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/admin/AcctgAdminServices.groovy
    ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/payment/FindInvoicesByDueDate.groovy
    ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/rate/RateServices.groovy
    ofbiz/ofbiz-framework/trunk/applications/workeffort/groovyScripts/workeffort/calendar/Days.groovy
    ofbiz/ofbiz-framework/trunk/applications/workeffort/groovyScripts/workeffort/calendar/Month.groovy
    ofbiz/ofbiz-framework/trunk/applications/workeffort/groovyScripts/workeffort/calendar/Week.groovy

Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/admin/AcctgAdminServices.groovy
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/admin/AcctgAdminServices.groovy?rev=1802753&r1=1802752&r2=1802753&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/admin/AcctgAdminServices.groovy (original)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/admin/AcctgAdminServices.groovy Mon Jul 24 06:13:11 2017
@@ -23,6 +23,8 @@ import org.apache.ofbiz.base.util.UtilPr
 import org.apache.ofbiz.entity.condition.EntityConditionBuilder
 import org.apache.ofbiz.entity.GenericValue
 import org.apache.ofbiz.entity.util.EntityUtil
+import org.apache.ofbiz.service.ModelService
+
 
 def createPartyAcctgPreference() {
     //check that the party is an INTERNAL_ORGANIZATION, as defined in PartyRole
@@ -120,7 +122,7 @@ def updateFXConversion() {
     delegator.storeAll(uomConversions)
 
     //now create a new conversion relationship
-    Map createParams = dispatcher.getDispatchContext().makeValidContext("createUomConversionDated", "IN", parameters)
+    Map createParams = dispatcher.getDispatchContext().makeValidContext("createUomConversionDated", ModelService.IN_PARAM, parameters)
     if (!parameters.fromDate) {
         createParams.put("fromDate", nowTimestamp)
     }

Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/payment/FindInvoicesByDueDate.groovy
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/payment/FindInvoicesByDueDate.groovy?rev=1802753&r1=1802752&r2=1802753&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/payment/FindInvoicesByDueDate.groovy (original)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/payment/FindInvoicesByDueDate.groovy Mon Jul 24 06:13:11 2017
@@ -17,10 +17,11 @@
  * under the License.
  */
 
+import org.apache.ofbiz.service.ModelService
 context.invoicePaymentInfoList = []
 
 if (parameters.invoiceTypeId) { // it's not the initialisation but a real search request
-    serviceCtx = dispatcher.getDispatchContext().makeValidContext("getInvoicePaymentInfoListByDueDateOffset", "IN", parameters)
+    serviceCtx = dispatcher.getDispatchContext().makeValidContext("getInvoicePaymentInfoListByDueDateOffset", ModelService.IN_PARAM, parameters)
     result = runService("getInvoicePaymentInfoListByDueDateOffset", serviceCtx)
     context.invoicePaymentInfoList = result.invoicePaymentInfoList 
 }

Modified: ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/rate/RateServices.groovy
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/rate/RateServices.groovy?rev=1802753&r1=1802752&r2=1802753&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/rate/RateServices.groovy (original)
+++ ofbiz/ofbiz-framework/trunk/applications/accounting/groovyScripts/rate/RateServices.groovy Mon Jul 24 06:13:11 2017
@@ -21,8 +21,10 @@ import org.apache.ofbiz.base.util.UtilDa
 import org.apache.ofbiz.base.util.UtilProperties
 import org.apache.ofbiz.entity.GenericValue
 import org.apache.ofbiz.entity.util.EntityUtil
+import org.apache.ofbiz.service.ModelService
 import org.apache.ofbiz.service.ServiceUtil
 
+
 import java.sql.Timestamp
 
 
@@ -48,7 +50,7 @@ def updateRateAmount() {
     if (rateAmountLookedUpValue) {
         updating = (rateAmountLookedUpValue.fromDate.compareTo(newEntity.fromDate) == 0)
         if (rateAmountLookedUpValue.rateAmount != rateAmount) {
-            Map expireRateAmountMap = dispatcher.getDispatchContext().makeValidContext('expireRateAmount', 'IN', rateAmountLookedUpValue)
+            Map expireRateAmountMap = dispatcher.getDispatchContext().makeValidContext('expireRateAmount', ModelService.IN_PARAM, rateAmountLookedUpValue)
             result = run service: 'expireRateAmount', with: expireRateAmountMap
             if (ServiceUtil.isError(result)) return result
         } else {
@@ -105,7 +107,7 @@ def updatePartyRate() {
         }
     }
     if (parameters.rateAmount) {
-        Map createRateAmountMap = dispatcher.getDispatchContext().makeValidContext('updateRateAmount', 'IN', parameters)
+        Map createRateAmountMap = dispatcher.getDispatchContext().makeValidContext('updateRateAmount', ModelService.IN_PARAM, parameters)
         result = run service: 'updateRateAmount', with: createRateAmountMap
         if (ServiceUtil.isError(result)) return result
     }
@@ -121,7 +123,7 @@ def expirePartyRate() {
         lookedUpValue.store()
 
         //expire related rate amount
-        Map expireRateAmountMap = dispatcher.getDispatchContext().makeValidContext('expireRateAmount', 'IN', parameters)
+        Map expireRateAmountMap = dispatcher.getDispatchContext().makeValidContext('expireRateAmount', ModelService.IN_PARAM, parameters)
         result = run service: 'expireRateAmount', with: expireRateAmountMap
         if (ServiceUtil.isError(result)) return result
     }
@@ -163,7 +165,7 @@ def getRateAmount() {
         serviceName = 'getRatesAmountsFromEmplPositionTypeId'
     }
     if (serviceName) {
-        Map serviceContextMap = dispatcher.getDispatchContext().makeValidContext(serviceName, "IN", parameters)
+        Map serviceContextMap = dispatcher.getDispatchContext().makeValidContext(serviceName, ModelService.IN_PARAM, parameters)
         if (!parameters.rateCurrencyUomId) {
             serviceContextMap.rateCurrencyUomId = UtilProperties.getPropertyValue('general.properties', 'currency.uom.id.default', 'USD')
         }
@@ -175,7 +177,7 @@ def getRateAmount() {
 
     if (!ratesList) {
         ratesList = from('RateAmount').where([rateTypeId: parameters.rateTypeId]).queryList();
-        Map serviceContextMap = dispatcher.getDispatchContext().makeValidContext("filterRateAmountList", "IN", parameters)
+        Map serviceContextMap = dispatcher.getDispatchContext().makeValidContext("filterRateAmountList", ModelService.IN_PARAM, parameters)
         serviceContextMap.ratesList = ratesList
         Map result = run service: 'filterRateAmountList', with: serviceContextMap
         ratesList = EntityUtil.filterByDate(result.filteredRatesList)

Modified: ofbiz/ofbiz-framework/trunk/applications/workeffort/groovyScripts/workeffort/calendar/Days.groovy
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/workeffort/groovyScripts/workeffort/calendar/Days.groovy?rev=1802753&r1=1802752&r2=1802753&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/workeffort/groovyScripts/workeffort/calendar/Days.groovy (original)
+++ ofbiz/ofbiz-framework/trunk/applications/workeffort/groovyScripts/workeffort/calendar/Days.groovy Mon Jul 24 06:13:11 2017
@@ -21,6 +21,7 @@ import java.sql.Timestamp
 import org.apache.ofbiz.base.util.UtilDateTime
 import org.apache.ofbiz.base.util.UtilMisc
 import org.apache.ofbiz.base.util.UtilValidate
+import org.apache.ofbiz.service.ModelService
 
 String startParam = parameters.startTime
 Timestamp start = null
@@ -36,7 +37,7 @@ Timestamp prev = UtilDateTime.getDayStar
 context.prevMillis = new Long(prev.getTime()).toString()
 Timestamp next = UtilDateTime.getDayStart(start, 1, timeZone, locale)
 context.nextMillis = new Long(next.getTime()).toString()
-Map serviceCtx = dispatcher.getDispatchContext().makeValidContext("getWorkEffortEventsByPeriod", "IN", parameters)
+Map serviceCtx = dispatcher.getDispatchContext().makeValidContext("getWorkEffortEventsByPeriod", ModelService.IN_PARAM, parameters)
 serviceCtx.putAll(UtilMisc.toMap("userLogin", userLogin, "start", start, "numPeriods", 24, "periodType", Calendar.HOUR, "locale", locale, "timeZone", timeZone))
 if (context.entityExprList) {
     serviceCtx.entityExprList = entityExprList

Modified: ofbiz/ofbiz-framework/trunk/applications/workeffort/groovyScripts/workeffort/calendar/Month.groovy
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/workeffort/groovyScripts/workeffort/calendar/Month.groovy?rev=1802753&r1=1802752&r2=1802753&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/workeffort/groovyScripts/workeffort/calendar/Month.groovy (original)
+++ ofbiz/ofbiz-framework/trunk/applications/workeffort/groovyScripts/workeffort/calendar/Month.groovy Mon Jul 24 06:13:11 2017
@@ -21,6 +21,7 @@ import java.sql.Timestamp
 import org.apache.ofbiz.base.util.UtilDateTime
 import org.apache.ofbiz.base.util.UtilMisc
 import org.apache.ofbiz.base.util.UtilValidate
+import org.apache.ofbiz.service.ModelService
 
 String startParam = parameters.startTime
 Timestamp start = null
@@ -58,7 +59,7 @@ if (followingMonthDays < 0) {
     followingMonthDays += 7
 }
 numDays += followingMonthDays
-Map serviceCtx = dispatcher.getDispatchContext().makeValidContext("getWorkEffortEventsByPeriod", "IN", parameters)
+Map serviceCtx = dispatcher.getDispatchContext().makeValidContext("getWorkEffortEventsByPeriod", ModelService.IN_PARAM, parameters)
 serviceCtx.putAll(UtilMisc.toMap("userLogin", userLogin, "start", getFrom, "calendarType", "VOID", "numPeriods", numDays, "periodType", Calendar.DATE, "locale", locale, "timeZone", timeZone))
 if (context.entityExprList) {
     serviceCtx.entityExprList = entityExprList

Modified: ofbiz/ofbiz-framework/trunk/applications/workeffort/groovyScripts/workeffort/calendar/Week.groovy
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/trunk/applications/workeffort/groovyScripts/workeffort/calendar/Week.groovy?rev=1802753&r1=1802752&r2=1802753&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/trunk/applications/workeffort/groovyScripts/workeffort/calendar/Week.groovy (original)
+++ ofbiz/ofbiz-framework/trunk/applications/workeffort/groovyScripts/workeffort/calendar/Week.groovy Mon Jul 24 06:13:11 2017
@@ -21,6 +21,7 @@ import java.sql.Timestamp
 import org.apache.ofbiz.base.util.UtilDateTime
 import org.apache.ofbiz.base.util.UtilMisc
 import org.apache.ofbiz.base.util.UtilValidate
+import org.apache.ofbiz.service.ModelService
 
 String startParam = parameters.startTime
 Timestamp start = null
@@ -37,7 +38,7 @@ context.prevMillis = new Long(prev.getTi
 Timestamp next = UtilDateTime.getDayStart(start, 7, timeZone, locale)
 context.nextMillis = new Long(next.getTime()).toString()
 Timestamp end = UtilDateTime.getDayStart(start, 6, timeZone, locale)
-Map serviceCtx = dispatcher.getDispatchContext().makeValidContext("getWorkEffortEventsByPeriod", "IN", parameters)
+Map serviceCtx = dispatcher.getDispatchContext().makeValidContext("getWorkEffortEventsByPeriod", ModelService.IN_PARAM, parameters)
 serviceCtx.putAll(UtilMisc.toMap("userLogin", userLogin, "start", start, "numPeriods", 7, "periodType", Calendar.DATE, "locale", locale, "timeZone", timeZone))
 if (context.entityExprList) {
     serviceCtx.entityExprList = entityExprList