|
|
com.architech.function
|
Field Summary | |
Exception |
lastError
The Exception object set by the last call in this library. |
Constructor Summary | |
userFunctions2()
|
Method Summary | |
void |
abortAssemblyLine(String reason)
Throws a rseAbortAL exception to tell the assembly line to terminate the assembly line. |
int |
charCode(char ch)
Returns a character's numeric value using the Character.digit method. |
int |
charCode(String str,
int index)
Returns the numeric value for a character. |
boolean |
chdir(String directory)
Change Java runtime working directory (Sets the "user.dir" property which not always works!!). |
boolean |
copyFile(String fromPath,
String toPath,
boolean overwrite)
Copy file. |
String |
dtSeconds()
Returns the number of milliseconds since Jan 1 1970 as a string. |
void |
dumpEntry(Entry e)
Dumps an entry to the console log. |
boolean |
dumpJavaClass(String className)
Dumps the public methods for a Java class. |
String |
entry2LDIF(Entry e)
Converts an Entry object to an LDIF string. |
String |
formatDate(Date date,
String format)
this method formats a java.util.Date object using the provided template |
rscConnectorInterface |
getConnector(String name)
Load a connector. |
String |
getcwd()
Returns the current working directory. |
com.architech.protocols.FTPBean |
getFTP()
Returns an instance of the FTP object. |
String |
getJavaProperty(String prop)
Returns the value for a system property. |
String |
getOSName()
Returns the name of the operating system./ |
com.architech.parser.rspParserInterface |
getParser(String name)
Load a parser. |
String |
getScriptText(String name)
Returns the text from the Script Library. |
String |
getX400Attribute(String x400,
String sep,
String attribute)
Returns an attribute value from an X.400 address. |
org.apache.xpath.XPathAPI |
getXPathAPI()
Returns the Apache XPathAPI |
Entry |
httpGet(String url)
Posts file to a web server. |
Entry |
httpPost(String url,
Object file)
|
Entry |
httpRequest(String method,
String contentType,
String url,
Object file)
|
void |
ignoreEntry()
Throws a rseEntryIgnore exception to tell the assembly line to skip the current connector and continue with the next connector in the assembly line. |
boolean |
isValidInt(String str)
Returns true if a string holds a valid Integer. |
rscConnectorInterface |
loadConnector(String connectorName)
Load a connector. |
String |
mapString(String source,
String fromSet,
String toSet)
Translates characters in a string. |
Attribute |
newAttribute(String name)
Creates a new Attribute object. |
Entry |
newEntry()
Creates a new Entry object. |
Object |
newObject(String className)
Creates a new object. |
rscSearchCriteria |
newSearchCriteria()
Creates a new rscSearchCriteira object. |
String |
normalizeX400(String value,
String cursep,
String newsep)
Converts an X.400 address to a string using short form attribute names. |
BufferedWriter |
openFileForAppend(String path)
Opens a file in append mode and returns the associated BufferedWriter object. |
BufferedReader |
openFileForInput(String path)
Opens a file for input and returns the associated BufferedReader object. |
BufferedWriter |
openFileForOutput(String path)
Opens a file in output mode and returns the associated BufferedWriter object. |
Date |
parseDate(String value,
String format)
Converts a String to a java.util.Date object. |
Entry |
parseObject(String parser,
Object data)
Use a parser to interpret data. |
String |
remove(String s,
String source)
Remove occurrences of a character from a string. |
String |
removeStringChars(String source,
String fromSet)
Removes occurrences of characters from a string. |
void |
restartEntry()
Throws a rseRestartEntry exception to tell the assembly line to skip all connectors and start with first connector in the assembly line using the current work object. |
com.architech.function.NodeIterator |
selectNodeIterator(org.w3c.dom.Node contextNode,
String str)
Selects nodes using an XPath expression from an XML node. |
org.w3c.dom.NodeList |
selectNodeList(org.w3c.dom.Node contextNode,
String str)
Selects nodes using an XPath expression from an XML node. |
org.w3c.dom.Node |
selectSingleNode(org.w3c.dom.Node contextNode,
String str)
Selects a single node using an XPath expression from an XML node. |
String |
sendMail(String from,
String recipient,
String subject,
String body,
String attachment)
Sends an email message. |
void |
setJavaProperty(String prop,
String value)
Sets the value of a property name. |
com.architech.function.executeCommand |
shellCommand(String command)
Executes a shell command. |
void |
skipEntry()
Throws a rseEntrySkipped exception to tell the assembly line to skip the current entry. |
void |
skipTo(String name)
Throws a rseSkipTo exception to tell the task to skip to the action/connector named by name. |
InterruptedException |
sleep(int seconds)
Causes the current thread (e.g. |
boolean |
snmpTrap(String host,
int port,
String oid,
String value)
Sends an SNMP trap. |
String[] |
splitString(String source,
String separators)
Splits a string into an array of strings. |
void |
throwException(String message)
Throws a generic java.lang.Exception. |
String |
toHex(String str)
Converts a string to a hexadecimal string where each character is converted to a two-byte hex value. |
Integer |
toInt(String str)
Convert a string to an java.lang.Integer object. |
String |
translateString(String str,
String fromCharset,
String toCharset)
Translate a string from one character set to another. |
String |
trim(String str)
Trims leading/traing white-space from a string. |
void |
writeln(Writer w,
String str)
Writes a string plus a CRLF using a Writer object. |
String |
xslTransform(Object xsl,
Object xml)
Calls the XSLTransformer to transform an XML document using a given style sheet. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public Exception lastError
Constructor Detail |
public userFunctions2()
Method Detail |
public String remove(String s, String source) throws Exception
remove (" ", "J O P")
. The returned value would then be "JOP".
var a = "A string with blanks"; var b = system.remove (" ", a); task.logmsg ("Result: " + b); // "Astringwithblanks"
s
- The character to be removedsource
- The string from which characters are removedpublic String trim(String str)
str
- The string to trimpublic Integer toInt(String str) throws Exception
str
- The string with a numberpublic boolean isValidInt(String str)
str
- The string to testpublic BufferedWriter openFileForAppend(String path) throws Exception
path
- The file path to openpublic BufferedWriter openFileForOutput(String path) throws Exception
path
- The file path to open (overwrites existing file)public BufferedReader openFileForInput(String path) throws Exception
path
- The file path to openpublic void writeln(Writer w, String str) throws Exception
w
- The writer objectstr
- The string to writepublic String sendMail(String from, String recipient, String subject, String body, String attachment) throws Exception
from
- The From fieldrecipient
- A comma separated list of recipient addressessubject
- The Subject fieldbody
- The message textattachment
- If specified a file-path that will be attached to the messagepublic boolean copyFile(String fromPath, String toPath, boolean overwrite) throws Exception
fromPath
- The source filetoPath
- The destination fileoverwrite
- Specify true if destination should be overwritten.public Attribute newAttribute(String name)
name
- The attribute namepublic rscSearchCriteria newSearchCriteria()
public Entry newEntry()
public Object newObject(String className)
className
- The java class namepublic void skipEntry() throws com.architech.exceptions.rseEntrySkipped
public void ignoreEntry() throws com.architech.exceptions.rseEntryIgnore
public void restartEntry() throws com.architech.exceptions.rseRestartEntry
public void skipTo(String name) throws com.architech.exceptions.rseSkipTo
public void abortAssemblyLine(String reason) throws com.architech.exceptions.rseAbortAL
reason
- Descriptive text why the AL is terminatedpublic void throwException(String message) throws Exception
message
- The exception's message textpublic rscConnectorInterface loadConnector(String connectorName)
connectorName
- The connector name as it appears in the configuration filepublic String dtSeconds()
public InterruptedException sleep(int seconds)
seconds
- Number of seconds to sleeppublic String removeStringChars(String source, String fromSet)
source
- The source stringfromSet
- A string specifying characters to be removed from sourcepublic String mapString(String source, String fromSet, String toSet)
source
- The source stringfromSet
- The characters to be replacedtoSet
- The characters to replace characters in fromSetpublic String translateString(String str, String fromCharset, String toCharset)
str
- The source stringfromCharset
- The source character settoCharset
- The target character setpublic String toHex(String str)
str
- The source stringpublic int charCode(String str, int index)
str
- The source stringindex
- The position of the character in strpublic int charCode(char ch)
ch
- The characterpublic String getX400Attribute(String x400, String sep, String attribute)
x400
- The X.400 addresssep
- The separator used in the address ( typically "/" or ";" )attribute
- The X.400 attributepublic String normalizeX400(String value, String cursep, String newsep)
value
- The X.400 addresscursep
- The separator used in valuenewsep
- The separator to be used in the resultpublic Date parseDate(String value, String format)
value
- The date in string formformat
- The format of value (e.g. "YYYY.MM.DD", "MM/DD/YY" etc ...)lastError
public String formatDate(Date date, String format)
value
- The date objectformat
- The format of value (e.g. "YYYY.MM.DD", "MM/DD/YY" etc ...)lastError
public String[] splitString(String source, String separators)
source
- The source stringseparators
- The word-separating characterspublic rscConnectorInterface getConnector(String name)
name
- The connector name as it appears in the configuration filepublic com.architech.parser.rspParserInterface getParser(String name)
name
- The parser name as it appears in the configuration filepublic Entry parseObject(String parser, Object data)
parser
- The parser namedata
- Any object of type Reader, InputStream or object that has a toString methodlastError
public com.architech.function.executeCommand shellCommand(String command)
command
- The shell command to executeexecuteCommand
public String getOSName()
public String getJavaProperty(String prop)
prop
- The property namepublic void setJavaProperty(String prop, String value)
prop
- The property namevalue
- The property valuepublic String entry2LDIF(Entry e)
e
- The entrypublic com.architech.protocols.FTPBean getFTP()
FTPBean
public void dumpEntry(Entry e)
e
- The entrypublic org.apache.xpath.XPathAPI getXPathAPI()
public org.w3c.dom.Node selectSingleNode(org.w3c.dom.Node contextNode, String str)
contextNode
- The XML document nodestr
- The XPath search stringpublic org.w3c.dom.NodeList selectNodeList(org.w3c.dom.Node contextNode, String str)
contextNode
- The XML document nodestr
- The XPath search stringpublic com.architech.function.NodeIterator selectNodeIterator(org.w3c.dom.Node contextNode, String str)
contextNode
- The XML document nodestr
- The XPath search stringpublic String xslTransform(Object xsl, Object xml)
xsl
- The XSL Style sheet (String, java.io.File, java.io.Reader )xml
- The XML document (String, java.io.File, java.io.Reader )public boolean dumpJavaClass(String className)
className
- The java class namelastError
public boolean chdir(String directory)
directory
- File system directorypublic String getcwd()
public String getScriptText(String name)
name
- The script name as it appears in the configuration.public boolean snmpTrap(String host, int port, String oid, String value)
host
- The IP hostport
- The TCP portoid
- The OIDvalue
- The valuelastError
public Entry httpGet(String url)
url
- The URL to the web serverfile
- The file name to be sent. You can provide this parameter as a String or
as a java.io.File object. If this parameter is NULL the method will do
as GET with no additional data, otherwise a POST is performed.lastError
public Entry httpPost(String url, Object file)
public Entry httpRequest(String method, String contentType, String url, Object file)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
![]() |
|