Commit Graph
10472 Commits
Author SHA1 Message Date
Mathieu Lirzin a71766e929 Improved: Rewrite ‘loadHandlerMap’
(OFBIZ-10453)

This retrieves the attribute "class" instead of "className" which was
mistakenly used in revision 1862323.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862343 13f79535-47bb-0310-9956-ffa450edef68
2019-06-30 12:12:31 +00:00
Mathieu Lirzin c51b0693fc Improved: Factorize collecting events defined in “controller.xml”
(OFBIZ-10453)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862342 13f79535-47bb-0310-9956-ffa450edef68
2019-06-30 12:08:53 +00:00
Jacques Le Roux 1519900ed5 Reverted: Mathieu's changes in ConfigXMLReader.java from yesterday
OFBiz was crashing 

Reverts rev. 1862324, 1862323, 1862322




git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862333 13f79535-47bb-0310-9956-ffa450edef68
2019-06-30 08:38:58 +00:00
Mathieu Lirzin 946f6558f5 Fixed: Add missing import
(OFBIZ-10453)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862324 13f79535-47bb-0310-9956-ffa450edef68
2019-06-29 18:30:38 +00:00
Mathieu Lirzin 760ab05112 Improved: Rewrite ‘loadHandlerMap’
(OFBIZ-10453)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862323 13f79535-47bb-0310-9956-ffa450edef68
2019-06-29 18:10:36 +00:00
Mathieu Lirzin 6e3490d735 Improved: Factorize collecting events defined in “controller.xml”
(OFBIZ-10453)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862322 13f79535-47bb-0310-9956-ffa450edef68
2019-06-29 18:10:15 +00:00
Mathieu Lirzin 3fcf744748 Improved: Remove useless ‘null’ check in ‘EventFactory’
(OFBIZ-10911)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862321 13f79535-47bb-0310-9956-ffa450edef68
2019-06-29 18:09:21 +00:00
Mathieu Lirzin c5ea5d85d3 Improved: Use try with resources in ‘readXmlDocument’
(OFBIZ-8202)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862320 13f79535-47bb-0310-9956-ffa450edef68
2019-06-29 18:08:20 +00:00
Mathieu Lirzin 4d7e598257 Improved: Refactor ‘trackStats’ and ‘trackVisit’
(OFBIZ-11130)

This Factorizes their implementation which was copy-pasted. The remaining
issue concerning the undesirable re-implementation of ‘resolveURI’ has been
explained in a comment.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862315 13f79535-47bb-0310-9956-ffa450edef68
2019-06-29 15:13:30 +00:00
Jacques Le Roux 30a03b771f Improved: no functional change, just formating to check INFRA-18664
I can no longer find ofbiz-bot on Freenode because the good old qwebirc based 
webchat, was moving to a new Kiwi IRC based solution: https://freenode.net/


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862311 13f79535-47bb-0310-9956-ffa450edef68
2019-06-29 14:19:03 +00:00
Mathieu Lirzin 2a24e0ecc1 Improved: Add ‘RequestHandler#from’ static method
(OFBIZ-11129)

Avoid some boiler-plate when retrieving the request handler inside a
servlet context.
--this line, and those below, will be ignored--

M    applications/content/src/main/java/org/apache/ofbiz/content/cms/CmsEvents.java
M    applications/order/src/main/java/org/apache/ofbiz/order/task/TaskEvents.java
M    applications/product/src/main/java/org/apache/ofbiz/product/category/ftl/SeoTransform.java
M    applications/product/src/main/java/org/apache/ofbiz/product/category/ftl/UrlRegexpTransform.java
M    applications/product/src/main/java/org/apache/ofbiz/product/product/ProductSearchSession.java
M    framework/webapp/src/main/java/org/apache/ofbiz/webapp/control/RequestHandler.java
M    framework/webapp/src/main/java/org/apache/ofbiz/webapp/event/CoreEvents.java
M    framework/webapp/src/main/java/org/apache/ofbiz/webapp/ftl/OfbizUrlTransform.java
M    framework/widget/src/main/java/org/apache/ofbiz/widget/model/IterateSectionWidget.java
M    framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/html/HtmlTreeRenderer.java
M    framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroFormRenderer.java
M    framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroMenuRenderer.java
M    framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroScreenRenderer.java
M    framework/widget/src/main/java/org/apache/ofbiz/widget/renderer/macro/MacroTreeRenderer.java


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862295 13f79535-47bb-0310-9956-ffa450edef68
2019-06-28 23:04:54 +00:00
Mathieu Lirzin 21135cb104 Improved: Use ‘ServletRequest#getServletContext’ when possible
(OFBIZ-11129)

Avoid unecessary casts by using ‘ServletRequest#getServletContext’
instead of ‘ServletRequest#getAttribute’. This method is available
since Servlet specification 3.0.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862294 13f79535-47bb-0310-9956-ffa450edef68
2019-06-28 23:04:03 +00:00
Mathieu Lirzin 59599e3cb2 Improved: Add missing generics
(OFBIZ-10966)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862250 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 19:39:22 +00:00
Mathieu Lirzin 698af7c46b Improved: Remove dead code
(OFBIZ-10966)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862249 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 19:38:44 +00:00
Mathieu Lirzin 1bb65ee273 Improved: Make private methods static when possible
(OFBIZ-10966)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862248 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 19:36:37 +00:00
Mathieu Lirzin 8c3c6cd438 Improved: Inline ‘StringUtil#toMap’
(OFBIZ-11014)

‘StringUtil#toMap’ was only used in the ‘CollectionConverters.StringToMap’
converter so in order to clean ‘StringUtil’ it seems better to inline it.  The
corresponding tests has been adapted to check
‘CollectionConverters.StringToMap#convert’ behavior instead.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862228 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:40:25 +00:00
Mathieu Lirzin b0c0ec7603 Explain how the previous item is handled when rendering form
Additionally avoid useless ‘Map#putAll’ invokation.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862227 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:35:11 +00:00
Mathieu Lirzin ae9041285c Improved: Add ‘ComponentConfig#components’ static method
(OFBIZ-11101)

This factorizes the construction of a stream for the collection of
components.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862226 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:34:10 +00:00
Mathieu Lirzin 0deec7b2a4 Improved: Add ‘ComponentConfig#matchingComponentName’ static method
(OFBIZ-11101)

This factorizes the construction of a predicate filtering components by
their names.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862225 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:33:11 +00:00
Mathieu Lirzin 84468dd604 Improved: Rewrite ‘ComponentConfig#getAllEntityResourceInfos’
(OFBIZ-11101)

It now has a stream based implementation.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862224 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:32:15 +00:00
Mathieu Lirzin c28820ebb8 Improved: Rewrite ‘ComponentConfig#getKeystoreInfo’
(OFBIZ-11101)

It now has a stream based implementation.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862223 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:31:14 +00:00
Mathieu Lirzin 99a0d56144 Improved: Inline ‘ComponentConfig#isFileResourceLoader’
(OFBIZ-11101)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862222 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:30:25 +00:00
Mathieu Lirzin 6e0432014f Improved: Rewrite ‘ComponentConfig#getAllWebappResourceInfos’
(OFBIZ-11101)

It now has a stream based implementation.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862220 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:26:12 +00:00
Mathieu Lirzin ba54e32071 Improved: Rewrite ‘ComponentConfig#getAllTestSuiteInfos’
(OFBIZ-11101)

It now has a stream based implementation.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862219 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:25:11 +00:00
Mathieu Lirzin 554cad0289 Improved: Rewrite ‘ComponentConfig#getAllServiceResourceInfos’
(OFBIZ-11101)

It now has a stream based implementation.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862218 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:24:01 +00:00
Mathieu Lirzin 58ed9c5ce8 Improved: Rewrite ‘ComponentConfig#getAllKeystoreInfos’
(OFBIZ-11101)

It now has a stream based implementation.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862217 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:23:18 +00:00
Mathieu Lirzin 2305408526 Improved: Rewrite ‘ComponentConfig#getAllConfigurations’
(OFBIZ-11101)

It now has a stream based implementation.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862216 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:22:03 +00:00
Mathieu Lirzin ecadb1aac1 Improved: Rewrite ‘ComponentConfig#getAllClasspathInfos’
(OFBIZ-11101)

It now has a stream based implementation.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862215 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:19:56 +00:00
Jacques Le Roux be99f5a0a7 Improved: no functional change
Adds missing ASL2 headers, thanks to Mathieu on dev ML :)
Also automatically sorts imports

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862214 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 14:03:34 +00:00
Jacques Le Roux ac288a4e7d Fixed: Export XML data, ,o proper error message displayed if user misses to
select entities 
(OFBIZ-11125)

No Proper error message is displayed if user misses to select entities from the 
list, and throw error message

Thanks: Jayansh Shinde

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862207 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 12:03:21 +00:00
Jacques Le Roux b16285dd64 Implemented: JSON entity data import and export utility
(OFBIZ-10966)

Currently, we support import/export entity data in XML format.
  Nowadays JSON is widely used in industry, we can have support for JSON format 
  which looks quite similar to XML support.

Here is example of XML data and it's JSON version
<Party partyId="123456" partyTypeId="PERSON" statusId="PARTY_ENABLED"/>
{“Party”: {"partyId":"123456","partyTypeId":"PERSON","statusId":"PARTY_ENABLED”}}

Design Proposal

We can write entityImportJson and entityImportDirJson services for importing 
JSON from screen and directory respectively.
And the entityExportAllJson service for exporting entity data in JSON.

Import Design
 The import service will perform following operations:
 1.) Validate the input JSON data
 2.) On successful validation, convert JSON to OFBiz's entity model 
     (GenericValue)
 3.) The GenericValue will be inserted in database by some handler class for e.g 
     we can write JsonDataHandler, it will convert given JSON to 
     List<GenericValue>, and finally write it to database 
     (Similar pattern is used in XML import).

Export Design
 Based on existing XML pattern the writeXmlText method of GenericEntity class 
 write the exported data in XML format. 
 In the similar way, we can implement writeJsonText to export data in JSON format.

jleroux: I fixed 2 trivials things and at my request in last patch Jayansh added 
"JSON Data Export All" and "JSON Data Import Dir

Thanks: Jayansh Shinde 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862206 13f79535-47bb-0310-9956-ffa450edef68
2019-06-27 11:49:22 +00:00
Jacques Le Roux a60ebb4de2 Fixed: Allow to create single file if both directory and filename is
provided by user
(OFBIZ-11124)

In framework/webtools XML Data Export I reported an issue, Jayansh fixed it:

If user provided file name and output directory in that case the entity xml 
files are generated at both locations, i.e. at root we have test.xml and in user 
provided output directory we have multiple files with [entityname].xml. 

The expected change would be if user provided both output directory and filename 
then file should be created in given directory with given filename.

Thanks: Jayansh Shinde for the fix

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1862045 13f79535-47bb-0310-9956-ffa450edef68
2019-06-25 09:36:03 +00:00
Deepak Nigam 5e6c96d8bb Implemented: The feature where a user will be able to add different types of content(image, document, URL, etc.) to an order.
(OFBIZ-7257)
Here is an implementation plan for the proposed solution. 
Order Attachment Flow:
1) Show 'Attachments' instead of 'Image' on the order view screen.
2) If there are any attachments associated with the order, then their information will be displayed in the form of a button(Content link) else 'No Attachment' label should be shown.
3) If no attachments are there, then along with the label, a button(Add Attachment) will be displayed.
On clicking the Add Attachment button, a user will be redirected to a page where he/she can add different types of content(image, document, URL, etc.) to the order.
Order Attachment Modeling:
Used OrderContent as the entity to store the content and order association.
Created OrderContentType data for an image and document for starters.

Thanks Avnindra Sharma for reporting the original issue, Devanshu Vyas for providing the patch and Jacques for review and suggestions.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1861853 13f79535-47bb-0310-9956-ffa450edef68
2019-06-22 12:06:43 +00:00
Mathieu Lirzin ddbc034d36 Improved: Extract ‘intersects’ predicate in a method
(OFBIZ-11099)

The lambda expression was a bit too long, so it is preferable to
extract it in a dedicated method.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860956 13f79535-47bb-0310-9956-ffa450edef68
2019-06-10 15:24:14 +00:00
Mathieu Lirzin 266e0d0a87 Improved: Use the ‘Deque’ interface in ‘ContainerLoader’
(OFBIZ-11099)

With a deque it is possible to iterate from the end of a list with
‘Deque#descendingIterator’ which is useful when unloading containers.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860954 13f79535-47bb-0310-9956-ffa450edef68
2019-06-10 15:22:10 +00:00
Mathieu Lirzin 8a681cd347 Improved: Add missing ‘static’ modifier for safe public methods
(OFBIZ-11098)

In order to make it clear when a method is not depending on the
internal state of an object, it is a good practice to declare it as
static.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860946 13f79535-47bb-0310-9956-ffa450edef68
2019-06-10 14:11:20 +00:00
Mathieu Lirzin ffe2e7ffdf Improved: Add missing ‘static’ modifier for private methods
(OFBIZ-11098)

In order to make it clear when a method is not depending on the
internal state of an object, it is a good practice to declare it as
static.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860937 13f79535-47bb-0310-9956-ffa450edef68
2019-06-10 12:27:40 +00:00
Jacques Le Roux 08f0b84462 Improved: no functional change, adds missing license headers
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860902 13f79535-47bb-0310-9956-ffa450edef68
2019-06-09 13:08:08 +00:00
Mathieu Lirzin e2c85737e4 Improved: Add static modifiers in ‘EntityDataLoadContainer’
(OFBIZ-11070)

When no reference to ‘this’ is made, it is better to declare methods
as static.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860838 13f79535-47bb-0310-9956-ffa450edef68
2019-06-08 14:59:02 +00:00
Mathieu Lirzin 8b2de5fae2 Improved: Rewrite ‘EntityDataLoadContainer#isDataReadersEnabled’
(OFBIZ-11070)

Use a boolean expression instead of a conditional.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860837 13f79535-47bb-0310-9956-ffa450edef68
2019-06-08 14:57:08 +00:00
Mathieu Lirzin 0a465fa748 Improved: Rewrite ‘EntityDataLoadContainer#isPropertySet’
(OFBIZ-11070)

Use a boolean expression instead of a conditional.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860836 13f79535-47bb-0310-9956-ffa450edef68
2019-06-08 14:54:38 +00:00
Deepak Dixit ee60f84b65 Improved: Added Debug error statement for freemarker OFBIZ_DEFAULT_HANDLER, it will be helpful while debugging.
(OFBIZ-10817)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860696 13f79535-47bb-0310-9956-ffa450edef68
2019-06-06 05:42:30 +00:00
Nicolas Malin 69d4c767ea Fixed: Decrypt a field on embedded entity-view failed
(OFBIZ-11078)

When you tried to decrypt a field present on embedded entity-view, key use is the view name and not the final entity who contains this field.

You currently have the problem on PartyContactMechDetail where if you want to displaying the ftpPassword for a FtpAddress, the view failed and tried to use ContactMechDetail to decrypt instead of FtpAddress

To solve it, we iterate on the entity contains the field in the view while is an entity-view :

    PartyContactMechDetail.ftpPassword
         -> ContactMechDetail.ftpPassword
              -> FtpAddress.ftpPassword
                   -> key found FtpAddress

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860365 13f79535-47bb-0310-9956-ffa450edef68
2019-05-29 18:53:37 +00:00
Jacques Le Roux 6447258bf3 Improved: no functional change
Adds missing ASL2 licenses

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860259 13f79535-47bb-0310-9956-ffa450edef68
2019-05-28 12:52:17 +00:00
Jacques Le Roux 87fc949af8 Reverted: Refactor EntityDataLoadContainer
(OFBIZ-11070)

There is something wrong with Mathieu's changes, reverting all for now


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860113 13f79535-47bb-0310-9956-ffa450edef68
2019-05-27 09:29:28 +00:00
Mathieu Lirzin 07406d341d Improved: Add static modifiers in ‘EntityDataLoadContainer’
(OFBIZ-11070)

When no reference to ‘this’ is made, it is better to declare methods
as static.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860064 13f79535-47bb-0310-9956-ffa450edef68
2019-05-26 12:40:21 +00:00
Mathieu Lirzin 655f19c2fa Improved: Inline ‘EntityDataLoadContainer#getLoadFiles’
(OFBIZ-11070)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860063 13f79535-47bb-0310-9956-ffa450edef68
2019-05-26 12:35:13 +00:00
Mathieu Lirzin b71cd98911 Improved: Rewrite ‘EntityDataLoadContainer#isDataReadersEnabled’
(OFBIZ-11070)

Use a boolean expression instead of a conditional.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860062 13f79535-47bb-0310-9956-ffa450edef68
2019-05-26 12:33:13 +00:00
Mathieu Lirzin 388f4c8b52 Improved: Rewrite ‘EntityDataLoadContainer#isPropertySet’
(OFBIZ-11070)

Use a boolean expression instead of a conditional.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860061 13f79535-47bb-0310-9956-ffa450edef68
2019-05-26 12:31:19 +00:00
Jacques Le Roux 28e119027c Improved: Use Groovy Truth instead of UtilValidate Class in Groovy
(OFBIZ-11064)

As we all know, Groovy is a powerful language with great built-in functions. 
Groovy Truth[1] is one of them, which is not used properly in our code base. 
We have used UtilValidate Class to validate arguments for Empty or NotEmpty, 
which can easily be done in groovy with built-in functionality[1].
 
Current Code: if (UtilValidate.isNotEmpty(locations)) { ... }
Groovy Built-in Code: if (locations) { ... }
 
[1] - http://groovy-lang.org/semantics.html#Groovy-Truth
 
We need to careful for some points while we change this:
Like:
maxRetry = 0
if (!maxRetry)
{  // Not set, use a default  maxRetry = -1 }

Because groovy evaluates zero to be false, it wouldn't be possible to set
maxRetry to zero.  So it's best not to use groovy truth for null-checks on
numbers in some cases. 
 
Thanks: Pawan Verma

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1860051 13f79535-47bb-0310-9956-ffa450edef68
2019-05-26 10:36:16 +00:00