Commit Graph
9048 Commits
Author SHA1 Message Date
Nicolas Malin a5644da3e4 Fixed: Continue the common-theme upload (OFBIZ-9138 Create a common theme)
Forgot to complete the xsd with element common-screens as child of theme and the attribute name on the same element

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1806169 13f79535-47bb-0310-9956-ffa450edef68
2017-08-25 13:12:22 +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 a728d0c3b0 Implemented: Continue the common-theme upload (OFBIZ-9138 Create a common theme)
Five step
#10 when you missed a definition on your theme, improve the error message to understand what template failed
Now the common-theme would be functional

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1806151 13f79535-47bb-0310-9956-ffa450edef68
2017-08-25 10:04:44 +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
Nicolas Malin dad46a5d6b Implemented: Continue the common-theme upload (OFBIZ-9138 Create a common theme)
Five step these step break all the UI
#8 Migrate the ListVisualThemes screen to use theme definition instead information from the VisualTheme entity

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1806148 13f79535-47bb-0310-9956-ffa450edef68
2017-08-25 09:53:56 +00:00
Nicolas Malin 10af80b1a8 Implemented: Continue the common-theme upload (OFBIZ-9138 Create a common theme)
Five step these step break all the UI
#2 The MacroScreenRenderer class now resolve the macro ftl library location from the model theme
The widget.properties lost all definition now managed by the theme definition

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1806140 13f79535-47bb-0310-9956-ffa450edef68
2017-08-25 09:36:04 +00:00
Nicolas Malin 871ed108a6 Implemented: Continue the common-theme upload (OFBIZ-9138 Create a common theme)
Five step WARNING these step is separate on many commit break all the UI
#1 Prepare the common screens to retrieve widget.properties, VisualThemeRessources and common screen location from the modelTheme

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1806137 13f79535-47bb-0310-9956-ffa450edef68
2017-08-25 09:31:58 +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
Deepak Dixit ddf43d864d Removed images from framework component-load.xml as we moved images into common-theme.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1806128 13f79535-47bb-0310-9956-ffa450edef68
2017-08-25 06:50:03 +00:00
Nicolas Malin 37ac02106b Implemented: Continue the common-theme upload (OFBIZ-9138 Create a common theme)
Third step bis restore CommonScreens.xml with all screens redirect to common-theme

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1806093 13f79535-47bb-0310-9956-ffa450edef68
2017-08-24 21:56:35 +00:00
Nicolas Malin aec57b51c5 Implemented: Continue the common-theme upload (OFBIZ-9138 Create a common theme)
Third step, move macro ftl libraries and ftl template present on framework common to common theme
At this step, the common-theme is forced like the common component previously.

Main common screens present on CommonScreens.xml, LookupScreens.xml and HelpScreens.xml are moved to common screen with a forced rewrite to common-theme 
Warning this commit is going to follow with a other commit for CommonScreens.xml because LookupScreens.xml and HelpScreens.xml are recreated on common-theme, but to keep the history of CommonScreens.xml it was moved entirely, the second commit restore it with redirect call.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1806091 13f79535-47bb-0310-9956-ffa450edef68
2017-08-24 21:55:06 +00:00
Nicolas Malin 15da786110 Implemented: Continue the common-theme upload (OFBIZ-9138 Create a common theme)
Second step, move all images and js library on the common-theme component and move the dedicate webapp image (for continuous compatibility)
The components image is removed from framework.

Warning this commit raise the problem that many images has been uploaded on the framework directory (properties image.server.path and image.management.path) and we need to found a solution to set them out static folder to a dynamic folder like runtime.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1806084 13f79535-47bb-0310-9956-ffa450edef68
2017-08-24 20:38:19 +00:00
Nicolas Malin 965fed43d2 Implemented: Start the common-theme upload (OFBIZ-9138 Create a common theme)
First step, commit model theme engine :
ModelTheme: java object who interact with system and theme definition
VisualTheme: java object who interact with the user session and the theme
ThemeFactory: java factory to load and access to VisualTheme and ModelTheme with the cache
widget-theme.xsd: dtd to define a theme

Load also the main structure common-theme component, (empty for all template, screen, style or js) with this theme definition.
It's not functional at this time


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1806076 13f79535-47bb-0310-9956-ffa450edef68
2017-08-24 19:01:34 +00:00
Nicolas Malin deebac1bb1 Fixed: Consistency and Readability improvements for make-value tag (OFBIZ-8986)
Consistency on the attribute order for make-value element as : entity-name, value-field
Thanks to Ankush Upadhyay and Devanshu Vyas for the issue and the corrective patch

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805956 13f79535-47bb-0310-9956-ffa450edef68
2017-08-23 20:44:44 +00:00
Taher A. Alkhateeb 3806cad490 Refactor OFBiz containers and remove StartupCommandToArgsAdapter
(OFBIZ-9441)

A major refactoring patch that applies the following changes:

- Fully refactor the EntityDataLoadContainer
- Fully refactor the TestRunContainer
- In both above mentioned containers the logic is broken up into smaller
  methods to enhance code readability. It also changes the signature of
  the method calls to rely on StartupCommand instead of String[] arrays
- Remove most old documentation and commented out code where applicable
- Delete the StratupCommandToArgsAdapter as it is no longer needed
- Create a new feature in which OFBiz by default fails if any data file
  fails to load. This can be overridden by passing a flag called
  "continue-on-failure" e.g. ./gradlew "ofbiz --load-data continue-on-failure"
- Add a new property to --test called "loglevel" (old code but working properly)
- Add many new properties to the --load-data command including repair-columns,
  try-inserts, maintain-txs, etc ... These properties are old, but somehow
  did not make it into the command line arguments. This code is now exposed
  through the command line to set a direction in the future of whether to
  keep or delete these extra commands
- Update the documentation output of ./gradlew "ofbiz --help" to incorporate
  the new mentioned properties
- Refactor README.md to incorporate the changes to the gradle commands for both
  "-load-data" and "-test" properties. Also remove the gradle GUI
  documentation as it is now deprecated.
- Also refactor README.md in other locations to cleanup and make it more
  consistent. This icludes moving long notes into new sections and reducing
  the verbosity of the security header. Furthermore, created a new header
  called Miscellaneous documentation to house the newly created sections
- lots of small changes to remove EOL white space

Thanks: Jacques Le Roux for reviewing and testing


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805947 13f79535-47bb-0310-9956-ffa450edef68
2017-08-23 18:56:15 +00:00
Jacques Le Roux 7f350f3ff5 No functional change
Fixes typos reported by Renuka Srishti on dev ML


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805936 13f79535-47bb-0310-9956-ffa450edef68
2017-08-23 16:27:58 +00:00
Nicolas Malin 2e9a000287 Fixed: Consistency and Readability improvements for view-map tag (OFBIZ-9110)
Consistency on the attribute order for view-map element as : name, type, page
Thanks to Ankush Upadhyay and Devanshu Vyas for the issue and the corrective patch

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805892 13f79535-47bb-0310-9956-ffa450edef68
2017-08-23 12:18:09 +00:00
Nicolas Malin 5d73d58f8b Implemented: Add uel function to resolve a label (OFBIZ-9617)
Instead call a label from FlexibalStringExpander syntax $
{groovy: org.apache.ofbiz.base.UtilProperty.getMessage(myRessource, myLabel, locale)}

, this issue propose to implemented an uel function like : $
{util:label(myRessource, myLabel, locale)} 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805888 13f79535-47bb-0310-9956-ffa450edef68
2017-08-23 11:58:42 +00:00
Jacques Le Roux b4bfcee1b9 Fixes a typo reported by Renuka Srishti on dev ML
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805775 13f79535-47bb-0310-9956-ffa450edef68
2017-08-22 15:04:24 +00:00
Deepak Dixit 0cdc258281 Removed duplicated request/view mapping
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805755 13f79535-47bb-0310-9956-ffa450edef68
2017-08-22 11:52:02 +00:00
Deepak Dixit e6038b7310 Removed unused variable previousRequestAttrMap from RequestHandler.java, as its not used since long.It was added at r#741374
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805739 13f79535-47bb-0310-9956-ffa450edef68
2017-08-22 09:16:57 +00:00
Jacques Le Roux 45855c4d6c Fixed: Ecommerce login/logout don't work properly for trunk and stable
(OFBIZ-9240)

ecomseo trunk and stable (R16)

    Get to https://demo-trunk.ofbiz.apache.org/ecomseo/ 
        or https://demo-stable.ofbiz.apache.org/ecomseo/
    login => main page logged in
    logout => main page, not logged in
    login => main page logged in
    Use the "Not you" link => 404
    Refresh (F5 key) get you to the main page, not logged in

So it works almost correctly but you need a refresh (F5 key) for the "Not you" 
link, not sure why yet. 
It"s the same locally with OFBIZ-9206 fixed*, w/ or w/o portoffset ecommerce 
trunk and stable (R16)

    Get to https://ofbiz-vm2.apache.org:8443/ecommerce 
        or https://ofbiz-vm2.apache.org:18443/ecommerce
    login => blank page (no 404 in access log)
    Refresh (F5 key) get you to the main page, logged in
    logout => blank page (no 404 in access log)
    Refresh (F5 key) get you to the main page, not logged in
    login => blank page (no 404 in access log)
    Refresh (F5 key) get you to the main page, logged in
    use the "Not you" link => blank page (no 404 in access log)
    Refresh (F5 key) get you to the main page, not logged in

So it works almost correctly but you need a refresh (F5 key) between in the 
3 cases, not sure why yet. 
It's the same locally with OFBIZ-9206 fixed, w/ or w/o portoffset

Rohit:
The sequencing order of ControlFilter and ContextFilter is causing this problem.
I tried to swap the order in case ecommerce but changing the sequence will not 
work because other filters(like ContentUrlFilter, CatalogUrlFilter) depends on 
the context prepared by ContextFilter.

The issue is like when we are doing chaining of request using request-redirect 
than one request attribute(FORWARDED_FROM_SERVLET) set to TRUE from 
ControlServlet. In case of ecommerce ContextFilter run before ControlFilter 
which copies all the attribute from parent request to redirect request and 
when execution reaches the ControlFilter for the redirect request than request 
will fail to hit the servlet due to the code present 
at line 126(ControlFilter.java).

To fix this problem I removed the code which copies all the attribute from 
parent request to redirect request because this thing is already taken care in 
the RequestHandler.

Thanks: Rohit and Jacopo for the analysis and the fix

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805677 13f79535-47bb-0310-9956-ffa450edef68
2017-08-21 20:46:28 +00:00
Jacques Le Roux 33d7198d0a Fixed: LabelManager doesn't search labels in .groovy files
(OFBIZ-8153)

The logic written needs more use cases to be covered for groovy files, existing 
findUiLabelMapInFile is not fit for groovy files.

Following patterns are currently used in groovy files:
1. uiLabelMap.xxxxx
2. uiLabelMap.get("xxxxx")

Thanks: Suraj Khurana

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805558 13f79535-47bb-0310-9956-ffa450edef68
2017-08-20 14:14:26 +00:00
Jacques Le Roux 2f66c248e6 No functional change,
In 3 places we use uiLabelMap.get("xxxxx") instead of uiLabelMap.xxxxx which 
does essentially the same when there is no default parameter passed to get()
http://mrhaki.blogspot.fr/2009/11/groovy-goodness-get-value-from-map-or.html

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805548 13f79535-47bb-0310-9956-ffa450edef68
2017-08-20 12:11:39 +00:00
Michael Brohl 7f9e0ebf75 Improved: Fixing defects reported by FindBugs, package
org.apache.ofbiz.base.component.
(OFBIZ-9560)

Thanks Dennis Balkir for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805472 13f79535-47bb-0310-9956-ffa450edef68
2017-08-18 20:52:19 +00:00
Michael Brohl 076a2f62d8 Improved: EmailServices.sendMailFromScreen improved to take multiple
attachments with appropriate type along with several email fixes.
(OFBIZ-9395)

This patch fixes a number of issues combined in a patch because of the 
code dependencies.

1. it enables to add BCC adress(es) to service 
OrderServices.sendOrderNotificationScreens to oversteer 
ProductStoreEmailSetting of BCC the same was as for CC.

2. a method UtilValidate.isEmailList(String) is added to check a 
comma separated list of email addresses, used for example to check the 
String passed to the new BCC field for an Order-Notification.

3. there are improvements in EmailServices.sendMailFromScreen. The 
attachment type of MailAttachments is now not only .pdf but depends on 
the specific file. This has not been the case before - the mime type was
always hard coded as .pdf. The same goes for the bodyPart content-type 
which is now set to the passed content type or the default text/html 
type. Before this was also always set to text/html. 
Additionally, an attachment that has the mime-type text/plain is not 
rendered with the fop-renderer anymore but with a simple text-renderer. 
Therefore it is possible to send an CSV file as attachment now.

The patch also refactors some catch-Blocks in the 
EmailServices.sendMailFromScreen by using multi-catch since the e
xception handling is always the same.

Thanks Martin Becker for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805459 13f79535-47bb-0310-9956-ffa450edef68
2017-08-18 19:10:41 +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 d6b89bc509 Fixed: Collection added to itself
(OFBIZ-9578)

In a recent github mirror, I've found suspicious code.
Branch: master
path: framework/entity/src/main/java/org/apache/ofbiz/entity/jdbc/DatabaseUtil.java

...
1588         protected final List<String> messages = new LinkedList<String>();
...
1596         protected int updateData(Collection<String> messages) {
1597             if (messages != null && UtilValidate.isNotEmpty(this.messages)) {
1598                 messages.addAll(messages);
1599             }
1600             return count;
1601         }
1602     }

In Line 1598, `messages.addAll' should be `this.messages.addAll'? 
This might not be an issue but I wanted to report this just in case.

Thanks: JC (jaechang.nam@gmail.com)for report 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805143 13f79535-47bb-0310-9956-ffa450edef68
2017-08-16 07:41:31 +00:00
Jacques Le Roux 3cc575b6de Improved: Check there are no white spaces around the name of a form field when
updating a form
(OFBIZ-9306)

Sometimes ago, I lost an hour because of a space at the end of a field's name in 
a form. In creation it does not pass (the field lacks) but when updating the 
form it passes and it's hard to find from where comes the problem.

Thanks: Michael for review and spotting a possible NPE in my 1st patch

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805141 13f79535-47bb-0310-9956-ffa450edef68
2017-08-16 06:34:56 +00:00
Nicolas Malin cb175c71f7 Fixed: Missing fieldInfo when call constructor for ModelFormField Password, File and Lookup
(OFBIZ-9577)

When you create a form with an entity or service auto fields, the three previous form field call only "super(fieldSource, modelFormField);" in their constructor or this initialise a TextField with the fieldInfo FieldInfo.TEXT.
I force the field info when the super constructor is called

This missing has been found during investigation on the issue OFBIZ-9577 to improve auto-fields-service with a file upload



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1805011 13f79535-47bb-0310-9956-ffa450edef68
2017-08-14 15:47:36 +00:00
Jacques Le Roux 6d55e9342b No functional changes, fixes JavaDoc issues
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804973 13f79535-47bb-0310-9956-ffa450edef68
2017-08-14 10:04:34 +00:00
Jacques Le Roux a85c94dc2f Implemented: New UtilMisc method collectionToString(...) building safely a
String with the given collection and delimiter
(OFBIZ-9397)

The added method UtilMisc.collectionToString(Collection values, String delimiter) 
creates a String from the values of a collection, separated with the given 
delimiter. This is done in a safe way without a "null" literal.

Thanks: Martin Becker

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804970 13f79535-47bb-0310-9956-ffa450edef68
2017-08-14 09:52:49 +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
Jacques Le Roux 1eb540f616 No functional change.
This has been deprecated for 5+ years, time for action!

Uses digestHash() methods instead of getDigestHash(). Easily replaceable...

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804880 13f79535-47bb-0310-9956-ffa450edef68
2017-08-13 07:21:01 +00:00
Nicolas Malin 082d629aa9 Implemented: Connect OFBiz to a read only database (OFBIZ-6401)
Add a DAO helper class to use a datasource as readonly
This helper is disable by default. To enable it change the helper class on your datasource use in entityengine.xml like

    <datasource name="localderby"
            helper-class="org.ofbiz.entity.datasource.ReadOnlyHelperDAO"
            schema-name="OFBIZ" ...



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804826 13f79535-47bb-0310-9956-ffa450edef68
2017-08-11 17:09:08 +00:00
Nicolas Malin 8deead6052 Fixed: Related to the issue OFBIZ-6401Connect OFBiz to a read only database
Escape null pointer exception stack trace when the helper return no value 


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804824 13f79535-47bb-0310-9956-ffa450edef68
2017-08-11 17:02:34 +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
Jacques Le Roux b6e860f6b7 Improved: [FB] Package org.apache.ofbiz.base.metrics
(OFBIZ-9567)

Changes a division with two long variables whose result was casted into a double
Now it performs a proper double division

Thanks: Dennis Balkir (and FB ;))

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804656 13f79535-47bb-0310-9956-ffa450edef68
2017-08-10 10:27:57 +00:00
Jacques Le Roux 6d67c194a0 Improved: [FB] Package org.apache.ofbiz.base.config
(OFBIZ-9566)

MainResourceHandler
 The protected fields were set to private since the class is not extended 
 anywhere. If they need to be accessed in the future, getter that return an 
 unmodifiable version should be implemented (Collections.unmodifiableXXX).

Refactor:
 Uses multi exceptions catch (explicitly to not catch, hence somehow swallow, 
 RuntimeException)
 Uses return instead of else when appropriate
 Extracts a getLoader() handy method
 Removes an useless thrown exception in invalidateDocument()
 Removes an useless Document cast
 Removes an useless ResourceLoader null initialisation 

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804639 13f79535-47bb-0310-9956-ffa450edef68
2017-08-10 07:52:16 +00:00
Jacques Le Roux 98e89f33ff No functional trivial changes
When reviewing code, Eclipse complains: "Javadoc: Invalid param tag name"
when a param tag name "contains" a colon at end

Weirdly it does not complain about @return. Go figure! But I'll apply the same!

This removes all cases found in trunk. Another way could be to add a space 
between the tag and the colon. But that's not how it's recommended to write

http://www.oracle.com/technetwork/articles/java/index-137868.html

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804637 13f79535-47bb-0310-9956-ffa450edef68
2017-08-10 07:21:22 +00:00
Jacques Le Roux d0dd85d890 Improved: [FB] Package org.apache.ofbiz.base.container
(OFBIZ-9563)

Fixes some diamond operators

ComponentContainer.java
  deleted multiple unnecessary nullchecks
  added nullcheck, because sortedComponentNames could possibly be assigned as 
    null through the method list()

ContainerConfig.java
  deleted multiple unnecessary else-blocks
  deleted two initializations to shorten the code and return the value directly

Thanks: Dennis Balkir


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804636 13f79535-47bb-0310-9956-ffa450edef68
2017-08-10 07:10:55 +00:00
Jacques Le Roux 75c40fef71 No functional trivial changes
When reviewing code, Eclipse complains: "Javadoc: Invalid param tag name"
when a param tag name "contains" a colon at end

This removes all cases found in trunk. Another way could be to add a space 
between the tag and the colon. But that's not how it's recommended to write

http://www.oracle.com/technetwork/articles/java/index-137868.html

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804635 13f79535-47bb-0310-9956-ffa450edef68
2017-08-10 06:31:38 +00:00
Jacques Le Roux d34d77bde3 Improved: [FB] Package org.apache.ofbiz.base.concurrent
(OFBIZ-9562)

Fixes some diamond operators
Implementes equals method to fix potential problems
Implementes hashCode method because I implemented equals method
Implementes timeDiff method to keep the code DRY

Thanks: Dennis Balkir

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804634 13f79535-47bb-0310-9956-ffa450edef68
2017-08-10 06:11:26 +00:00
Jacques Le Roux 89eca637b8 Improved: [FB] Package org.apache.ofbiz.base.lang.test
(OFBIZ-9565)

Fixes some diamond operators

Thanks: Dennis Balkir

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804558 13f79535-47bb-0310-9956-ffa450edef68
2017-08-09 15:46:11 +00:00
Jacques Le Roux d232eae643 Improved: [FB] Package org.apache.ofbiz.base.lang
(OFBIZ-9564)

Implemented method hashCode() because method equals() was implemented
Changed Exception to RuntimeException because no exception was thrown and the 
only occurring exception could be a runtimeexception

Thanks: Dennis Balkir

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804556 13f79535-47bb-0310-9956-ffa450edef68
2017-08-09 15:44:00 +00:00
Jacques Le Roux f1fb12bd0b Improved: Refactor EntityListIterator
(OFBIZ-9549)

The EntityListIterator contains duplicate code and has need for refactoring in 
general.

Thanks: Tobias Laufkötter

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804328 13f79535-47bb-0310-9956-ffa450edef68
2017-08-07 12:43:54 +00:00
Jacques Le Roux 82ce693f5a Fixed: Bug SQL Count Distinct command in GenericDAO.java
(OFBIZ-5701)

jleroux: Kieuanhvu's explanation was not totally clear. So I rather provide
Renuka Srishti's at OFBIZ-9428 "getResultsSizeAfterPartialList() return wrong 
count with distinct() for View Entity"

Here is the code sample to test the issue:

EntityListIterator productAssocListItr = null;
productAssocListItr = from("ProductAndAssoc").distinct().queryIterator();
productAssocListSize = productAssocListItr.getResultsSizeAfterPartialList();

productAssocListSize will differ from the actual distinct records in the 
ProductAndAssoc View Entity.
This issue exists because it gives distinct records on the basis of the 
first column in the table.

Thanks: Kieuanhvu for the patch, Renuka Srishti for a clear explanation and a 
simple way to test (in a groovy for me)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804319 13f79535-47bb-0310-9956-ffa450edef68
2017-08-07 10:40:32 +00:00
Jacques Le Roux f41feebf57 Completed: Remove the never implemented deleteParty (pre Apache era)
(OFBIZ-9556)

In dev ML in this thread https://s.apache.org/pc90 
I suggested to remove the never implemented deleteParty (pre Apache era)


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1804315 13f79535-47bb-0310-9956-ffa450edef68
2017-08-07 10:00:55 +00:00