Commit Graph
921 Commits
Author SHA1 Message Date
Nicolas Malin d5898e6401 Implemented: improve makeValue in groovy DSL to load directly with a map (OFBIZ-10020)
When you create a GenericValue with groovy, you need to initial it with makeValue and after set all fields.
***
GenericValue product = makeValue('Product')
product.internalName = parameters.internalName
***

I simplified this dsl with an automatic parameters check so you can directly write :
***
GenericValue product = makeValue('Product', parameters)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1816437 13f79535-47bb-0310-9956-ffa450edef68
2017-11-27 11:38:24 +00:00
Jacques Le Roux c1a11e83ae Fixed: Fix Default or Empty Catch block in Java and Groovy files
(OFBIZ-8341)

While reviewing r1812057 I spotted a bunch of swallowed ClassCastExceptions

I then reviewed all ClassCastExceptions and this fixes all of them with a 
minimal logging

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1815797 13f79535-47bb-0310-9956-ffa450edef68
2017-11-20 12:32:44 +00:00
Deepak Dixit ae6440d8c1 Improved: Added toString() method in ServiceEcaAction class file
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1814161 13f79535-47bb-0310-9956-ffa450edef68
2017-11-03 10:31:06 +00:00
Jacques Le Roux 7ca508d5c7 No functional change.
While reviewing r1813634, I found that we could use a multi-catch, and while
doing so found that we were missing a CertificateException according to Eclipse

Confirmed by Java:
:compileJava
ofbiz\framework\service\src\main\java\org\apache\ofbiz\service\rmi\socket\ssl\
SSLServerSocketFactory.java:75: error: 
unreported exception CertificateException; must be caught or declared to be
thrown
                ks.load(fis, passphrase);

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813671 13f79535-47bb-0310-9956-ffa450edef68
2017-10-29 08:16:58 +00:00
Michael Brohl b73414c870 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.service.rmi.socket.ssl.
(OFBIZ-9714)

I modified the patch to keep the previous logic to get the SSL server 
socket. The cast should be safe because of the SSLServerSocketFactory
being used to get the socket.

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813634 13f79535-47bb-0310-9956-ffa450edef68
2017-10-28 14:19:22 +00:00
Deepak Dixit eea53baef0 Fixed: Moved enabled attribute definition to its correct place, it was added in wrong attribute group
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1813219 13f79535-47bb-0310-9956-ffa450edef68
2017-10-24 18:33:04 +00:00
Michael Brohl b29bb5df10 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.service.job.
(OFBIZ-9709)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812916 13f79535-47bb-0310-9956-ffa450edef68
2017-10-22 13:31:23 +00:00
Michael Brohl c2d7f3622f Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.service.eca.
(OFBIZ-9683)

Thanks Julian Leichert for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812897 13f79535-47bb-0310-9956-ffa450edef68
2017-10-22 11:24:21 +00:00
Deepak Dixit 651a17d213 Improved: Added ability to disable seca rule (OFBIZ-9826)
We have enabled flag in ServiceEcaRule class, if its set false then seca rule will not be executed.
But there is not way to disable seca.

We can add enabled flag in SECA definition to disable the existing seca rule.
Here is the proposal:
- Add new attribute on seca tag named enabled
- Default value will be true for this.
- If user want to disable existing OOTB seca rule, then user can define same rule in custom component and set the enabled=false
Need to do some changes in code to honor the enabled attribute while loading seca rule.

Also as per current flow if same seca rule is define more then once, system will execute all the rule, ideally it should not execute same rule (same rule, condition and action) if its defined more than one.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812394 13f79535-47bb-0310-9956-ffa450edef68
2017-10-17 11:52:14 +00:00
Deepak Dixit 2a8a37f308 Improved: Manage life span of SecurityGroupPermission entity.
Applied patch from jira issue(OFBIZ-9801) Thanks Suraj Khurana for your contribution


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812383 13f79535-47bb-0310-9956-ffa450edef68
2017-10-17 10:47:47 +00:00
Deepak Dixit 8dceb2fc0a Inconsistent String Comparisons, Applied patch for framework service classes.
Thanks Devanshu Vyas for your contribution (OFBIZ-9254)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812264 13f79535-47bb-0310-9956-ffa450edef68
2017-10-16 09:25:36 +00:00
Michael Brohl ace34aa4f7 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.service.semaphore.
(OFBIZ-9693)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812163 13f79535-47bb-0310-9956-ffa450edef68
2017-10-13 20:57:01 +00:00
Michael Brohl 8d4dd73dd3 Improved: Update build.gradle to the latest dependencies.
(OFBIZ-9674)

Thanks Julian Leichert for providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812161 13f79535-47bb-0310-9956-ffa450edef68
2017-10-13 20:42:25 +00:00
Michael Brohl 1ced20acb0 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.service.test.
(OFBIZ-9694)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812061 13f79535-47bb-0310-9956-ffa450edef68
2017-10-12 22:54:12 +00:00
Michael Brohl be4b13e954 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.service.calendar.
(OFBIZ-9691)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812057 13f79535-47bb-0310-9956-ffa450edef68
2017-10-12 22:07:59 +00:00
Michael Brohl 8a9e3b2e7d Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.service.mail.
(OFBIZ-9690)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1812051 13f79535-47bb-0310-9956-ffa450edef68
2017-10-12 21:18:35 +00:00
Michael Brohl 0f51376f26 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.service.config.model.
(OFBIZ-9682)

Thanks Julian Leichert for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1811699 13f79535-47bb-0310-9956-ffa450edef68
2017-10-10 13:46:42 +00:00
Michael Brohl f0771922f0 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.service.engine.
(OFBIZ-9688)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1811468 13f79535-47bb-0310-9956-ffa450edef68
2017-10-08 10:39:01 +00:00
Michael Brohl 4303f902b4 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.service.group.
(OFBIZ-9684)

I modified the patch to make ServiceGroupReader#groupsCache private.

Thanks Julian Leichert for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1811467 13f79535-47bb-0310-9956-ffa450edef68
2017-10-08 10:28:57 +00:00
Michael Brohl ca51783af8 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.service.
(OFBIZ-9638)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1811431 13f79535-47bb-0310-9956-ffa450edef68
2017-10-07 14:30:13 +00:00
Michael Brohl 96601e4d22 Fixed: Exception in service semaphore in wait mode and with multi
thread calls.
(OFBIZ-9534).

Thanks Pierre Gaudin for reporting and providing the patch.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1811406 13f79535-47bb-0310-9956-ffa450edef68
2017-10-07 10:23:02 +00:00
Rishi Solanki 25e99b2812 Fixed: Can enter empty content for product facility (OFBIZ-8323). A Generic Issue with EntityAutoEngine in which success message is appended to result after invoking create, update, delete, expire methods. Now engine would return success or error from invoking method and won't prepare the message its own. Same patch was committed and we receive test integration fails, minor modification in patch to put the message in the return map instead of map with key successMessage. Patch having problem with invokeUpdate.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1808833 13f79535-47bb-0310-9956-ffa450edef68
2017-09-19 07:49:37 +00:00
Rishi Solanki c0f2e5ee8f Reverted: Test Integration failed due to fix done in 1807908. OFBIZ-8323
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1807915 13f79535-47bb-0310-9956-ffa450edef68
2017-09-09 16:01:39 +00:00
Rishi Solanki ec9cba10ed Fixed: Can enter empty content for product facility (OFBIZ-8323). A Generic Issue with EntityAutoEngine in which success message is appended to result after invoking create, update, delete, expire methods. Now engine would return success or error from invoking method and won't prepare the message its own.
Thanks to Lalit Dashora for your contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1807908 13f79535-47bb-0310-9956-ffa450edef68
2017-09-09 14:11:51 +00:00
Deepak Dixit 482cc1f979 Fixed: Updated deprecated element type set mixed as true in services.xsd as we are using it in mixed mode. Also moved deprecated sequence after namespace.Found this issue while reading log, this will fix those warning.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1806206 13f79535-47bb-0310-9956-ffa450edef68
2017-08-25 18:13:06 +00:00
Nicolas Malin 3bc6806561 Fixed: Continue the common-theme upload (OFBIZ-9138 Create a common theme)
Forgot to add the visualTheme on automatic attribute forward to service context.
 Thanks to Aditya Sharma to raise it with the issue OFBIZ-9622


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1806164 13f79535-47bb-0310-9956-ffa450edef68
2017-08-25 12:29:22 +00:00
Nicolas Malin 10fa4452b7 Implemented: Continue the common-theme upload (OFBIZ-9138 Create a common theme)
Four step load the visualTheme in user session, freemarker, screen, groovy and service context
Add util to resolve easily a visualTheme

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1806134 13f79535-47bb-0310-9956-ffa450edef68
2017-08-25 08:18:35 +00:00
Jacques Le Roux c3f3ea6847 Improved: Enable/Disable JMS
(OFBIZ-4454)

Allows to Enable/Disable JMS with a service properties

Thanks: Adrian for report Dimitri Unruh for creating the Jira

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805158 13f79535-47bb-0310-9956-ffa450edef68
2017-08-16 09:15:00 +00:00
Jacques Le Roux 514cdb1ae5 Improved: GenericServiceJob.failed(Throwable) avoid logging stacktraces for
non technical service semaphore exceptions
(OFBIZ-9400)

GenericServicejob.failed(...) logs a stacktrace on every SemaphoreWait and 
SemaphoreFail exception. The patch changes this for the non-technical service 
semaphore exceptions to a one liner error logging to avoid polluting the logfile 
with stacktraces e.g. in a scenario where a service is scheduled in short 
intervals and fails expected while the former one is still running.

jleroux: I agree the case Martin describes must be quite annoying, especially in 
production!

Thanks: Martin Becker

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804962 13f79535-47bb-0310-9956-ffa450edef68
2017-08-14 09:47:36 +00:00
Jacques Le Roux bfd533ccc3 Improved: [DEPRECATION] Replace BigDecimal.ROUND_* by RoundingMode.*
(OFBIZ-9571)

No functional change.

We read at http://docs.oracle.com/javase/7/docs/api/java/math/BigDecimal.html : 
<<Using the integer fields in this class (such as ROUND_HALF_UP) to represent 
rounding mode is largely obsolete; the enumeration values of the RoundingMode 
enum, (such as RoundingMode.HALF_UP) should be used instead.>>

That's an easy global replacement. But it also needs to import the RoundingMode 
class. It was 26 files so I decided to rather clean all the imports in all files
 with the help of Eclipse.

This is a 1st step. I will need to closely look at 2 special class: UtilNumber
and Calculate.



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804953 13f79535-47bb-0310-9956-ffa450edef68
2017-08-14 08:32:21 +00:00
Jacques Le Roux a938fcfbc9 Implemented: ServiceSemaphore: Check for Transaction before suspending it in
dbWrite(...)
(OFBIZ-9401)

In ServiceSemaphore.dbWrite(...) the transaction is suspended without checking 
if there is a transaction in place. This results in logging a warning each time 
the TransactionUtil.suspend() method is invoked without a current transaction in
 place. The given patch cuts this unnecessary logging by checking if there is an
 transaction in place to suspend. If a transaction exists - suspend it.

Thanks: Martin Becker

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804940 13f79535-47bb-0310-9956-ffa450edef68
2017-08-13 19:20:14 +00:00
Nicolas Malin 703148c27e Implemented: Manage deprecated service in the ModelService (OFBIZ-9558)
When you want to remove a service we add a new xml element <deprecated/> that you can put on the service definition like this

<service name="oldService" ...>
    <deprecated use-instead="newService" since="theReleaseXXX">The reason to move it as deprecated</deprecated>
    <implements service="newService"/>
</service>

A deprecated service generate a warning log each time it is called
When you navigate on webtools a deprecated service is strike in the service list and display deprecated reason on the service definition detail page.

Thanks to Scott, Deepak, Taher and Jacques for sharing on this subject

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804786 13f79535-47bb-0310-9956-ffa450edef68
2017-08-11 12:41:22 +00:00
Deepak Dixit a0d99ed40f Improved: Replace fields with id-ne, id-long-ne and id-vlong-ne by id, id-long and id-vlong respectively which are not primary keys (OFBIZ-9355)
Thanks Aditya Sharma for your contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804026 13f79535-47bb-0310-9956-ffa450edef68
2017-08-03 17:51:07 +00:00
Nicolas Malin e193e14ccd Improved: Improve groovy DSL, runService call makeValidContext (OFBIZ-9523)
When you call run service with groovy, you need to be sure that all parametes are good for the service call.
This improvement simplify this dsl with an automatic parameters check so you can call directly like that
run service : createProduct, with: context

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1802798 13f79535-47bb-0310-9956-ffa450edef68
2017-07-24 12:17:01 +00:00
Taher A. Alkhateeb 609c7d37e3 Improved: minor refactoring to remove miscellanous warnings
Minor code cleanup to remove:
- unused private variables
- unused imports
- improper object castings



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1802172 13f79535-47bb-0310-9956-ffa450edef68
2017-07-17 16:59:18 +00:00
Jacques Le Roux 4a8ec59b63 Improved: ServiceSemaphore.waitOrFail() remove redundant logging
(OFBIZ-9399)

Removes the redundant logging done in ServiceSemaphore.waitOrFail() since the
 error will be logged by the ServiceEngine anyway.

Thanks: Martin Becker

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1801380 13f79535-47bb-0310-9956-ffa450edef68
2017-07-09 16:37:10 +00:00
Arun Patidar e85c824585 Improved: Use serviceUtil() in place of hard-coded error/success messages. (OFBIZ-9466)
Thanks Pawan Verma for your contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1801313 13f79535-47bb-0310-9956-ffa450edef68
2017-07-08 18:43:54 +00:00
Deepak Dixit 34b4b6823c Improved: Added new constraints for INOUT modelservice param, Also updated remaining occurrences for hardcoded IN, OUT and INOUT model service param. (OFBIZ-9434)
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1801267 13f79535-47bb-0310-9956-ffa450edef68
2017-07-08 09:01:37 +00:00
Deepak Dixit 982356f563 Improved: Remove hard-coded instances of "IN" with ModelService.IN_PARAM (OFBIZ-9434)
Thanks Devanshu and Pawan for your contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1801266 13f79535-47bb-0310-9956-ffa450edef68
2017-07-08 08:35:32 +00:00
Jacques Le Roux ab36d3297e Fixed: Wiki restructure issues
(OFBIZ-9416)

Replaces a bunch of deprecated links or shortcuts

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1799242 13f79535-47bb-0310-9956-ffa450edef68
2017-06-19 17:38:38 +00:00
Jacques Le Roux 93dc619f0a No functional changes.
Replaces EntityListIterator.close() in finally by try-with-ressource

I think I have done all these kinds of changes. This is tested.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1798571 13f79535-47bb-0310-9956-ffa450edef68
2017-06-13 09:48:49 +00:00
Jacques Le Roux e49d09f7dd No functional changes.
Replaces entityListIterator.close() in finally by try-with-ressource

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1797097 13f79535-47bb-0310-9956-ffa450edef68
2017-05-31 18:43:05 +00:00
Deepak Dixit 18d4cc3381 Improved: Replace fields with "id-ne", "id-long-ne" and "id-vlong-ne"
with "id", "id-long" and "id-vlong" respectively which are primary keys
(OFBIZ-9351)
Thanks Aditya Sharma for your contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1796379 13f79535-47bb-0310-9956-ffa450edef68
2017-05-27 11:28:36 +00:00
Michael Brohl 9b54d99541 Fixed: Fix TemporalExpressions.Frequency to avoid moving job start times away
from given freqCount raster.
(OFBIZ-9374)

If a job is scheduled using TemporalExpressions.Frequency the start time of the 
job will gradually move forward when the excecution of the job is delayed by one 
or more units of the frequency type.

Example: Job is set up to start at 2017-01-01 00:00:00 and run every ten 
minutes. One month later due to some circumstances the job starts at 
2017-02-01 00:01:01 which results in the next execution to be scheduled at 
2017-02-01 01:11:00 in stead of 2017-02-01 01:10:00.

The reason behind this behaviour is the TemporalExpressions.Frequency#prepareCal 
function. It has the purpose to jump from the first starting time to the latest 
possible execution of the job. But instead it just sets it to the current time 
(with the precision of the chosen frequency type) and calculates the next 
execution time from this point.

Thanks: Tobias Laufkötter for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1796047 13f79535-47bb-0310-9956-ffa450edef68
2017-05-24 12:26:48 +00:00
Deepak Dixit 590573f9f2 Improved: Remove hard-coded success/error message variables set in service output (OFBIZ-9303)
Thanks Devanshu Vyas for your contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1795340 13f79535-47bb-0310-9956-ffa450edef68
2017-05-16 17:02:22 +00:00
Jacques Le Roux 5b6cdb16f9 Implemented: Add the entity-auto CRUD services for RuntimeData
(OFBIZ-9161)

At OFBIZ-9159 I added the entity-auto CRUD services for JobSandbox but 
w/o permission check. 

While working on this issue I decided it's better to have them and decided to 
also put them for JobSandbox CRUD services.

So here are the entity-auto CRUD services for RuntimeData and permission check 
for JobSandbox CRUD services


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1776558 13f79535-47bb-0310-9956-ffa450edef68
2016-12-30 13:16:50 +00:00
Jacques Le Roux 5167567dc3 Implemented: Add the entity-auto CRUD services for JobSandbox
(OFBIZ-9159)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1776528 13f79535-47bb-0310-9956-ffa450edef68
2016-12-30 08:53:50 +00:00
Jacques Le Roux 540dba0300 Implemented: Add a isValid() method to the ModelService class
(OFBIZ-9158)

Improves after a discussion with Scott and Taher on dev ML

Improved to be called only with IN params, the JavaDoc is also improved to 
reflect the changes



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1776447 13f79535-47bb-0310-9956-ffa450edef68
2016-12-29 16:08:11 +00:00
Jacques Le Roux 570c0002e6 Implemented: Add a isValid() method to the ModelService class
(OFBIZ-9158)

The idea is to use validate() to render a boolean result. I needed that in a 
custom project, I think it's worth contributing.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1776243 13f79535-47bb-0310-9956-ffa450edef68
2016-12-28 08:47:25 +00:00
Michael Brohl 945a8afd9c Improved: refactor javadocs in OFBiz to be standards compliant
(OFBIZ-9144)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1774922 13f79535-47bb-0310-9956-ffa450edef68
2016-12-18 18:12:21 +00:00