Difference between revisions of "XSLHelper"

From GreenVulcano Wiki
Jump to: navigation, search
(Created page with "Class FQN: '''it.greenvulcano.util.xml.XSLTUtils''' ==Following the XSLTUtils public static methods== <syntaxhighlight lang="java5"> /** * @param str * @return the string in upp...")
 
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
Class FQN: '''it.greenvulcano.util.xml.XSLTUtils'''
+
In some cases it may be necessary to manipulate data at XSL transformation time. This can be done by mean of tools called XSL helpers.
  
==Following the XSLTUtils public static methods==
+
There are three ways to implement an XSL helper:
<syntaxhighlight lang="java5">
+
* [[XSLTUtils]] : date/time and strings manipulation
/**
+
* [[GenericRetriever]] : data conversion by querying the database
* @param str
+
* [[JavaScriptRetriever]] : data handling by executing JavaScript code
* @return the string in upper case
+
* [[TableRetriever]] : data conversion by querying the database
*/
+
<br>
public static synchronized String upperCase(String str)
+
----
  
/**
+
Other informations about data manipulation and retrievers can be found [[Retriever_Config|here]].
* @param str
 
* @return the string in lower case
 
*/
 
public static synchronized String lowerCase(String str)
 
 
 
/**
 
* @param str
 
* @param width
 
* @param padding
 
* @return the string left filled with padding character passed
 
*/
 
public static synchronized String leftPad(String str, int width, char padding)
 
 
 
/**
 
* @param str
 
* @param width
 
* @param padding
 
* @return the string right filled with padding character passed
 
*/
 
public static synchronized String rightPad(String str, int width, char padding)
 
 
 
/**
 
* @param str
 
* @return the trimmed string
 
*
 
* @see java.lang.String#trim()
 
*/
 
public static synchronized String trim(String str)
 
 
 
/**
 
* @param str
 
* @param find
 
* @param replace
 
* @return the replaced string
 
*/
 
public static String replace(String str, String find, String replace)
 
 
 
/**
 
* @see it.greenvulcano.util.xml.XMLUtils#serializeDOM_S(Node, String)
 
*/
 
public static String serializeNode(Node node, String encoding)
 
 
 
/**
 
* @see it.greenvulcano.util.xml.XSLTUtils#convertDate(String, String, String)
 
*/
 
public static String convertDate(String date, String formatIn, String formatOut)
 
 
 
/**
 
* @see it.greenvulcano.util.xml.XSLTUtils#convertDate(String, String, String, String, String)
 
*/
 
public static String convertDate(String date, String formatIn, String tZoneIn, String formatOut, String tZoneOut)
 
 
 
/**
 
* @see it.greenvulcano.util.xml.XSLTUtils#nowToString(String)
 
*/
 
public static String nowToString(String formatOut)
 
 
 
/**
 
* @see it.greenvulcano.util.xml.XSLTUtils#nowToString(String, String)
 
*/
 
public static String nowToString(String tZoneOut, String formatOut)
 
</syntaxhighlight>
 

Latest revision as of 14:15, 22 May 2012

In some cases it may be necessary to manipulate data at XSL transformation time. This can be done by mean of tools called XSL helpers.

There are three ways to implement an XSL helper:



Other informations about data manipulation and retrievers can be found here.