Commit Graph
2044 Commits
Author SHA1 Message Date
Shi Jinghai 17d9904b83 Reverted: Add method attribute to request-map to controll a uri can be called GET or POST only
OFBIZ-10438


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1834917 13f79535-47bb-0310-9956-ffa450edef68
2018-07-03 06:21:02 +00:00
Shi Jinghai 68003b9526 Implemented: Add method attribute to request-map to controll a uri can be called GET or POST only
OFBIZ-10438

The request-map element has a new method attribute to control a uri be called by GET or POST or all.

Thanks: Mathieu Lirzin for the contribution.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1834389 13f79535-47bb-0310-9956-ffa450edef68
2018-06-26 02:00:33 +00:00
Taher A. Alkhateeb d46a33a627 Improved: improve XML parsing with more restrictive settings
(OFBIZ-10435)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1833708 13f79535-47bb-0310-9956-ffa450edef68
2018-06-18 12:23:44 +00:00
Jacques Le Roux affc8a17cc Improved: Remove UtilValidate::isEmpty(String) method
(OFBIZ-10412)

UtilValidate class contains a `isEmpty` method both for `CharSequence` and for 
`String` types but since the first is an interface for the other and that the 
implementation are the same we don't need to keep the one for the concrete type.

Additionnaly I have removed the unused Generic type for the remaining 
implementation.

Thanks: Mathieu Lirzin

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1832170 13f79535-47bb-0310-9956-ffa450edef68
2018-05-24 13:36:08 +00:00
Jacques Le Roux 1840297cac Improved: Secure HTTP headers
(OFBIZ-6766)

After reading https://www.fastly.com/blog/headers-we-dont-want and more in the
Jira, only improves UtilHttp.setResponseBrowserProxyNoCache() by adding 
Cache-Control:private to avoid caching in proxy.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1832128 13f79535-47bb-0310-9956-ffa450edef68
2018-05-23 20:53:45 +00:00
Michael Brohl 9341c23b0f Reverted: Undo remove of test files in r1831567
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1831846 13f79535-47bb-0310-9956-ffa450edef68
2018-05-18 10:48:44 +00:00
Gil Portenseigne a71f88b1ad Fixed : change OFBiz always log level to OFF log4j level, instead of using FATAL log4j level
(OFBIZ-6206)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1831788 13f79535-47bb-0310-9956-ffa450edef68
2018-05-17 15:02:03 +00:00
Michael Brohl 5c547ae60e Fixed: Removed unnecessary class and folders.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1831567 13f79535-47bb-0310-9956-ffa450edef68
2018-05-14 13:34:03 +00:00
Deepak Dixit 645e6e1c47 Fixed: Fix typo 'paramters' => 'parameters'
(OFBIZ-10394)
Thanks Mathieu Lirzin for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1830936 13f79535-47bb-0310-9956-ffa450edef68
2018-05-04 19:34:07 +00:00
Jacques Le Roux e551e6cf8d Improved: Generalize toMap to abitrary key types
(OFBIZ-10354)

The `toMap` static method doesn't use its 'K' generic type in its implementation

Thanks: Mathieu Lirzin

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1830588 13f79535-47bb-0310-9956-ffa450edef68
2018-04-30 13:30:35 +00:00
Gil Portenseigne 78bf31c937 Fixed: Convert README.md to README.adoc.
(OFBIZ-10272)

Complete Jacques Fix, replacing all README.md occurence with README.adoc.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1827470 13f79535-47bb-0310-9956-ffa450edef68
2018-03-22 08:54:00 +00:00
Jacques Le Roux 6813d5d2b1 Fixed: Convert README.md to README.adoc.
(OFBIZ-10272)

Not sure why it went unnoticed so long, but by removing README.md 
(replacing README.adoc) r1827046 brokes testZipReadme

Not a big deal, we can just replace the file in the test (from README.md to 
README.adoc). We could chose a more sure to remain file, but I guess that now we 
are going with asciidoc and README.adoc should stay

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1827457 13f79535-47bb-0310-9956-ffa450edef68
2018-03-22 05:30:39 +00:00
Nicolas Malin 73bd798dda Fixed: HttpClient failed to return the error result
(OFBIZ-10281)

When you call the HttpClient on Rest API on url that return you an error, the HttpClient failed to give you the error stream:
    callResult = restClient.getStream();

If the flow is an error in the catch block with the line 
    in = con.getInputStream();
that return a FileNotFoundException

To solve if, if the connexion is an instance of HttpURLConnection we resolve this error inputStream contains the error message

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1827212 13f79535-47bb-0310-9956-ffa450edef68
2018-03-19 16:04:21 +00:00
Jacques Le Roux d354300e69 Fixed: Logout do not remove autoLogin
(OFBIZ-4959)

I used the only available (and I must say confusing) WebappInfo.getName() when
I needed the webAppName not the WebappInfoName. So this put in a new 
WebappInfo.getMountPoint() and use it in getWebappInfo

Also use LoginWorker.autoLoginSet() in different places where I missed it. In 
other words all autoUserLogin coockies are deleted on login and logout, and
an autoUserLogin cookie is created when going locally from a webapp to another,
with checkExternalLoginKey


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1826938 13f79535-47bb-0310-9956-ffa450edef68
2018-03-16 09:35:06 +00:00
Michael Brohl 7bc137dd35 Improved: Extended UtilFormatOut with new method formatPercentageRate.
(OFBIZ-10199)

Thanks Martin for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1826679 13f79535-47bb-0310-9956-ffa450edef68
2018-03-13 20:16:12 +00:00
Michael Brohl 1885f9a0a0 Improved: Change log level from INFO to VERBOSE for detail logging in
UtilCache.findSizeInByte
(OFBIZ-10200)

Thanks Martin Becker for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1826597 13f79535-47bb-0310-9956-ffa450edef68
2018-03-12 22:08:42 +00:00
Michael Brohl aebec6aafc Fixed: UtilCodec URL decoding breaks values with german umlauts.
(OFBIZ-10275)

Thanks Martin Becker for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1826592 13f79535-47bb-0310-9956-ffa450edef68
2018-03-12 21:43:48 +00:00
Arun Patidar 51f51c1623 Improved:Update regex used for validating credit cards.
(OFBIZ-9761)
Thanks Amit Gadaley for your contribution and Michael Brohl for reviewing patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1825216 13f79535-47bb-0310-9956-ffa450edef68
2018-02-24 11:32:18 +00:00
Jacques Le Roux 84bc50b994 Fixed: Logout do not remove autoLogin
(OFBIZ-4959)

Logout method do not disable autoLogin functionality. 
Instead of that it just initializes autoLogin in session and request.

jleroux: this was also needed by OFBIZ-10206 "Security issue in Token Based 
Authentication". 
This creates a keep-autologin-cookie boolean attribute in the webapp element of 
the  ofbiz-component.xml, documented in ofbiz-component.xsd
This attribute is used to get the value from the ofbiz-component.xml files in a
new autoLogoutCleanCookies() LoginWorker method. This method is used not only 
when login out but also when login in. This to be sure that in every cases the 
cookies related to the webapps are removed.
For now only the ecommerce, ecomseo et webpos webapps are keeping and using 
their autologin cookies

Thanks: Roberto Benítez Monje for report and Taher for discussion and suggestion

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1824803 13f79535-47bb-0310-9956-ffa450edef68
2018-02-19 19:23:36 +00:00
Jacques Le Roux f26b20885a No functional change, removes reference to MD5 in comments. It's not used anymore
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1824128 13f79535-47bb-0310-9956-ffa450edef68
2018-02-13 12:51:30 +00:00
Jacques Le Roux 630d993a21 Improved: [DEPRECATION] Replace BigDecimal.ROUND_* by RoundingMode.*
(OFBIZ-9571)

No functional change, just better JavaDoc 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1824124 13f79535-47bb-0310-9956-ffa450edef68
2018-02-13 12:45:13 +00:00
Jacques Le Roux 6ce8dd89e3 Improved: [DEPRECATION] Replace BigDecimal.ROUND_* by RoundingMode.*
(OFBIZ-9571)

No functional change, simply better JavaDoc for deprecated 
getBigDecimalRoundingMode() methods

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1824104 13f79535-47bb-0310-9956-ffa450edef68
2018-02-13 09:30:34 +00:00
Jacques Le Roux b06570590e Improved: [DEPRECATION] Replace BigDecimal.ROUND_* by RoundingMode.*
(OFBIZ-9571)

UtilNumber class
 Deprecates and replaces both getBigDecimalRoundingMode() by getRoundingMode()
 Deprecates toPercentString()
 Puts a log for a NumberFormatException

Calculate class
 Uses RoundingMode where necessary. No deprecation, this should be only used
 by Minilang

The rest
 Adapts the whole code for that
 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1823931 13f79535-47bb-0310-9956-ffa450edef68
2018-02-12 10:04:29 +00:00
Jacques Le Roux 35679e415b Fixed: UtilNumber.getBigDecimalRoundingMode() returns a wrong value
(OFBIZ-10218)

While working on OFBIZ-9571 I found that getBigDecimalRoundingMode() returns  
DEFAULT_BD_SCALE when the passed value for the file parameter is emtpy. 
This has certainly be C/P from getBigDecimalScale() and never found before.

While at it I refactored a bit getBigDecimalRoundingMode()  and 
getBigDecimalScale() 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1823876 13f79535-47bb-0310-9956-ffa450edef68
2018-02-11 18:51:07 +00:00
Gil Portenseigne fba4f5b235 Implemented : Add new FileUtil methods for zip management (OFBIZ-10188)
Add zipFileStream method that will zip FileStream to a zipped one.
Add unzipFileToFolder method to unzip a given archive to a given Folder.
Add fileUtil groovy test suite that create zip file containing README.md, then unzip it to tmp folder and compare original and unzipped files.
Thanks Jacques for the review.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1823567 13f79535-47bb-0310-9956-ffa450edef68
2018-02-08 15:32:31 +00:00
Nicolas Malin 21fa500df1 Improved: complete previous commit to add security in groovy context (OFBIZ-10196)
add security on groovy junit test
add security on eclipse and intellij groovy dsl definition
Thanks to Dennis Balkir for the suggest

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1823028 13f79535-47bb-0310-9956-ffa450edef68
2018-02-03 14:16:16 +00:00
Jacques Le Roux e45a869e17 Fixed: streaming large content cause out of memory exception.
(OFBIZ-10133)

No functional change in trunk
Slightly improves formatting in streamContent() in trunk. 

Uses the same code in R16, notably for setting
byte[] buffer = new byte[bufferSize];
that guarantee no issues, and using try-with-ressource

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1821054 13f79535-47bb-0310-9956-ffa450edef68
2018-01-13 09:37:38 +00:00
Jacques Le Roux 67d62f9ad6 No functional changes.
Replaces close() in finally by try-with-ressource



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1821039 13f79535-47bb-0310-9956-ffa450edef68
2018-01-12 22:37:25 +00:00
Jacques Le Roux 823cc0bf99 Fixed: streaming large content cause out of memory exception.
(OFBIZ-10133)

When ofbiz streams a large content (eg. video file), get out of memory exception.

To reproduce the issue see the Jira

jleroux: I just removed final for bufferSize, I see no needs for that local
variable

Thanks: Wai for the patch Michael for the discussion

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1821036 13f79535-47bb-0310-9956-ffa450edef68
2018-01-12 21:59:22 +00:00
Jacques Le Roux 7b9792b509 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

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1820966 13f79535-47bb-0310-9956-ffa450edef68
2018-01-12 11:24:48 +00:00
Jacques Le Roux 55ba682e2c No functional change, replace tabs by spaces
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1820965 13f79535-47bb-0310-9956-ffa450edef68
2018-01-12 11:22:31 +00:00
Deepak Dixit fb77a3c477 Improved: Logging: change all System.out/.err/.. println to Debug.log... in the code base (OFBIZ-10045)
Thanks Michael Brohl and Kyra Pritzel-Hentley for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1819124 13f79535-47bb-0310-9956-ffa450edef68
2017-12-23 09:08:04 +00:00
Michael Brohl 50c4bba4b2 Improved: Replace all "e.printStackTrace();" by calls to the Debug class.
(OFBIZ-10083)

Thanks Jacques Le Roux for reporting and Kyra Pritzel-Hentley 
for providing the patches.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818921 13f79535-47bb-0310-9956-ffa450edef68
2017-12-21 12:33:04 +00:00
Michael Brohl 98ee1e4f01 Improved: Fixing defects reported by code analysis tools, package
org.apache.ofbiz.base.util.string.
(OFBIZ-10097)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818677 13f79535-47bb-0310-9956-ffa450edef68
2017-12-19 15:19:10 +00:00
Jacques Le Roux 1c1d7dca60 No functional change, puts back this comment after r1818495, it may helps
sometimes, but better be verbose and tested, else it's too much

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818574 13f79535-47bb-0310-9956-ffa450edef68
2017-12-18 14:11:26 +00:00
Jacques Le Roux a8d6883644 No functional change, puts back this comment after r1818495, it may helps
sometimes

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818571 13f79535-47bb-0310-9956-ffa450edef68
2017-12-18 14:07:58 +00:00
Michael Brohl 4c7f71a9f8 Improved: General refactoring and code improvements, package
org.apache.ofbiz.base.concurrent.
(OFBIZ-9928)

Thanks Dennis Balkir for reporting and providing the patches.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818547 13f79535-47bb-0310-9956-ffa450edef68
2017-12-18 10:11:40 +00:00
Michael Brohl e489038c59 Improved: General refactoring and code improvements, package
org.apache.ofbiz.base.conversion.
(OFBIZ-9929)

Thanks Dennis Balkir for reporting and providing the patches.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818546 13f79535-47bb-0310-9956-ffa450edef68
2017-12-18 10:09:55 +00:00
Michael Brohl 7e765af8f9 Improved: General refactoring and code improvements, package
org.apache.ofbiz.base.lang.
(OFBIZ-9931)

Thanks Dennis Balkir for reporting and providing the patches.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818543 13f79535-47bb-0310-9956-ffa450edef68
2017-12-18 09:41:33 +00:00
Michael Brohl 95b2e68ac7 Improved: General refactoring and code improvements, package
org.apache.ofbiz.base.config.
(OFBIZ-9935)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818539 13f79535-47bb-0310-9956-ffa450edef68
2017-12-18 09:23:30 +00:00
Michael Brohl 61ba2c6f5b Improved: General refactoring and code improvements, package
org.apache.ofbiz.base.metrics.
(OFBIZ-9936)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818536 13f79535-47bb-0310-9956-ffa450edef68
2017-12-18 09:20:22 +00:00
Nicolas Malin 06dda4ae17 Fixed: Massive stacktraces in JuelConnector.
Added a constraint to verbose logging to avoid logging too much.

Complete the revision 1818498

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818510 13f79535-47bb-0310-9956-ffa450edef68
2017-12-17 20:01:06 +00:00
Michael Brohl a9cd441fc3 Improved: General refactoring and code improvements, package
org.apache.ofbiz.base.test.
(OFBIZ-9938)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818505 13f79535-47bb-0310-9956-ffa450edef68
2017-12-17 19:00:31 +00:00
Michael Brohl 90b6706b2c Improved: General refactoring and code improvements, package
org.apache.ofbiz.base.util.cache.
(OFBIZ-9939)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818504 13f79535-47bb-0310-9956-ffa450edef68
2017-12-17 18:57:17 +00:00
Michael Brohl 4ec7fb0588 Improved: General refactoring and code improvements, package
org.apache.ofbiz.base.util.cache.test.
(OFBIZ-9940)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818503 13f79535-47bb-0310-9956-ffa450edef68
2017-12-17 18:55:31 +00:00
Michael Brohl 80a852fcdf Improved: General refactoring and code improvements, package
org.apache.ofbiz.base.util.template.
(OFBIZ-9941)

Thanks Dennis Balkir for reporting and providing the patches.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818502 13f79535-47bb-0310-9956-ffa450edef68
2017-12-17 18:54:10 +00:00
Michael Brohl 57f1e05e77 Improved: General refactoring and code improvements, package
org.apache.ofbiz.base.crypto.
(OFBIZ-9942)

Thanks Dennis Balkir for reporting and providing the patches.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818501 13f79535-47bb-0310-9956-ffa450edef68
2017-12-17 18:51:18 +00:00
Michael Brohl d3580da466 Fixed: Massive stacktraces in JuelConnector.
Added a constraint to verbose logging to avoid logging too much.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818498 13f79535-47bb-0310-9956-ffa450edef68
2017-12-17 18:08:53 +00:00
Michael Brohl 960394e6c2 Improved: General refactoring and code improvements, package
org.apache.ofbiz.base.util.
(OFBIZ-9944)

Thanks Dennis Balkir for reporting and providing the patches.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1818495 13f79535-47bb-0310-9956-ffa450edef68
2017-12-17 16:57:56 +00:00
Jacques Le Roux d1bdee2c6c Improved: Always check if debug verbose is on when using Debug.logVerbose()
(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
2017-12-16 19:00:19 +00:00