Commit Graph
65 Commits
Author SHA1 Message Date
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 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 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
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 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
Arun Patidar 001bbe9a52 Integrating google phone number library for validating telecom numbers. (OFBIZ-9358)
Applied slightly modified patch. Thanks Suraj Khurana and Renuka Srishti for your contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1802661 13f79535-47bb-0310-9956-ffa450edef68
2017-07-22 09:10:50 +00:00
Taher A. Alkhateeb 3ed1891429 Improved: removed unused private final variables in UtilValidate.java
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1801431 13f79535-47bb-0310-9956-ffa450edef68
2017-07-10 09:05:51 +00:00
Michael Brohl eab1123394 Improved: UtilMisc.toMap(), toList() and toSet() refactoring taking Varargs for
creating the wanted data structure.
(OFBIZ-9393)

This patch removes a number of outdated methods that took a fixed number of 
objects to create a data structure, such as a linked list. Since the code is 
outdated and inflexible, this patch removes these methods and added methods to 
create the given data structure via a variable amount of arguments. 
This approach also ensures that no other code needs a refactoring. In addition 
the method populateMap() was removed which was private and was only used by the 
multiple outdated toMap() functions.

Thanks Martin Becker for reporting and providing the patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1800299 13f79535-47bb-0310-9956-ffa450edef68
2017-06-29 16:04:01 +00:00
Taher A. Alkhateeb 662b54cf8a Improved: exception handling block in ContainerConfig removing code duplication
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1799712 13f79535-47bb-0310-9956-ffa450edef68
2017-06-23 21:40:51 +00:00
Taher A. Alkhateeb 632e55f378 Implemented: removed unused private variables from UtilDateTime
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1799148 13f79535-47bb-0310-9956-ffa450edef68
2017-06-19 08:08:36 +00:00
Jacques Le Roux 4e529f7055 Improved: Writer closed but not in case of exception
(OFBIZ-9388)

This is an improvement only because no cases were reported. But obviously in 
case of unlucky exception after the Writer creation and before it's closed the 
Writer remains in memory.

The solution is to use try-with-ressources when possible, even when finally was
used (no problems then).

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1797742 13f79535-47bb-0310-9956-ffa450edef68
2017-06-06 07:34:28 +00:00
Jacques Le Roux c056e0ae87 No functional change.
When Adrian removed finished removing Javolution from the base component at
r1635910 https://s.apache.org/cwfE he routinely changed FastList to LinkedList 
and FastMap to HashMap.

Actually those are just duplicates of ArrayList for LinkedList and strictly 
HashMap for, er, HashMap.

This removes those useless line from the tests.

I wodered about it, but I hope noone will argue that we should keep LinkedList, 
obviously ArrayList is enough there as a List implementation.

With this change the words fastlist and fastmap (case insensitive) no longer 
exists in any OOTB files.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1794504 13f79535-47bb-0310-9956-ffa450edef68
2017-05-09 08:11:55 +00:00
Jacques Le Roux bcca0823ba No functional change, fixes indentation after r1792939
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1792959 13f79535-47bb-0310-9956-ffa450edef68
2017-04-27 21:23:31 +00:00
Jacques Le Roux eabcc96c5f Fixed: Create and use an OWASP PolicyFactory for content sanitization in
ContentWorker for Birt Flexible Reports
(OFBIZ-9166)



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1792939 13f79535-47bb-0310-9956-ffa450edef68
2017-04-27 18:46:36 +00:00
Jacques Le Roux a59c0054c8 Fixed: On setting verbose true, UtilHttp.getParameterMap() method prints
username and password in logs
(OFBIZ-9310)

In UtilHttp.getParameterMap(HttpServletRequest request, Set<? extends String>...
method, following line of code prints username and password in logs when verbose
 is set to true.

Debug.logVerbose("Request Parameter Map Entries: " + 
System.getProperty("line.separator") + UtilMisc.printMap(paramMap), module);

Aditya suggested:
Removed the line that prints "Request Parameter Map Entries" as it may print 
username and password entered by user when verbose set to true. 
It may not be a grave concern for staging environment as verbose are not logged 
there but it is still unethical to print such details.

jleroux: I decided to rather comment out the line which might still be useful
in some cases...

Thanks: Aditya Sharma

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1791346 13f79535-47bb-0310-9956-ffa450edef68
2017-04-14 11:04:04 +00:00
Jacques Le Roux 1abfaae094 No functional change, fixes a typo
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/ofbiz-framework/trunk@1785478 13f79535-47bb-0310-9956-ffa450edef68
2017-03-04 13:08:50 +00:00
Jacques Le Roux f0b3ba7634 Fixed: Reinstate url cache in UtilURL.fromResource
(OFBIZ-9208)

Adrian created the following commit to cache URL objects 


Revision: 1649979
Author: adrianc
Date: 07 January 2015 00:24:28
Message:
Some optimizations for URL lookups.
----
Modified : /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilProperties.java
Modified : /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilURL.java

and was later reverted in this commit

Revision: 1650347
Author: adrianc
Date: 08 January 2015 17:53:59
Message:
Some small fixups for some of my previous commits.
----
Modified : /ofbiz/trunk/framework/entity/src/org/ofbiz/entity/util/EntityClassLoader.java
Modified : /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/UtilURL.java

We have found in one of our production servers that line 98 in UtilURL.java

url = loader.getResource(resourceName);

has caused locking and looking at the stack trace (from jstack). There are 
numerous threads waiting on locks from within this method

I propose the cache gets added back (we have done this as a patch on our systems
 with no ill effect)

FYI - The commits are in reference to the EntityClassLoader which is not used 
and does not work see OFBIZ-6210

Thanks: Gareth Carter for report and suggestion

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1782520 13f79535-47bb-0310-9956-ffa450edef68
2017-02-10 20:38:46 +00:00
Jacques Le Roux b057011c26 No functional change, reverts r1781366
I did not even notice I committed this bunch of WIP stuff. I guess I clicked 
somewhere while my machine was too buzy

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1781367 13f79535-47bb-0310-9956-ffa450edef68
2017-02-02 10:54:06 +00:00
Jacques Le Roux e130654d28 No functional change, this was reverted in r1781367
I did not even notice I committed this bunch of WIP stuff. I guess I clicked 
somewhere while my machine was too buzy



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1781366 13f79535-47bb-0310-9956-ffa450edef68
2017-02-02 10:33:59 +00:00
Jacques Le Roux 7785d5a470 Implemented: Birt Report Builder: an enhancement of the Birt component.
Easier user possibility of report creation.
(OFBIZ-6919)

Fixes a small issue: the REPORT contentId is now named FLEXIBLE_REPORT

Note: the BIRT_REPORT_BUILDER_USAGE_POLICY still need to be completed. Hence 
it's for now bypassed in ContentWorker.renderContentAsText(), based on the 
FLEXIBLE_REPORT contentId

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1779701 13f79535-47bb-0310-9956-ffa450edef68
2017-01-21 07:02:19 +00:00
Taher A. Alkhateeb 72b9013f24 Implemented: renamed the directory specialpurpose to plugins
(OFBIZ-7972)

In another step towards completing the plugin system for OFBiz, we renamed
the /specialpurpose directory to /plugins and changed all occurences of the
word "specialpurpose" to "plugins" in all files found in the system

Reference discussion: http://markmail.org/message/hpyuxkmftiyn44w2


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1778271 13f79535-47bb-0310-9956-ffa450edef68
2017-01-11 10:48:47 +00:00
Jacques Le Roux 6c88ed0ab9 Implemented: Create and use an OWASP PolicyFactory for content sanitization
in ContentWorker for Birt Report Builder
(OFBIZ-9166)

This is still an incomplete feature because I did not find yet a way to complete
the BIRT_REPORT_BUILDER_USAGE_POLICY and had to bypass the sanitization for this
case, WIP...

This commit has no effect on OFBiz yet.

I need to commit this now to continue to work on the main task: OFBIZ-6919
"New implementation of Birt. Easier user possibility of report creation". 







git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1777451 13f79535-47bb-0310-9956-ffa450edef68
2017-01-05 11:29:26 +00:00
Michael Brohl 97ba34128e Improved: refactor javadocs in OFBiz to be standards compliant
(OFBIZ-9144)

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1774815 13f79535-47bb-0310-9956-ffa450edef68
2016-12-17 23:34:51 +00:00
Taher A. Alkhateeb 71f512a0d2 Improved: refactor javadocs in OFBiz to be standards compliant
(OFBIZ-9144)

This is the first commit to the above mentioned issue which fixes many javadoc
errors dispersed through the different components. The fixes are not
necessarily improvements to the javadocs but rather making them valid javadocs
to prevent reporting errors from gradle


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1774154 13f79535-47bb-0310-9956-ffa450edef68
2016-12-14 09:22:32 +00:00
Jacopo Cappellato 2dc10024e4 Fixed: removed empty file (invalid class), a leftover of the commit that
removed Cobertura some time ago.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1773363 13f79535-47bb-0310-9956-ffa450edef68
2016-12-09 11:40:33 +00:00
Jacopo Cappellato d15dabb392 Fixed: incorrect @see reference to method in Javadoc.
Thanks: Taher Alkhateeb for the report. 


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1773354 13f79535-47bb-0310-9956-ffa450edef68
2016-12-09 10:33:54 +00:00
Jacopo Cappellato bd40d8526f Fixed: a series of wrong argument names in Javadoc comments.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1773338 13f79535-47bb-0310-9956-ffa450edef68
2016-12-09 08:49:56 +00:00
Shi Jinghai 71acaf13e7 Improved: LoginWorker HashCrypt the type of hash for one-way encryption
(OFBIZ-8537)

Committed wangjunyuan's new patch.

Thanks: wangjunyuan for the new patch to make the PBKDF2 hashed password comply with RFC 6070, the feedbacks of Jacques and Nicolas on the previous patch.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1773066 13f79535-47bb-0310-9956-ffa450edef68
2016-12-07 12:45:15 +00:00
Taher A. Alkhateeb 8074a9b3c6 Improved: Refactor and simplify the startup sequence in OFBiz
(OFBIZ-8337)

This is another major commit to the refactoring of the startup sequence in
OFBiz with the following highlighted changes:

- Delete the NativeLibClassLoader.java
- Delete the native classpath logic in Classpath.java
- Refactor the ComponentContainer and StartupControlPanel to operate without
  the NativeLibClassLoader. This substantially simplifies the code
- Declare a URLClassLoader in ComponentContainer that is instantiated upon
  building the classpath for all components. This makes the classloader start
  in one shot
- Simplify the Config file and remove fields that are not used. Also
  refactor some messy logic for loading the props file and other code
  improvements
- Refactor all the .properties files for startup to have a consistent
  structure that clearly documents all available properties and the
  default value for each property. This change is also related to the
  changes applied on Config.java
- Remove the declaration of the StartupLoader implementation class
  from all startup .properties files because only one implementation exists
  and it should be the default always.
- Refactor the loaders retrieval code (main, rmi, test, load-data) defined
  in the startup .properties files
- Refactor some switch statements to comply with java coding standards
- Add the DTDs defined in base through Gradle because we removed the
  NativeLibClassLoader and the classpath buildup logic in StartupControlPanel

Thanks: Jacopo Cappellato for reviewing the work


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1772879 13f79535-47bb-0310-9956-ffa450edef68
2016-12-06 12:31:00 +00:00
Shi Jinghai dbcfeaefb0 Implemented: LoginWorker HashCrypt the type of hash for one-way encryption
Added PBKDF2 hash type to encrypt password.

Thanks: wangjunyuan for this contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1772589 13f79535-47bb-0310-9956-ffa450edef68
2016-12-05 01:32:51 +00:00
Taher A. Alkhateeb 7d2d6216ca Improved: Refactor and simplify the startup sequence in OFBiz
(OFBIZ-8337)

Continuing the refactoring work on the startup sequence, this commit
specifically focuses on the ComponentContainer and how it loads
components into the system. The following changes are made:

- simplify and cleanup the ofbiz-containers.xml to have only one entry
- substantially simplify the ComponentLoaderConfig class and remove unnecessary defined state
- delete the JustLoadComponentsContainer (used to exist for the server command --testlist which no longer exists)
- fully refactor the ComponentContainer class and breakup the messy logic into chunks of private methods. The methods are also properly documented.
- remove an old reference to the testlist container which no longer exists



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1772256 13f79535-47bb-0310-9956-ffa450edef68
2016-12-01 19:29:23 +00:00
Jacopo Cappellato 090c93d37f [Implemented]: Upgraded Freemarker to the latest release 2.3.25.
This upgrade fixes the SuppressFBWarnings warnings occuring at compilation time.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1771927 13f79535-47bb-0310-9956-ffa450edef68
2016-11-29 17:41:30 +00:00
Arun Patidar 80498ef38d Implemented: Refer to objects by their interfaces rather than class when instantiating Collection implementation classes in Java files
(OFBIZ-9023) (OFBIZ-9026)(OFBIZ-9027)(OFBIZ-9032)(OFBIZ-9034)(OFBIZ-9036)(OFBIZ-9030)

Thanks: Divesh Dutta, Amit Gadaley and Shubham Agrawal for the contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1768189 13f79535-47bb-0310-9956-ffa450edef68
2016-11-05 11:16:49 +00:00
Taher A. Alkhateeb aadf556625 Reverted: partially reverted r1765127 to fix classpath issue
(OFBIZ-8337)

The above mentioned revision introduced a regression in which starting
OFBiz in debug mode triggers classpath exceptions due to not finding
certain jars. Upon investigation we realized that the new logic
instantiates the loader class before the custom ClassLoader is
instantiated. The fix would take a bit more time, hence reverting now
to quickly resolve the issue and make the code base ready for the next
release. The revert essentially re-introduce a List<StartupLoader> data
set instead of a single StartupLoader.

This is a minimal revert (less than 400 lines) instead of a full revert
going above 2000 lines because we isolated only the parts that trigger the
regression mentioned above. However, we should ideally revisit this code
and clean it up again with careful attention to the class loading sequence.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1767866 13f79535-47bb-0310-9956-ffa450edef68
2016-11-03 11:03:54 +00:00
Deepak Dixit b150af15ea Improved: UtilValidate isEmpty and isNotEmpty methods not used correctly
(OFBIZ-8413)

Thanks Pawan Verma for your contribution.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1766868 13f79535-47bb-0310-9956-ffa450edef68
2016-10-27 19:21:41 +00:00
Taher A. Alkhateeb d44020f0d6 Improved: Refactor and simplify the startup sequence in OFBiz
(OFBIZ-8337)

This is a major refactoring exercise to simplify the startup sequence in
OFBiz. There are no functional changes, however, both the logic and the
API signatures of the core classes in OFBiz are changed to help simplify
the startup sequence. The changes insofar are summarized as:

- Rename ContainerConfig.Container to ContainerConfig.Configuration, the old
  nameing was very confusing as it confuses it with actual containers
- Change the signature of ContainerLoader and Container to accept
  List<StartupCommand> instead of String[]. And also migrate the adapter for
  converting these args into a standalone class called
  StartupCommandsToArgsAdapter
- Remove the LockedBy annotation as it is not used
- Substantially simplify the ContainerLoader load and unload logic and delete
  the start logic (merge it with load). The interface StartupLoader was updated
  accordingly
- Remove old logic to load containers in hot-deploy components
- Remove printThreadDump output from ContainerLoader which used to exist for
  debugging purposes and is no longer necessary
- Cleanup the AdminServer startup logic
- Change the StartupControlPanel logic to use only one StartupLoader instead
  of a list. The only implementation is ContainerLoader
- Remove the synchronized blocks in StartupControlPanel due to having only one
  loader
- Update the startup .properties files to reflect the changes in the startup
  logic
- Update the TestRunContainer to use List<StartupCommand> in its logic

We expect more commits (specifically to the containers) to complete this
refactoring initiative



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1765127 13f79535-47bb-0310-9956-ffa450edef68
2016-10-16 09:07:08 +00:00
Jacques Le Roux 02203f4c01 No functional change: removes unused UtilCache.createLineInfo() method, found
while working on OFBIZ-8321

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1764222 13f79535-47bb-0310-9956-ffa450edef68
2016-10-11 10:37:27 +00:00
Jacques Le Roux 9fe4260342 Improves: After r1761181 some useful comments were removed. This readds them
Also some comments were not removed but should have been, this removes them
No functional changes



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1763154 13f79535-47bb-0310-9956-ffa450edef68
2016-10-03 11:12:48 +00:00
Jacques Le Roux 77732423ac Fixes: Can't find resource for bundle
(OFBIZ-8336)

When going for example to EditProductContent (Product --> Content) 
the following error message appears:
2016-09-27 20:02:40,822 |http-nio-8444-exec-7 |UtilProperties |I| null
java.util.MissingResourceException: Can't find resource for bundle 
org.apache.ofbiz.base.util.UtilProperties$UtilResourceBundle, 
key FieldDescription.sequenceNum

jleroux: this has not been handled right from start and in several changes
later. Rather than throwing an exception in UtilProperties.getMessage() it's 
better to check if the bundle contains the key and else to log info


Thanks: Ingo Wolfmayr for report and Rohit Koushal for research

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1763085 13f79535-47bb-0310-9956-ffa450edef68
2016-10-02 17:12:37 +00:00
Jacopo Cappellato 7370ea5409 Improved: added some missing license headers.
git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1762238 13f79535-47bb-0310-9956-ffa450edef68
2016-09-25 21:25:02 +00:00
Jacopo Cappellato b84345831b Improved: cleanups and enhancements in the FreeMarkerWorker class, and client
code using it, that wraps most of the OFBiz integration with FreeMarker.

This is the list of the main modifications:
* simplified and cleaned up the public methods of FreeMarkerWorker, used to 
retrieve and render Freemarker templates and changed client code accordingly to 
use them
* removed unused methods in FreeMarkerWorker and made some others private
* improved the integration code in FreeMarkerWorker to better use the Freemarker 
API and specifically to leverage the various TemplateLoaders and the Freemarker 
caching mechanism; it is now possible to switch the OFBiz legacy template 
caching mechanism to use the Freemarker one instead
* improved the implementation of Freemarker template rendering from strings 
(used by DataResourceWorker): it now leverages the Freemarker's 
StringTemplateLoader that provides the ability to cache the strings, retrieved 
from DataResources records, based on the timestamp of the last modification
* moved freemarkerImports.properties from "widget" to "base" component, and 
changed its content (and the content of the associated templates 
AutoImportTemplate.ftl and HtmlTemplate.ftl) to remove the dependency from base 
to widget&common; some resources of "widget" and "common" are still referenced 
from AutoImportTemplate.ftl (that is in "base") but even if they are soft 
dependencies: if they are missing the system will load properly without any 
error or warning; before this change it was impossible to use, or unit test, 
FreeMarkerWorker before the "widget" and "common" components were loaded by the 
system, now it is possible
* created a new class for unit tests for FreeMarkerWorker, named 
FreeMarkerWorkerTests: at the moment it contains just one simple unit test but 
more should be implemented
* refactored WebToolsServices.entityImport(...) to leverage the 
FreeMarkerWorker.renderTemplate(...) method to run the Freemarker template, 
rather than dealing with the Freemarker API directly; this is now possible 
thanks to the cleanups and improvements done in the FreeMarkerWorker class; this 
same approach should be implemented for a few other similar integration points 
(mostly in the "content" component); this is a TODO item
* moved the encodeDoubleQuotes(...) method from FreeMarkerWorker to 
MacroFormRenderer and made it private since this is the only calss using it and 
its logic is not related to FreeMarker



git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1762227 13f79535-47bb-0310-9956-ffa450edef68
2016-09-25 17:20:58 +00:00
Jacopo Cappellato 86e630c340 Fix for: Freemarker's ignore_missing attribute of the #include directive was not
working because of an issue in the OFBiz custom TemplateLoader for Freemarker 
templates.
(OFBIZ-8292)

The OFBiz custom TemplateLoader now returns null if the resource is missing as 
required by the TemplateLoader specification.
Additional cleanups for unused methods in the FreeMarkerWorker class and some 
minor fine tuning; improved the way errors are rendered: now the full stack 
trace is not shown in the screen but only in the logs.

Thanks: Jacques Le Roux for the report.


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1761586 13f79535-47bb-0310-9956-ffa450edef68
2016-09-20 14:51:20 +00:00
Taher A. Alkhateeb f94944b080 Fix for: removing the need to generate ofbiz-base-test.jar
In reference to the below discussion thread, this commit removes a task
 which generates the above mentioned jar file which holds a service
 definition. The fix is replace the gradle task which automatically
 generates service with a flat directiory (META-INF) that defines the
 service provides. All tests pass.
 
 Thread: http://markmail.org/message/wzmw2qbacg4hup7r
 
 Thanks: Jacques Le Roux for reporting this issue


git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1761421 13f79535-47bb-0310-9956-ffa450edef68
2016-09-19 10:46:42 +00:00
Ashish Vijaywargiya da3b8a406f Improved: Clean up commented out code in Java source for Base component.
(OFBIZ-8036)
Thanks: Harsh for the contribution.

git-svn-id: https://svn.apache.org/repos/asf/ofbiz/trunk@1761200 13f79535-47bb-0310-9956-ffa450edef68
2016-09-17 11:38:35 +00:00