Commit Graph
37 Commits
Author SHA1 Message Date
Nicolas Malin 8a51586c63 Fixed: service createCommunicationEventWithoutPermission failed to store a communication
(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
2020-11-30 09:40:04 +01:00
Jacques Le Roux 70ff1c5006 Fixed: createPartyGroupRoleAndContactMechs service not working (OFBIZ-11986)
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 :)
2020-09-30 14:28:31 +02:00
Jacques Le Roux 7b01534208 Fixed: createPartyGroupRoleAndContactMechs service not working (OFBIZ-11986)
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
2020-09-30 14:28:30 +02:00
Pawan Verma 034e03abf4 Improved: Inconsistent String Comparisons(OFBIZ-9254)
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.
2020-07-30 17:01:54 +05:30
Priya SharmaandPriya Sharma 15aec7e8f7 WIP: [Improved]: Use GroovyBaseScript's logging utility methods instead of using Debug (OFBIZ-11762) (#185)
* [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>
2020-06-06 10:17:23 +02:00
Pawan Verma 3f9e37797a Fixed: RuntimeException in getPartyNameForDate service for partyNameHistory.gender field(OFBIZ-11736)
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.
2020-05-23 23:35:39 +05:30
Wiebke Pätzold 8af7cf8775 Improved: Converted AccountServices from mini lang to groovy
(OFBIZ-11413)

Added ServiceDefs createPartyContactMechs and createPartyGroupRoleAndContactMechs.
Also converted createPartyGroupRoleAndContactMechs because it is used in AccountServies and needed more return values.
2020-05-15 14:41:54 +02:00
Pawan Verma e2901786c2 Fixed: Exception Error reflecting while Ecommerce Quick Checkout and Ordermgr Checkout
(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.
2020-04-18 13:23:58 +05:30
Harutyun Farajyan ae686c3ff6 Improved: Convert PartyPermissionServices.xml from mini lang to groovy
(OFBIZ-11433)

Thanks to Harutyun Farajyan for providing the patch
2020-03-27 11:11:32 +01:00
Nicolas Malin c8a838ef03 Improved: Convert PartyServices.xml from mini lang to groovy
(OFBIZ-11361)

Thanks to Leila Mekika for providing the patch
2020-03-10 14:37:57 +01:00
Nicolas Malin 2b98727c5f Improved: Convert party/LookupServices.xml mini-lang to groovyDSL
(OFBIZ-11362)

Deprecate lookupParty service by performFindParty and rewrite to work as bridge during the deprecation time
2020-03-04 21:25:23 +01:00
Nicolas Malin 604a3bfa02 Improved: Convert PartyInvitationService.xml from minilang to groovy
(OFBIZ-11360)

Thanks to Marie-Aline Pantais for providing the patch.
2020-02-28 16:39:06 +01:00
Nicolas Malin 2d9a5081fb Fixed: Convert ContactMechServices.xml mini-lang to groovyDSL
(OFBIZ-11358)

Add missing parenthesis to generate success message with elvis syntax
2020-02-22 12:09:04 +01:00
Nicolas Malin c51f703d36 Improved: Convert ContactMechServices.xml mini-lang to groovyDSL
(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
2020-02-22 11:19:40 +01:00
Jacques Le Roux 531793820e Improved: Add a discussion feature in order detail view for following
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
2019-09-26 15:11:52 +00:00
Gil Portenseigne 8e9df028b6 Fix parenthesis syntax error in groovy
(OFBIZ-11186)

Thanks Samuel Trégouët for your contribution

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866513 13f79535-47bb-0310-9956-ffa450edef68
2019-09-06 14:56:33 +00:00
Nicolas Malin c66a030d25 Convert CommunicationEventServices mini lang to groovy, service createCommunicationEvent
(OFBIZ-9992) (OFBIZ-11164)
Last commit with literal translation for service createCommunicationEvent

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1866337 13f79535-47bb-0310-9956-ffa450edef68
2019-09-03 16:56:16 +00:00
Nicolas Malin 60787a31d5 Improved: Convert CommunicationEventServices mini lang to groovy
(OFBIZ-9992) (OFBIZ-11164)
Thanks to Carl Demus for this conversion

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1865920 13f79535-47bb-0310-9956-ffa450edef68
2019-08-26 09:12:50 +00:00
Mathieu Lirzin 9b68a55d64 Improved: Compile groovy integration tests
(OFBIZ-11165)

Since there is no need for dynamic reload for integration tests,
it is better to compile Groovy tests.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1865786 13f79535-47bb-0310-9956-ffa450edef68
2019-08-23 18:00:01 +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
Nicolas Malin 4bcb3aab15 Fixed: Warning in console logs related to entity definitions
(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
2018-09-07 13:11:01 +00:00
Nicolas Malin ea9844a6c4 Improved: Refactoring ContactMechWorker.get[Entity]ContactMechValueMaps function to improve processing speed
(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
2018-08-18 21:23:31 +00:00
Gil Portenseigne 9fbb3765e4 Implemented : File transfer management with communicationEvent and new contactMech FTP_ADDRESS
(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
2018-05-18 15:53:35 +00:00
Arun Patidar 8345feffab Fixed: Incorrect Party profile view redirection in SFA due to missing roleType.
(OFBIZ-10121)
Thanks Ankit Joshi for your contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1825233 13f79535-47bb-0310-9956-ffa450edef68
2018-02-24 12:40:32 +00:00
Nicolas Malin 40fdd2ca73 Implemented: Continue the common-theme upload (OFBIZ-9138 Create a common theme)
Five step 
#9 Change all set screen and script that call widget.properties values replaced by call to modelTheme

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1806150 13f79535-47bb-0310-9956-ffa450edef68
2017-08-25 10:02:34 +00:00
Jacques Le Roux ec2f674a92 Improved: EntityListIterator closed but not in case of exception
(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
2017-06-02 11:25:17 +00:00
Wei Zhang 7427f9f794 The viewSize should be converted Integer for multiplication
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1792020 13f79535-47bb-0310-9956-ffa450edef68
2017-04-20 07:25:58 +00:00
Jacques Le Roux 0a5b1646b7 No functional changes
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-config
http://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
2017-02-01 10:58:46 +00:00
Arun Patidar 2bfc816e9b Improved: Removed semicolon from all Groovy files of all components.
(OFBIZ-8652)

Thanks: Rohit Koushal, Jacques Le Roux and Rishi Solanki for the contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1767764 13f79535-47bb-0310-9956-ffa450edef68
2016-11-02 19:09:13 +00:00
Mridul Pathak 2c2cb96eff Improved: Removed unused imports from groovy files in party component.
(OFBIZ-8465)

Thanks: Gopal Yadav for contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1765036 13f79535-47bb-0310-9956-ffa450edef68
2016-10-15 11:40:23 +00:00
Nicolas Malin 768c46a0de Improved : review order condition to resolve party enable on Lookup[PartyGroup|Perso]
(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
2016-09-18 09:59:13 +00:00
Divesh Dutta 6aac00975e [OFBIZ-7475] Provided the option to update Check Payment Method from Party profile page. Introduced new service updateCheckAccount. Thanks Jagpreet Kaur for the patch and Swapnil for creating the ticket.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1759180 13f79535-47bb-0310-9956-ffa450edef68
2016-09-04 17:11:08 +00:00
Deepak Dixit 834691742b (OFBIZ-6274) Renamed OFBiz artefacts from org.ofbiz.* to org.apache.ofbiz.*.Thanks to Taher for working on it.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1752920 13f79535-47bb-0310-9956-ffa450edef68
2016-07-16 10:30:49 +00:00
Ashish Vijaywargiya cb5fe32c7e Applied patch from jira issue - OFBIZ-6293 - If a party is both a contact and a lead, then SFA profile renders screens for both.
Thanks Pierre for creating the issue and Thanks Ravi for providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1750089 13f79535-47bb-0310-9956-ffa450edef68
2016-06-24 13:18:33 +00:00
Arun Patidar a91b9edae9 Applied patch from ticket - OFBIZ-7339 - Replace EntityUtilProperties getPropertyValue method with correct method calls. Thanks Rahul Singh Kushwah and Rishi Solanki for your contribution.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1749882 13f79535-47bb-0310-9956-ffa450edef68
2016-06-23 13:10:51 +00:00
Deepak Dixit d9a8278ae6 (OFBIZ-7245) Renamed groovy file in upper camel case as per best practices
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1747850 13f79535-47bb-0310-9956-ffa450edef68
2016-06-11 06:12:27 +00:00
Deepak Dixit e929d179d8 (OFBIZ-7228) Relocate .groovy files in the party component
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1747770 13f79535-47bb-0310-9956-ffa450edef68
2016-06-10 18:39:22 +00:00