Commit Graph
9474 Commits
Author SHA1 Message Date
Taher A. Alkhateeb 22d780cdae Improved: Further refactor MapContext and MapStack
(OFBIZ-10485)

This commit applies multiple new refactoring enhancements as follows:
- rename stackList to contexts (the data structure holding the context Deque)
- refactor the size function to utilize streams to sum all keys
- Implement a function "entryStream()" that returns a stream of all keys in the
  correct sequential order and utilize this function in multiple functions for
  iterating over the keys including "containsValue", "values" and "entrySet".
  This implementation is necessary to avoid code repetition and ensure correct
  order with no duplicates
- Re-design the get functions of the context map to use a generic function with
  a functional interface "withMapContainingKey". The purpose of it is to avoid
  checking for nulls and instead use the "containsKey" function followed by the
  injected lambda expressions in both signatures of the get function

Thanks: Mathieu Lirzin for the patch and implementing suggested changes.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1837462 13f79535-47bb-0310-9956-ffa450edef68
2018-08-05 12:36:09 +00:00
Gil Portenseigne d3021c213b Improved : Use the stream API in FormRenderer
(OFBIZ-10505)

Thanks Mathieu for the patches

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1837460 13f79535-47bb-0310-9956-ffa450edef68
2018-08-05 09:18:20 +00:00
Taher A. Alkhateeb e534c3b3b7 Improved: refactored the MapContext object with multiple improvements
(OFBIZ-10485)

- Removed the constructor and factory method "getMapContext" as it was
  redundant and does not add any value
- Replaced manual for-loop for collection walking in multiple methods with
  simple stream calls applied declaratively with less noise in the code.
- Fully removed the ListSet custom data structure with as that data structure
  did not serve any meaningful purpose and it is always better to rely on
  the java builtin data structures where possible. Construction was replaced
  with a HashSet instead.

Thanks: Mathieu Lirzin for your time, discussions and patch.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1837409 13f79535-47bb-0310-9956-ffa450edef68
2018-08-04 08:39:16 +00:00
Gil Portenseigne 03107374d2 Improved : Inline ‘getFieldListsByPosition’ method
(OFBIZ-10503)

Refactors ‘getFieldListsByPosition’ method using stream. Thanks Mathieu for the patches

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1837348 13f79535-47bb-0310-9956-ffa450edef68
2018-08-03 07:28:34 +00:00
Gil Portenseigne b16339e90a Improved : Factorize and Refactor filtering of duplicated ‘use-when’ fields in ‘FormRenderer’
(OFBIZ-10502)

Thanks Mathieu for providing unit test and improvment patches

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1837254 13f79535-47bb-0310-9956-ffa450edef68
2018-08-01 20:02:09 +00:00
Deepak Dixit 252828d8b0 Improved: Improved: Use application/javascript instead of text/javascript
(OFBIZ-10492)
Added missing file in last commit

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1836893 13f79535-47bb-0310-9956-ffa450edef68
2018-07-28 12:21:52 +00:00
Deepak Dixit ef0c694a46 Improved: Use application/javascript instead of text/javascript
(OFBIZ-10492)
Replace text/javascript with application/javascript in all the script tag

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1836886 13f79535-47bb-0310-9956-ffa450edef68
2018-07-28 10:51:52 +00:00
Deepak Dixit 99220516cb Improved: Use application/javascript instead of text/javascript
(OFBIZ-10492)
Updated compressibleMimeType list and use application/javascript in place of text/javascript

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1836871 13f79535-47bb-0310-9956-ffa450edef68
2018-07-28 06:26:48 +00:00
Michael Brohl fc3c92f7d6 Fixed: Corrected wrong import introduced in 1813640.
Thanks Scott Gray for reporting.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1836796 13f79535-47bb-0310-9956-ffa450edef68
2018-07-27 09:30:13 +00:00
Taher A. Alkhateeb 2c4907a873 Improved: refactor the MapContext to use a Deque instead of List interface
(OFBIZ-10485)

The MapContext and MapStack classes are abstracting away the underlying
LinkedList implementation behind a List. The problem is that the push and pop
methods are implemented awkwardly by using index zero or using size() to find
the ends of the collection.

Thus this improvement maintains the same code signature but replaces the List
interface with the Deque to utilize the getFirst(), addFirst() and addLast()
functions making the code cleaner and more declaractive.

Thanks: Mathieu Lirzin for the patch and explanation of your work.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1836710 13f79535-47bb-0310-9956-ffa450edef68
2018-07-26 10:02:06 +00:00
Taher A. Alkhateeb bf655a7d16 Improved: Add missing @override annotations in MapContext
(OFBIZ-10485)

Those are missing for methods that override super methods with identical signatures.

Thanks: Mathieu Lirzin for your patch and analysis


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1836632 13f79535-47bb-0310-9956-ffa450edef68
2018-07-25 13:25:05 +00:00
Taher A. Alkhateeb a80c623fe7 Improved: Reafctor MapContext by removing unused code
(OFBIZ-10485)

- Remove unused functions that are only supposed to be used internally.
- Remove redundant warning and @override annotations

Thanks: Mathieu Lirzin for the patch, and careful analysis of code.
Thanks: Pradhan Sharma for reviewing the work


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1836631 13f79535-47bb-0310-9956-ffa450edef68
2018-07-25 13:21:32 +00:00
Deepak Dixit 397628ba7d Improved: Remove use of deprecated language attribute from script tag
(OFBIZ-10491)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1836545 13f79535-47bb-0310-9956-ffa450edef68
2018-07-24 11:26:23 +00:00
Deepak Dixit 2f6618753c Fixed: compressableMimeType is not a valid attribute of apache http connector
(OFBIZ-10487)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1836144 13f79535-47bb-0310-9956-ffa450edef68
2018-07-18 06:42:10 +00:00
Taher A. Alkhateeb a93c963f54 Improved: sanitized the output of XML-RPC when errors are reported.
(OFBIZ-10484)

This is implemented by overriding the parent "execute" method with a more
sanitized output for clarity and enhanced security.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1836141 13f79535-47bb-0310-9956-ffa450edef68
2018-07-18 06:30:15 +00:00
Gil Portenseigne 00a1a84053 Improved : File transfer management with communicationEvent and new contactMech FTP_ADDRESS
(OFBIZ-10245)

Rename SQL reserved words, thanks Deepak for reporting the issue and providing a patch

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1835994 13f79535-47bb-0310-9956-ffa450edef68
2018-07-15 20:49:28 +00:00
Deepak Dixit b13070d7fa Improved: Standardise layout for Party
(OFBIZ-10334)
Thanks Dennis Balkir for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1835957 13f79535-47bb-0310-9956-ffa450edef68
2018-07-15 09:10:49 +00:00
Jacques Le Roux 8fe6c1d23c Improved: no functional change, simply adds XXX tag :)
Forgot I had other pending changes :/ 
Now really removed, automated things can sometimes screw you :/


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1835896 13f79535-47bb-0310-9956-ffa450edef68
2018-07-14 10:16:46 +00:00
Jacques Le Roux 2ebcd632b6 Improved: no functional change, simply adds XXX tag :)
Forgot I had other pending changes :/ now removed


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1835895 13f79535-47bb-0310-9956-ffa450edef68
2018-07-14 10:12:38 +00:00
Jacques Le Roux 996311e7a7 Improved: no functional change, simply adds XXX tag :)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1835893 13f79535-47bb-0310-9956-ffa450edef68
2018-07-14 09:58:22 +00:00
Suraj Khurana 65b5b117f7 Improved: Empty header row should not render if list to render in file is empty.
(OFBIZ-7598)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1835869 13f79535-47bb-0310-9956-ffa450edef68
2018-07-14 05:10:00 +00:00
Jacques Le Roux b4ad57201f Improved: Rename the misnamed setUserLocale.js to setUserTimeZone.js
(OFBIZ-10472)

At the same time renames setLocaleFromBrowser to SetTimeZoneFromBrowser 
everywhere it's needed
And adds a documentation about the auth mismatch as suggested by Mathieu

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1835628 13f79535-47bb-0310-9956-ffa450edef68
2018-07-11 11:16:07 +00:00
Jacques Le Roux 7906358abe Reverted: setLocaleFromBrowser requires authentification
(OFBIZ-10460)

The setLocaleFromBrowser request map defined in common-controller.xml has an 
attribute of auth=false
While the service associated with it in framework/common/servicedef/services.xml 
has an attribute of auth=true.

jleroux: this was missing in the initial patch. At OFBIZ-9264 the description is
    "it sets the time zone of the user logged in to it's browser time zone."
So being logged in seems needed, hence better to set auth=true everywhere

Thanks: as reported by Deepak in OFBIZ-10460 there is a problem with that.
So we need keep the inconsistence and the service protected.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1835616 13f79535-47bb-0310-9956-ffa450edef68
2018-07-11 08:14:29 +00:00
Aditya Sharma 130df396ff Improved: Using 'buttontext' styling for the index of service engine
(OFBIZ-10467)
To give OFBiz a more equal look, the style buttontext can be added for the alphabetical index of the service engine main page.
This makes the buttons look alike with the ones that are already there for the entity engine main page.
Thanks: Dennis Balkir for patch and Pierre Smits & Jacques Le Roux for the discussion

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1835612 13f79535-47bb-0310-9956-ffa450edef68
2018-07-11 07:05:11 +00:00
Gil Portenseigne 8686e1f4c7 Improved: GetLocaleList call can provide duplicate results
(OFBIZ-10458)

Just improve hasFilter condition to use .with groovy notation.

Thanks Mathieu Lirzin

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1835599 13f79535-47bb-0310-9956-ffa450edef68
2018-07-10 19:59:20 +00:00
Jacques Le Roux eaffb3d0f8 Fixed: setLocaleFromBrowser requires authentification
(OFBIZ-10460)

The setLocaleFromBrowser request map defined in common-controller.xml has an 
attribute of auth=false
While the service associated with it in framework/common/servicedef/services.xml 
has an attribute of auth=true.

jleroux: this was missing in the initial patch. At OFBIZ-9264 the description is
    "it sets the time zone of the user logged in to it's browser time zone."
So being logged in seems needed, hence better to set auth=true everywhere

Thanks: Mathieu Lirzin for report

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1835586 13f79535-47bb-0310-9956-ffa450edef68
2018-07-10 17:31:50 +00:00
Jacques Le Roux e20b34bc24 Implemented: Add a mechanism to prevent the usage of EntitySyncRemove
(OFBIZ-10008)

No configurations is available to disable usage of EntitySyncRemove. 
And it's creating problems when having a large database and frequent delete 
operations.

saveEntitySyncRemoveInfo is used to create EntitySyncRemove records in 
GenericDelegator.removeValue() and removeByPrimaryKey().

This adds a mechanism to prevent the usage of EntitySyncRemove by adding a 
property in general.properties file used to configure in entityengine.xml 






git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1835296 13f79535-47bb-0310-9956-ffa450edef68
2018-07-07 07:46:04 +00:00
Gil Portenseigne f428a7e803 Fixed: GetLocaleList call can provide duplicate results
(OFBIZ-10458)

A new Junit test is implemented to validate that no duplicates are present.
Groovy service has been refactored to use a more functional style

Thanks Mathieu Lirzin for reporting and providing the patch


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1835282 13f79535-47bb-0310-9956-ffa450edef68
2018-07-06 21:10:07 +00:00
Deepak Dixit fcdfc47d0a Fixed: Framework webapp freemarkerTransform.properties has dependency on proudct component
(OFBIZ-10463)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1835235 13f79535-47bb-0310-9956-ffa450edef68
2018-07-06 11:46:52 +00:00
Shi Jinghai 65905bd8d3 Reverted: Add method attribute to request-map to controll a uri can be called GET or POST only
OFBIZ-10438

Forgot to revert site-conf.xsd.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1835043 13f79535-47bb-0310-9956-ffa450edef68
2018-07-04 05:32:10 +00:00
Suraj Khurana 920050d685 Reverted: Empty header row should not render if list to render in file is empty because after this, search Result tables won't show first search result.
{OFBIZ-10438}

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1835042 13f79535-47bb-0310-9956-ffa450edef68
2018-07-04 05:24:41 +00:00
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
Jacques Le Roux 39582de221 Improved: Factorize code logic from ‘ConfigXMLReader’
(OFBIZ-10453)

There is a lot of repetitive code in ConfigXMLReader. 
Using a functional interface as a parameter of a generic algorithm avoids those
repetitions.

Thanks: Mathieu Lirzin

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

Add apache license to MethodNotAllowedException.java.

Thanks: Mathieu Lirzin for the contribution.


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

ControlServlet.java returned to the previous doGet/doPost structure.

Thanks: Mathieu Lirzin for the contribution.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1834465 13f79535-47bb-0310-9956-ffa450edef68
2018-06-27 05:48:59 +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 ca9b1bbd41 Reverted: Navigate from a domain to another with automated signed in
authentication
(OFBIZ-10307)

This reverts the work done previously for OFBIZ-9833 and OFBIZ-10206
Most parts of it will actually be reused later in a patch. By reverting it will 
allow to provide a patch for others to review


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1833510 13f79535-47bb-0310-9956-ffa450edef68
2018-06-14 14:37:24 +00:00
Jacques Le Roux bdd946d0e8 Improved: Remove unused code in CommonEvents::setFollowerPage
(OFBIZ-10413)

`CommonEvents::setFollowerPage` contains two unused variable definitions.  
After basic search I found that this request handler is used only in 
`webapp/partymgr/controller.xml` 
However I was unable to understand its purpose, so I have added a comment to add
 some kind of docstring.

jleroux: this event method is never used because the pushPage request map is 
also never used. So we can get rid of the whole.
At the same time, fixes a typo in comment an remove an useless import

Thanks: Mathieu Lirzin for initial reporting

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1833505 13f79535-47bb-0310-9956-ffa450edef68
2018-06-14 13:18:49 +00:00
Jacques Le Roux 4472a0e39e Improved: no functional change, fix a typo in a comment
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1833388 13f79535-47bb-0310-9956-ffa450edef68
2018-06-12 09:22:40 +00:00
Rishi Solanki b9cf8a5d55 Improved: Add Support for Disable attribute in CheckBox Form Widget. Disabled attrivute can be used as
<field><check disabled=true/></field>

and default value for attribute will be false.
(OFBIZ-10367)
Thanks Pawan Verma for reporting the improvement and providing patch for that.
Thanks James Yong for testing the work.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1833231 13f79535-47bb-0310-9956-ffa450edef68
2018-06-09 12:34:49 +00:00
Jacques Le Roux 3304dec663 Fixed: The first visit event are not executed in case of CMS
(OFBIZ-10389)

Execution of the first visit events depends on the trackVisit function

In RequestHandler.java file

if (this.trackVisit(request) && session.getAttribute("_FIRST_VISIT_EVENTS_") == null) {
    // execute first visit event
}

trackVisit function does not honor the default controller request 
(in this case, cms) So, we should improve the code of trackVisit to honor 
default controller request.


Thanks: Swapnil M Mane

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1832944 13f79535-47bb-0310-9956-ffa450edef68
2018-06-05 13:56:29 +00:00
Jacques Le Roux 66fa6b9c51 Improved: no functional change, fixes a typo in comment while at it
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1832930 13f79535-47bb-0310-9956-ffa450edef68
2018-06-05 11:29:11 +00:00
Jacques Le Roux c704689c3a Improved: no functional change, removes trailing blanks
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1832762 13f79535-47bb-0310-9956-ffa450edef68
2018-06-03 08:55:51 +00:00
Jacques Le Roux 25f853db70 Fixed: Session fixation issue
(OFBIZ-10420)

Prevents the session fixation by making Tomcat generate a new jsessionId 
(ultimately put in cookie). Only do when really signing in to avoid unnecessary 
calls

This improves the way it's done by using request.changeSessionId() instead of 
creating a brand new session. So there is no possible side effects on client and
no need to set initial request info (using setInitialRequestInfo)

Thanks: Taher for asking about it










git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1832756 13f79535-47bb-0310-9956-ffa450edef68
2018-06-03 08:33:09 +00:00
Jacques Le Roux 598eee0d93 Fixed: Session fixation issue
(OFBIZ-10420)

Fixes a session fixation security issue discovered by a client with the security
 audit tool "IBM Security AppScan Enterprise , Version : 9.0.3.7"

Prevents the session fixation by making Tomcat generate a new jsessionId 
(ultimately put in cookie). 

Only do when really signing in to avoid unnecessary calls
Though if the client has disabled the use of cookies, then a session will be 
new on each request, not a good choice on client side!




git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1832662 13f79535-47bb-0310-9956-ffa450edef68
2018-06-01 07:37:27 +00:00
Jacques Le Roux 94ec9094c4 Improved: Add session tracking mode and make cookie secure
(OFBIZ-6655)

In CrossSubdomainSessionValve::replaceCookie sets HttpOnly if it was in replaced
cookie

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1832591 13f79535-47bb-0310-9956-ffa450edef68
2018-05-31 09:27:32 +00:00
Wei Zhang 6da8a7fc29 Fixed: Incorrect data type conversion of variable serviceEndTime in CoreEvents.java
(OFBIZ-10419)

A minor fix for serviceEndTime conversion

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1832577 13f79535-47bb-0310-9956-ffa450edef68
2018-05-31 01:20:54 +00:00
Jacques Le Roux 16ad1e4870 Improved: New documentation for EntitySync
(OFBIZ-10390)

No functional changes while working on EntitySync-manual.adoc and checking the 
opportunity of existing debug log (it's a bit verbose, but it's OK as is)
Simply uses a multi-catch where possible



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1832411 13f79535-47bb-0310-9956-ffa450edef68
2018-05-28 17:34:20 +00:00
Jacques Le Roux 22b6c33e88 Improved: Empty header row should not render if list to render in file is empty
(OFBIZ-7598)

If list inside form doesn't contain data, then header row should not render from
better UI perspective and proper message should be shown to user.

Get to catalog/control/EditProductGoodIdentifications with eg 
productId=ID:GZ-1006 for a test 

Thanks: Suraj 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1832401 13f79535-47bb-0310-9956-ffa450edef68
2018-05-28 14:37:44 +00:00