oracle.apps.xdo.template.rtf
Class XSLTFunctions

java.lang.Object
  extended by oracle.apps.xdo.template.rtf.XSLTFunctions

public class XSLTFunctions
extends java.lang.Object


Nested Class Summary
static class XSLTFunctions.MySequenceNumber
          my implmentation of sequence number
 
Field Summary
static java.util.Hashtable DATE_FORMAT_MAP_PLSQL
           
static int DATE_FORMAT_TYPE_JAVA
           
static int DATE_FORMAT_TYPE_MS
           
static int DATE_FORMAT_TYPE_PLSQL
           
static int DATE_FORMAT_TYPE_XSL
           
static java.lang.String DEFAULT_DATE_FORMAT
           
static java.lang.String GROUPING_ROOT_KEY
           
static java.lang.String RCS_ID
           
static boolean RCS_ID_RECORDED
           
static java.lang.String TRANS_TEMP_NAME
           
static char[] TRANS_TOKEN_END
           
static char[] TRANS_TOKEN_START
           
static java.lang.String TRANS_TPL_PREFIX
           
 
Constructor Summary
XSLTFunctions()
           
 
Method Summary
static double abs(double num)
          Method to get the absolute value of a number.
static java.lang.String add_group_array(org.w3c.dom.NodeList nl, java.lang.String variableName, org.w3c.dom.NodeList currentGroup)
           
static java.lang.String add_intersect_nodelists_array(org.w3c.dom.NodeList nl, java.lang.String name, org.w3c.dom.NodeList nl1, org.w3c.dom.NodeList nl2)
          combine intersect and store together
static java.lang.String append_to(java.lang.String ctxs, java.lang.String name, java.lang.String value)
          This class append a string to a existing variable string in the context
static java.lang.Object attach_glyphs(java.lang.String ctx, java.lang.Object node, java.lang.String todo)
          wrap glyph along with the svg output
static java.lang.String bcd_to_ascii(java.lang.String value, int length, int charCodeLength, int padding, java.lang.String paddingChar)
          Convert BCD to Ascii function
static java.lang.String bidi(java.lang.String str)
          # kgao bugfix 5937887 convert bidi string to its correct order ...
static int block_counter(java.lang.String ctx, java.lang.String name)
          generate a block counter
static java.lang.Object call_extension(java.lang.String ctx, java.lang.String classKey, java.lang.Object params)
          calling an external system and pass property for external string handling the callee should implement oracle.apps.xdo.common.xml.XSLTExtHandler interface
static java.lang.String chart_svg(java.lang.String ctx, org.w3c.dom.Element node, int width, int height, int inshape, java.lang.String contentType, java.lang.String outputFormat)
          create a base64 encoded png chart based on given xml node
static java.lang.String chart(org.w3c.dom.Element node, int width, int height)
          create a base64 encoded png chart based on given xml node
static java.lang.String chr(java.lang.String chrcode)
          Return the character for the given code in UTF-8
static java.lang.String chr(java.lang.String chrcode, java.lang.String encodingScheme)
          Return the character for the given code in the given encoding, which must be one of Java's encoding.
static java.lang.String clean_cache(org.w3c.dom.NodeList nl)
          Call this method if you used sequence_number or set/get_variable in this transformation this method clean up all the static cache of these variables
static java.lang.String clear_group_array(org.w3c.dom.NodeList nl, java.lang.String variableName)
           
static boolean contains_node(org.w3c.dom.NodeList nl1, org.w3c.dom.NodeList nl2)
           
protected static org.w3c.dom.NodeList convert_base_nl(org.w3c.dom.NodeList nl, java.lang.String base, java.lang.String inBase)
           
static java.lang.String convert_base_s(java.lang.String value, java.lang.String base)
          Convert Number from one Base type to another function
static java.lang.String convert_base_s(java.lang.String value, java.lang.String base, java.lang.String inBase)
          Convert Number from one Base type to another function
static java.lang.Object convert_base(java.lang.Object obj, java.lang.String base, java.lang.String inBase)
           
static java.lang.String convert_case(java.lang.String source, java.lang.String aCase)
          Convert Case for converting case of strings
static java.lang.String count(java.lang.Object nlo, boolean isPositive)
          return a sum of a nodelist
static java.lang.String create_block_counter(java.lang.String ctxs, java.lang.String name, int start, int current, int increment)
          create a new block counter
static org.w3c.dom.NodeList create_groups(java.lang.String ctxs, org.w3c.dom.NodeList nl, java.lang.String sequence, java.lang.String prefix)
           
static java.lang.String create_sequence_number(java.lang.String ctxs, java.lang.String name, int start, int max, int current, int increment)
          create a new sequence number
static java.lang.String current_date(java.lang.String locStr, java.lang.String tzID)
          Returns the current date in "yyyy-MM-dd" format in the given locale and timezone.
static java.lang.String current_time(java.lang.String locStr, java.lang.String tzID)
          Returns the current time in the given locale and timezone.
static long date_diff(java.lang.String format, java.lang.String fromDate, java.lang.String toDate, java.lang.String locStr, java.lang.String tzID)
          Method to get the difference between two dates in the given locale.
static java.lang.String date_to_millis(java.lang.String date)
           
static org.w3c.dom.NodeList decimal_part_nl(org.w3c.dom.NodeList nl)
          return the decimal of the text
static java.lang.String decimal_part_s(java.lang.String s)
           
static java.lang.Object decimal_part(java.lang.Object o)
           
static org.w3c.dom.NodeList distinct_values(org.w3c.dom.NodeList nl)
           
static java.lang.String div(java.lang.String dividend, java.lang.String divisor)
           
protected static java.lang.String evaluateGroupValue(org.w3c.dom.Element e, java.lang.String[] groupKeys)
          validate element's group value based on given array of child elements
static java.lang.String fill_block(java.lang.String source, java.lang.String fillChar, int recordLength)
          Fill block with on record of filler characters
static org.w3c.dom.NodeList foreach_number(java.lang.String key, java.lang.String start, java.lang.String end, java.lang.String interval)
          This function create a nodelist of series of counting numbers
static java.lang.String format_barcode(java.lang.String key, java.lang.String orig, java.lang.String barcode, java.lang.String vendor)
           
static java.lang.String format_date(java.lang.String d, java.lang.String locStr, java.lang.String tzID)
          Method to convert date to string in Java's native format.
static java.lang.String format_date(java.lang.String d, java.lang.String f, java.lang.String locStr, java.lang.String tzID)
          Method to convert date to string in given format.
static java.lang.String format_date(java.lang.String d, java.lang.String f, java.lang.String e, java.lang.String locStr, java.lang.String tzID)
          Method to convert date in given format to string in given format.
static java.lang.String format_number(double d, int len, java.lang.String locStr)
          Convert a number to string with Java's default symbols.
static java.lang.String format_number(double d, int len, java.lang.String s1, java.lang.String s2, java.lang.String locStr)
          Convert a number to string with the specified separators.
static java.lang.String formatCurrency(float number, java.lang.String locale)
          convert a number into currency
protected static java.lang.String formatDate(int num)
          return a well-formated string by given a date value, e.g.
static java.lang.String gauge_svg(java.lang.String ctx, org.w3c.dom.Element node, int width, int height, int inshape, java.lang.String contentType, java.lang.String outputFormat)
          create a base64 encoded png chart based on given xml node
static java.lang.String german_eft_string(java.lang.String orig)
          German EFT charset
static java.lang.String get_array(java.lang.String ctxs, java.lang.String varName, int index)
          Set a value in an hash table.
static int get_day(java.lang.String date, java.lang.String locStr)
          Method to get the day part of a date in "yyyy-MM-dd" in the given locale.
static org.w3c.dom.NodeList get_dummy_document()
          return a duumy xml document
static int get_group_array_size(org.w3c.dom.NodeList nl, java.lang.String variableName)
           
static org.w3c.dom.NodeList get_group_array(org.w3c.dom.NodeList nl, java.lang.String variableName, int index)
           
static org.w3c.dom.NodeList get_groups(java.lang.String ctxs, java.lang.String prefix, java.lang.String level, java.lang.String value)
           
static int get_month(java.lang.String date, java.lang.String locStr)
          Method to get the month part of a date in "yyyy-MM-dd" in the given locale.
static java.lang.Object get_variable(java.lang.String ctxs, java.lang.String name)
          an implementation of getting variable in XSLT, suggest not to use this feature except for EFT template's needs
static int get_year(java.lang.String date, java.lang.String locStr)
          Method to get the year part of a date in "yyyy-MM-dd" in the given locale.
static java.lang.String getHourRange(java.lang.String sDate, java.lang.String tzID)
          Returns the current hour to next hour range only for US.
protected static java.lang.String getNodeText(org.w3c.dom.Node n)
           
protected static java.lang.String getValidNumber(java.lang.String param)
          return a valid number by given string The method remove any formatting symbols, such as space
static java.lang.String getWeekRange(java.lang.String sDate, java.lang.String tzID)
          Returns the week range in which the given date falls, only for US.
static java.lang.String greeting(java.lang.String name)
          Testing function
static org.w3c.dom.NodeList group(java.lang.Object nl, java.lang.String groupKey)
           
static java.lang.String ifelse(boolean cond, java.lang.String pt, java.lang.String pf)
          return the second parameter if the first parameter is true or return 3rd parameter
static java.lang.String image_extension(java.lang.String ctx, org.w3c.dom.Element node, java.lang.String clazz, int width, int height)
          create a base64 encoded png or other encoded images by an extension
static java.lang.String increment_block_counter(java.lang.String ctx, java.lang.String name)
          increase a block counter
static int index_of(java.lang.Object nl1, org.w3c.dom.NodeList nl2)
          check the index of a node inside a node list
static java.lang.String init_cap(java.lang.String s)
          init cap
static int instr(java.lang.String str, java.lang.String ptn, int st, int idx)
          instr, implements the pl/sql instr
static org.w3c.dom.NodeList integer_part_nl(org.w3c.dom.NodeList nl)
          return the integer of the text
static java.lang.String integer_part_s(java.lang.String s)
           
static java.lang.Object integer_part(java.lang.Object o)
           
static org.w3c.dom.NodeList intersect_nodelists(org.w3c.dom.NodeList nl1, org.w3c.dom.NodeList nl2)
          eeeh, this is a dumb implementation of find the same set of nodes in two different NodeList by comparing each one of one NodeLine to every one in another NodeList.
static boolean is_bidi_locale(java.lang.String locale)
          check if a locale is bidi locale or not
static boolean is_numeric(java.lang.String s)
          check if a string is a numeric value
static java.lang.String left(java.lang.String text, int numChars)
          Method to get a left substring of a text.
static java.lang.String log(java.lang.String log)
          log a string
static java.lang.String lognode(org.w3c.dom.NodeList nl)
           
static java.lang.String lpad_fix(java.lang.String src, int len, java.lang.String pad)
          mimic PL/SQL LPAD function
static java.lang.String lpad(java.lang.String src, int len, java.lang.String pad)
          mimic PL/SQL LPAD function
static java.lang.String lpadext(java.lang.String src, int len, java.lang.String pad)
           
static java.lang.String ltrim(java.lang.String text)
          Method to remove the leading white spaces in a string
protected static java.lang.Object makeKey(org.w3c.dom.NodeList nl)
           
protected static java.lang.Object makeKey(java.lang.String ctx)
           
static int max_group_array_size(org.w3c.dom.NodeList nl, java.lang.String variableName)
           
static float max(float v1, float v2)
          calculate the maximum value of the input values
static java.lang.String maximum_date(java.lang.Object o)
          cauclate the maximum value of the input node list
static java.lang.String maximum(java.lang.Object o)
          calculate the maximum value of the input node list
static java.lang.String millis_to_date(java.lang.String millis)
           
static float min(float v1, float v2)
          calculate the minimum value of the input values
static java.lang.String minimum_date(java.lang.Object o)
          cauclate the maximum value of the input node list
static java.lang.String minimum(java.lang.Object o)
          cauclate the maximum value of the input node list
static java.lang.String month_name(int month, boolean abbreviate, java.lang.String locStr)
          Method to get the name of the month in the given locale.
static java.lang.String ms_format_date_tz(java.lang.String key, java.lang.String ds, java.lang.String fmt, java.lang.String tz)
          return a Microsoft date string based on the given xml schema dateTime string and the format string and the timezone
static java.lang.String ms_format_date(java.lang.String key, java.lang.String ds, java.lang.String fmt)
          return a Microsoft date string based on the given xml schema dataTime string and the format string
static java.lang.String ms_format_number(java.lang.String ns, java.lang.String fmt)
          return a Microsoft number string based on the number and the format string
static java.lang.String ms_format_number(java.lang.String key, java.lang.String ns, java.lang.String fmt)
          return a Microsoft number string based on the number and the format string
static java.lang.String ms_format_string(java.lang.String key, java.lang.String s, java.lang.String fmt)
          return a Microsoft string based on the given string and the format string
static java.lang.String ms_sysdate(java.lang.String key, java.lang.String format)
          get a sysdate as string by given ms format
static java.lang.String mtranslate(java.lang.String s, java.lang.String locale)
          translate a string based on memory by given original string and locale
static java.lang.String next_element(org.w3c.dom.NodeList currentGrouping, org.w3c.dom.NodeList currentGroup, java.lang.String name)
          Method to get the next element value in the current group.
static java.lang.String next_sequence_number(java.lang.String ctx, java.lang.String name)
          increase a sequence number
static java.lang.String normalize_string(java.lang.String ctx, java.lang.String orig)
          normalize the string based on registered replacement string in the context
protected static org.w3c.dom.NodeList number_part(org.w3c.dom.NodeList nl, boolean ip)
          return a new node set with either int or decimal part of the text
static java.lang.Object offset_variable(java.lang.String ctxs, java.lang.String name, java.lang.String value)
          offset a variable in XSLT, suggest not to use this feature except for special cases
static java.lang.String ora_format_date_offset(java.lang.String gs, int offset, java.lang.String operator)
           
static java.lang.String ora_format_date_tz(java.lang.String gs, java.lang.String fmt, java.lang.String tzstring)
          return an oracle date string based on the given xml schema datTime string, format string and the tz
static java.lang.String ora_format_date(java.lang.String gs, java.lang.String fmt)
          return an oracle date string based on the given xml schema dateTime string and the format string
static java.lang.String ora_format_date(java.lang.String gs, java.lang.String fmt, java.lang.String baseType)
           
static java.lang.String ora_translate(java.lang.String source, java.lang.String search, java.lang.String replacement)
          Create xsl node containing call for xdoxslt:ora_translate function
protected static java.lang.String parsePLSQLDateFormat(java.lang.String format)
          evaluate an xpath's value on current nodeList
static java.lang.String pat_format_number(double d, java.lang.String pat, java.lang.String locStr)
          Method to format a number with a pattern.
static float pow(float n1, float n2)
          mimic PL/SQL ** calcuation
static java.lang.String prev_element(org.w3c.dom.NodeList currentGrouping, org.w3c.dom.NodeList currentGroup, java.lang.String name)
          Method to get the previous element value in the current group.
static java.lang.String questionMark(int len)
          Output ? characters
static java.lang.String register_barcode_vendor(java.lang.String key, java.lang.String className, java.lang.String id)
           
static java.lang.String register_replace_string(java.lang.String ctx, java.lang.String orig, java.lang.String dest)
          register a new replacable character for this context
static org.w3c.dom.NodeList regroup(org.w3c.dom.NodeList nl, java.lang.String groupKey, boolean clone)
          generate a group nodelist
static java.lang.String remove_group_array(org.w3c.dom.NodeList nl, java.lang.String variableName)
           
static java.lang.String removeAll(java.lang.String stringList, java.lang.String message)
          return a string after removing all strings in the stringList from the message
static java.lang.String replace(java.lang.String src, java.lang.String pat, java.lang.String to)
          replace all same patterns in a string with another pattern
static java.lang.String replicate(java.lang.String text, int times)
          Method to replicate a string n times.
static java.lang.String reset_sequence_number(java.lang.String ctx, java.lang.String name)
          reset a sequence number
static java.lang.String right(java.lang.String text, int numChars)
          Method to get a right substring of a text.
static double round(double value)
          Rounds a value with 0 precision
static double round(double value, int precision)
          Round a value with the given precision
static java.lang.String rpad_fix(java.lang.String src, int len, java.lang.String pad)
          mimic PL/SQL RPAD function
static java.lang.String rpad(java.lang.String src, int len, java.lang.String pad)
          mimic PL/SQL RPAD function
static java.lang.String rpadext(java.lang.String src, int len, java.lang.String pad)
           
static java.lang.String rtrim(java.lang.String text)
          Method to remove the trailing white spaces in a string
static long sec_diff(java.lang.String dateA, java.lang.String dateB, java.lang.String locStr, java.lang.String tzID)
          Method to get the difference between two dates in seconds in the given locale.
protected static void selectNodes(oracle.apps.xdo.template.rtf.XSLTFunctions.MyNodeList nl, org.w3c.dom.Node n, java.lang.String path)
          select nodes from a Node based on given pseudo-xpath
static int sequence_number(java.lang.String ctx, java.lang.String name)
          generate a sequence number
static void set_array(java.lang.String ctxs, java.lang.String varName, int index, java.lang.String value)
          Set a value in an hash table.
static java.lang.String set_variable(java.lang.String ctxs, java.lang.String name, java.lang.Object o)
          an implementation of setting variable in XSLT, suggest not to use this feature except for EFT template's needs
static java.lang.String set_xslt_locale(java.lang.String ctx, java.lang.String locale, java.lang.String tz, java.lang.String calendar, java.lang.String additionalInfo)
          Set xslt locale information for data/number/currency formatting support by using apps i18n library
static java.lang.String space(int i)
          Mimic PL/SQL space() function
static java.lang.String specialProcess(java.lang.String src)
          this function is to convert all the \n or \r character to \r\n this is to make line terminatior visible in window notepad
static java.lang.String stopwatch_start(java.lang.String ks, java.lang.String name)
           
static java.lang.String stopwatch_stop(java.lang.String ks, java.lang.String name)
           
static org.w3c.dom.NodeList string_to_nodelist(java.lang.Object nl, java.lang.String trans)
           
static java.lang.String sum(org.w3c.dom.NodeList nl)
          return a sum of a nodelist
static java.lang.String sysdate_as_xsdformat()
           
static java.lang.String sysdate()
          get a sysdate as string
static java.lang.String sysdate(java.lang.String format)
          get a sysdate as string
static java.lang.String sysdate(java.lang.String format, int type)
          get a sysdate as string by given format
static long time_in_millis(java.lang.String date)
           
static java.lang.String to_char(java.lang.String date, java.lang.String mask)
          Convert a date string in a format date string using the mask as the mask string
static java.lang.String to_number(java.lang.String s)
           
static java.lang.String toWordsAmt(double amount)
          Returns the string which is the corrosponding amount in words in indian currency system.
static java.lang.String trim(java.lang.String text)
          Remove spaces in a string.
static double truncate(double value)
          Method to truncate a value
static double truncate(double value, int precision)
          Method to truncate a value
static org.w3c.dom.NodeList wrap_node(org.w3c.dom.NodeList nl)
          wrap current nodelist into a single node and return the nodelist which contains the node
static java.lang.String xdo_format_currency(java.lang.String key, java.lang.String param, java.lang.String mask, java.lang.String symbolFlag)
           
static java.lang.String xdo_format_date_c_tz(java.lang.String key, java.lang.String date, java.lang.String mask, java.lang.String calendar, java.lang.String tz)
          XDO Date format routine
static java.lang.String xdo_format_date_c(java.lang.String key, java.lang.String date, java.lang.String mask, java.lang.String calendar)
          XDO Date format routine
static java.lang.String xdo_format_date_l(java.lang.String key, java.lang.String date, java.lang.String mask, java.lang.String locale, java.lang.String tz)
          format a sysdate with locale and timezone
static java.lang.String xdo_format_date_tz(java.lang.String key, java.lang.String date, java.lang.String mask, java.lang.String tz)
          XDO Date format routine
static java.lang.String xdo_format_date(java.lang.String key, java.lang.String date, java.lang.String mask)
          XDO Date format routine
static java.lang.String xdo_format_number_l(java.lang.String param, java.lang.String mask, java.lang.String locale)
           
static java.lang.String xdo_format_number_lc(java.lang.String param, java.lang.String mask, java.lang.String locale, java.lang.String nfcs)
           
static java.lang.String xdo_format_number(java.lang.String key, java.lang.String param, java.lang.String mask)
           
static java.lang.String xdo_format_sysdate(java.lang.String key, java.lang.String mask)
          Format a sysdate
static java.lang.Object xl(java.lang.String ks, java.lang.String biff, java.lang.Object params)
          Excel-alike formula's runtime calculation support
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RCS_ID

public static final java.lang.String RCS_ID
See Also:
Constant Field Values

RCS_ID_RECORDED

public static final boolean RCS_ID_RECORDED

DATE_FORMAT_MAP_PLSQL

public static final java.util.Hashtable DATE_FORMAT_MAP_PLSQL

GROUPING_ROOT_KEY

public static final java.lang.String GROUPING_ROOT_KEY
See Also:
Constant Field Values

DEFAULT_DATE_FORMAT

public static final java.lang.String DEFAULT_DATE_FORMAT
See Also:
Constant Field Values

DATE_FORMAT_TYPE_PLSQL

public static final int DATE_FORMAT_TYPE_PLSQL
See Also:
Constant Field Values

DATE_FORMAT_TYPE_MS

public static final int DATE_FORMAT_TYPE_MS
See Also:
Constant Field Values

DATE_FORMAT_TYPE_JAVA

public static final int DATE_FORMAT_TYPE_JAVA
See Also:
Constant Field Values

DATE_FORMAT_TYPE_XSL

public static final int DATE_FORMAT_TYPE_XSL
See Also:
Constant Field Values

TRANS_TOKEN_START

public static final char[] TRANS_TOKEN_START

TRANS_TOKEN_END

public static final char[] TRANS_TOKEN_END

TRANS_TEMP_NAME

public static final java.lang.String TRANS_TEMP_NAME
See Also:
Constant Field Values

TRANS_TPL_PREFIX

public static final java.lang.String TRANS_TPL_PREFIX
See Also:
Constant Field Values
Constructor Detail

XSLTFunctions

public XSLTFunctions()
Method Detail

greeting

public static final java.lang.String greeting(java.lang.String name)
Testing function

Parameters:
name - string of name
Returns:
a greeting

log

public static final java.lang.String log(java.lang.String log)
log a string


lognode

public static final java.lang.String lognode(org.w3c.dom.NodeList nl)

stopwatch_start

public static final java.lang.String stopwatch_start(java.lang.String ks,
                                                     java.lang.String name)

stopwatch_stop

public static final java.lang.String stopwatch_stop(java.lang.String ks,
                                                    java.lang.String name)

xl

public static final java.lang.Object xl(java.lang.String ks,
                                        java.lang.String biff,
                                        java.lang.Object params)
Excel-alike formula's runtime calculation support


chart_svg

public static final java.lang.String chart_svg(java.lang.String ctx,
                                               org.w3c.dom.Element node,
                                               int width,
                                               int height,
                                               int inshape,
                                               java.lang.String contentType,
                                               java.lang.String outputFormat)
create a base64 encoded png chart based on given xml node

Parameters:
node - the xml element node
Returns:
the base64 encoded chart png

gauge_svg

public static final java.lang.String gauge_svg(java.lang.String ctx,
                                               org.w3c.dom.Element node,
                                               int width,
                                               int height,
                                               int inshape,
                                               java.lang.String contentType,
                                               java.lang.String outputFormat)
create a base64 encoded png chart based on given xml node

Parameters:
node - the xml element node
Returns:
the base64 encoded chart png

attach_glyphs

public static final java.lang.Object attach_glyphs(java.lang.String ctx,
                                                   java.lang.Object node,
                                                   java.lang.String todo)
wrap glyph along with the svg output

Parameters:
node - the xml element node
Returns:
the original node but with glyphs attached

image_extension

public static final java.lang.String image_extension(java.lang.String ctx,
                                                     org.w3c.dom.Element node,
                                                     java.lang.String clazz,
                                                     int width,
                                                     int height)
create a base64 encoded png or other encoded images by an extension

Parameters:
node - the xml element node
Returns:
encoded image as a string

call_extension

public static final java.lang.Object call_extension(java.lang.String ctx,
                                                    java.lang.String classKey,
                                                    java.lang.Object params)
calling an external system and pass property for external string handling the callee should implement oracle.apps.xdo.common.xml.XSLTExtHandler interface


chart

public static final java.lang.String chart(org.w3c.dom.Element node,
                                           int width,
                                           int height)
create a base64 encoded png chart based on given xml node

Parameters:
node - the xml element node
Returns:
the base64 encoded chart png

formatCurrency

public static final java.lang.String formatCurrency(float number,
                                                    java.lang.String locale)
convert a number into currency

Parameters:
number - as currency
locale - the locale of the currency

formatDate

protected static java.lang.String formatDate(int num)
return a well-formated string by given a date value, e.g. 3 -> 03

Parameters:
num - the date value
Returns:
a string with well-formed value

ora_format_date_offset

public static final java.lang.String ora_format_date_offset(java.lang.String gs,
                                                            int offset,
                                                            java.lang.String operator)

ora_format_date

public static final java.lang.String ora_format_date(java.lang.String gs,
                                                     java.lang.String fmt)
return an oracle date string based on the given xml schema dateTime string and the format string

Parameters:
ds - the xml schema dateTime string
fmt - the format string

ora_format_date

public static final java.lang.String ora_format_date(java.lang.String gs,
                                                     java.lang.String fmt,
                                                     java.lang.String baseType)

ora_format_date_tz

public static final java.lang.String ora_format_date_tz(java.lang.String gs,
                                                        java.lang.String fmt,
                                                        java.lang.String tzstring)
return an oracle date string based on the given xml schema datTime string, format string and the tz

Parameters:
ds - the xml schema dateTime string
fmt - the format string
tz - the time zone string

ms_format_string

public static final java.lang.String ms_format_string(java.lang.String key,
                                                      java.lang.String s,
                                                      java.lang.String fmt)
return a Microsoft string based on the given string and the format string

Parameters:
key - context key
s - the string
fmt - to format

set_xslt_locale

public static final java.lang.String set_xslt_locale(java.lang.String ctx,
                                                     java.lang.String locale,
                                                     java.lang.String tz,
                                                     java.lang.String calendar,
                                                     java.lang.String additionalInfo)
Set xslt locale information for data/number/currency formatting support by using apps i18n library

Parameters:
ctx - the ctx key
locale - the locale information
tz - the timezone information
calendar - the calendar to be used
additionalInfo - includes date format overridings and currency masks
Returns:
the formatting context to be used for all the formatting calls, the context keeps all the pre-instanciated formatter to increase performance

xdo_format_sysdate

public static final java.lang.String xdo_format_sysdate(java.lang.String key,
                                                        java.lang.String mask)
Format a sysdate

Parameters:
key - the context key
mask - the formatting mask to be used for the sysdate
Returns:
the formatted sysdate

xdo_format_date_l

public static final java.lang.String xdo_format_date_l(java.lang.String key,
                                                       java.lang.String date,
                                                       java.lang.String mask,
                                                       java.lang.String locale,
                                                       java.lang.String tz)
format a sysdate with locale and timezone

Parameters:
key - the context key
mask - the formatting mask to be used for the sysdate
locale - the locale information
tz - the time zone information
Returns:
the formatted sysdate

xdo_format_date

public static final java.lang.String xdo_format_date(java.lang.String key,
                                                     java.lang.String date,
                                                     java.lang.String mask)
XDO Date format routine

Parameters:
key - the context key
date - the date string in xsd:dateTime format
mask - the formatting mask
Returns:
formatted string, return original string if exception happens

xdo_format_date_tz

public static final java.lang.String xdo_format_date_tz(java.lang.String key,
                                                        java.lang.String date,
                                                        java.lang.String mask,
                                                        java.lang.String tz)
XDO Date format routine

Parameters:
key - the context key
date - date string in xsd:dateTime format
mask - the formatting mask
tz - the timezone string
Returns:
formatted string, return original string if exception happens

xdo_format_date_c

public static final java.lang.String xdo_format_date_c(java.lang.String key,
                                                       java.lang.String date,
                                                       java.lang.String mask,
                                                       java.lang.String calendar)
XDO Date format routine

Parameters:
key - the context key
date - date string in xsd:dateTime format
mask - the formatting mask
calendar - the name of the calendar to be used
Returns:
formatted string, return original string if exception happens

xdo_format_date_c_tz

public static final java.lang.String xdo_format_date_c_tz(java.lang.String key,
                                                          java.lang.String date,
                                                          java.lang.String mask,
                                                          java.lang.String calendar,
                                                          java.lang.String tz)
XDO Date format routine

Parameters:
key - the context key
date - date string in xsd:dateTime format
mask - the formatting mask
calendar - the name of the calendar to be used
tz - the timezone strign
Returns:
formatted string, return original string if exception happens

xdo_format_number

public static final java.lang.String xdo_format_number(java.lang.String key,
                                                       java.lang.String param,
                                                       java.lang.String mask)

xdo_format_currency

public static final java.lang.String xdo_format_currency(java.lang.String key,
                                                         java.lang.String param,
                                                         java.lang.String mask,
                                                         java.lang.String symbolFlag)

xdo_format_number_l

public static final java.lang.String xdo_format_number_l(java.lang.String param,
                                                         java.lang.String mask,
                                                         java.lang.String locale)

xdo_format_number_lc

public static final java.lang.String xdo_format_number_lc(java.lang.String param,
                                                          java.lang.String mask,
                                                          java.lang.String locale,
                                                          java.lang.String nfcs)

getValidNumber

protected static final java.lang.String getValidNumber(java.lang.String param)
return a valid number by given string The method remove any formatting symbols, such as space

Parameters:
param - the number as a string
Returns:
the valid number as a string

ifelse

public static final java.lang.String ifelse(boolean cond,
                                            java.lang.String pt,
                                            java.lang.String pf)
return the second parameter if the first parameter is true or return 3rd parameter

Parameters:
cond - condition
pt - true's value
pf - false's value

init_cap

public static final java.lang.String init_cap(java.lang.String s)
init cap

Parameters:
s - init cap the s
Returns:
the init capped s

integer_part

public static final java.lang.Object integer_part(java.lang.Object o)

decimal_part

public static final java.lang.Object decimal_part(java.lang.Object o)

integer_part_nl

public static final org.w3c.dom.NodeList integer_part_nl(org.w3c.dom.NodeList nl)
return the integer of the text

Parameters:
nl - the node set
Returns:
a new nodelist of the integer part only

decimal_part_nl

public static final org.w3c.dom.NodeList decimal_part_nl(org.w3c.dom.NodeList nl)
return the decimal of the text

Parameters:
nl - the node set
Returns:
a new nodelist of the decimal part only

number_part

protected static final org.w3c.dom.NodeList number_part(org.w3c.dom.NodeList nl,
                                                        boolean ip)
return a new node set with either int or decimal part of the text

Parameters:
nl - the node set
true - if integer part, false if decimal part
Returns:
a new node set

integer_part_s

public static final java.lang.String integer_part_s(java.lang.String s)

decimal_part_s

public static final java.lang.String decimal_part_s(java.lang.String s)

sum

public static final java.lang.String sum(org.w3c.dom.NodeList nl)
return a sum of a nodelist

Parameters:
nl - the node set
true - if integer part, false if decimal part
Returns:
a new node set

ms_sysdate

public static final java.lang.String ms_sysdate(java.lang.String key,
                                                java.lang.String format)
get a sysdate as string by given ms format

Parameters:
key - the key
format - the date mask

ms_format_date

public static final java.lang.String ms_format_date(java.lang.String key,
                                                    java.lang.String ds,
                                                    java.lang.String fmt)
return a Microsoft date string based on the given xml schema dataTime string and the format string

Parameters:
ds - the xml schema dateTime string
fmt - the format string

ms_format_date_tz

public static final java.lang.String ms_format_date_tz(java.lang.String key,
                                                       java.lang.String ds,
                                                       java.lang.String fmt,
                                                       java.lang.String tz)
return a Microsoft date string based on the given xml schema dateTime string and the format string and the timezone

Parameters:
ds - the xml schema dateTime string
fmt - the format string
tz - the timezone

ms_format_number

public static final java.lang.String ms_format_number(java.lang.String ns,
                                                      java.lang.String fmt)
return a Microsoft number string based on the number and the format string

Parameters:
ns - the number
fmt - the format string

ms_format_number

public static final java.lang.String ms_format_number(java.lang.String key,
                                                      java.lang.String ns,
                                                      java.lang.String fmt)
return a Microsoft number string based on the number and the format string

Parameters:
ns - the number
fmt - the format string

get_dummy_document

public static final org.w3c.dom.NodeList get_dummy_document()
return a duumy xml document

Returns:
the dummy document with a dummy root element in a nodeList

mtranslate

public static final java.lang.String mtranslate(java.lang.String s,
                                                java.lang.String locale)
translate a string based on memory by given original string and locale

Parameters:
s - the original string
locale - the locale of translated text

sysdate

public static final java.lang.String sysdate()
get a sysdate as string

Returns:
a sysdate string in YYMMDD format

sysdate_as_xsdformat

public static final java.lang.String sysdate_as_xsdformat()

sysdate

public static final java.lang.String sysdate(java.lang.String format)
get a sysdate as string

Returns:
a sysdate string in given plsql format

sysdate

public static final java.lang.String sysdate(java.lang.String format,
                                             int type)
get a sysdate as string by given format

Parameters:
format - the date format in pl/sql format
Returns:
a sysdate string in given format

time_in_millis

public static final long time_in_millis(java.lang.String date)

date_to_millis

public static final java.lang.String date_to_millis(java.lang.String date)

millis_to_date

public static final java.lang.String millis_to_date(java.lang.String millis)

parsePLSQLDateFormat

protected static final java.lang.String parsePLSQLDateFormat(java.lang.String format)
evaluate an xpath's value on current nodeList

Parameters:
nl - the node list
xpath - the xpath
Returns:
the result

is_bidi_locale

public static final boolean is_bidi_locale(java.lang.String locale)
check if a locale is bidi locale or not

Parameters:
locale - the locale as a string
Returns:
true if it's a bidi locale

replace

public static final java.lang.String replace(java.lang.String src,
                                             java.lang.String pat,
                                             java.lang.String to)
replace all same patterns in a string with another pattern

Parameters:
src - source string
pat - pattern string
to - new pattern string
Returns:
the new string

instr

public static final int instr(java.lang.String str,
                              java.lang.String ptn,
                              int st,
                              int idx)
instr, implements the pl/sql instr

Parameters:
str, - the oringal string
ptn, - the pattern
st, - the start point
idx, - the number of occurence

lpad_fix

public static final java.lang.String lpad_fix(java.lang.String src,
                                              int len,
                                              java.lang.String pad)
mimic PL/SQL LPAD function

Parameters:
src - the source string
len - length of the dest string
pad - the padding string

lpad

public static final java.lang.String lpad(java.lang.String src,
                                          int len,
                                          java.lang.String pad)
mimic PL/SQL LPAD function

Parameters:
src - the source string
len - length of the dest string
pad - the padding string

rpadext

public static final java.lang.String rpadext(java.lang.String src,
                                             int len,
                                             java.lang.String pad)

lpadext

public static final java.lang.String lpadext(java.lang.String src,
                                             int len,
                                             java.lang.String pad)

rpad_fix

public static final java.lang.String rpad_fix(java.lang.String src,
                                              int len,
                                              java.lang.String pad)
mimic PL/SQL RPAD function

Parameters:
src - the source string
len - length of the dest string
pad - the padding string

rpad

public static final java.lang.String rpad(java.lang.String src,
                                          int len,
                                          java.lang.String pad)
mimic PL/SQL RPAD function

Parameters:
src - the source string
len - length of the dest string
pad - the padding string

specialProcess

public static java.lang.String specialProcess(java.lang.String src)
this function is to convert all the \n or \r character to \r\n this is to make line terminatior visible in window notepad

Parameters:
src -
Returns:

max

public static final float max(float v1,
                              float v2)
calculate the maximum value of the input values

Parameters:
v1 - the first value
v2 - the second value
Returns:
the greater one

min

public static final float min(float v1,
                              float v2)
calculate the minimum value of the input values

Parameters:
v1 - the first value
v2 - the seocnd value
Returns:
the smaller one

maximum_date

public static final java.lang.String maximum_date(java.lang.Object o)
cauclate the maximum value of the input node list

Parameters:
v1 - the node list
Returns:
the greatest one

maximum

public static final java.lang.String maximum(java.lang.Object o)
calculate the maximum value of the input node list

Parameters:
v1 - the node list
Returns:
the greatest one

questionMark

public static final java.lang.String questionMark(int len)
Output ? characters

Parameters:
len - number of ? characters to output
Returns:

minimum_date

public static final java.lang.String minimum_date(java.lang.Object o)
cauclate the maximum value of the input node list

Parameters:
v1 - the node list
Returns:
the greatest one

minimum

public static final java.lang.String minimum(java.lang.Object o)
cauclate the maximum value of the input node list

Parameters:
v1 - the node list
Returns:
the greatest one

space

public static final java.lang.String space(int i)
Mimic PL/SQL space() function

Parameters:
i - the number of spaces

pow

public static final float pow(float n1,
                              float n2)
mimic PL/SQL ** calcuation

Parameters:
n1 - the base number
n2 - the power number

german_eft_string

public static final java.lang.String german_eft_string(java.lang.String orig)
German EFT charset

Parameters:
orig - the original string
Returns:
the validated string, change all invalidate char to space

register_replace_string

public static final java.lang.String register_replace_string(java.lang.String ctx,
                                                             java.lang.String orig,
                                                             java.lang.String dest)
register a new replacable character for this context

Parameters:
nl - the context node list
orig - the original string
dest - the new String
Returns:
an empty string

normalize_string

public static final java.lang.String normalize_string(java.lang.String ctx,
                                                      java.lang.String orig)
normalize the string based on registered replacement string in the context

Parameters:
nl - the contet node list
orig - the orignal string
Returns:
the new string

is_numeric

public static final boolean is_numeric(java.lang.String s)
check if a string is a numeric value

Parameters:
s - the string
Returns:
true if it's numeric value

makeKey

protected static final java.lang.Object makeKey(org.w3c.dom.NodeList nl)

makeKey

protected static final java.lang.Object makeKey(java.lang.String ctx)

create_sequence_number

public static final java.lang.String create_sequence_number(java.lang.String ctxs,
                                                            java.lang.String name,
                                                            int start,
                                                            int max,
                                                            int current,
                                                            int increment)
create a new sequence number

Parameters:
root - the root element of stylesheet, use as the key of the cache (use '/node()', to get the element)
name - the sequence number generator's name
int - the start number
max - the maximam number of the generator, will wrap if reachs this

sequence_number

public static final int sequence_number(java.lang.String ctx,
                                        java.lang.String name)
generate a sequence number

Parameters:
root - the root element of stylesheet, use as the key of the cache (use '/node()', to get the element)
name - the sequence number generator's name
Returns:
the next value of the sequence number, return 0 if the sequence number is not found

next_sequence_number

public static final java.lang.String next_sequence_number(java.lang.String ctx,
                                                          java.lang.String name)
increase a sequence number

Parameters:
root - the root element of stylesheet, use as the key of the cache (use '/node()'), to get the element)
name - the sequence number generator's name
Returns:
is always ""

create_block_counter

public static final java.lang.String create_block_counter(java.lang.String ctxs,
                                                          java.lang.String name,
                                                          int start,
                                                          int current,
                                                          int increment)
create a new block counter

Parameters:
root - the root element of stylesheet, use as the key of the cache (use '/node()', to get the element)
name - the block counter's name
int - the start number

block_counter

public static final int block_counter(java.lang.String ctx,
                                      java.lang.String name)
generate a block counter

Parameters:
root - the root element of stylesheet, use as the key of the cache (use '/node()', to get the element)
name - the block counter's name
Returns:
the current value of the block counter, return 0 if the block counter is not found

increment_block_counter

public static final java.lang.String increment_block_counter(java.lang.String ctx,
                                                             java.lang.String name)
increase a block counter

Parameters:
root - the root element of stylesheet, use as the key of the cache (use '/node()'), to get the element)
name - the block counter name
Returns:
is always ""

wrap_node

public static final org.w3c.dom.NodeList wrap_node(org.w3c.dom.NodeList nl)
wrap current nodelist into a single node and return the nodelist which contains the node

Parameters:
nl - the original nodelist
Returns:
the new created nodelist

reset_sequence_number

public static final java.lang.String reset_sequence_number(java.lang.String ctx,
                                                           java.lang.String name)
reset a sequence number

Parameters:
root - the root element of stylesheet, use as the key of the cache (use '/node()'), to get the element)
name - the sequence number generator's name
Returns:
is always ""

set_variable

public static final java.lang.String set_variable(java.lang.String ctxs,
                                                  java.lang.String name,
                                                  java.lang.Object o)
an implementation of setting variable in XSLT, suggest not to use this feature except for EFT template's needs

Parameters:
root - the root element of stylesheet, use as the key of the cache (use '/node()' to get the element)
name - the name of the variable
value - the new value of the variable
return - the orignal value of the variable

get_variable

public static final java.lang.Object get_variable(java.lang.String ctxs,
                                                  java.lang.String name)
an implementation of getting variable in XSLT, suggest not to use this feature except for EFT template's needs

Parameters:
root - the root element of stylesheet, use as the key of the cache (use '/node()' to get the element)
name - the name of the variable
Returns:
the current value of the variable

offset_variable

public static final java.lang.Object offset_variable(java.lang.String ctxs,
                                                     java.lang.String name,
                                                     java.lang.String value)
offset a variable in XSLT, suggest not to use this feature except for special cases

Parameters:
root - the root element of stylesheet, use as the key of the cache(use '/nose()' to get to element)
name - the name of the variable
value - the new value of the variable
return - the updated value of the variable

append_to

public static final java.lang.String append_to(java.lang.String ctxs,
                                               java.lang.String name,
                                               java.lang.String value)
This class append a string to a existing variable string in the context

Parameters:
root - the root element of stylesheet, use as the key of the cache(use '/nose()' to get to element)
name - the name of the variable
value - the appended string of the variable

clean_cache

public static final java.lang.String clean_cache(org.w3c.dom.NodeList nl)
Call this method if you used sequence_number or set/get_variable in this transformation this method clean up all the static cache of these variables

Parameters:
root - the root element of stylesheet, use as the key of the cache (use '/node()' to get the elemen)
return - an empty string

index_of

public static final int index_of(java.lang.Object nl1,
                                 org.w3c.dom.NodeList nl2)
check the index of a node inside a node list

Parameters:
nl1 - the node list that contains the node to be checked, if it's a list, pick the very first one
nl2 - the node list that contains a list of node
Returns:
the index of the node in nl1 in nl2, return 1 if it's the first one, return -1 if not found

foreach_number

public static final org.w3c.dom.NodeList foreach_number(java.lang.String key,
                                                        java.lang.String start,
                                                        java.lang.String end,
                                                        java.lang.String interval)
This function create a nodelist of series of counting numbers

Parameters:
key - the key object to help us find the xmldoc
start - the start number
end - the end number that the nodelist will not reach, i.e. i=start; iinterval - the interval
Returns:
a nodelist that represent this nodelist

regroup

public static final org.w3c.dom.NodeList regroup(org.w3c.dom.NodeList nl,
                                                 java.lang.String groupKey,
                                                 boolean clone)
generate a group nodelist

Parameters:
nl - grouping node list
groupKey - the key to use to group the elements

group

public static final org.w3c.dom.NodeList group(java.lang.Object nl,
                                               java.lang.String groupKey)

getNodeText

protected static final java.lang.String getNodeText(org.w3c.dom.Node n)

distinct_values

public static final org.w3c.dom.NodeList distinct_values(org.w3c.dom.NodeList nl)

get_groups

public static final org.w3c.dom.NodeList get_groups(java.lang.String ctxs,
                                                    java.lang.String prefix,
                                                    java.lang.String level,
                                                    java.lang.String value)

create_groups

public static final org.w3c.dom.NodeList create_groups(java.lang.String ctxs,
                                                       org.w3c.dom.NodeList nl,
                                                       java.lang.String sequence,
                                                       java.lang.String prefix)

evaluateGroupValue

protected static final java.lang.String evaluateGroupValue(org.w3c.dom.Element e,
                                                           java.lang.String[] groupKeys)
validate element's group value based on given array of child elements

Parameters:
element - the element
groupKeys - the keys

to_number

public static final java.lang.String to_number(java.lang.String s)

string_to_nodelist

public static final org.w3c.dom.NodeList string_to_nodelist(java.lang.Object nl,
                                                            java.lang.String trans)

selectNodes

protected static final void selectNodes(oracle.apps.xdo.template.rtf.XSLTFunctions.MyNodeList nl,
                                        org.w3c.dom.Node n,
                                        java.lang.String path)
select nodes from a Node based on given pseudo-xpath

Parameters:
nl - the node list we add to
n - the node
path - the pseodo-xpath, i.e. only node/node/... supported

add_group_array

public static final java.lang.String add_group_array(org.w3c.dom.NodeList nl,
                                                     java.lang.String variableName,
                                                     org.w3c.dom.NodeList currentGroup)

get_group_array

public static final org.w3c.dom.NodeList get_group_array(org.w3c.dom.NodeList nl,
                                                         java.lang.String variableName,
                                                         int index)

get_group_array_size

public static final int get_group_array_size(org.w3c.dom.NodeList nl,
                                             java.lang.String variableName)

clear_group_array

public static final java.lang.String clear_group_array(org.w3c.dom.NodeList nl,
                                                       java.lang.String variableName)

remove_group_array

public static final java.lang.String remove_group_array(org.w3c.dom.NodeList nl,
                                                        java.lang.String variableName)

max_group_array_size

public static final int max_group_array_size(org.w3c.dom.NodeList nl,
                                             java.lang.String variableName)

contains_node

public static final boolean contains_node(org.w3c.dom.NodeList nl1,
                                          org.w3c.dom.NodeList nl2)

intersect_nodelists

public static final org.w3c.dom.NodeList intersect_nodelists(org.w3c.dom.NodeList nl1,
                                                             org.w3c.dom.NodeList nl2)
eeeh, this is a dumb implementation of find the same set of nodes in two different NodeList by comparing each one of one NodeLine to every one in another NodeList. Life will be easier if the nodeList is sorted in someway, but right now we don't know how to sort them by given no context. I don't know if we sort by the hashcode, then it will be fater or not

Parameters:
nl1 - the first nodelist
nl2 - the second nodelist
Returns:
a new NodeList that contains nodes exists in both NodeLists

add_intersect_nodelists_array

public static final java.lang.String add_intersect_nodelists_array(org.w3c.dom.NodeList nl,
                                                                   java.lang.String name,
                                                                   org.w3c.dom.NodeList nl1,
                                                                   org.w3c.dom.NodeList nl2)
combine intersect and store together


ora_translate

public static final java.lang.String ora_translate(java.lang.String source,
                                                   java.lang.String search,
                                                   java.lang.String replacement)
Create xsl node containing call for xdoxslt:ora_translate function

Parameters:
source - the source string
search - the search string
replacement - the replacement string

register_barcode_vendor

public static final java.lang.String register_barcode_vendor(java.lang.String key,
                                                             java.lang.String className,
                                                             java.lang.String id)

format_barcode

public static final java.lang.String format_barcode(java.lang.String key,
                                                    java.lang.String orig,
                                                    java.lang.String barcode,
                                                    java.lang.String vendor)

convert_base

public static final java.lang.Object convert_base(java.lang.Object obj,
                                                  java.lang.String base,
                                                  java.lang.String inBase)

convert_base_nl

protected static final org.w3c.dom.NodeList convert_base_nl(org.w3c.dom.NodeList nl,
                                                            java.lang.String base,
                                                            java.lang.String inBase)

convert_base_s

public static java.lang.String convert_base_s(java.lang.String value,
                                              java.lang.String base,
                                              java.lang.String inBase)
Convert Number from one Base type to another function

Parameters:
source - the source string
base - base of the output value
base - base of the input value

convert_base_s

public static java.lang.String convert_base_s(java.lang.String value,
                                              java.lang.String base)
Convert Number from one Base type to another function

Parameters:
source - the source string
base - base of the output value

bcd_to_ascii

public static java.lang.String bcd_to_ascii(java.lang.String value,
                                            int length,
                                            int charCodeLength,
                                            int padding,
                                            java.lang.String paddingChar)
Convert BCD to Ascii function

Parameters:
source - the source string
length - of the output value
Ascii - code byte length

fill_block

public static java.lang.String fill_block(java.lang.String source,
                                          java.lang.String fillChar,
                                          int recordLength)
Fill block with on record of filler characters

Parameters:
source - the source string
fillChar - filler character
recordLength - size of the record

count

public static final java.lang.String count(java.lang.Object nlo,
                                           boolean isPositive)
return a sum of a nodelist

Parameters:
nl - the node set
true - if integer part, false if decimal part
Returns:
a new node set

removeAll

public static java.lang.String removeAll(java.lang.String stringList,
                                         java.lang.String message)
return a string after removing all strings in the stringList from the message

Parameters:
stringList - comma delimited list of strings to be replaced
message - string from which to remove the strings in the string list
Returns:
message after removing the strings in the string list

convert_case

public static java.lang.String convert_case(java.lang.String source,
                                            java.lang.String aCase)
Convert Case for converting case of strings

Parameters:
source - the source string
aCase - case of the reulting string

to_char

public static java.lang.String to_char(java.lang.String date,
                                       java.lang.String mask)
Convert a date string in a format date string using the mask as the mask string

Parameters:
date - the date as an string
mask - the formatting mask
Returns:
the formatted date

chr

public static java.lang.String chr(java.lang.String chrcode)
Return the character for the given code in UTF-8

Parameters:
chrcode - character code string
Returns:
character for the code in UTF-8

chr

public static java.lang.String chr(java.lang.String chrcode,
                                   java.lang.String encodingScheme)
Return the character for the given code in the given encoding, which must be one of Java's encoding.

Parameters:
chrcode - character code string
encodingScheme - one of the character encodings available in Java
Returns:
character for the code in the given encoding

div

public static java.lang.String div(java.lang.String dividend,
                                   java.lang.String divisor)

current_date

public static java.lang.String current_date(java.lang.String locStr,
                                            java.lang.String tzID)
Returns the current date in "yyyy-MM-dd" format in the given locale and timezone. This function supports only Gregorian calendar.

Parameters:
locStr - string representing a locale
tzID - timezone ID
Returns:
the current date in "yyyy-MM-dd" format

current_time

public static java.lang.String current_time(java.lang.String locStr,
                                            java.lang.String tzID)
Returns the current time in the given locale and timezone. This function supports only Gregorian calendar.

Parameters:
locStr - string representing a locale
tzID - timezone ID
Returns:
the current time

trim

public static java.lang.String trim(java.lang.String text)
Remove spaces in a string.

Parameters:
text - the text to be trimmed
Returns:
the trimmed text

ltrim

public static java.lang.String ltrim(java.lang.String text)
Method to remove the leading white spaces in a string

Parameters:
text - the text to be trimmed
Returns:
the trimmed text

rtrim

public static java.lang.String rtrim(java.lang.String text)
Method to remove the trailing white spaces in a string

Parameters:
text - the text to be trimmed
Returns:
the trimmed text

abs

public static double abs(double num)
Method to get the absolute value of a number.

Parameters:
num - the number for which the absolute value is required.
Returns:
the absolute value of the number

left

public static java.lang.String left(java.lang.String text,
                                    int numChars)
Method to get a left substring of a text.

Parameters:
text - the input text
numChars - the number of characters in the left substring.
Returns:
the left substring

right

public static java.lang.String right(java.lang.String text,
                                     int numChars)
Method to get a right substring of a text.

Parameters:
text - the input text
numChars - the number of characters in the right substring.
Returns:
the right substring

round

public static double round(double value)
Rounds a value with 0 precision

Parameters:
value - the value to be rounded
Returns:
the rounded value

round

public static double round(double value,
                           int precision)
Round a value with the given precision

Parameters:
value - the value to be rounded
precision - the rounding precision
Returns:
the rounded value

truncate

public static double truncate(double value)
Method to truncate a value

Parameters:
value - the value to be truncated.
Returns:
the truncated value

truncate

public static double truncate(double value,
                              int precision)
Method to truncate a value

Parameters:
value - the value to be truncated.
precision - the precision of truncation.
Returns:
the truncated value

replicate

public static java.lang.String replicate(java.lang.String text,
                                         int times)
Method to replicate a string n times.

Parameters:
text - the text to be replicated
times - the number of times the string needs to be replicated.
Returns:
the replicated value.

date_diff

public static long date_diff(java.lang.String format,
                             java.lang.String fromDate,
                             java.lang.String toDate,
                             java.lang.String locStr,
                             java.lang.String tzID)
Method to get the difference between two dates in the given locale. The dates need to be in "yyyy-MM-dd" format. This function supports only Gregorian calendar.

Parameters:
format - the format to which the difference is required; allowed formats are y (for Year), m(for month), w(for week), d(for day), h(for hour), mi(for minute), s(for seconds) and ms(for milliseconds)
fromDate - the first date
toDate - the second date
locStr - locale string
tzID - timezone ID
Returns:
the difference in dates in the desired format

sec_diff

public static long sec_diff(java.lang.String dateA,
                            java.lang.String dateB,
                            java.lang.String locStr,
                            java.lang.String tzID)
Method to get the difference between two dates in seconds in the given locale. The dates need to be in "yyyy-MM-dd'T'HH:mm:ss". This function supports only Gregorian calendar.

Parameters:
dateA - the first date
dateB - the second date
locStr - locale string
tzID - timezone ID
Returns:
difference in seconds.

get_day

public static int get_day(java.lang.String date,
                          java.lang.String locStr)
Method to get the day part of a date in "yyyy-MM-dd" in the given locale. This function supports only Gregorian calendar.

Parameters:
date - the input date string
locStr - locale string
Returns:
the day part of the date string

get_month

public static int get_month(java.lang.String date,
                            java.lang.String locStr)
Method to get the month part of a date in "yyyy-MM-dd" in the given locale. This function supports only Gregorian calendar.

Parameters:
date - the input date string
locStr - locale string
Returns:
the month part of the date string

get_year

public static int get_year(java.lang.String date,
                           java.lang.String locStr)
Method to get the year part of a date in "yyyy-MM-dd" in the given locale. This function supports only Gregorian calendar.

Parameters:
date - the input date string
locStr - locale string
Returns:
the year part of the date string

month_name

public static java.lang.String month_name(int month,
                                          boolean abbreviate,
                                          java.lang.String locStr)
Method to get the name of the month in the given locale. This function supports only Gregorian calendar.

Parameters:
month - the input month
abbreviate - whether to abbreviate the month name
locStr - locale string
Returns:
the month name

next_element

public static java.lang.String next_element(org.w3c.dom.NodeList currentGrouping,
                                            org.w3c.dom.NodeList currentGroup,
                                            java.lang.String name)
Method to get the next element value in the current group.

Parameters:
currentGrouping - the current grouping nodelist
currentGroup - the current node
name - the name of the XML tag.
Returns:
the next element value in the current group.

prev_element

public static java.lang.String prev_element(org.w3c.dom.NodeList currentGrouping,
                                            org.w3c.dom.NodeList currentGroup,
                                            java.lang.String name)
Method to get the previous element value in the current group.

Parameters:
currentGrouping - the current grouping nodelist
currentGroup - the current node
name - the name of the XML tag.
Returns:
the previous element value in the current group.

format_number

public static java.lang.String format_number(double d,
                                             int len,
                                             java.lang.String locStr)
Convert a number to string with Java's default symbols.

Parameters:
d - the input number
len - the minimum number of decimal positions to include.
locStr - locale string
Returns:
the string equivalent

format_number

public static java.lang.String format_number(double d,
                                             int len,
                                             java.lang.String s1,
                                             java.lang.String s2,
                                             java.lang.String locStr)
Convert a number to string with the specified separators.

Parameters:
d - the input number
len - the minimum number of decimal positions to include.
s1 - the thousand seperator
s2 - the decimal seperator
locStr - locale string
Returns:
the string equivalent

pat_format_number

public static java.lang.String pat_format_number(double d,
                                                 java.lang.String pat,
                                                 java.lang.String locStr)
Method to format a number with a pattern.

Parameters:
d - the input number
pat - the desired number format.
locStr - locale string
Returns:
the formatted number

format_date

public static java.lang.String format_date(java.lang.String d,
                                           java.lang.String locStr,
                                           java.lang.String tzID)
Method to convert date to string in Java's native format. This function supports only Gregorian calendar.

Parameters:
d - the input date string
locStr - locale string
tzID - timezone ID
Returns:
the formatted date

format_date

public static java.lang.String format_date(java.lang.String d,
                                           java.lang.String f,
                                           java.lang.String locStr,
                                           java.lang.String tzID)
Method to convert date to string in given format. This function supports only Gregorian calendar.

Parameters:
d - the input date string
f - the date format required.
locStr - locale string
tzID - timezone ID
Returns:
the formatted date

format_date

public static java.lang.String format_date(java.lang.String d,
                                           java.lang.String f,
                                           java.lang.String e,
                                           java.lang.String locStr,
                                           java.lang.String tzID)
Method to convert date in given format to string in given format. This function supports only Gregorian calendar.

Parameters:
d - the input date string
f - the date format required.
e - tge date format of the input string
locStr - locale string
tzID - timezone
Returns:
the formatted date

set_array

public static final void set_array(java.lang.String ctxs,
                                   java.lang.String varName,
                                   int index,
                                   java.lang.String value)
Set a value in an hash table. Need a context key to be thread-safe.

Parameters:
ctxs - context key
varName - name of the hash table
index - index of the hash table
value - value to be set

get_array

public static final java.lang.String get_array(java.lang.String ctxs,
                                               java.lang.String varName,
                                               int index)
Set a value in an hash table. Need a context key to be thread-safe.

Parameters:
ctxs - context key
varName - name of the hash table
index - index of the hash table
Returns:
value at the index of the hash table

toWordsAmt

public static java.lang.String toWordsAmt(double amount)
Returns the string which is the corrosponding amount in words in indian currency system. This function is only for Crystal migration. Non-Crystal users should not use this function.

Parameters:
amount - the amount
Returns:
corrosponding amount in words in indian currency system

getHourRange

public static java.lang.String getHourRange(java.lang.String sDate,
                                            java.lang.String tzID)
Returns the current hour to next hour range only for US. This function is only for Crystal migration. Non-Crystal users should not use this function.

Parameters:
sDate - input date string
Returns:
the current hour to next hour range

getWeekRange

public static java.lang.String getWeekRange(java.lang.String sDate,
                                            java.lang.String tzID)
Returns the week range in which the given date falls, only for US. This function is only for Crystal migration. Non-Crystal users should not use this function.

Parameters:
sDate - input date string
tzID - timezone ID
Returns:
the week range in which the given date falls

bidi

public static java.lang.String bidi(java.lang.String str)
# kgao bugfix 5937887 convert bidi string to its correct order ...

Parameters:
str -
Returns:
bidi_str