(OFBIZ-10410)
Instead of relying on manual synchronisation, use a concurrent map for caching
loaded classes.
Inline private `invoke` delegate which intent was fuzzy.
Spread arguments when calling `Method::invoke` and `Class::getMethod`.
jleroux: interesting, it's the 1st use in OFBiz of the "::" syntax for calling
methods
(cf. https://docs.oracle.com/javase/specs/jls/se8/html/jls-15.html#jls-15.13-500)
I note that the string "::" is used in many places as a separator, notably
in caches, as cache key separator but this should not be confusing.
Thanks: Mathieu Lirzin
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1832199 13f79535-47bb-0310-9956-ffa450edef68
(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
(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
better to use it.
For now only `site-conf.xsd` is fixed
Thanks: Mathieu Lirzin
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1831930 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10245)
This commit introduce a new way to manage file transfer in OFBiz.
Inspired by mailing communication event management, a new communicationEventTypeId is created ('FILE_TRANSFER_COMM').
Such commEvent with classics : partyIdFrom/partyIdTo/contactMechIdTo/entryDate etc. are analysed by a job (like sendEmailDated), to send associated contents to a configured FTP/SFTP/FTPS server. If failure happens, it is catched and stored in communicationEvent, waiting for a new try.
For this purpose :
A new contactMechTypeId is introduced (FtpAddress), with its corresponding table. This contactMech store needed information for basic user/password authentication (server url and protocol, port, username, password, etc.)
A new service sendFileTransferDated that will look for pending file transfer and call following service.
A new service sendCommEventAsFtp that take a selected commEvent, check its structure and manage its status after trying the associated content file transfers.
A new service sendContentToFtp, that take a content and transfer it to a given FtpAddress.
A seca createCommEventFromFtpTransfer on sendContentToFtp to manage plural content file transfer, creating children communicationEvent to follow each content transfer separately (only for several content transfers).
A new Interface FtpClientInterface, with the 3 implementations of FTP, FTPS (To Implement), SFTP clients to manage Ftp connection and transfer.
A new property file to enable and manage redirection for testing purpose.
With this implementation, creating a communicationEvent, with a FtpAddress contactMechIdTo, and sendFileTransferDated job planned, the file is transfered to the ftp : communication event status set to COM_COMPLETE, if error occured the communication event status is set to COM_BOUNCED with error message on communicationEvent note.
Thanks Rishi for your feedbacks
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1831867 13f79535-47bb-0310-9956-ffa450edef68
attribute
(OFBIZ-10406)
While calling checkProductRelatedPermission, if permission is failed ten
fail-property tag uses ${checkActionLabel} which is not handled properly in
MessageElement.java.
There are 2-3 other occurrences as well of such type but not in working
condition.
Thanks: Suraj
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1831831 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10390)
The current EntitySync documentation in wiki is POS oriented so somehow
deprecated.
I have recently worked on a project with EntitySync and collected as much
possible information.
I also got David E. Jones's agreement to reuse the part on EntitySync in his
2006 "Apache OFBiz Advanced Framework - Training Video Transcription" document.
So this is a new replacing asciidoc document, it's a WIP...
Thanks: David for agreement on reusing his doc.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1830972 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
(OFBIZ-10369)
The events contained in the controller configuration for first-visit, pre-post processor and before-after login are executed in arbitrary order rather than the defined order.
If we define an event configuration as follow:
<after-login>
<event name=keepCartUpdated type=java path=org.apache.ofbiz.order.shoppingcart.ShoppingCartEvents invoke=keepCartUpdated/>
<event name=restoreAutoSaveList type=java path=org.apache.ofbiz.order.shoppinglist.ShoppingListEvents invoke=restoreAutoSaveList/>
<event name=saveCartToAutoSaveList type=java path=org.apache.ofbiz.order.shoppinglist.ShoppingListEvents invoke=saveCartToAutoSaveList/>
</after-login>
We wait that OFBIz run keepCartUpdated, restoreAutoSaveList and after saveCartToAutoSaveList event but the HashMap who organise them return arbitrary order and can return saveCartToAutoSaveList, keepCartUpdated and restoreAutoSaveList. Convert the HashMap to LinkedHashMap help to keep the loaded order.
Thanks to Vikas Mayur for solve this issue
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1830303 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10369)
The events contained in the controller configuration for first-visit, pre-post processor and before-after login are executed in arbitrary order rather than the defined order.
If we define an event configuration as follow:
<after-login>
<event name=keepCartUpdated type=java path=org.apache.ofbiz.order.shoppingcart.ShoppingCartEvents invoke=keepCartUpdated/>
<event name=restoreAutoSaveList type=java path=org.apache.ofbiz.order.shoppinglist.ShoppingListEvents invoke=restoreAutoSaveList/>
<event name=saveCartToAutoSaveList type=java path=org.apache.ofbiz.order.shoppinglist.ShoppingListEvents invoke=saveCartToAutoSaveList/>
</after-login>
We wait that OFBIz run keepCartUpdated, restoreAutoSaveList and after saveCartToAutoSaveList event but the HashMap who organise them return arbitrary order and can return saveCartToAutoSaveList, keepCartUpdated and restoreAutoSaveList. Convert the HashMap to LinkedHashMap help to keep the loaded order.
Thanks to Vikas Mayur for solve this issue
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1830301 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-7112)
Remove useless redundant code.
results map is already initialised in the beginning with isExistInDb
as "N" and value as "".
These values only changed when systemProperty != null. S
o except for this condition if we return results at any point it will have
isExistInDb as "N" and value as "".
If we remove the lines I removed in the patch, it will only remove put
operations that are not necessary.
Thanks: Aditya
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1828217 13f79535-47bb-0310-9956-ffa450edef68
(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
(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
(OFBIZ-9833)
Removes the code I temporarily removed on trunk demo (controversial) to test my
changes
Also adds the LoginWorker.autoLoginSet()
This is just a commit to go ahead, later I will revert all related and provide
a patch for discussion at OFBIZ-9833.
I'll also certainly use Deepak's JWTManager.createJwt() instead of mine, it's
more general and I actually only need to pass the userLoginId. We have though
to discuss that anyway, I see some differences...
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1826949 13f79535-47bb-0310-9956-ffa450edef68
(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
When calling OFBiz with the command gradlew "ofbiz -l readers=seed-initial"
the system crashes. The reason is because of a faulty dependency of
"seed-initial" data in the entityext component to "seed" data in the security
component. The fix is simply to change the type of reader for the requested
data in SecurityPermissionSeedData.xml from "seed" to "seed-initial"
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1825436 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10195)
This improvement add a way to specify a condition-group attribute on search fields, for performFind service usage.
The same group conditions are gathered with AND operator, and each group is added with a OR
The resulting condition is added to the other with AND operator.
Thanks Taher for your reviews and ideas
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1825350 13f79535-47bb-0310-9956-ffa450edef68