OBEROn SDK

com.oberon.ooql.sdk
Class JLClient

java.lang.Object
  extended by com.oberon.ooql.sdk.JLClient

public class JLClient
extends java.lang.Object

Utility functions for Triggers and Programs usage

Version:
5.0

Field Summary
static java.lang.String appName
          OBEROn Application name
static java.lang.String ATTRSEP
          The value separator for multivalue Fields
static java.lang.String build
          OBEROn current build number
static java.lang.String copyright
          OBEROn copyright text
static java.lang.String credits
          OBEROn credits text
static java.text.SimpleDateFormat dateFormat
          Default date format
static java.lang.String version
          OBEROn current version
 
Constructor Summary
JLClient()
           
 
Method Summary
static java.lang.String arrayToString(java.lang.String[] array, java.lang.String delim)
          Deprecated. 
static boolean checkPattern(java.util.Vector<java.lang.String> patterns, java.lang.String text)
          Deprecated. 
static void cleanDirs(java.lang.String path)
          Deprecated. 
static long computeDateDiff(java.lang.String sStartDate, java.lang.String sEndDate)
          Returns the days between two dates
static void copyFile(java.io.File fromFile, java.io.File toFile, boolean move)
          Deprecated. 
static void createLocalDir(java.lang.String path)
          Deprecated. 
static AdminBase elementToAdminObject(org.jdom.Element element)
          Return the administration java element from XML element
static void elementToStream(org.jdom.Element element, java.io.OutputStreamWriter writer, boolean pretty, java.lang.String encoding)
          Deprecated. 
static java.lang.String elementToString(org.jdom.Element element, boolean pretty, java.lang.String encoding)
          Deprecated. 
static java.lang.String getAdminUser()
          Get the Administrator User name
static byte[] getBytesFromFile(java.lang.String filepath)
          Deprecated. 
static java.lang.Class<?> getClassFromType(java.lang.String adminType)
          Returns the related java class for an administration type
static java.lang.String getConnectionType()
          Get the connection type (DB,RMI,HTTP)
static java.lang.String getCurrentDate()
          Returns current date/time (GMT) in dateFormat format
static java.lang.String getDBBuild()
          Get the Database Build number
static java.lang.String getHexValue(int decValue)
          Convert integer value (decimal) to hexadecimal value
static int getIntValue(java.lang.String hexValue)
          Convert hexadecimal value to integer value (decimal)
static java.lang.String getMailServer()
          Get the Mail server name or IP
static java.lang.String getStringPart(java.lang.String sourceText, java.lang.String leftBound, java.lang.String rightBound)
          Deprecated. 
static java.lang.String[] getSVNAccount()
          Get the SVN repository account
static java.lang.String getSVNUrl()
          Get the SVN repository url
static java.lang.String getTempDir()
          Get the Temporary directory
static java.lang.String getWebRoot()
          Get the Web server url
static java.lang.String hashPassword(java.lang.String password, int length)
          Deprecated. 
static java.util.Vector hashTableKeysToVector(java.util.Hashtable hTable)
          Collect hashtable keys into a vector
static boolean isBlank(java.lang.String string)
          Deprecated. 
static java.util.Vector<java.lang.String> listFiles(java.lang.String path, boolean subdirs)
          Deprecated. 
static void orderVector(java.util.Vector vector, boolean increase, boolean asString)
          Deprecated. 
static org.jdom.Element parseXML(java.lang.String xmlText)
          Deprecated. 
static java.lang.String performOOQL(java.lang.String command, Framework framework)
          Execute a single OOQL command
static java.util.Vector<java.lang.String> performOOQLCommands(java.lang.String commands, Framework framework)
          Execute OOQL commands
static java.lang.String replaceDictionaryKeyWords(java.lang.String inputString, boolean encode, java.lang.String language, Framework framework)
          Replace dictionary keywords with translations
static java.lang.String replaceObjectKeyWords(java.lang.String inputString, ObjectBase objlink, boolean encode, java.lang.String language, Framework framework)
          Replace substitution keywords with ObjectObj or Link data values or dictionary translations
static java.lang.String replaceObjectKeyWords(java.lang.String inputString, ObjectBase objlink, java.lang.String language, Framework framework)
          Replace substitution keywords with ObjectObj or Link data values.
static java.lang.String replaceString(java.lang.String source, java.lang.String replace, java.lang.String substitute)
          Deprecated. 
static java.io.File saveBytesToFile(java.lang.String path, java.lang.String filename, byte[] filedata)
          Deprecated. 
static void setSVNUrl(java.lang.String url)
          Set the SVN repository url
static java.util.Vector<java.lang.String> StringTokensToVector(java.lang.String stringToTokenize, java.lang.String delim)
          Deprecated. 
static java.lang.String vectorToString(java.util.Vector<?> vector, java.lang.String delim)
          Deprecated. 
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ATTRSEP

public static final java.lang.String ATTRSEP
The value separator for multivalue Fields

See Also:
Constant Field Values

version

public static final java.lang.String version
OBEROn current version

See Also:
Constant Field Values

appName

public static final java.lang.String appName
OBEROn Application name

See Also:
Constant Field Values

build

public static final java.lang.String build
OBEROn current build number

See Also:
Constant Field Values

copyright

public static final java.lang.String copyright
OBEROn copyright text

See Also:
Constant Field Values

credits

public static final java.lang.String credits
OBEROn credits text

See Also:
Constant Field Values

dateFormat

public static final java.text.SimpleDateFormat dateFormat
Default date format

Constructor Detail

JLClient

public JLClient()
Method Detail

getTempDir

public static java.lang.String getTempDir()
Get the Temporary directory


getMailServer

public static java.lang.String getMailServer()
Get the Mail server name or IP


getWebRoot

public static java.lang.String getWebRoot()
Get the Web server url


setSVNUrl

public static void setSVNUrl(java.lang.String url)
Set the SVN repository url


getSVNUrl

public static java.lang.String getSVNUrl()
Get the SVN repository url


getSVNAccount

public static java.lang.String[] getSVNAccount()
Get the SVN repository account

Returns:
array of String: [0] url / [1] user / [2] password

getAdminUser

public static java.lang.String getAdminUser()
Get the Administrator User name


getDBBuild

public static java.lang.String getDBBuild()
Get the Database Build number


getConnectionType

public static java.lang.String getConnectionType()
Get the connection type (DB,RMI,HTTP)


getHexValue

public static java.lang.String getHexValue(int decValue)
Convert integer value (decimal) to hexadecimal value


getIntValue

public static int getIntValue(java.lang.String hexValue)
Convert hexadecimal value to integer value (decimal)


hashTableKeysToVector

public static java.util.Vector hashTableKeysToVector(java.util.Hashtable hTable)
Collect hashtable keys into a vector


getCurrentDate

public static java.lang.String getCurrentDate()
Returns current date/time (GMT) in dateFormat format


getClassFromType

public static java.lang.Class<?> getClassFromType(java.lang.String adminType)
Returns the related java class for an administration type


elementToAdminObject

public static AdminBase elementToAdminObject(org.jdom.Element element)
Return the administration java element from XML element

Parameters:
element - the xml element root

computeDateDiff

public static long computeDateDiff(java.lang.String sStartDate,
                                   java.lang.String sEndDate)
Returns the days between two dates


isBlank

@Deprecated
public static boolean isBlank(java.lang.String string)
Deprecated. 

Check if the input string is blank (null , empty or formed exclusively by spaces)


replaceString

@Deprecated
public static java.lang.String replaceString(java.lang.String source,
                                                        java.lang.String replace,
                                                        java.lang.String substitute)
Deprecated. 

Replace all occurrences of a sub-string into a given string with another substitute sub-string

Parameters:
source - the source string
replace - the sub-string to replace
substitute - the substitute sub-string Example: replaceString("My source string"," s"," S") return "My Source String"

getStringPart

@Deprecated
public static java.lang.String getStringPart(java.lang.String sourceText,
                                                        java.lang.String leftBound,
                                                        java.lang.String rightBound)
Deprecated. 

Get the first occurrence of sub-string included between two bound sub-strings (left and right)

Parameters:
sourceText - the source string
leftBound - the left side sub-string
rightBound - the right side sub-string Example: getStringPart("user[MyName]","user[","]") return "MyName"

checkPattern

@Deprecated
public static boolean checkPattern(java.util.Vector<java.lang.String> patterns,
                                              java.lang.String text)
Deprecated. 

Check if a text match one of given patterns

Parameters:
patterns - Vector of the pattern (use wildcards "*" match 0/n chars and "?" match a single char)
text - the text to verify

vectorToString

@Deprecated
public static java.lang.String vectorToString(java.util.Vector<?> vector,
                                                         java.lang.String delim)
Deprecated. 

Return vector elements as a single string separated with a fixed separator chars

Parameters:
vector - the input vector
delim - the element separator

arrayToString

@Deprecated
public static java.lang.String arrayToString(java.lang.String[] array,
                                                        java.lang.String delim)
Deprecated. 

Return array elements as a single string separated with a fixed separator chars

Parameters:
array - the input array
delim - the element separator

StringTokensToVector

@Deprecated
public static java.util.Vector<java.lang.String> StringTokensToVector(java.lang.String stringToTokenize,
                                                                                 java.lang.String delim)
Deprecated. 

Split a string into a token vector

Parameters:
stringToTokenize - the input string
delim - the token separator

orderVector

@Deprecated
public static void orderVector(java.util.Vector vector,
                                          boolean increase,
                                          boolean asString)
Deprecated. 

Sort a vector

Parameters:
vector - the vector to sort
increase - if true order from less values to high values
asString - if true treat the vector elements as strings

elementToString

@Deprecated
public static java.lang.String elementToString(org.jdom.Element element,
                                                          boolean pretty,
                                                          java.lang.String encoding)
                                        throws OberonException
Deprecated. 

Return a XML dom structure as XML text

Parameters:
element - the xml element root
pretty - enable/disable the xml indented style
encoding - set the encoding charset ( UTF-8 , ISO-8859-1 , ...)
Throws:
OberonException

elementToStream

@Deprecated
public static void elementToStream(org.jdom.Element element,
                                              java.io.OutputStreamWriter writer,
                                              boolean pretty,
                                              java.lang.String encoding)
                            throws java.io.IOException,
                                   OberonException
Deprecated. 

Write a XML dom structure as XML text to a stream

Parameters:
element - the xml element root
writer - the output stream writer
pretty - enable/disable the xml indented style
encoding - set the encoding charset ( UTF-8 , ISO-8859-1 , ...)
Throws:
java.io.IOException
OberonException

parseXML

@Deprecated
public static org.jdom.Element parseXML(java.lang.String xmlText)
                                 throws java.lang.Exception
Deprecated. 

Parse XML text and return the relative XML dom structure

Parameters:
xmlText - the xml text
Throws:
java.lang.Exception

hashPassword

@Deprecated
public static java.lang.String hashPassword(java.lang.String password,
                                                       int length)
Deprecated. 

Generates hashed password ("MD5" algorithm)

Parameters:
password - the password to hash
length - length of the result string

getBytesFromFile

@Deprecated
public static byte[] getBytesFromFile(java.lang.String filepath)
                               throws java.io.IOException,
                                      OberonException
Deprecated. 

Read data from a local file system file

Parameters:
filepath - the file absolute path
Throws:
java.io.IOException
OberonException

saveBytesToFile

@Deprecated
public static java.io.File saveBytesToFile(java.lang.String path,
                                                      java.lang.String filename,
                                                      byte[] filedata)
                                    throws java.io.IOException,
                                           OberonException
Deprecated. 

Save data to a local file system file

Parameters:
path - the file path
filename - the file name
filedata - the file content data
Throws:
java.io.IOException
OberonException

createLocalDir

@Deprecated
public static void createLocalDir(java.lang.String path)
                           throws java.io.IOException,
                                  OberonException
Deprecated. 

Create a directory tree for a given path on the local file system

Parameters:
path - the directory path
Throws:
java.io.IOException
OberonException

copyFile

@Deprecated
public static void copyFile(java.io.File fromFile,
                                       java.io.File toFile,
                                       boolean move)
                     throws java.io.IOException,
                            OberonException
Deprecated. 

Copy or rename a file on the local file system

Parameters:
fromFile - the original file
toFile - the destination file
move - if true move (rename) the file
Throws:
java.io.IOException
OberonException

listFiles

@Deprecated
public static java.util.Vector<java.lang.String> listFiles(java.lang.String path,
                                                                      boolean subdirs)
Deprecated. 

Return the list of file inside a directory or recursively on its sub-directories

Parameters:
path - the directory path
subdirs - if true recurse on sub-directories (return the full paths)

cleanDirs

@Deprecated
public static void cleanDirs(java.lang.String path)
Deprecated. 

Remove all empty directories recursively starting from the given path

Parameters:
path - the directory start path

performOOQLCommands

public static java.util.Vector<java.lang.String> performOOQLCommands(java.lang.String commands,
                                                                     Framework framework)
                                                              throws OberonException
Execute OOQL commands

Parameters:
commands - multiple OOQL commands (each command must ends with ";")
framework - the current User framework
Returns:
a vector where each element represents the result of a single command
Throws:
OberonException

performOOQL

public static java.lang.String performOOQL(java.lang.String command,
                                           Framework framework)
                                    throws OberonException
Execute a single OOQL command

Parameters:
command - the OOQL command (must ends with ";")
framework - the current User framework
Throws:
OberonException

replaceObjectKeyWords

public static java.lang.String replaceObjectKeyWords(java.lang.String inputString,
                                                     ObjectBase objlink,
                                                     java.lang.String language,
                                                     Framework framework)
                                              throws java.lang.Exception
Replace substitution keywords with ObjectObj or Link data values.

Parameters:
inputString - the input string containing the substitution keywords
objlink - the ObjectObj or Link instance
language - the translation language
framework - the User framework
Returns:
a string where the substitution keywords are replace with related values. Example:
inputString="objname=<name>&objid=<id>"
resultString="objname=2140938&objid=#00034-65F5A443"
Note: the resultString is http url encoded (UTF-8)
Throws:
java.lang.Exception

replaceObjectKeyWords

public static java.lang.String replaceObjectKeyWords(java.lang.String inputString,
                                                     ObjectBase objlink,
                                                     boolean encode,
                                                     java.lang.String language,
                                                     Framework framework)
                                              throws java.lang.Exception
Replace substitution keywords with ObjectObj or Link data values or dictionary translations

Parameters:
inputString - the input string containing the substitution keywords
objlink - the ObjectObj or Link instance
encode - if true apply the url encoding to keyword values
language - the translation language
framework - the User framework
Returns:
a string where the substitution keywords are replace with related values. Example:
inputString="objname=<name>&objid=<id>&text=<[Section,DictKey]>"
resultString="objname=2140938&objid=#00034-65F5A443&text=DictKey_Translation"
Throws:
java.lang.Exception

replaceDictionaryKeyWords

public static java.lang.String replaceDictionaryKeyWords(java.lang.String inputString,
                                                         boolean encode,
                                                         java.lang.String language,
                                                         Framework framework)
                                                  throws java.lang.Exception
Replace dictionary keywords with translations

Parameters:
inputString - the input string containing the substitution keywords
encode - if true apply the url encoding to keyword values
language - the translation language
framework - the User framework
Returns:
a string where the substitution keywords are replace with related values.
Throws:
java.lang.Exception
Since:
2.2.02 Example:
inputString="text=<[Section,DictKey]>"
resultString="text=DictKey_Translation"

OBEROn SDK

Copyright © 2008-2014 Mirko Solazzi. All Rights Reserved.