This is an automated email from the ASF dual-hosted git repository.
gtchaboussie pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ofbiz-framework.git
The following commit(s) were added to refs/heads/trunk by this push:
new caa5bde27f Improved groovy dsl descriptor (#2096)
caa5bde27f is described below
commit caa5bde27f976065dba26e423563597a55b33fb1
Author: Gaetan <[email protected]>
AuthorDate: Mon Sep 28 09:41:33 2026 +0200
Improved groovy dsl descriptor (#2096)
Improved: Improved OFBiz intellij dsl descriptor
Explanation
Added various intellij method descriptors based on GroovyBaseScript.
Thanks Nicolas for the review
---------
Co-authored-by: cgaetan <[email protected]>
---
.../ofbiz/base/OfbizDslDescriptorForIntelliJ.gdsl | 48 ++++++++++++++++++----
.../ofbiz/service/engine/GroovyBaseScript.groovy | 14 +++----
2 files changed, 47 insertions(+), 15 deletions(-)
diff --git
a/framework/base/src/main/resources/org/apache/ofbiz/base/OfbizDslDescriptorForIntelliJ.gdsl
b/framework/base/src/main/resources/org/apache/ofbiz/base/OfbizDslDescriptorForIntelliJ.gdsl
index 0967303cec..81bbcdfe6d 100644
---
a/framework/base/src/main/resources/org/apache/ofbiz/base/OfbizDslDescriptorForIntelliJ.gdsl
+++
b/framework/base/src/main/resources/org/apache/ofbiz/base/OfbizDslDescriptorForIntelliJ.gdsl
@@ -29,20 +29,52 @@ contributor(groovyContext) {
property name: 'security', type: 'org.apache.ofbiz.security.Security'
method name: 'runService', type: 'java.util.Map', params: [serviceName:
'String', inputMap: 'java.util.Map']
+ method name: 'runAsyncService', type: 'void', params: [serviceName:
'String', inputMap: 'java.util.Map']
method name: 'run', type: 'java.util.Map', params: [args: '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: 'runAsync', type: 'void', params: [args: '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: 'makeValue', type: 'org.apache.ofbiz.entity.GenericValue',
params: [entityName: 'String']
+ method name: 'makeValue', type: 'org.apache.ofbiz.entity.GenericValue',
params: [entityName: 'String', inputMap: 'java.util.Map']
+ method name: 'from', type: 'org.apache.ofbiz.entity.util.EntityQuery',
params: [entityName: 'String']
+ method name: 'from', type: 'org.apache.ofbiz.entity.util.EntityQuery',
params: [dynamicViewEntity: 'org.apache.ofbiz.entity.model.DynamicViewEntity']
+ method name: 'select', type: 'org.apache.ofbiz.entity.util.EntityQuery',
params: [fields: 'String...']
+ method name: 'select', type: 'org.apache.ofbiz.entity.util.EntityQuery',
params: [fields: 'java.util.Set<String>']
+
+ method name: 'create', type: 'org.apache.ofbiz.entity.GenericValue',
params: [entityName: 'String', fields: 'java.util.Map']
+ method name: 'update', type:
'org.apache.ofbiz.service.engine.EntityUpdateBuilder', params: [entityName:
'String']
+ method name: 'delete', type:
'org.apache.ofbiz.service.engine.EntityDeleteBuilder', params: [entityName:
'String']
+
+ method name: 'success', type: 'java.util.Map'
+ method name: 'success', type: 'java.util.Map', params: [message: 'String']
+ method name: 'success', type: 'java.util.Map', params: [returnValues:
'java.util.Map']
+ method name: 'success', type: 'java.util.Map', params: [message: 'String',
returnValues: 'java.util.Map']
+ method name: 'success', type: 'java.util.Map', params: [resource:
'String', key: 'String']
+ method name: 'success', type: 'java.util.Map', params: [resource:
'String', key: 'String',
+ context:
'java.util.Map', returnValues: 'java.util.Map']
- 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: 'failure', type: 'java.util.Map', params: [message: 'String',
returnValues: 'java.util.Map']
+ method name: 'failure', type: 'java.util.Map', params: [resource:
'String', key: 'String', returnValues: 'java.util.Map']
+ method name: 'error', type: 'java.util.Map', params: [message: 'String']
+ method name: 'error', type: 'java.util.Map', params: [resource: 'String',
key: 'String']
+ method name: 'error', type: 'java.util.Map', params: [resource: 'String',
key: 'String', context: 'java.util.Map']
+
+ method name: 'logVerbose', type: 'void', 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: 'logError', type: 'void', params: [t: 'java.lang.Throwable']
+ method name: 'logError', type: 'void', params: [t: 'java.lang.Throwable',
message: 'String']
+
+ method name: 'label', type: 'String', params: [ressource: 'String',
message: 'String']
+ method name: 'label', type: 'String', params: [ressource: 'String',
message: 'String', context: 'java.util.Map']
+
+ method name: 'fail', type: 'void', params: [message: 'String']
+ method name: 'fail', type: 'void', params: [resource: 'String', key:
'String']
+ method name: 'fail', type: 'void', params: [resource: 'String', key:
'String', context: 'java.util.Map']
+
+ method name: 'require', type: 'void', params: [condition: 'boolean',
message: 'String']
+ method name: 'require', type: 'void', params: [condition: 'boolean',
resource: 'String', key: 'String']
+ method name: 'require', type: 'void', params: [condition: 'boolean',
resource: 'String', key: 'String', context: 'java.util.Map']
}
diff --git
a/framework/service/src/main/groovy/org/apache/ofbiz/service/engine/GroovyBaseScript.groovy
b/framework/service/src/main/groovy/org/apache/ofbiz/service/engine/GroovyBaseScript.groovy
index 4339b77515..ea0e756d3a 100644
---
a/framework/service/src/main/groovy/org/apache/ofbiz/service/engine/GroovyBaseScript.groovy
+++
b/framework/service/src/main/groovy/org/apache/ofbiz/service/engine/GroovyBaseScript.groovy
@@ -70,11 +70,11 @@ abstract class GroovyBaseScript extends Script {
runAsyncService((String)args.get('service'), (Map)args.get('with',
[:]))
}
- Map makeValue(String entityName) throws ExecutionServiceException {
+ GenericValue makeValue(String entityName) throws ExecutionServiceException
{
return binding.getVariable('delegator').makeValue(entityName)
}
- Map makeValue(String entityName, Map inputMap) throws
ExecutionServiceException {
+ GenericValue makeValue(String entityName, Map inputMap) throws
ExecutionServiceException {
return binding.getVariable('delegator').makeValidValue(entityName,
inputMap)
}
@@ -113,16 +113,16 @@ abstract class GroovyBaseScript extends Script {
}
/* codenarc-disable NoDef, MethodReturnTypeRequired */
- def success(Map returnValues) {
+ Map success(Map returnValues) {
return success(null, returnValues)
}
- def success(String resource, String key, Map returnValues = [:]) {
+ Map success(String resource, String key, Map returnValues = [:]) {
return success(label(resource, key), returnValues)
}
- def success(String resource, String key, Map context, Map returnValues) {
+ Map success(String resource, String key, Map context, Map returnValues) {
return success(label(resource, key, context), returnValues)
}
- def success(String message = '', Map returnValues = [:]) {
+ Map success(String message = '', Map returnValues = [:]) {
if (this.binding.hasVariable('request')) {
// the script is invoked as an "event"
if (message) {
@@ -162,7 +162,7 @@ abstract class GroovyBaseScript extends Script {
return error(label(resource, key, context))
}
/* codenarc-disable NoDef, MethodReturnTypeRequired */
- def error(String message) {
+ Map error(String message) {
if (this.binding.hasVariable('request')) {
// the script is invoked as an "event"
if (message) {