public class eMFrameUtils
extends java.lang.Object
The main methods to use to access objects your task may need:
addUnique(Collection, Collection) - Adds only unique items from one Collection to another Collection.getLocalizedString(String, String, MContext) - Returns a localized String from a resource file based upon the locale.getModulesBasePath() - Gets a filesystem dependant full path to the modules directory.getRealPath(java.lang.String) - Gets the full path from a path relative to our webapp.setErrorMessage(java.lang.Throwable, com.novell.emframe.dev.MContext) - Sets the error information in the results for the current request.setMessage(String, String, String, MContext) - Sets error/success message with plain and bold text as well as error details.urlDecode(String, MContext) - Decodes String that has been urlEncoded.urlEncode(String) - URL encodes using utf-8 encoding.| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
EMPTY_STRING
A string with no content.
|
| Constructor and Description |
|---|
eMFrameUtils() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addUnique(java.util.Collection collection,
java.util.Collection newItems)
Adds all newItems to Collection if they don't exist.
|
static void |
addUnique(java.util.Collection dstCollection,
java.lang.Object[] sourceObjects)
Adds all sourceObjects to dstCollection if they don't exist.
|
static int |
byteToDecimal(byte b)
Converts a byte to its positive decimal value.
|
static java.lang.Throwable |
callVerifyForDeviceMethod(MContext context,
org.jdom.Document doc)
Deprecated.
as of iManager 2.5; will be removed at future date
|
static java.lang.String |
commaSepStr(java.util.ArrayList a)
Concatinates tokens together seperated by commas (duplicating any commas found in array elements.
|
static java.util.ArrayList |
commaSplit(java.lang.String s)
Tokenize a comma-separated string into a ArrayList of tokens (converting double commas to single comma).
|
static java.lang.String |
concatProperties(java.util.Properties properties)
Creates semi-colon delimited key/value pair string.
|
static java.lang.String |
concatStrings(java.lang.String[] strings,
java.lang.String delimiter)
Concatinates tokens together seperated by delimiter.
|
static java.lang.Throwable |
discoverRootException(java.lang.Throwable ex)
If the exception is a org.apache.jasper.JasperException, it finds the root cause.
|
static java.lang.String |
formatMessage(java.lang.String pattern,
java.lang.Object[] arguments)
Convenience method that works just like MessageFormat.formatMessage(), but first replaces all
occurences of ' with ''.
|
static java.lang.String |
getAccessMode(MContext context)
Returns the current mode of Role-based services ("Unrestricted", "CollectionOwner", or "Assigned").
|
static byte[] |
getByteArray(java.io.InputStream is)
Reads in all of the input stream and retuns it as a byte[].
|
static java.lang.String |
getClassName(org.jdom.Document doc)
Inspects plug-in XML descriptor and returns Java class entry point.
|
static java.lang.String |
getConfigSetting(com.novell.nps.gadgetManager.BaseGadgetInstance task,
java.lang.String prop,
java.lang.String defaultValue)
Deprecated.
as of 2.6 UserConfig
|
static java.lang.String[] |
getConfigSettings(com.novell.nps.gadgetManager.BaseGadgetInstance task,
java.lang.String prop)
Deprecated.
as of 2.6 use com.novell.emframe.dev.config.SystemConfig#getSystemConfig(MContext)
|
static java.util.Locale |
getCurrentLocale(javax.servlet.http.HttpSession session)
Deprecated.
Use
LocUtils.getCurrentLocale(HttpSession) instead |
static java.lang.String |
getDisplayName(org.jdom.Document taskDoc,
MContext context)
Gets the display name of an iManager plug-in from the XML descriptor.
|
static java.lang.String |
getDisplayName(org.jdom.Element root,
MContext context)
Gets the display name of an iManager plug-in from the XML descriptor.
|
static java.lang.String |
getDisplayName(org.jdom.Element root,
java.lang.String tagName,
MContext context)
Gets the display name of an iManager plug-in from the XML descriptor and passes in the tag name to
use to get the display-name key.
|
static java.lang.String |
getErrorTemplate(MContext context)
Deprecated.
as of 2.6 use Task.setUIPage(String)
|
static java.lang.String |
getExceptionMessage(java.lang.Exception e,
MContext context)
Inspects the exception and creates the best message it can (based on the type of exception).
|
static java.lang.String |
getLocalizedString(java.lang.String strResourceFile,
java.lang.String strResId,
java.util.Locale locale)
Gets a localized String from a resource file.
|
static java.lang.String |
getLocalizedString(java.lang.String strResourceFile,
java.lang.String strResId,
java.util.Locale locale,
java.lang.String defaultValue)
Gets a localized String from a resource file.
|
static java.lang.String |
getLocalizedString(java.lang.String strResourceFile,
java.lang.String strResId,
MContext context)
Gets a localized String from a resource file.
|
static java.lang.String |
getLocalizedString(java.lang.String strResourceFile,
java.lang.String strResId,
java.lang.String strDefaultValue,
MContext context)
Gets a localized String from a resource file.
|
static java.lang.String |
getMergeTemplate(MContext context)
Deprecated.
as of 2.5 use Task.getUIPage()
|
static java.lang.String |
getModuleFromFullName(java.lang.String fullName)
From a full jsp resource name (ex.
|
static java.lang.String |
getModulesBasePath()
Gets a filesystem dependant full path to the modules directory.
|
static java.lang.String[] |
getMvedValues(java.lang.String name,
MContext context) |
static java.lang.Object[] |
getOperationsByObjectType(org.jdom.Document doc,
java.lang.String objectType)
This method will retrieve the operations listed under the object-type element
for the directory event listener definitions.
|
static java.lang.String |
getPageFromFullName(java.lang.String fullName)
From a full jsp resource name (ex.
|
static java.lang.String |
getRBSExceptionLocalizedString(com.novell.rbs.RBSException ex,
MContext context)
Inspects an RBSException and creates localized error message.
|
static java.lang.String |
getRealPath(java.lang.String relativeURL)
Gets the full path from a path relative to our webapp.
|
static java.lang.String |
getSingleTarget(javax.servlet.http.HttpServletRequest request)
When using the TargetChooser widget (TC), this method returns the name
of the object selected by the user.
|
static java.lang.String |
getUniqueString(java.lang.String prefix,
java.lang.String postfix)
Simply creates a string that is guarenteed to be unique.
|
static java.util.Properties |
getUrlParams(org.jdom.Document doc)
Allows easy access to URL params stored in plug-in XML descriptor.
|
static java.util.Properties |
getUrlParamsAsProperties(org.jdom.Document doc)
Allows easy access to URL params stored in plug-in XML descriptor.
|
static Version |
getVersion(MContext context) |
static byte[] |
hexStringToByteArray(java.lang.String str)
Converts a string to a byte array.
|
static boolean |
instanceOf(java.lang.String className,
java.lang.Class c)
Checks if the className Class is an instance of class c.
|
static boolean |
isMS55(javax.servlet.http.HttpServletRequest req)
Checks to see if client device is Microsoft Internet Explorer 5.5 using the "User-Agent" string.
|
static boolean |
isNN6(javax.servlet.http.HttpServletRequest req)
Checks to see if client device is Netscape Navigator 6 using the "User-Agent" string.
|
static boolean |
isPalm(javax.servlet.http.HttpServletRequest req)
Checks to see if client device is a Palm Pilot using the "User-Agent" string.
|
static boolean |
isTaskAssigned(java.lang.String taskId,
MContext context)
Checks if the user has access to the specified task.
|
static java.lang.String |
join(java.util.Collection collection)
Concatenates Strings in a Collection together separated with a "," delimiter.
|
static java.lang.String |
join(java.util.Collection collection,
java.lang.String delimiter)
Concatenates Strings in a Collection together separated with a delimiter.
|
static java.lang.String |
makeAttributeNameLDAPCompliant(java.lang.String attrName,
MContext context)
makeAttributeNameLDAPCompliant Verify that an attribute name complies with LDAP naming convensions.
|
static org.w3c.dom.Document |
newDocument()
Instanciates an empty org.w3c.Document.
|
static void |
out(org.w3c.dom.Document doc)
Deprecated.
As of iManager 2.5. Will be removed. Use D.log(org.w3c.dom.Document doc)
|
static java.lang.String |
pack(java.lang.String[] list,
MContext context)
Packs a String array into one string.
|
static java.lang.String |
pack(java.lang.String value1,
java.lang.String value2,
MContext context)
Packs a pair of strings into one string.
|
static java.util.Properties |
parseParameters(java.lang.String params)
Parses a semi-colon delimited string of key/value pairs (ex.
|
static java.util.Properties |
parseParameters(java.lang.String params,
java.lang.String delimiter)
Parses a delimited string of key/value pairs.
|
static java.util.HashMap |
parseParameters2(java.lang.String params)
Parses a semi-colon delimited string of key/value pairs (ex.
|
static void |
refreshOV(MContext context)
Tasks that delete or created object should call this to ensure the object view is refreshed.
|
static void |
refreshResourceFileMap(java.lang.String map)
Refreshes the filemap.
|
static java.lang.String |
replaceNonAsciiWithAscii(java.lang.String str,
java.lang.String extendedAscii,
java.lang.String normalAscii)
This method will take a String as input and do a checking
for any non-ascii character.If the non-ascii character
found , it will replace the non-ascii character with valid
ascii character.
|
static java.lang.String[] |
replaceNonAsciiWithAsciiForArray(java.lang.String[] str,
java.lang.String extendedAscii,
java.lang.String normalAscii)
This method will take a String array as input and do a checking for any
non-ascii character for each string in that array.If the non-ascii
character found ,it will replace the non-ascii character with valid ascii
character.
|
static java.lang.String |
replaceSubString(java.lang.String source,
java.lang.String fromSubString,
java.lang.String toSubString)
Simple string replacement method.
|
static java.lang.String |
replaceWith(java.lang.String strOrig,
java.lang.String strFind,
java.lang.String strReplace)
Simple string replacement method.
|
static byte[] |
reverseBytes(byte[] bytes)
Reverses a byte array.
|
static void |
saveOSState(MContext context)
Deprecated.
Use JSP instead of XSL.
|
static void |
setErrorMessage(java.lang.Throwable t,
MContext context)
Sets the error information in the results for the current request.
|
static void |
setErrorTemplate(MContext context,
java.lang.String template)
Deprecated.
as of 2.5 use Task.setUIPage()
|
static void |
setMergeTemplate(MContext context,
java.lang.String template)
Deprecated.
as of 2.5 use Task.setUIPage()
|
static void |
setMessage(java.lang.String messageMode,
java.lang.String title,
java.lang.String body,
MContext context)
Sets error/success message.
|
static void |
setMessage(java.lang.String messageMode,
java.lang.String title,
java.lang.String plainText,
java.lang.String boldText,
MContext context)
Sets error/success message with plain and bold text.
|
static void |
setMessage(java.lang.String messageMode,
java.lang.String title,
java.lang.String plainText,
java.lang.String boldText,
java.lang.String errorDetails,
MContext context)
Sets error/success message with plain and bold text as well as error details.
|
static void |
setMooErrorMessage(javax.servlet.http.HttpServletRequest req,
java.lang.String header,
java.lang.String body,
java.util.ArrayList errors)
Sets the error messages for a Multiple Object Operation.
|
static void |
setMooErrorMessage(java.util.Properties resultStrings,
java.lang.String header,
java.lang.String body,
java.util.ArrayList errors)
Deprecated.
as of 2.7
|
static void |
setupTargetChooser(MContext context,
java.util.Properties resultStrings,
java.lang.String[] objectTypeNames)
Deprecated.
use setupTargetChooser( objectTypeNames, context )
|
static void |
setupTargetChooser(java.lang.String[] objectTypeNames,
MContext context)
Must be called during the server side processing on the request before the TargetChooser widget is used.
|
static void |
shouldRunIneDir(javax.servlet.http.HttpServletRequest req)
Deprecated.
|
static void |
sortKeyValues(java.util.ArrayList keys,
java.util.ArrayList values,
MContext context)
Takes two String ArrayLists, keys and values, and sorts the keys array moving the
values in the value array to corresponding index positions.
|
static void |
sortStringArray(java.lang.String[] myArray)
Sorts a String array while ignoring case.
|
static java.lang.String[] |
split(java.lang.String s,
java.lang.String delimiter)
Tokenize a string into a String array of tokens.
|
static java.lang.String |
stringToHTMLExt(java.lang.String str)
This method extends stringToHTML by also encoding international characters.
|
static java.lang.String |
stringToXML(java.lang.String str)
Deprecated.
As of iManager 2.5, use XmlUtil.stringToXML instead.
|
static java.lang.String |
toDisplay(java.lang.String strText)
Method to escape string for use in HTML.
|
static java.lang.String |
toHexString(byte[] bytes)
Converts a byte array to a hex string.
|
static java.util.Vector |
tokenize(java.lang.String params,
java.lang.String delimiter)
Tokenize a string into a Vector of tokens.
|
static java.lang.String |
toOSFilterString(java.lang.String[] types)
Creates a String that can be used as an ObjectSelector filter string.
|
static java.lang.String |
toScript(java.lang.String strText) |
static java.lang.String |
toTag(java.lang.String str)
Escapes chars for use in HTML tags.
|
static java.lang.String |
trimQuotes(java.lang.String str)
Removes the leading and trailing quotes from a String object.
|
static java.lang.String[] |
unpack(java.lang.String s,
MContext context)
Unpacks data packed with the pack routine.
|
static java.lang.String |
urlDecode(java.lang.String s,
MContext context)
Decodes String that has been urlEncoded.
|
static java.lang.String |
urlDecode(java.lang.String s,
java.lang.String encoding)
Decodes string that has been urlEncoded.
|
static java.lang.String |
urlEncode(java.lang.String strText)
URL encodes using utf-8 encoding.
|
static java.lang.String |
urlEncode(java.lang.String s,
MContext context)
Encodes URL for strings.
|
static java.lang.String |
urlEncode(java.lang.String strText,
java.lang.String charset)
Encodes all characters except 0-9, A-Z, and a-z.
|
static java.lang.String |
urlEncodePath(java.lang.String strText)
Encodes all characters except 0-9, A-Z, and a-z and '/'.
|
static java.lang.String |
urlEncodePath(java.lang.String strText,
java.lang.String charset)
Encodes all characters except 0-9, A-Z, and a-z and '/'.
|
static java.lang.String |
urlEncodeWithSpecials(java.lang.String strText)
Encodes all characters except 0-9, A-Z, a-z, -, _, ., space and '/'.
|
static boolean |
verifyTemplateExistsForDevice(MContext context,
java.lang.String template)
Deprecated.
as of iMan 2.5; Will be removed at future date
|
static java.lang.String |
xmlDecode(java.lang.String str)
Deprecated.
As of iManager 2.5, use XmlUtils.xmlDecode instead.
|
static java.lang.String |
xmlEncode(java.lang.String strText)
Deprecated.
As of iManager 2.5, use XmlUtils.xmlEncode instead.
|
public static final java.lang.String EMPTY_STRING
public static final java.lang.String getModuleFromFullName(java.lang.String fullName)
fullName - String containing the module and jsp path (ex. "base/MyJsp.jsp")public static final java.lang.String getPageFromFullName(java.lang.String fullName)
fullName - String containing the module and jsp path (ex. "base/MyJsp.jsp")public static final org.w3c.dom.Document newDocument()
public static final void saveOSState(MContext context)
context - MContext of the plug-inpublic static final java.lang.String getDisplayName(org.jdom.Document taskDoc,
MContext context)
taskDoc - XML Document containing the task descriptorcontext - MContext of the plug-inpublic static final java.lang.String getDisplayName(org.jdom.Element root,
MContext context)
root - XML Element containing the task descriptorcontext - MContext of the plug-inpublic static final java.lang.String getDisplayName(org.jdom.Element root,
java.lang.String tagName,
MContext context)
root - XML Element containing the task descriptortagName - name of tag containing key into properties filecontext - MContext of the plug-inpublic static java.util.Locale getCurrentLocale(javax.servlet.http.HttpSession session)
LocUtils.getCurrentLocale(HttpSession) insteadsession - public static final java.lang.String getLocalizedString(java.lang.String strResourceFile,
java.lang.String strResId,
MContext context)
strResourceFile - String containing the base name of the resource containing the
localized string. This is the name without the language (e.g. _en) specifier at the end.strResId - String containing the key name in the resource file whose localized value
is to be returned.context - MContext of the plug-inpublic static final java.lang.String getLocalizedString(java.lang.String strResourceFile,
java.lang.String strResId,
java.lang.String strDefaultValue,
MContext context)
strResourceFile - String containing the base name of the resource containing the
localized string. This is the name without the language (e.g. _en) specifier at the end.strResId - String containing the key name in the resource file whose localized value
is to be returned.strDefaultValue - String value to be returned if the localized string can not be found.context - MContext of the plug-inpublic static final java.lang.String getLocalizedString(java.lang.String strResourceFile,
java.lang.String strResId,
java.util.Locale locale)
strResourceFile - String containing the base name of the resource containing the
localized string. This is the name without the language (e.g. _en) specifier at the end.strResId - String containing the key name in the resource file whose localized value
is to be returned.locale - The current locale for the userpublic static java.lang.String getLocalizedString(java.lang.String strResourceFile,
java.lang.String strResId,
java.util.Locale locale,
java.lang.String defaultValue)
strResourceFile - String containing the base name of the resource containing the
localized string. This is the name without the language (e.g. _en) specifier at the end.strResId - String containing the key name in the resource file whose localized value
is to be returned.locale - The current locale for the userdefaultValue - String value to be returned if the localized string can not be found.public static final java.lang.String getExceptionMessage(java.lang.Exception e,
MContext context)
e - Exception to get a message forcontext - MContext of the plug-inpublic static final java.lang.String trimQuotes(java.lang.String str)
If the String has a leading and a trailing quote character, the quotes will be removed.
str - String that will have its quotes removedpublic static final java.lang.String getUniqueString(java.lang.String prefix,
java.lang.String postfix)
prefix - String containing the prefixpostfix - String containing the postfixpublic static final java.util.Properties parseParameters(java.lang.String params)
params - String containing semi-colon delimited string of key/value pairs (ex. key1=val1;key2=val2)public static final java.util.HashMap parseParameters2(java.lang.String params)
params - String containing semi-colon delimited string of key/value pairs (ex. "key1=val1;key2=val2")public static final java.util.Properties parseParameters(java.lang.String params,
java.lang.String delimiter)
params - A delimited string of key/value pairs; for example: "key1=val1;key2=val2"delimiter - The delimiter between the key/value pairs; for example: ";"public static final java.lang.String concatProperties(java.util.Properties properties)
properties - Properties object containing all key/value pairspublic static final java.util.Vector tokenize(java.lang.String params,
java.lang.String delimiter)
params - String containing tokens seperated by delimiter (ex. "token1.token2.token3")delimiter - String containing the delimiter between tokens (ex. ".")public static final java.lang.String[] split(java.lang.String s,
java.lang.String delimiter)
s - String containing tokens seperated by delimiter (ex. "token1.token2.token3")delimiter - String containing the delimiter between tokens (ex. ".")public static final java.lang.String concatStrings(java.lang.String[] strings,
java.lang.String delimiter)
strings - String array of tokensdelimiter - String containing the delimiter between tokens (ex. ".")public static final java.util.ArrayList commaSplit(java.lang.String s)
s - String containing tokens seperated by commas (ex. "token1,toke,,n2,token3")public static final java.lang.String commaSepStr(java.util.ArrayList a)
a - ArrayList of tokenspublic static void setMooErrorMessage(java.util.Properties resultStrings,
java.lang.String header,
java.lang.String body,
java.util.ArrayList errors)
setMooErrorMessage()public static void setMooErrorMessage(javax.servlet.http.HttpServletRequest req,
java.lang.String header,
java.lang.String body,
java.util.ArrayList errors)
req - HttpServletReq.header - String containing the title of the errorbody - String containing the error message to display as the body of the messageerrors - ArrayList of error messages. This should be a list of arrays. Each array in the list should have
three elements.public static final java.lang.String join(java.util.Collection collection,
java.lang.String delimiter)
collection - Collection object of Stringsdelimiter - String containing the delimiter between tokens (ex. ".")public static final java.lang.String join(java.util.Collection collection)
collection - Collection object of Stringspublic static final java.util.Properties getUrlParams(org.jdom.Document doc)
doc - XML Document containing the plug-in descriptorpublic static final void sortStringArray(java.lang.String[] myArray)
myArray - String array to be sortedpublic static final boolean verifyTemplateExistsForDevice(MContext context, java.lang.String template)
context - MContext for the plug-intemplate - String containing the .jsp filepublic static final java.lang.Throwable callVerifyForDeviceMethod(MContext context, org.jdom.Document doc)
context - MContext for the plug-indoc - XML Document describing the plug-inpublic static final boolean instanceOf(java.lang.String className,
java.lang.Class c)
className - String containing class namec - Class object to check if is an instance of classNamepublic static final java.lang.String toHexString(byte[] bytes)
bytes - byte array of valuespublic static final int byteToDecimal(byte b)
b - byte to convertpublic static final byte[] hexStringToByteArray(java.lang.String str)
throws java.lang.NumberFormatException
The string is parsed such that each character represents a single nibble in the byte array. Valid characters are [0-9a-fA-F].
str - String which is parsedjava.lang.NumberFormatExceptionpublic static byte[] reverseBytes(byte[] bytes)
bytes - The byte array to reversepublic static void addUnique(java.util.Collection dstCollection,
java.lang.Object[] sourceObjects)
dstCollection - Collection to be added tosourceObjects - Object array to add to Collectionpublic static void addUnique(java.util.Collection collection,
java.util.Collection newItems)
collection - Collection to be added tonewItems - Collection to add to the existing collectionpublic static final java.util.Properties getUrlParamsAsProperties(org.jdom.Document doc)
doc - XML Document containing the plug-in descriptorpublic static final void setupTargetChooser(java.lang.String[] objectTypeNames,
MContext context)
objectTypeNames - String array containing case sensitive names of the object classes that are valid for
the TargetChooser (* for all)context - MContext of the plug-inpublic static java.lang.String makeAttributeNameLDAPCompliant(java.lang.String attrName,
MContext context)
attrName - String representing an attribute namecontext - MContext.public static final void setupTargetChooser(MContext context, java.util.Properties resultStrings, java.lang.String[] objectTypeNames)
objectTypeNames - String array containing case sensitive names of the object classes that are valid for
the TargetChooser (* for all)resultStrings - Properties object no longer usedcontext - MContext of the plug-insetupTargetChooser(String[], MContext)public static java.lang.String toOSFilterString(java.lang.String[] types)
types - String array of object class namespublic static final java.lang.String getRBSExceptionLocalizedString(com.novell.rbs.RBSException ex,
MContext context)
ex - the Exceptioncontext - MContext of the plug-inpublic static final java.lang.String getClassName(org.jdom.Document doc)
doc - XML Document describing the plug-inpublic static final java.lang.Object[] getOperationsByObjectType(org.jdom.Document doc,
java.lang.String objectType)
doc - - DocumentobjectType - - the object typepublic static final void sortKeyValues(java.util.ArrayList keys,
java.util.ArrayList values,
MContext context)
keys - An ArrayList of String entries to be sortedvalues - An ArrayList of corresponding string valuescontext - MContext of the plug-inpublic static final void setMessage(java.lang.String messageMode,
java.lang.String title,
java.lang.String body,
MContext context)
messageMode - String containing "success", "error", or "fatal"title - String containing localized title of errorbody - String containing localized body of errorcontext - MContext of the plug-inpublic static final void setMessage(java.lang.String messageMode,
java.lang.String title,
java.lang.String plainText,
java.lang.String boldText,
java.lang.String errorDetails,
MContext context)
messageMode - String containing "success", "error", or "fatal"title - String containing localized title of errorplainText - String containing localized body of error; should contain a {0} to be replaced with boldboldText - String containing part of message to be boldederrorDetails - String containing more details of error messagecontext - MContext of the plug-inpublic static final void setMessage(java.lang.String messageMode,
java.lang.String title,
java.lang.String plainText,
java.lang.String boldText,
MContext context)
messageMode - String containing "success", "error", or "fatal"title - String containing localized title of errorplainText - String containing localized body of error; should contain a {0} to be replaced with boldboldText - String containing part of message to be boldedcontext - MContext of the plug-inpublic static void setErrorMessage(java.lang.Throwable t,
MContext context)
header parameter, andbody parameter.t - The exception with the error to display. If the exception is an SPI excetion, the error messages
are retrieved from it and a result string named GeneralMsg.Error.Detail is added which contains
the name of the HTML help file explaining the error. If the exception is a PluginException,
the error messages from the root exception (in the case of nested exceptions) are retrieved. If
the exception is a NamespaceException, an appropriate message is generated. For other
exceptions, a general messages is used, and a stackTrace is added to a string named stackTrace.context - MContext of the plug-inpublic static final void out(org.w3c.dom.Document doc)
doc - XML Document to outputpublic static final java.lang.String getSingleTarget(javax.servlet.http.HttpServletRequest request)
request - HttpServletRequest containing posted data from the target chooserpublic static final java.lang.String getAccessMode(MContext context)
context - MContext of the plug-inpublic static final boolean isTaskAssigned(java.lang.String taskId,
MContext context)
taskId - String containing taskId to check for access (ex. "base.ModifyUser")context - MContext of the plug-inpublic static final void refreshOV(MContext context)
context - MContext of the plug-inpublic static java.lang.String toScript(java.lang.String strText)
public static java.lang.String urlEncode(java.lang.String strText,
java.lang.String charset)
strText - String to encodecharset - String containing character set for encodingpublic static java.lang.String urlEncode(java.lang.String strText)
strText - String to encodepublic static java.lang.String urlEncodeWithSpecials(java.lang.String strText)
strText - String to encodecharset - String containing charset to use for encodingpublic static java.lang.String urlEncodePath(java.lang.String strText,
java.lang.String charset)
strText - String to encodecharset - String containing charset to use for encodingpublic static java.lang.String urlEncodePath(java.lang.String strText)
strText - String to encodepublic static java.lang.String formatMessage(java.lang.String pattern,
java.lang.Object[] arguments)
pattern - String to formatarguments - Object array to pass to MessageFormat.format()public static java.lang.String replaceWith(java.lang.String strOrig,
java.lang.String strFind,
java.lang.String strReplace)
strOrig - Original stringstrFind - String to find in original stringstrReplace - String to replace strFind in origial stringpublic static java.lang.String toDisplay(java.lang.String strText)
strText - String to escapepublic static java.lang.String replaceSubString(java.lang.String source,
java.lang.String fromSubString,
java.lang.String toSubString)
source - Original stringfromSubString - String containing substring to replace in the original stringtoSubString - String containing the replacement substringpublic static java.lang.String xmlEncode(java.lang.String strText)
strText - String to escapepublic static java.lang.String toTag(java.lang.String str)
str - String to escapepublic static java.lang.String xmlDecode(java.lang.String str)
str - String to decodepublic static java.lang.String stringToHTMLExt(java.lang.String str)
str - String to encodepublic static java.lang.String stringToXML(java.lang.String str)
str - String to escapepublic static final java.lang.String urlEncode(java.lang.String s,
MContext context)
s - String to encodecontext - MContext used to get the character encoding. If null then
the default of utf-8 will be used.urlDecode(String, MContext)public static final java.lang.String urlDecode(java.lang.String s,
MContext context)
s - String to decodecontext - MContext used to get the character encoding. If null then
the default of utf-8 will be used.urlEncode(String, MContext)public static final java.lang.String urlDecode(java.lang.String s,
java.lang.String encoding)
s - String to decodeencoding - String containing the encoding to use. If this is null, "8859_1" will be used.urlEncode(String, String)public static final java.lang.String pack(java.lang.String value1,
java.lang.String value2,
MContext context)
value1 - String containing the first valuevalue2 - String containing the second valuecontext - MContext of the plug-inpublic static final java.lang.String pack(java.lang.String[] list,
MContext context)
list - String array containing the valuescontext - MContext of the plug-inpublic static final java.lang.String[] unpack(java.lang.String s,
MContext context)
s - String containing a valid packed string. The empty string is not valid.context - MContext of the plug-inpublic static void setMergeTemplate(MContext context, java.lang.String template)
context - MContext of the plug-intemplate - String containing the .jsp file to set as the "merge" parameter on the HttpServletRequestTask.setUIPage(String)public static void setErrorTemplate(MContext context, java.lang.String template)
context - MContext of the plug-intemplate - String containing the .jsp file to set as the "error" parameter on the HttpServletRequestTask.setUIPage(String)public static java.lang.String getErrorTemplate(MContext context)
context - MContext of the plug-inTask.setUIPage(String)public static java.lang.String getMergeTemplate(MContext context)
context - MContext of the plug-inTask.getUIPage()public static boolean isMS55(javax.servlet.http.HttpServletRequest req)
req - HttpServletRequestpublic static boolean isNN6(javax.servlet.http.HttpServletRequest req)
req - HttpServletRequestpublic static boolean isPalm(javax.servlet.http.HttpServletRequest req)
req - HttpServletRequestpublic static java.lang.String getConfigSetting(com.novell.nps.gadgetManager.BaseGadgetInstance task,
java.lang.String prop,
java.lang.String defaultValue)
task - BaseGadgetInstance of the task trying to get the settingprop - String containing the name of the configuration settingdefaultValue - String containing the dafault value to return if prop is not foundUserConfigpublic static java.lang.String[] getConfigSettings(com.novell.nps.gadgetManager.BaseGadgetInstance task,
java.lang.String prop)
task - BaseGadgetInstance of the task trying to get the settingprop - String containing the name of the configuration settingSystemConfig.getSystemConfig(MContext)public static java.lang.String getModulesBasePath()
public static java.lang.String getRealPath(java.lang.String relativeURL)
relativeURL - String containing the relative URL (ex. "/")public static void refreshResourceFileMap(java.lang.String map)
throws java.io.FileNotFoundException
map - String containing the name of the file map (usually this is the module id)java.io.FileNotFoundExceptionpublic static final byte[] getByteArray(java.io.InputStream is)
throws java.io.IOException
is - InputStream to readjava.io.IOExceptionpublic static java.lang.Throwable discoverRootException(java.lang.Throwable ex)
ex - org.apache.jasper.JasperException that wrappers a real exceptionpublic static Version getVersion(MContext context)
context - public static java.lang.String[] getMvedValues(java.lang.String name,
MContext context)
public static void shouldRunIneDir(javax.servlet.http.HttpServletRequest req)
throws java.lang.Exception
req - java.lang.Exceptionpublic static java.lang.String replaceNonAsciiWithAscii(java.lang.String str,
java.lang.String extendedAscii,
java.lang.String normalAscii)
str - - contain non-breaking space.extendedAscii - - character to replacenormalAscii - - character to be replaced withpublic static java.lang.String[] replaceNonAsciiWithAsciiForArray(java.lang.String[] str,
java.lang.String extendedAscii,
java.lang.String normalAscii)
str[] - -
contain non-breaking space.extendedAscii - - character to replacenormalAscii - - character to be replaced with
API Documentation Copyright © 1998-2004 Novell, Inc. All rights reserved.
NDS is a registered trademark of Novell, Inc. in the United States and other countries.
Generated ${TODAY} ${TSTAMP}.