Re: Suggest to improve groovy DSL

2017-06-30 Thread Jacques Le Roux

Hi Nico,

Did not read it all, but sounds promising. Going to bed anyway :D

Jacques


Le 30/06/2017 à 23:33, Nicolas Malin a écrit :

Hello

I found some idea to improve the groovy DSL during my first try to convert 
mini-lang.
I don't know if it's possible or logical at this time but I just sharing my 
mind :)


entity-one : with the minilang is really usefull to call directly a entity like 
that

currently with groovy
GenericValue product = from("Product").where([productId: 
productId).findOne()
we lose the automapping so I imagine a syntax like that :
GenericValue product = from("Product").autoMap(groovyCtx).findOne()
or
GenericValue product = from("Product").findOne(groovyCtx)
or
GenericValue product = from("Product").resolveOne(groovyCtx)
or something like that

Make valid service context :
in minilang

Currently with groovy we need to call the dispatchcontext
Map createProductMap = 
dispatcher.getDispatchContext().makeValidContext('createProduct', 'IN', 
parameters)
My idea would be like that
Map createProductMap = prepare service: 'createProduct' //to pool from 
groovyCtx
or
Map createProductMap = prepare service: 'createProduct' with: parameters 
//to pool from parameters
or
Map createProductMap = prepare service: 'createProduct' with: parameters 
mode: 'IN' //to pool from parameters and indicate the mode

It's would be the same to prepare a genericValue:
GenericValue product = prepare entity: 'Product' with: parameters

Resolve a label
in minilang

in groovy
String message = UtilProperties.getMessage('AccountingErrorUiLabels', 
'AccountingUpdateRateAmountAlreadyExist', locale)
My idea
String message = message: 'AccountingUpdateRateAmountAlreadyExist', from: 
'AccountingErrorUiLabels', with: 'messageCtx'

Security control
in minilang

in groovy
if (security.hasPermission("ACCOUNTING_CREATE", userLogin))
My idea
if (has permission: 'ACCOUNTING_CREATE')
***

I tried to implement "prepapre" for fun with success below :)

Index: 
framework/service/src/main/java/org/apache/ofbiz/service/engine/GroovyBaseScript.groovy
===
--- 
framework/service/src/main/java/org/apache/ofbiz/service/engine/GroovyBaseScript.groovy
 (révision 1800195)
+++ 
framework/service/src/main/java/org/apache/ofbiz/service/engine/GroovyBaseScript.groovy
 (copie de travail)
@@ -19,6 +19,8 @@
 package org.apache.ofbiz.service.engine

 import org.apache.ofbiz.base.util.Debug
+import org.apache.ofbiz.entity.finder.PrimaryKeyFinder
+import org.apache.ofbiz.entity.model.ModelEntity
 import org.apache.ofbiz.entity.util.EntityQuery
 import org.apache.ofbiz.service.ServiceUtil
 import org.apache.ofbiz.service.ExecutionServiceException
@@ -47,6 +49,15 @@
 return runService((String)args.get('service'), (Map)args.get('with', 
new HashMap()))
 }

+Map prepare(Map args) throws ExecutionServiceException {
+if ((String)args.get('service')) {
+return result = binding.getVariable('dispatcher').getDispatchContext().makeValidContext((String) args.get('service'), "IN", (Map) 
args.get('with', binding.getVariable('parameters')))

+}
+if ((String)args.get('entity')) {
+return result = binding.getVariable('delegator').makeValidValue((String) args.get('entity'), (Map) args.get('with', 
binding.getVariable('parameters')))

+}
+}
+
 Map makeValue(String entityName) throws ExecutionServiceException {
 return result = binding.getVariable('delegator').makeValue(entityName)
 }
@@ -63,6 +74,13 @@
 return EntityQuery.use(binding.getVariable('delegator')).select(fields)
 }

+Map fromOneAuto(def entity) {
+Debug.logError( ' ' + binding.getVariables(), '##')
+return result = 
PrimaryKeyFinder.runFind(binding.getVariable('delegator').getModelEntity(entity),
+binding.getVariables(), binding.getVariable('delegator'), 
true, true, null, null)
+
+}
+
 def success(String message) {
 // TODO: implement some clever i18n mechanism based on the userLogin 
and locale in the binding
 if (this.binding.hasVariable('request')) {
Index: 
applications/accounting/groovyScripts/payment/FindInvoicesByDueDate.groovy
===
--- applications/accounting/groovyScripts/payment/FindInvoicesByDueDate.groovy 
(révision 1800195)
+++ applications/accounting/groovyScripts/payment/FindInvoicesByDueDate.groovy 
(copie de travail)
@@ -20,7 +20,7 @@
 context.invoicePaymentInfoList = []

 if (parameters.invoiceTypeId) { // it's not the initialisation but a real 
search request
-serviceCtx = 
dispatcher.getDispatchContext().makeValidContext("getInvoicePaymentInfoListByDueDateOffset",
 "IN", parameters)
+serviceCtx = prepare service: 'getInvoicePaymentInfoListByDueDateOffset'
 result = runService("getInvoicePaymentInfoListByDueDate

Suggest to improve groovy DSL

2017-06-30 Thread Nicolas Malin

Hello

I found some idea to improve the groovy DSL during my first try to 
convert mini-lang.
I don't know if it's possible or logical at this time but I just sharing 
my mind :)



entity-one : with the minilang is really usefull to call directly a 
entity like that


currently with groovy
GenericValue product = from("Product").where([productId: 
productId).findOne()

we lose the automapping so I imagine a syntax like that :
GenericValue product = from("Product").autoMap(groovyCtx).findOne()
or
GenericValue product = from("Product").findOne(groovyCtx)
or
GenericValue product = from("Product").resolveOne(groovyCtx)
or something like that

Make valid service context :
in minilang
to-map="createProductMap"/>

Currently with groovy we need to call the dispatchcontext
Map createProductMap = 
dispatcher.getDispatchContext().makeValidContext('createProduct', 'IN', 
parameters)

My idea would be like that
Map createProductMap = prepare service: 'createProduct' //to pool 
from groovyCtx

or
Map createProductMap = prepare service: 'createProduct' with: 
parameters //to pool from parameters

or
Map createProductMap = prepare service: 'createProduct' with: 
parameters mode: 'IN' //to pool from parameters and indicate the mode


It's would be the same to prepare a genericValue:
GenericValue product = prepare entity: 'Product' with: parameters

Resolve a label
in minilang
property="AccountingCreatePaymentPermissionError"/>

in groovy
String message = 
UtilProperties.getMessage('AccountingErrorUiLabels', 
'AccountingUpdateRateAmountAlreadyExist', locale)

My idea
String message = message: 'AccountingUpdateRateAmountAlreadyExist', 
from: 'AccountingErrorUiLabels', with: 'messageCtx'


Security control
in minilang

in groovy
if (security.hasPermission("ACCOUNTING_CREATE", userLogin))
My idea
if (has permission: 'ACCOUNTING_CREATE')
***

I tried to implement "prepapre" for fun with success below :)

Index: 
framework/service/src/main/java/org/apache/ofbiz/service/engine/GroovyBaseScript.groovy

===
--- 
framework/service/src/main/java/org/apache/ofbiz/service/engine/GroovyBaseScript.groovy 
(révision 1800195)
+++ 
framework/service/src/main/java/org/apache/ofbiz/service/engine/GroovyBaseScript.groovy 
(copie de travail)

@@ -19,6 +19,8 @@
 package org.apache.ofbiz.service.engine

 import org.apache.ofbiz.base.util.Debug
+import org.apache.ofbiz.entity.finder.PrimaryKeyFinder
+import org.apache.ofbiz.entity.model.ModelEntity
 import org.apache.ofbiz.entity.util.EntityQuery
 import org.apache.ofbiz.service.ServiceUtil
 import org.apache.ofbiz.service.ExecutionServiceException
@@ -47,6 +49,15 @@
 return runService((String)args.get('service'), 
(Map)args.get('with', new HashMap()))

 }

+Map prepare(Map args) throws ExecutionServiceException {
+if ((String)args.get('service')) {
+return result = 
binding.getVariable('dispatcher').getDispatchContext().makeValidContext((String) 
args.get('service'), "IN", (Map) args.get('with', 
binding.getVariable('parameters')))

+}
+if ((String)args.get('entity')) {
+return result = 
binding.getVariable('delegator').makeValidValue((String) 
args.get('entity'), (Map) args.get('with', 
binding.getVariable('parameters')))

+}
+}
+
 Map makeValue(String entityName) throws ExecutionServiceException {
 return result = 
binding.getVariable('delegator').makeValue(entityName)

 }
@@ -63,6 +74,13 @@
 return 
EntityQuery.use(binding.getVariable('delegator')).select(fields)

 }

+Map fromOneAuto(def entity) {
+Debug.logError( ' ' + binding.getVariables(), '##')
+return result = 
PrimaryKeyFinder.runFind(binding.getVariable('delegator').getModelEntity(entity),
+binding.getVariables(), 
binding.getVariable('delegator'), true, true, null, null)

+
+}
+
 def success(String message) {
 // TODO: implement some clever i18n mechanism based on the 
userLogin and locale in the binding

 if (this.binding.hasVariable('request')) {
Index: 
applications/accounting/groovyScripts/payment/FindInvoicesByDueDate.groovy

===
--- 
applications/accounting/groovyScripts/payment/FindInvoicesByDueDate.groovy 
(révision 1800195)
+++ 
applications/accounting/groovyScripts/payment/FindInvoicesByDueDate.groovy 
(copie de travail)

@@ -20,7 +20,7 @@
 context.invoicePaymentInfoList = []

 if (parameters.invoiceTypeId) { // it's not the initialisation but a 
real search request
-serviceCtx = 
dispatcher.getDispatchContext().makeValidContext("getInvoicePaymentInfoListByDueDateOffset", 
"IN", parameters)
+serviceCtx = prepare service: 
'getInvoicePaymentInfoListByDueDateOffset'
 result = runService("getInvoicePaymentInfoListByDueDateOffset", 
serviceCtx)


buildbot success in on ofbiz-trunk-framework-plugins

2017-06-30 Thread buildbot
The Buildbot has detected a restored build on builder 
ofbiz-trunk-framework-plugins while building . Full details are available at:
https://ci.apache.org/builders/ofbiz-trunk-framework-plugins/builds/200

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: orcus_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 'on-ofbiz-plugins-commit' 
triggered this build
Build Source Stamp: [branch ofbiz/ofbiz-plugins/trunk] 1800457
Blamelist: jleroux

Build succeeded!

Sincerely,
 -The Buildbot





Re: svn commit: r1795781 - in /ofbiz/ofbiz-plugins/trunk: lucene/build.gradle solr/build.gradle

2017-06-30 Thread Jacques Le Roux

Hi Michael,

You don't have to worry about that. I fixed the whole thing at revision: 
1800457. Hint: it was not correctly done even for Solr.

Jacques


Le 29/06/2017 à 21:41, Michael Brohl a écrit :

Hi Jacques,

why do we need the solr.log.dir in the Lucene plugin? I think the it only 
belongs in the Solr Plugin.

I'll remove it during my work on 
https://issues.apache.org/jira/browse/OFBIZ-9440 if there are no objections.

Regards,

Michael


Am 22.05.17 um 11:18 schrieb jler...@apache.org:

Author: jleroux
Date: Mon May 22 09:18:25 2017
New Revision: 1795781

URL: http://svn.apache.org/viewvc?rev=1795781&view=rev
Log:
Improved: Missing Java Option solr.log.dir. Logging may be missing or incomplete
(OFBIZ-)

I noticed this error in trunk demo error.log but could not reproduce locally
(Windows)

Jinghai suggested the fix committed, Taher mentioned it should be in plugins


Thanks: Jinghai and Taher

Modified:
 ofbiz/ofbiz-plugins/trunk/lucene/build.gradle
 ofbiz/ofbiz-plugins/trunk/solr/build.gradle

Modified: ofbiz/ofbiz-plugins/trunk/lucene/build.gradle
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/lucene/build.gradle?rev=1795781&r1=1795780&r2=1795781&view=diff
==
--- ofbiz/ofbiz-plugins/trunk/lucene/build.gradle (original)
+++ ofbiz/ofbiz-plugins/trunk/lucene/build.gradle Mon May 22 09:18:25 2017
@@ -20,4 +20,7 @@ dependencies {
  pluginLibsCompile 'org.apache.lucene:lucene-core:6.5.1'
  pluginLibsCompile 'org.apache.lucene:lucene-queryparser:6.5.1'
  pluginLibsCompile 'org.apache.lucene:lucene-analyzers-common:6.5.1'
-}
\ No newline at end of file
+}
+def jvmArguments = ['-Xms128M', '-Xmx1024M',
+'-Dsolr.log.dir=runtime/logs',
+'-Dsolr.log.level=INFO']

Modified: ofbiz/ofbiz-plugins/trunk/solr/build.gradle
URL: 
http://svn.apache.org/viewvc/ofbiz/ofbiz-plugins/trunk/solr/build.gradle?rev=1795781&r1=1795780&r2=1795781&view=diff
==
--- ofbiz/ofbiz-plugins/trunk/solr/build.gradle (original)
+++ ofbiz/ofbiz-plugins/trunk/solr/build.gradle Mon May 22 09:18:25 2017
@@ -19,3 +19,6 @@
  dependencies {
  pluginLibsCompile 'org.apache.solr:solr-core:6.5.1'
  }
+def jvmArguments = ['-Xms128M', '-Xmx1024M',
+'-Dsolr.log.dir=runtime/logs',
+'-Dsolr.log.level=INFO']









buildbot success in on ofbiz-trunk-framework-plugins

2017-06-30 Thread buildbot
The Buildbot has detected a restored build on builder 
ofbiz-trunk-framework-plugins while building . Full details are available at:
https://ci.apache.org/builders/ofbiz-trunk-framework-plugins/builds/197

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: lares_ubuntu

Build Reason: forced: by IRC user  (privmsg): forces manual build 
after adding on plugins commit
Build Source Stamp: HEAD
Blamelist: 

Build succeeded!

Sincerely,
 -The Buildbot





Re: OFBiz Dev List and Deepak Dixit mentioned in ASF Annual Report

2017-06-30 Thread Michael Brohl

Hi Sharan,

thanks for sharing and "thumbs up" for Deepak :-)

Best regards,

Michael


Am 30.06.17 um 09:34 schrieb Sharan Foga:

Hi Everyone

I'm not sure if you saw the announcement for the ASF Annual Report that was 
published. I took a quick look through it and saw that on page 25 our OFBiz dev 
list has been listed as one of the most active and on page 26 Deepak Dixit is 
listed as one of the top 5 issue closers!

https://blogs.apache.org/foundation/entry/the-apache-software-foundation-announces15

Thanks
Sharan






smime.p7s
Description: S/MIME Cryptographic Signature


Re: OFBiz Dev List and Deepak Dixit mentioned in ASF Annual Report

2017-06-30 Thread Swapnil Mane
Super, good going team and Deepak :)
Thanks Sharan for sharing.



- Best Regards,
Swapnil M Mane

On Fri, Jun 30, 2017 at 1:04 PM, Sharan Foga  wrote:

> Hi Everyone
>
> I'm not sure if you saw the announcement for the ASF Annual Report that
> was published. I took a quick look through it and saw that on page 25 our
> OFBiz dev list has been listed as one of the most active and on page 26
> Deepak Dixit is listed as one of the top 5 issue closers!
>
> https://blogs.apache.org/foundation/entry/the-apache-softwar
> e-foundation-announces15
>
> Thanks
> Sharan
>
>


Re: OFBiz Dev List and Deepak Dixit mentioned in ASF Annual Report

2017-06-30 Thread Deepak Dixit
Thanks Sharan for sharing :)

Thanks & Regards
--
Deepak Dixit
www.hotwaxsystems.com
www.hotwax.co

On Fri, Jun 30, 2017 at 1:31 PM, Jacques Le Roux <
jacques.le.r...@les7arts.com> wrote:

> Yes thanks Sharan,
>
> I have always thought that Deepak is one of our best contributors :)
>
> Congrats Deepak!
>
> Jacques
>
>
>
> Le 30/06/2017 à 09:49, Taher Alkhateeb a écrit :
>
>> Yeah I saw that too. Awesome work Deepak
>>
>> On Jun 30, 2017 10:34 AM, "Sharan Foga"  wrote:
>>
>> Hi Everyone
>>>
>>> I'm not sure if you saw the announcement for the ASF Annual Report that
>>> was published. I took a quick look through it and saw that on page 25 our
>>> OFBiz dev list has been listed as one of the most active and on page 26
>>> Deepak Dixit is listed as one of the top 5 issue closers!
>>>
>>> https://blogs.apache.org/foundation/entry/the-apache-softwar
>>> e-foundation-
>>> announces15
>>>
>>> Thanks
>>> Sharan
>>>
>>>
>>>
>


buildbot failure in on ofbiz-trunk-framework-plugins

2017-06-30 Thread buildbot
The Buildbot has detected a new failure on builder 
ofbiz-trunk-framework-plugins while building . Full details are available at:
https://ci.apache.org/builders/ofbiz-trunk-framework-plugins/builds/196

Buildbot URL: https://ci.apache.org/

Buildslave for this Build: lares_ubuntu

Build Reason: The AnyBranchScheduler scheduler named 
'on-ofbiz-framework-commit' triggered this build
Build Source Stamp: [branch ofbiz/ofbiz-framework/trunk] 1800368
Blamelist: taher

BUILD FAILED: failed shell_4

Sincerely,
 -The Buildbot





Re: OFBiz Dev List and Deepak Dixit mentioned in ASF Annual Report

2017-06-30 Thread Jacques Le Roux

Yes thanks Sharan,

I have always thought that Deepak is one of our best contributors :)

Congrats Deepak!

Jacques


Le 30/06/2017 à 09:49, Taher Alkhateeb a écrit :

Yeah I saw that too. Awesome work Deepak

On Jun 30, 2017 10:34 AM, "Sharan Foga"  wrote:


Hi Everyone

I'm not sure if you saw the announcement for the ASF Annual Report that
was published. I took a quick look through it and saw that on page 25 our
OFBiz dev list has been listed as one of the most active and on page 26
Deepak Dixit is listed as one of the top 5 issue closers!

https://blogs.apache.org/foundation/entry/the-apache-software-foundation-
announces15

Thanks
Sharan






Re: OFBiz Dev List and Deepak Dixit mentioned in ASF Annual Report

2017-06-30 Thread Taher Alkhateeb
Yeah I saw that too. Awesome work Deepak

On Jun 30, 2017 10:34 AM, "Sharan Foga"  wrote:

> Hi Everyone
>
> I'm not sure if you saw the announcement for the ASF Annual Report that
> was published. I took a quick look through it and saw that on page 25 our
> OFBiz dev list has been listed as one of the most active and on page 26
> Deepak Dixit is listed as one of the top 5 issue closers!
>
> https://blogs.apache.org/foundation/entry/the-apache-software-foundation-
> announces15
>
> Thanks
> Sharan
>
>


OFBiz Dev List and Deepak Dixit mentioned in ASF Annual Report

2017-06-30 Thread Sharan Foga
Hi Everyone

I'm not sure if you saw the announcement for the ASF Annual Report that was 
published. I took a quick look through it and saw that on page 25 our OFBiz dev 
list has been listed as one of the most active and on page 26 Deepak Dixit is 
listed as one of the top 5 issue closers!

https://blogs.apache.org/foundation/entry/the-apache-software-foundation-announces15

Thanks
Sharan