|
Novell exteNd Director 5.2 API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Stores information about the rule context and the user's portal environment. EbiContext stores the user's ID, the user's portal session, response and request objects appropriate to the current user agent or browser, and information about the content being requested.
Information that persists between requests is stored in the EbiSession object, which is available from the context. The session includes a "whiteboard" that holds values that a component needs to keep available. You give each whiteboard value a key, which you use to retrieve the value. If there is no session, the portal creates a session-independent whiteboard for storing your persistent data. For more information, see Using whiteboard values in Director online help.
In a portal component, you can get the rule EbiContext from the EbiPortalContext object "context", passed in from getComponentData(). Here is the method you need:
com.sssw.re.api.EbiContext ctx = com.sssw.re.factory.EboFactory.createEbiContext( context.getEbiRequest().getHttpServletRequest(), context.getEbiResponse().getHttpServletResponse(), context.getServletContext());You can also get a generic context object from com.sssw.re.factory.EboFactory.
EbiPortalContext
,
EboFactory.createEbiContext(HttpServletRequest request,
HttpServletResponse response, ServletContext servletContext)
Method Summary | |
EbiContext |
fireRule(String ruleID)
Executes a rule. |
EbiContext |
fireTemporaryRule(String ruleXML)
Executes a rule that you supply in XML format. |
boolean |
getLog()
Returns the Boolean variable log, which indicates whether or not logging is active for the current request. |
String |
getPipelineID()
Gets the ID of the active rules pipeline. |
int |
getResponseType()
Gets the HTTP response type the component will find in the response phrase. |
String |
getURLString()
Gets the url String set on the context object. |
boolean |
isLog()
Returns the Boolean variable log, which indicates whether or not logging is active for the current request. |
String |
merge(String string)
Processes text that contains !valueOf expressions. |
String |
mergeEncoded(String string)
Adds URL encoding to a merged text. |
void |
setLog(boolean log)
Passes the boolean variable log, which indicates whether or not
logging is active for the current request. |
void |
setPipelineID(String pipelineID)
Sets the active pipeline for the portal context. |
void |
setResponseType(int responseType)
Sets the HTTP response type, which describes the type of value the portal component will find in the response phrase. |
void |
setRuleID(String ruleID)
Sets the rule ID for the current context. |
void |
setURLString(String url)
Sets the url string for the current context. |
void |
setUserID(String userID)
Sets the user ID associated with the context object. |
void |
validate()
Fires the rules associated with the current rules pipeline for the current user. |
void |
validate(String pipelineID)
Fires the rules associated with the specified rules pipeline for the current user. |
Methods implemented from interface com.sssw.fw.api.EbiRequestContext |
getContentType,
getCookieValue,
getResponsePhrase,
getResponseStatus,
getServletContext,
getURI,
hasQueryString,
setContentType,
setCookieValue,
setRequestResponse,
setResponsePhrase,
setResponseStatus,
setServletContext,
setURI |
Methods implemented from interface com.sssw.fw.api.EbiContext |
cloneCopy,
getAttributeNames,
getBrowserInfo,
getContextName,
getEbiRequest,
getEbiResponse,
getEbiSession,
getEbiSession,
getEbiWhiteboard,
getEJBContext,
getException,
getLocale,
getPrincipal,
getTemporaryData,
getTemporaryValue,
getValue,
getValue,
getValueNames,
hasSession,
hasValue,
isNewSession,
removeAllValues,
removeValue,
setEbiRequest,
setEbiResponse,
setEbiSession,
setEJBContext,
setException,
setTemporaryValue,
setValue |
Method Detail |
public void setUserID(String userID)
You might set the user ID if you are writing a login component. If your portal stores the user's ID in a cookie to save the trouble of logging on every time, you can retrieve the cookie and call setUserID().
userID
- a String that holds a user IDpublic void setRuleID(String ruleID)
rule
- Rule to be set in the current context.EbiContext.fireRule(String ruleID)
public void setURLString(String url)
String
- whose value is a URL.EbiContext.getURLString()
public EbiContext fireRule(String ruleID)
When firing a rule you need to handle the result of the rule's action. For implementation options see Handling the results of a rule in Director online help.
ruleID
- the name of a rule stored in your Director project's
resource set. Rules that you create in the Rules Designer in eXtend Workbench
are saved to this location.EbiRuleManager.fireRule(String ruleID, EbiContext context)
,
EbiContext.fireTemporaryRule(String ruleXML)
,
EbiRequestContext.getResponsePhrase()
,
EbiRequestContext.getResponseStatus()
,
EbiContext.getValue( String key)
public EbiContext fireTemporaryRule(String ruleXML)
For more information, see Firing temporary rules in Director online help.
ruleXML
- a String whose value is an XML rule definitionEbiRuleManager.fireTemporaryRule(String ruleXML, EbiContext context)
public boolean getLog()
public String getPipelineID()
EbiContext.setPipelineID(String pipelineID)
,
EbiContext.validate()
public String getURLString()
EbiContext.setPipelineID(String pipelineID )
public int getResponseType()
The type is valid only if a rule or other code set it.
EbiResponse
public boolean isLog()
EbiContext.getLog()
,
EbiContext.setLog(boolean log)
public String merge(String string)
!valueOf expressions are typically used as parameters for conditions and actions. When you write a custom condition or action, you can call merge() to resolve !valueOf expressions in its properties. You can also use these expressions in content stored in the content management system.
For more information, see Using whiteboard values in Director online help.
template
- a String that includes one or more !valueOf expressionstemplate
didn't include any
!valueOf expressions, the original String is returned.EbiAction
,
EbiCondition
,
EboStringTemplate
public String mergeEncoded(String string)
template
- A String
that includes one or more !valueOf expressionsString
where the !valueOf expressions have been replaced by
encoded values from the whiteboard. If template
didn't include
any !valueOf expression, an encoded version of the original String
is returned.EbiContext.merge(String string)
public void setLog(boolean log)
boolean
variable log, which indicates whether or not
logging is active for the current request.Boolean
- log; true means logging is active, false means logging is inactive.public void setPipelineID(String pipelineID)
pipelineID
- a String containing a valid pipeline IDEbiContext.validate()
,
EbiContext.getPipelineID()
public void setResponseType(int responseType)
Typically, code that sets the response phrase should also set the response type.
responseType
- an integer, as defined in EbiResponse, identifying
the type of information in the response phraseEbiResponse
,
EbiRequestContext.setResponsePhrase( String phrase )
public void validate() throws com.sssw.re.exception.EboValidateException
Pipelines are a series of steps with rules associated with them. The pipeline takes session information, such as the user and the user's group, and checks them against criteria specified in rules.
For more information, see Developing pipelines in Director online help.EbiRequestContext.getResponsePhrase()
,
EbiRequestContext.getResponseStatus()
,
EbiContext.getResponseType()
,
EbiContext.setPipelineID(String pipelineID)
public void validate(String pipelineID) throws com.sssw.re.exception.EboValidateException
Pipelines are a series of steps with rules associated with them. The pipeline takes session information, such as the user and the user's group, and checks them against criteria specified in rules. For more information, see Developing pipelines in Director online help.
EbiRequestContext.getResponsePhrase()
,
EbiRequestContext.getResponseStatus()
,
EbiContext.getResponseType()
|
Novell exteNd Director 5.2 API |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |