svn commit: r1820967 - in /ofbiz/ofbiz-framework/branches/release17.12: ./ framework/base/src/main/java/org/apache/ofbiz/base/OfbizDslDescriptorForEclipse.dsld framework/service/src/main/java/org/apache/ofbiz/service/engine/GroovyBaseScript.groovy

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

svn commit: r1820967 - in /ofbiz/ofbiz-framework/branches/release17.12: ./ framework/base/src/main/java/org/apache/ofbiz/base/OfbizDslDescriptorForEclipse.dsld framework/service/src/main/java/org/apache/ofbiz/service/engine/GroovyBaseScript.groovy

jleroux@apache.org
Author: jleroux
Date: Fri Jan 12 11:27:34 2018
New Revision: 1820967

URL: http://svn.apache.org/viewvc?rev=1820967&view=rev
Log:
"Applied fix from trunk for revision: 1820966  "
------------------------------------------------------------------------
r1820966 | jleroux | 2018-01-12 12:24:48 +0100 (ven., 12 janv. 2018) | 9 lines

Fixed: Correcting findOne() in OfbizDslDescriptorForEclipse.dsld
(OFBIZ-10159)

The method findOne() which is set in the OfbizDslDescriptorForEclipse.dsld is
wrong, since there is no implementation for this method, which only has a String
and a List as parameters. I changed it to the correct method, so it can be used
within groovy properly, also I put an implementation in the GroovyBaseScriptFile

Thanks: Dennis Balkir
------------------------------------------------------------------------

Modified:
    ofbiz/ofbiz-framework/branches/release17.12/   (props changed)
    ofbiz/ofbiz-framework/branches/release17.12/framework/base/src/main/java/org/apache/ofbiz/base/OfbizDslDescriptorForEclipse.dsld
    ofbiz/ofbiz-framework/branches/release17.12/framework/service/src/main/java/org/apache/ofbiz/service/engine/GroovyBaseScript.groovy

Propchange: ofbiz/ofbiz-framework/branches/release17.12/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Jan 12 11:27:34 2018
@@ -10,4 +10,4 @@
 /ofbiz/branches/json-integration-refactoring:1634077-1635900
 /ofbiz/branches/multitenant20100310:921280-927264
 /ofbiz/branches/release13.07:1547657
-/ofbiz/ofbiz-framework/trunk:1819499,1819598,1819800,1819805,1819811,1820038,1820262,1820374-1820375,1820441,1820457,1820644,1820658,1820790,1820823,1820862,1820949
+/ofbiz/ofbiz-framework/trunk:1819499,1819598,1819800,1819805,1819811,1820038,1820262,1820374-1820375,1820441,1820457,1820644,1820658,1820790,1820823,1820862,1820949,1820966

Modified: ofbiz/ofbiz-framework/branches/release17.12/framework/base/src/main/java/org/apache/ofbiz/base/OfbizDslDescriptorForEclipse.dsld
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/branches/release17.12/framework/base/src/main/java/org/apache/ofbiz/base/OfbizDslDescriptorForEclipse.dsld?rev=1820967&r1=1820966&r2=1820967&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/branches/release17.12/framework/base/src/main/java/org/apache/ofbiz/base/OfbizDslDescriptorForEclipse.dsld (original)
+++ ofbiz/ofbiz-framework/branches/release17.12/framework/base/src/main/java/org/apache/ofbiz/base/OfbizDslDescriptorForEclipse.dsld Fri Jan 12 11:27:34 2018
@@ -23,18 +23,18 @@ contribute(currentType(subType('groovy.l
  property name: 'delegator', type: 'org.apache.ofbiz.entity.Delegator'
  property name: 'dispatcher', type: 'org.apache.ofbiz.service.LocalDispatcher'
 
- method name: 'runService', type: 'java.util.Map', params: [serviceName: 'String', inputMap: 'java.util.Map']
- method name: 'makeValue', type: 'java.util.Map', params: [entityName: 'String']
- method name: 'findOne', type: 'java.util.Map', params: [entityName: 'String', inputMap: 'java.util.Map']
- method name: 'findList', type: 'java.util.List', params: [entityName: 'String', inputMap: 'java.util.Map']
- method name: 'select', type: 'org.apache.ofbiz.entity.util.EntityQuery', params: [entity: 'java.util.Set']
- method name: 'select', type: 'org.apache.ofbiz.entity.util.EntityQuery', params: [entity: 'String...']
- method name: 'from', type: 'org.apache.ofbiz.entity.util.EntityQuery', params: [entity: 'java.lang.Object']
- method name: 'success', type: 'def', params: [message: 'String']
- method name: 'failure', type: 'java.util.Map', params: [message: 'String']
- method name: 'error', type: 'def', params: [message: 'String']
- method name: 'logInfo', type: 'void', params: [message: 'String']
- method name: 'logWarning', type: 'void', params: [message: 'String']
- method name: 'logError', type: 'void', params: [message: 'String']
- method name: 'logVerbose', type: 'void', params: [message: 'String']
+    method name: 'runService', type: 'java.util.Map', params: [serviceName: 'String', inputMap: 'java.util.Map']
+    method name: 'makeValue', type: 'java.util.Map', params: [entityName: 'String']
+    method name: 'findOne', type: 'java.util.Map', params: [entityName: 'String', fields: 'java.util.Map', useCache: 'boolean']
+    method name: 'findList', type: 'java.util.List', params: [entityName: 'String', inputMap: 'java.util.Map']
+    method name: 'select', type: 'org.apache.ofbiz.entity.util.EntityQuery', params: [entity: 'java.util.Set']
+    method name: 'select', type: 'org.apache.ofbiz.entity.util.EntityQuery', params: [entity: 'String...']
+    method name: 'from', type: 'org.apache.ofbiz.entity.util.EntityQuery', params: [entity: 'java.lang.Object']
+    method name: 'success', type: 'def', params: [message: 'String']
+    method name: 'failure', type: 'java.util.Map', params: [message: 'String']
+    method name: 'error', type: 'def', params: [message: 'String']
+    method name: 'logInfo', type: 'void', params: [message: 'String']
+    method name: 'logWarning', type: 'void', params: [message: 'String']
+    method name: 'logError', type: 'void', params: [message: 'String']
+    method name: 'logVerbose', type: 'void', params: [message: 'String']
 }

Modified: ofbiz/ofbiz-framework/branches/release17.12/framework/service/src/main/java/org/apache/ofbiz/service/engine/GroovyBaseScript.groovy
URL: http://svn.apache.org/viewvc/ofbiz/ofbiz-framework/branches/release17.12/framework/service/src/main/java/org/apache/ofbiz/service/engine/GroovyBaseScript.groovy?rev=1820967&r1=1820966&r2=1820967&view=diff
==============================================================================
--- ofbiz/ofbiz-framework/branches/release17.12/framework/service/src/main/java/org/apache/ofbiz/service/engine/GroovyBaseScript.groovy (original)
+++ ofbiz/ofbiz-framework/branches/release17.12/framework/service/src/main/java/org/apache/ofbiz/service/engine/GroovyBaseScript.groovy Fri Jan 12 11:27:34 2018
@@ -18,6 +18,8 @@
  *******************************************************************************/
 package org.apache.ofbiz.service.engine
 
+import java.util.Map
+
 import org.apache.ofbiz.base.util.Debug
 import org.apache.ofbiz.entity.util.EntityQuery
 import org.apache.ofbiz.service.DispatchContext
@@ -25,6 +27,7 @@ import org.apache.ofbiz.service.LocalDis
 import org.apache.ofbiz.service.ModelService
 import org.apache.ofbiz.service.ServiceUtil
 import org.apache.ofbiz.service.ExecutionServiceException
+import org.apache.ofbiz.entity.GenericValue
 
 abstract class GroovyBaseScript extends Script {
     public static final String module = GroovyBaseScript.class.getName()
@@ -73,6 +76,10 @@ abstract class GroovyBaseScript extends
         return EntityQuery.use(binding.getVariable('delegator')).select(fields)
     }
 
+    GenericValue findOne(String entityName, Map<String, ? extends Object> fields, boolean useCache) {
+        return binding.getVariable('delegator').findOne(entityName, fields, useCache)
+    }
+
     def success(String message) {
         // TODO: implement some clever i18n mechanism based on the userLogin and locale in the binding
         if (this.binding.hasVariable('request')) {