------------------------------------------------------------------------
r1859877 | jleroux | 2019-05-24 15:47:08 +0200 (ven. 24 mai 2019) | 10 lignes
Fixed: Services allow arbitrary HTML for parameters with allow-html set to "safe"
(OFBIZ-5254)
This was reopened after discussion at
https://markmail.org/message/jnaitmwahjcjmdn5
This is a new solution which follows the work done with OFBIZ-6669 and OFBIZ-10187
Roughly said, it uses org.owasp.html.PolicyFactory and org.owasp.html.Sanitizers
Thanks: Christoph Neuroth for report
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1859878 13f79535-47bb-0310-9956-ffa450edef68
------------------------------------------------------------------------
r1857099 | jleroux | 2019-04-08 11:17:55 +0200 (lun. 08 avr. 2019) | 12 lignes
Improved: Using try-with-resources with File IO Objects.
(OFBIZ-9855)
Uses try with resources for File IO objects like ObjectInputStream and other
objects. File classes have the AutoCloseable interface.
jleroux: this is only a part of the 2nd patch. The 1st patch will be committed
soon too...
All tests pass
Thanks: Pradhan Yash Sharma
------------------------------------------------------------------------
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1857486 13f79535-47bb-0310-9956-ffa450edef68
===
Fixed: Missing oldStatusId in error when no status valid change record found
(OFBIZ-10377)
In the case of entity auto service, when an invalid status change is performed, the error message doesn't show the current status of the item from which the user is changing the status.
Thanks: Lalit Dashora for reporting the issue and providing the patch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/branches/release18.12@1856599 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10712)
We have checkAuth method in service dispatcher class, this method performs multiple auth related check.
if all checks passed it call the modelService.makeValid method to prepare service context (line#960) but this code executed only when service definition has a permission service call.
If service does not have any permission service call then it does not call the modelService.makeValid and this may cause the service validation issue unknown parameter found.
Ideally modelService.makeValid should call irrespective to permission service check.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1849193 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10701)
In order to detect potential issues early, the linting compiler option should be
used by default and disabled with {{./gradlew -PXlint:none build}}.
Additionally it is important to reduce the number of warnings otherwise new
warnings will remain unnoticed.
The warning related to the com.googlecode.concurrentlinkedhashmap dependency
should resolves itself once we handle upgrade to Caffeine like proposed in
OFBIZ-6747.
Thanks: Mathieu Lirzin
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1848673 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10488)
Since Java 8 it is possible to instantiate functional interfaces
(interfaces with one non-static method) with lambda expressions instead
of anonymous classes.
This replaces the creation of callable objects with lambda expressions.
Thanks: Mathieu Lirzin
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1848514 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10533)
The TemporalExpression for "MIDNIGHT_DAILY" has to be loaded as seed
data instead of initial-seed data to be available for other seed-initial
usages of this TemporalExpression.
The fix moves this TemporalExpression to the other TemporalExpression
seed data in ServiceSeedData.xml.
Thanks Martin Becker for reporting and providing the patch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1848449 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10649)
The service callback handling done in
org.apache.ofbiz.service.engine.AbstractEngine
can be rewritten more nicely without explicit iterators.
Additionally it is not nice that the engine is responsible for removing
disabled callbacks. The ServiceDispatcher should be responsible for removing
them.
Thanks: Mathieu Lirzin
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1846783 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10411)
To define boolean values, some ad-hoc enumeration of "true" and "false" are
repeatedly used. Since XML Schema defines a standard boolean datatype it's
better to use it.
Thanks: Mathieu Lirzin
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1846727 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10646)
Following discussion at https://markmail.org/message/y3izmnxd7jd6jbkf
this cleans some Groovy files in the base component, notably:
* remove ant-scripts folder and its content.
* Rename framework/base/groovyScript to framework/base/groovyScripts;
* Move GroovyInit.groovy and GroovyServiceTest.groovy respectively to
framework/base/groovyScripts and framework/common/groovyScripts
and change their paths where used.
* Removes GroovyInit.groovy from excludedConfigFiles in build.gradle
* After OFBIZ-10611 it's possible to move GroovyBaseScript.groovy from
framework/service/src/main/java/org/apache/ofbiz/service/engine
to
framework/service/src/main/groovy/org/apache/ofbiz/service/engine
* Removes FileUtilTests.groovy from basetests.xml (missed it in OFBIZ-10611)
* Fixes a typo in test-suite.xsd
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1846485 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10557)
Related to the discussion on dev [1] I turn off by default the indefinitely restart when a service async failed.
When a service run by async with persistence (eg: dispatcher.runAsync('returnErrorService', context, true)), the default value set on jobsandbox.maxRetry is now 0 instead of -1 before.
If you want run indefinitely an async service while isn't a success, set on your service definition max-retry='-1'.
[1] https://s.apache.org/EBhf
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1840526 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10282)
Thanks to Arun Patidar for reporting and review.
Thanks to Suraj Khurana for providing patch for the improvement.
Thanks to Jacques for discussion and finalizing the work.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1830545 13f79535-47bb-0310-9956-ffa450edef68
In a groovy service to call the security object you need to do : Security security = dispatcher.dispatchContext.security
For simplification, I set the security object in groovy context like dispatcher and delegator to call directly security.hasPermission()
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1822908 13f79535-47bb-0310-9956-ffa450edef68
(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
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1820966 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10052)
This completes the work done so far by removing double check in cases not using
brackets, like
if (Debug.verboseOn())
if (Debug.verboseOn()) Debug.logVerbose()
Thanks: Michael for reporting this case I missed.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818445 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10052)
This completes r1818075, there were still few cases, a last regexp search is
never too much :)
Found 4 other loops with Strings concatenation, but who cares, it's only
verbose logging...
There should not be anymore...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818077 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10052)
This completes r1818020, there were still few cases, a last review is never too
much
In PriceServices, I spotted
for (GenericValue orderItemPriceInfo: orderItemPriceInfos) {
if (Debug.verboseOn()) Debug.logVerbose(" --- " + orderItemPriceInfo
but it's OK with me, this should be rarely used, so not a perf issue
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818075 13f79535-47bb-0310-9956-ffa450edef68
org.apache.ofbiz.service.
(OFBIZ-9869)
The patch was modified to remove unnecessary Debug.is[Loglevel]On()
conditions, see OFBIZ-10049.
Thanks Dennis Balkir for reporting and providing the patch.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817746 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-9981)
Included Debug.logError in ServiceUtil.returnProblem so that in case of any
error occurred and handled, it will always be logged on the console.
jleroux: I put a toString() there, Debug.logError() does not work with maps
Also no functional change (better code) in QRCodeEvents
jleroux: I also replaced tabs by spaces there
and put debug info in exceptions
Thanks: Suraj Khurana
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1817455 13f79535-47bb-0310-9956-ffa450edef68
When you create a GenericValue with groovy, you need to initial it with makeValue and after set all fields.
***
GenericValue product = makeValue('Product')
product.internalName = parameters.internalName
***
I simplified this dsl with an automatic parameters check so you can directly write :
***
GenericValue product = makeValue('Product', parameters)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1816437 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-8341)
While reviewing r1812057 I spotted a bunch of swallowed ClassCastExceptions
I then reviewed all ClassCastExceptions and this fixes all of them with a
minimal logging
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1815797 13f79535-47bb-0310-9956-ffa450edef68