public interface PluginContext extends MContext
Task objects. TaskContext extends PluginContext, but these objects are
basically interchangable. PluginContext is left for backwards compatibility for methods passing a PluginContext.
TaskContext objects are passed in the execute
method of Task objects. Task objects can then
use the TaskContext object to get information about the HttpServletRequest
and about the user who is performing the task.
The main methods to use to access objects your task may need:
getSession() - Returns the HttpSession object if you need to get attributes off of the session.
However, try to use getAttribute, setAttribute, and removeAttribute or
getGlobalVar, setGlobalVar, and removeGlobalVar instead.
Any attributes put on the session by your task must be manually removed at logout by your task.getAuthAttribute(Object) - Use instead of getSession to get attributes off of a session
specific cache of key/value pairs that automatically gets cleaned up on logout.setAuthAttribute(Object, Object) - Use instead of getSession to set attributes on a session specific
cache of key/value pairs that automatically gets cleaned up on logout.removeAuthAttribute(Object) - Use instead of getSession to remove attributes off of a
session specific cache of key/value pairs that automatically gets cleaned up on logout.getRequest() - Returns the HttpServletRequest object. Use HttpServletRequest.setAttribute() to put
key/value pairs on the request so your JSP file can retrieve them using request.getAttribute().getAuthenticationBroker() - Returns the AuthenticationBroker object for use in obtaining
connections to the directory the user logged into (NDAP or LDAP connections).getDirUtils() - Returns the DirUtils object, which provides utility methods for accessing the
directory.getLocale() - Returns the Locale object to use for any localization of your task.getDeviceType() - Returns the current device used by the user (browser, mozilla, default, pocket).TaskContext| Modifier and Type | Method and Description |
|---|---|
void |
addToHistory(ObjectEntry oe)
Deprecated.
Add a directory object represented by ObjectEntry to the user's history list for later selection.
|
void |
addToHistory(java.lang.String objectTypeName,
java.lang.String objectName)
Deprecated.
Add a directory object represented by the object's type name (class) and the FDN of the object to the user's
history list for later selection.
|
void |
clearHistory()
Deprecated.
Clears all objects from the user's history list.
|
org.w3c.dom.Document |
createDocument(java.lang.String rootTagName)
Deprecated.
As of iManager 2.5, convert BaseGadgetInstance calls to Task
|
java.lang.Object |
getAttribute(java.lang.Object attrKey)
Deprecated.
as of 2.6
getAuthAttribute(Object) |
java.lang.Object |
getAuthAttribute(java.lang.Object attrKey)
Deprecated.
Returns the value to which the specified attribute key is associated with from the default authenticators context.
|
AuthenticationBroker |
getAuthenticationBroker()
Deprecated.
Returns the AuthenticationBroker associated with this logged in user.
|
iMgrAuthenticator |
getAuthenticator()
Deprecated.
Returns the iMgrAuthenticator object associated with this PluginContext.
|
com.novell.nps.gadgetManager.BaseGadgetInstance |
getBaseGadgetInstance()
Deprecated.
As of iManager 2.5. Will be removed at future date.
|
com.novell.webaccess.common.I18NLocale |
getBrowserLocale()
Deprecated.
As of iManager 2.5, use getLocale instead. Will be removed at a later date.
|
java.lang.String |
getClientLocal()
Deprecated.
as of 2.6 use
#getLocale(HttpSession) |
java.lang.String |
getContextPath()
Deprecated.
Returns the context path from the HttpServletRequest.
|
java.lang.String |
getDeviceType()
Deprecated.
Returns the current device type.
|
DirUtils |
getDirUtils()
Deprecated.
Returns the DirUtils object which contains utility methods for accessing the directory.
|
org.w3c.dom.Document |
getDocument()
Deprecated.
As of iManager 2.5, convert BaseGadgetInstance calls to Task
|
java.util.Properties |
geteMFrameConfigProperties()
Deprecated.
As of iManager 2.5, use com.novell.emframe.dev.config.SystemConfig instead
|
java.lang.String |
getGlobalVar(java.lang.String varName)
Deprecated.
|
HistoryNode[] |
getHistory(java.lang.String[] objectTypeNames)
Deprecated.
as of 2.6 this functionallity is no longer exposed.
|
com.novell.webaccess.common.I18NServletRequest |
getHttpServletRequest()
Deprecated.
As of iManager 2.5, use getRequest instead. Will be removed at a later date.
|
Task |
getLiveTask(java.lang.String taskId)
Deprecated.
as of 2.6 instead the task should pass any anformation needed on the request.
|
java.util.Locale |
getLocale()
Deprecated.
Returns the Locale for use in localization.
|
ManagementServiceSet |
getManagementServiceSet()
Deprecated.
As of iManager 2.5, use
ManagementServiceSet.getManagementServiceSet(HttpSession) |
java.lang.String |
getModulesPath()
Deprecated.
Returns the path to the modules directory for use in JSPs referencing images or other files under their module
directory.
|
java.lang.String |
getPersistentData(java.lang.String configID,
java.lang.String keyId)
Deprecated.
Reads data from the configID UserConfig persistent store.
|
java.util.Properties |
getProviderProperties()
Deprecated.
As of iManager 2.5, use SystemConfig instead.
|
javax.servlet.http.HttpServletRequest |
getRequest()
Deprecated.
Returns the current HttpServletRequest object for use by Tasks.
|
javax.servlet.http.HttpServletResponse |
getResponse()
Deprecated.
|
java.util.Properties |
getResultStrings()
Deprecated.
As of iManager 2.5, in Task.execute( TaskContext context, Properties resultStrings ) instead of
putting the key/value pairs in the Properties object, simply put them as attributes on the HttpServletRequest
object.
|
javax.servlet.http.HttpSession |
getSession()
Deprecated.
Returns the HttpSession object for retrieval of information.
|
java.util.Hashtable |
getSessionCache()
Deprecated.
As of iManager 2.5, use getAttribute, setAttribute, removeAttribute.
|
java.lang.String |
getTaskId()
Deprecated.
Returns the unique TaskID for this task.
|
java.io.File |
getWebappHome()
Deprecated.
Returns a File pointing to the root of webapps.
|
boolean |
isDisconnected()
Deprecated.
|
boolean |
isTaskAvailable(java.lang.String taskId)
Deprecated.
Checks to see if a Task with the specified unique ID is available to be run.
|
void |
removeAttribute(java.lang.Object attrKey)
Deprecated.
Removes the attribute key and associated value if present.
|
void |
removeAuthAttribute(java.lang.Object attrKey)
Deprecated.
Removes the attribute key and associated value if present from the default authenticators context.
|
void |
removeFromHistory(java.lang.String objectName)
Deprecated.
Removes a directory object from the user's history list based upon the FDN of the object.
|
void |
removeGlobalVar(java.lang.String varName)
Deprecated.
as of 2.0 use TaskContext.setAuthAttribute()
|
void |
setAttribute(java.lang.Object attrKey,
java.lang.Object attrValue)
Deprecated.
Saves the specified attribute value with the specified attribute key.
|
void |
setAuthAttribute(java.lang.Object attrKey,
java.lang.Object attrValue)
Deprecated.
Saves the specified attribute value with the specified attribute key in the default authenticators context.
|
void |
setGlobalVar(java.lang.String varName,
java.lang.String val)
Deprecated.
|
void |
setPersistentData(java.lang.String configID,
java.lang.String keyId,
java.lang.String data)
Deprecated.
Saves the data for the specified key in the configID UserConfig persistent store.
|
boolean |
storeeMFrameConfigProperty(java.lang.String header,
java.lang.String key,
java.lang.String value,
boolean evalAndUse)
Deprecated.
As of iManager 2.5, use SystemConfig or GeneralConfig.
|
com.novell.nps.gadgetManager.BaseGadgetInstance getBaseGadgetInstance()
Task class extends BaseGadgetInstance for backwards compatibility.ManagementServiceSet getManagementServiceSet()
ManagementServiceSet.getManagementServiceSet(HttpSession)iMgrAuthenticator. Going forward,
Tasks should get data from their iMgrAuthenticator instead of hard coding to the ManagementServiceSet.ManagementServiceSet.getManagementServiceSet(HttpSession)iMgrAuthenticator getAuthenticator()
getAuthenticator in interface MContextjava.util.Properties getResultStrings()
boolean storeeMFrameConfigProperty(java.lang.String header,
java.lang.String key,
java.lang.String value,
boolean evalAndUse)
header - String currently not usedkey - String currently not usedvalue - String currently not usedevalAndUse - boolean currently not usedSystemConfig,
GeneralConfigjava.util.Hashtable getSessionCache()
getAttribute(java.lang.Object),
setAttribute(java.lang.Object, java.lang.Object),
removeAttribute(java.lang.Object)java.lang.Object getAttribute(java.lang.Object attrKey)
getAuthAttribute(Object)Use instead of getSession to get attributes off of a session specific cache of key/value pairs that automatically gets cleaned up on logout.
attrKey - Object containing the attribute key whose associated value is to be returned
This may not be null.setAuthAttribute(Object, Object)java.lang.Object getAuthAttribute(java.lang.Object attrKey)
Use instead of getSession to get attributes off of a session specific cache of key/value pairs that automatically gets cleaned up on logout.
getAuthAttribute in interface MContextattrKey - Object containing the attribute key whose associated value is to be returned
This may not be null.setAttribute(java.lang.Object, java.lang.Object),
getGlobalVar(java.lang.String)void setAttribute(java.lang.Object attrKey,
java.lang.Object attrValue)
Use instead of getSession to set attributes on a session specific cache of key/value pairs that automatically gets cleaned up on logout.
attrKey - Object containing the attribute key whose associated value is to be set
This may not be null.attrValue - Object value to be saved. This may not be null.getAttribute(java.lang.Object),
setGlobalVar(java.lang.String, java.lang.String)void setAuthAttribute(java.lang.Object attrKey,
java.lang.Object attrValue)
Use instead of getSession to set attributes on a session specific cache of key/value pairs that automatically gets cleaned up on logout.
setAuthAttribute in interface MContextattrKey - Object containing the attribute key whose associated value is to be set
This may not be null.attrValue - Object value to be saved. This may not be null.getAttribute(java.lang.Object),
setGlobalVar(java.lang.String, java.lang.String)void removeAttribute(java.lang.Object attrKey)
Use instead of getSession to remove attributes off of a session specific cache of key/value pairs that automatically gets cleaned up on logout.
attrKey - Object containing the attribute key whose associated value is to be removed
This may not be null.removeGlobalVar(java.lang.String)void removeAuthAttribute(java.lang.Object attrKey)
Use instead of getSession to remove attributes off of a session specific cache of key/value pairs that automatically gets cleaned up on logout.
removeAuthAttribute in interface MContextattrKey - Object containing the attribute key whose associated value is to be removed
This may not be null.removeGlobalVar(java.lang.String)com.novell.webaccess.common.I18NServletRequest getHttpServletRequest()
getRequest()com.novell.webaccess.common.I18NLocale getBrowserLocale()
getLocale()java.util.Locale getLocale()
java.io.File getWebappHome()
getWebappHome in interface MContextvoid addToHistory(ObjectEntry oe)
addToHistory in interface MContextoe - ObjectEntry representing the directory objectvoid addToHistory(java.lang.String objectTypeName,
java.lang.String objectName)
addToHistory in interface MContextobjectTypeName - String containing the type or class name of the objectobjectName - String containing the full distinguished name (FDN) of the objectvoid removeFromHistory(java.lang.String objectName)
removeFromHistory in interface MContextobjectName - String containing the full distinguished name (FDN) of the objectvoid clearHistory()
clearHistory in interface MContextHistoryNode[] getHistory(java.lang.String[] objectTypeNames)
getHistory in interface MContextobjectTypeNames - String array of object types (classes) to retrieve history forboolean isTaskAvailable(java.lang.String taskId)
isTaskAvailable in interface MContexttaskId - String containing the unique ID of the Taskjavax.servlet.http.HttpServletRequest getRequest()
getRequest in interface MContextjavax.servlet.http.HttpServletResponse getResponse()
DirUtils getDirUtils()
getDirUtils in interface MContextjava.lang.String getGlobalVar(java.lang.String varName)
Use instead of getSession to get attributes off of a session specific cache of key/value pairs that automatically gets cleaned up on logout.
varName - String containing the attribute key whose associated value is to be returned
This may not be null.getAttribute(java.lang.Object),
setGlobalVar(java.lang.String, java.lang.String)void setGlobalVar(java.lang.String varName,
java.lang.String val)
Use instead of getSession to set attributes on a session specific cache of key/value pairs that automatically gets cleaned up on logout.
varName - String containing the attribute key whose associated value is to be set
This may not be null.val - String value to be saved. This may not be null.setAttribute(java.lang.Object, java.lang.Object),
getGlobalVar(java.lang.String)void removeGlobalVar(java.lang.String varName)
Use instead of getSession to remove attributes off of a session specific cache of key/value pairs that automatically gets cleaned up on logout.
varName - String containing the attribute key whose associated value is to be removed
This may not be null.removeGlobalVar(java.lang.String)AuthenticationBroker getAuthenticationBroker()
getAuthenticationBroker in interface MContextboolean isDisconnected()
java.lang.String getDeviceType()
The following table lists the possible return values and their meanings:
| Return Value | Meaning |
| browser | Internet Explorer |
| mozilla | Netscape or Mozilla-based browsers |
| default | All other browsers |
| PDA devices such as Palm Pilot and Windows CE devices |
getDeviceType in interface MContextjava.lang.String getClientLocal()
#getLocale(HttpSession)java.lang.String getContextPath()
getContextPath in interface MContextjava.lang.String getModulesPath()
getModulesPath in interface MContextgetContextPath()java.util.Properties geteMFrameConfigProperties()
SystemConfigjava.util.Properties getProviderProperties()
SystemConfigjavax.servlet.http.HttpSession getSession()
getSession in interface MContextgetAuthAttribute(java.lang.Object),
setAuthAttribute(java.lang.Object, java.lang.Object),
removeAuthAttribute(java.lang.Object)java.lang.String getTaskId()
org.w3c.dom.Document createDocument(java.lang.String rootTagName)
rootTagName - String containing the root XML element nameorg.w3c.dom.Document getDocument()
Task getLiveTask(java.lang.String taskId)
getLiveTask in interface MContexttaskId - String containing the unique ID of the taskvoid setPersistentData(java.lang.String configID,
java.lang.String keyId,
java.lang.String data)
setPersistentData in interface MContextconfigID - Name of the UserConfig store to put data in. If null, keyId - String containing the key name of the datadata - String containing the value datagetPersistentData(java.lang.String, java.lang.String)java.lang.String getPersistentData(java.lang.String configID,
java.lang.String keyId)
getPersistentData in interface MContextconfigID - Name of the UserConfig store to retreive data from from. If null, keyId - String containing the key name of the datasetPersistentData(java.lang.String, java.lang.String, java.lang.String)
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}.