Package org.openbravo.erpCommon.utility
Class BasicUtility
- java.lang.Object
-
- org.openbravo.erpCommon.utility.BasicUtility
-
public class BasicUtility extends Object
Basic utilities needed by the 'ApplyModule' module class. Before the 'ant apply.module' target is run a mini compilation is done to compile all classes needed by that code (and not more). This BasicUtility class was split out of the main 'Utility' class to not pull in the big chain of transitive compile-time dependencies into ApplyModule. Nothing should be added here without reviewing the list of files compiled by the 'ant compile.apply.module' target to check that it did not grow.
-
-
Constructor Summary
Constructors Constructor Description BasicUtility()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
fileToString(String strPath)
Generates a String representing the file in a pathstatic String
formatMessageBDToHtml(String message)
Formats a message String into a String for html presentation.static String
messageBD(ConnectionProvider conn, String strCode, String strLanguage)
static String
messageBD(ConnectionProvider conn, String strCode, String strLanguage, boolean escape)
Translate the given code into some message from the application dictionary.static String
wikifiedName(String strSource)
Generates a String representing the wikified name from source
-
-
-
Method Detail
-
messageBD
public static String messageBD(ConnectionProvider conn, String strCode, String strLanguage)
-
messageBD
public static String messageBD(ConnectionProvider conn, String strCode, String strLanguage, boolean escape)
Translate the given code into some message from the application dictionary.- Parameters:
conn
- Handler for the database connection.strCode
- String with the code to search.strLanguage
- String with the translation language.escape
- Escape \n and " characters- Returns:
- String with the translated message.
-
formatMessageBDToHtml
public static String formatMessageBDToHtml(String message)
Formats a message String into a String for html presentation. Escapes the &, <, >, " and ®, and replace the \n by <br/> and \r for space. IMPORTANT! : this method is designed to transform the output of Utility.messageBD method, and this method replaces \n by \\n and \" by "e. Because of that, the first replacements revert this previous replacements.- Parameters:
message
- message with java formating- Returns:
- html format message
-
fileToString
public static String fileToString(String strPath) throws FileNotFoundException
Generates a String representing the file in a path- Parameters:
strPath
-- Returns:
- file to a String
- Throws:
FileNotFoundException
-
wikifiedName
public static String wikifiedName(String strSource) throws FileNotFoundException
Generates a String representing the wikified name from source- Parameters:
strSource
-- Returns:
- strTarget: wikified name
- Throws:
FileNotFoundException
-
-