|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.novell.emframe.dev.PluginContext
Passes information to 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.getAttribute(java.lang.Object) or getGlobalVar(java.lang.String) - Use instead of getSession to get attributes off of a session
specific cache of key/value pairs that automatically gets cleaned up on logout.setAttribute(java.lang.Object, java.lang.Object) or setGlobalVar(java.lang.String, java.lang.String) - Use instead of getSession to set attributes on a session specific
cache of key/value pairs that automatically gets cleaned up on logout.removeAttribute(java.lang.Object)or removeGlobalVar(java.lang.String) - 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).
| Field Summary | |
protected iMgrAuthenticator |
authenticator
Holds the current iMgrAuthenticator. |
protected com.novell.nps.gadgetManager.BaseGadgetInstance |
baseGadgetInstance
Handle to the BaseGadgetInstance implementation of the task. |
protected static java.lang.String |
contextPath
String used to hold the context path of the servlet. |
protected javax.servlet.http.HttpServletRequest |
httpServletRequest
Holds the current HttpServletRequest. |
protected javax.servlet.http.HttpServletResponse |
httpServletResponse
Holds the current HttpServletResponse. |
protected com.novell.webaccess.common.I18NLocale |
i18nLocale
Holds the I18NLocale wrapper object used to hold the current Locale. |
protected com.novell.webaccess.common.I18NServletRequest |
i18nServletRequest
Holds the I18ServletRequest wrapper object used to hold the current request. |
protected ManagementServiceSet |
manageSS
Holds the current ManagementServiceSet. |
protected java.util.Properties |
resultStrings
Properties object where the name/values pairs generated by the task are stored. |
protected com.novell.nps.sessionManager.PortalSession |
session
Holds the current PortalSession wrapper around the HttpSession. |
| Constructor Summary | |
PluginContext(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
Constructs a PluginContext with the current HttpServletRequest and HttpServletResponse. |
|
| Method Summary | |
void |
addToHistory(ObjectEntry oe)
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)
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()
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)
Returns the value to which the specified attribute key is associated with. |
AuthenticationBroker |
getAuthenticationBroker()
Returns the AuthenticationBroker associated with this logged in user. |
iMgrAuthenticator |
getAuthenticator()
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()
Returns the list of Locales in a String that are "," delimited. |
java.lang.String |
getContextPath()
Returns the context path from the HttpServletRequest. |
java.lang.String |
getDeviceType()
Returns the current device type. |
DirUtils |
getDirUtils()
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)
Returns the value to which the specified attribute key is associated with. |
HistoryNode[] |
getHistory(java.lang.String[] objectTypeNames)
Returns an array of HistoryNode objects containing all objects in the user's history that match any of the object types (classes) passed in. |
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)
Returns a Task class pointing to an instantiated class for the taskId passed in. |
java.util.Locale |
getLocale()
Returns the Locale for use in localization. |
ManagementServiceSet |
getManagementServiceSet()
Deprecated. As of iManager 2.5, use getAuthenticator. |
java.lang.String |
getModulesPath()
Returns the path to the modules directory for use in JSPs referencing images or other files under their module directory. |
java.util.Properties |
getProviderProperties()
Deprecated. As of iManager 2.5, use SystemConfig instead. |
javax.servlet.http.HttpServletRequest |
getRequest()
Returns the current HttpServletRequest object for use by Tasks. |
javax.servlet.http.HttpServletResponse |
getResponse()
Returns the current HttpServletResponse associated with the HttpServletRequest. |
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()
Returns the HttpSession object for retrieval of information. |
java.util.Hashtable |
getSessionCache()
Deprecated. As of iManager 2.5, use getAttribute, setAttribute, removeAttribute. |
com.novell.emframe.fw.ServiceSyncLock |
getSynchLock()
Returns the ServiceSyncLock used to synchronize access to make this Task thread safe. |
java.lang.String |
getTaskId()
Returns the unique TaskID for this task. |
UserConfig |
getUserConfig()
Returns the UserConfig object from the session or creates one if not already present. |
java.io.File |
getWebappHome()
Returns a File pointing to the root of webapps. |
void |
init(javax.servlet.http.HttpServletRequest req,
com.novell.nps.gadgetManager.BaseGadgetInstance baseGadgetInstance)
Initialize the PluginContext with the HttpServletRequest and a BaseGadgetInstance handle to the task. |
void |
init(com.novell.webaccess.common.I18NServletRequest i18nReq,
javax.servlet.http.HttpServletRequest req,
com.novell.nps.gadgetManager.BaseGadgetInstance baseGadgetInstance)
Initialize the PluginContext with an I18NServletReqest as well as the HttpServletRequest and a BaseGadgetInstance handle to the task. |
boolean |
isTaskAvailable(java.lang.String taskId)
Checks to see if a Task with the specified unique ID is available to be run. |
boolean |
isXml()
Deprecated. As of iManager 2.5, convert XML/XSL Tasks to JSP |
void |
makeLike(PluginContext context)
Make the current PluginContext contain the same member variables as the passed in PluginContext. |
void |
removeAttribute(java.lang.Object attrKey)
Removes the attribute key and associated value if present. |
void |
removeFromHistory(java.lang.String objectName)
Removes a directory object from the user's history list based upon the FDN of the object. |
void |
removeGlobalVar(java.lang.String varName)
Removes the attribute key and associated value if present. |
void |
setAttribute(java.lang.Object attrKey,
java.lang.Object attrValue)
Saves the specified attribute value with the specified attribute key. |
void |
setGlobalVar(java.lang.String varName,
java.lang.String val)
Saves the specified attribute value with the specified attribute key. |
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. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected iMgrAuthenticator authenticator
protected com.novell.nps.gadgetManager.BaseGadgetInstance baseGadgetInstance
protected static java.lang.String contextPath
protected javax.servlet.http.HttpServletRequest httpServletRequest
protected javax.servlet.http.HttpServletResponse httpServletResponse
protected com.novell.webaccess.common.I18NLocale i18nLocale
protected com.novell.webaccess.common.I18NServletRequest i18nServletRequest
protected ManagementServiceSet manageSS
protected java.util.Properties resultStrings
protected com.novell.nps.sessionManager.PortalSession session
| Constructor Detail |
public PluginContext(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse resp)
req - The current HttpServletRequestresp - The current HttpServletResponse| Method Detail |
public void addToHistory(ObjectEntry oe)
oe - ObjectEntry representing the directory objectpublic void addToHistory(java.lang.String objectTypeName,
java.lang.String objectName)
objectTypeName - String containing the type or class name of the objectobjectName - String containing the full distinguished name (FDN) of the objectpublic void clearHistory()
public org.w3c.dom.Document createDocument(java.lang.String rootTagName)
rootTagName - String containing the root XML element name
public java.lang.Object getAttribute(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.
attrKey - 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)public AuthenticationBroker getAuthenticationBroker()
public iMgrAuthenticator getAuthenticator()
public com.novell.nps.gadgetManager.BaseGadgetInstance getBaseGadgetInstance()
Task class extends BaseGadgetInstance for backwards compatibility.
public com.novell.webaccess.common.I18NLocale getBrowserLocale()
getLocale()public java.lang.String getClientLocal()
public java.lang.String getContextPath()
public 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 |
public DirUtils getDirUtils()
public org.w3c.dom.Document getDocument()
public java.util.Properties geteMFrameConfigProperties()
SystemConfigpublic java.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)public HistoryNode[] getHistory(java.lang.String[] objectTypeNames)
objectTypeNames - String array of object types (classes) to retrieve history for
public com.novell.webaccess.common.I18NServletRequest getHttpServletRequest()
getRequest()public Task getLiveTask(java.lang.String taskId)
taskId - String containing the unique ID of the task
public java.util.Locale getLocale()
public ManagementServiceSet getManagementServiceSet()
iMgrAuthenticator. Going forward,
Tasks should get data from their iMgrAuthenticator instead of hard coding to the ManagementServiceSet.
getAuthenticator()public java.lang.String getModulesPath()
getContextPath()public java.util.Properties getProviderProperties()
SystemConfigpublic javax.servlet.http.HttpServletRequest getRequest()
public javax.servlet.http.HttpServletResponse getResponse()
public java.util.Properties getResultStrings()
public javax.servlet.http.HttpSession getSession()
getAttribute(java.lang.Object),
setAttribute(java.lang.Object, java.lang.Object),
removeAttribute(java.lang.Object),
getGlobalVar(java.lang.String),
setGlobalVar(java.lang.String, java.lang.String),
removeGlobalVar(java.lang.String)public java.util.Hashtable getSessionCache()
getAttribute(java.lang.Object),
setAttribute(java.lang.Object, java.lang.Object),
removeAttribute(java.lang.Object)public com.novell.emframe.fw.ServiceSyncLock getSynchLock()
public java.lang.String getTaskId()
public UserConfig getUserConfig()
public java.io.File getWebappHome()
public void init(javax.servlet.http.HttpServletRequest req,
com.novell.nps.gadgetManager.BaseGadgetInstance baseGadgetInstance)
Task class extends BaseGadgetInstance for backwards compatibility.
Tasks should not have to construct a PluginContext, but are passed an already created and initialized
PluginContext.
req - The current HttpServletRequestbaseGadgetInstance - BaseGadgetInstance handle to the taskpublic void init(com.novell.webaccess.common.I18NServletRequest i18nReq,
javax.servlet.http.HttpServletRequest req,
com.novell.nps.gadgetManager.BaseGadgetInstance baseGadgetInstance)
Task class extends BaseGadgetInstance for backwards compatibility.
i18nReq - The current HttpServletRequest wrapped in an I18NServletRequest objectreq - The current HttpServletRequestbaseGadgetInstance - BaseGadgetInstance handle to the taskpublic boolean isTaskAvailable(java.lang.String taskId)
taskId - String containing the unique ID of the Task
public boolean isXml()
public void makeLike(PluginContext context)
context - PluginContext to clonepublic 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)public void removeFromHistory(java.lang.String objectName)
objectName - String containing the full distinguished name (FDN) of the objectpublic 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)public 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)public 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)public 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 used
SystemConfig,
GeneralConfig
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||