OFBiz contains a large number of very useful Utility classes that can be called from anywhere throughout the application, including FreeMarker templates.
Some of the most useful ones are contained in the package org.ofbiz.base.util
. Some of their uses include String manipulation, validation, encryption, debugging, and date manipulation.
It is worth spending some time becoming familiar with the methods found in these classes. Very often the simple challenges we face have already been overcome by somebodyelse.
The following section is a guide to a few of the most useful and most commonly used methods from some of these Java classes.
These miscellaneous utility methods are generally to aid List or Map retrieval, iteration or creation.
Map returnMap = UtilMisc.toMap("keyOne", "valueOne");
A map of up to six key value pairs can be created in this way.
List returnList = UtilMisc.toList("valueOne", "valueTwo");
Again a List of up to six values can be created in this way.