(OFBIZ-12074)
When you call the service createCommunicationEventWithoutPermission to create a anonymous communication or from a user without party permission, the service failed due to missing permission.
With the minilang to groovy conversion the userLogin system it's not loaded before call the main service createCommunicationEvent
As Akash Jain reported:
<<While researched on ticket OFBIZ-11896 identified that groovy version of
createPartyGroupRoleAndContactMechs service (converted from mini lang at rev
8af7cf8775 ) is not working.
Identify these two reasons,
resolvePartyGroupMap called incorrectly
resolvePostalAddressMap and resolveTelecomNumberMap implemented incorrectly
as 'postalAddress' and 'telecomNumber' map processor
not available into PartyMapProcs.xml.
There may be more reasons along with these two reasons.>>
He was so true to say the later!
There are also some intentionally or automated formattings.
Thanks: Akash for report, Sourabh Jain for shy tentative :)
While researched on ticket OFBIZ-11896 identified that groovy version of
createPartyGroupRoleAndContactMechs service (converted from mini lang at rev
8af7cf8775 ) is not working.
Identify these two reasons,
resolvePartyGroupMap called incorrectly
resolvePostalAddressMap and resolveTelecomNumberMap implemented incorrectly
as 'postalAddress' and 'telecomNumber' map processor not available into PartyMapProcs.xml.
There may be more reasons along with these two reasons.
Thanks: Akash Jain for report, Sourabh Jain for incomplete patch (missed 2nd
point from Akash
There are some inconsistencies in the code for string comparison statusId.equals(PRUN_COMPLETED) whereas it should be written as PRUN_COMPLETED.equals(statusId) cause the former can throw NullPointerException if the variable found to be NULL.
Thanks: Devanshu for your contribution.
* [Improved]: Use GroovyBaseScript's logging utility methods instead of using Debug
- Replaced the debug.log methods with the respective groovy utility method
- Enhanced the GroovyBaseScript to entertain the fetch the current class name as the module name for logging
- Overloaded the logError method to entertain throwbale object for better logging
- Removed unused import statements and module variables.
(OFBIZ-11762)
* [Removed]: Extra line spaces. (OFBIZ-11762)
* [Revert]: Unwanted changes. (OFBIZ-11762)
* [Added] Same changes to these files. (OFBIZ-11762)
Co-authored-by: Priya Sharma <priya.sharma@example.com>
The reason for this issue is code is trying to get the gender of person from partyNameHistory record and gender is not a field in partyNameHistory entity. During conversion we minimized duplicate code which caused that issue.
I've added a check to avoid checking gender in partyNameHistory record.
(OFBIZ-11413)
Added ServiceDefs createPartyContactMechs and createPartyGroupRoleAndContactMechs.
Also converted createPartyGroupRoleAndContactMechs because it is used in AccountServies and needed more return values.
(OFBIZ-11506)
Here is more detail:
getRelatedParties service(groovy) was returning duplicate key of relatedPartyIdList. So HashMap was passed instead of List of string in entity condition that's why we are getting type casting error.
Thanks: Archana Asthana for report and Mohammed Rehan Khan for the patch.
(OFBIZ-11358)
Convert all services present on ContactMechService.xml to groovyDSL :
* createContactMech
* updateContactMech
* createPostalAddress
* updatePostalAddress
* createTelecomNumber
* updateTelecomNumber
* createEmailAddress
* updateEmailAddress
I reorganized to move service definition from general services.xml file
to dedicate services_contact.xml, and create a new directory groovyScript/contact/
to centralize in future all groovy for contactMech as present on minilang directory
communication about the order (mail, phone etc.)
(OFBIZ-11210)
This is in order detail view for following communication about the order
(mail, phone etc.) to keep an eye about all com' event linked to the order.
Thanks: Carl Demus
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1867581 13f79535-47bb-0310-9956-ffa450edef68
(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
(OFBIZ-10540)
Improve the previous fix at r183834 where an error has been introduce with the entity WorkEffortContactMech who is different than OrderContactMech (no purpose but fromDate, thruDate) where at the beginning I thinking, wrongly, that they was the same pattern.
I completed the generic function *getEntityContactMechValueMaps* to analyze on the fly what element have the entityview. To complete, I added unit test for WorkEffortContactMech.
Thanks to Deepak Nigam for the control.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1840296 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-10514)
ContactMechWorker.get[Entity]ContactMechValueMaps are old historic functions that resolve all contact mech context related to an Entity (Party, Facility, Order, WorkEffort).
The problem that they create too many db call during their execution that decrease OFBiz performance when the contactMech history grow.
A solution use to improve the process speed was replace all db call through *GenericValue.getRelated* function by *Delegator.makeValidValue* to instanciate each GenericValue needed after an unique search call on a viewEntity. For the four entities : Party, Facility, Order and WorkEffort, I use the same view structure with a sub view entity on ContactMechDetail. This offer more genericity and permit to slim code.
This commit introduce a regression on genericValue resolved for ContactMechType and ContactMechPurposeType that currently lost their description, it's actually not awkward because theses genericValue use the function .get("description", locale) to resolve the description so call directly the label system.
For Order and WorkEffort, I merged the resolving process in one function, that can be extend later easily for some other entity like Invoice or Quote.
The new FtpAddress wasn't managed by this worker so I introduce it to keep the coherence.
Last improvement, I use
getPartyContactMechValueMaps(Delegator delegator, String partyId, Timestamp date, String contactMechTypeId)
instead of
getPartyContactMechValueMaps(Delegator delegator, String partyId, boolean showOld, String contactMechTypeId)
to offert also more possibility to resolve at date instead just use now or all.
icing on the cake, I added groovy test to control this worker
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1838349 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
(OFBIZ-9385)
This is an improvement only because no cases were reported. But obviously in
case of unlucky exception after the EntityListIterator creation and before it's
closed the EntityListIterator remains in memory.
It should be closed in EntityListIterator.finalize() but the less happens there
the better.
I noticed Groovy has no try-with-ressources statement. I put a comment in
the description of OFBIZ-9296 "Update Gradle to 2.4.10" Maybe a solution would
be to use streams but really WTF! It seems Gradle 2.5 has autocloseable...
This contains also some refactoring and code cleaning
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1797373 13f79535-47bb-0310-9956-ffa450edef68
At http://markmail.org/message/ffmyw773p65fndey I wrote:
I'd like to follow the suggestion I made in the last message of the linked
thread.
In other words, use
http://subversion.apache.org/docs/release-notes/1.8.html#repos-dictated-confighttp://blogs.collab.net/subversion/the-road-to-repository-dictated-configuration-day-2-autoprops
Then this problem would be over. No longer need to check from time to time that
concerned files, have svn:eol-style=native property set
This imply that all OFBiz users use svn > 1.7, but we can inform them, et voilà
Then at markmail.org/message/h3q2yvj4db544ro7 I wrote:
Actually, since we get new committers now and then and their are able to create
new files I have a warning every 6 months which says "Check Java
files, have all svn:eol-style=native" (I totally forgot that because I assume
the machine knows it and warns me ;))
I could extend that to all files (at least the most prominent types), I'll
see...
This does what the last sentence said for Groovy, XML and few new Birt
Java files.
I'll see if I can implement the svn 1.8 repos-dictated-config ASAP!
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1781219 13f79535-47bb-0310-9956-ffa450edef68
(OFBIZ-7117)
Review the entity condition order to optimize sql search
Optimize java import
update code format
Thanks : Florian Montalbano to propose the order optimisation.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1761314 13f79535-47bb-0310-9956-ffa450edef68