|
HATS 7.5.1 Web API ReferencePublicly accessible methods not documented here are for IBM internal use only and may change in a future release of the product. |
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.ibm.hats.transform.AbstractRenderingRulesEngine
com.ibm.hats.transform.RenderingRulesEngine
public class RenderingRulesEngine
RenderingRulesEngine is the core functional class for Global Rules within HATS. This engine is constructed in an Apply Transformation action. The engine then processes the HostScreen using its set of RenderingRules, generating a list of MatchingElements. The engine is then passed around as a context attributes to the various Widgets. Widgets can grab the engine from the context attributes and check it against ComponentElements before they are rendered, and if they find a match, they can have the engine render the output and return it as a String.
Example of Widget Usage:
for (int i = 0; i < componentElements.length; i++) {
InputComponentElement ice = (InputComponentElement) componentElements[i];
//create and render the html input field's caption
HTMLWidgetUtilities.renderCaption(ice.getCaption(), factory, buffer);
//determine if a rendering rule applies to this input field, and if so render the rule output
String ruleOutput = RenderingRulesEngine.processMatchingElement(ice,contextAttributes);
if(ruleOutput!=null) buffer.append(ruleOutput);
else { //create the html input field from the input component element, then render it
TextInputElement input = factory.createTextInput(ice);
input.render(buffer);
}
//insert a line break
buffer.append("<br>");
}
Widget,
RenderingRule,
RenderingRuleSet| Field Summary | |
|---|---|
static String |
CLASS_NAME
|
| Fields inherited from class com.ibm.hats.transform.AbstractRenderingRulesEngine |
|---|
elementsFound |
| Constructor Summary | |
|---|---|
RenderingRulesEngine(IRenderingRuleSet ruleSet,
HsrScreen hostScreen,
BlockScreenRegion region,
ContextAttributes contextAttributes)
Class constructor for RenderingRulesEngine. |
|
RenderingRulesEngine(IRenderingRuleSet ruleSet,
HsrScreen hostScreen,
BlockScreenRegion region,
ContextAttributes contextAttributes,
int screenId)
|
|
| Method Summary | |
|---|---|
RenderingItem[] |
getRenderingItemsFromRenderingRule(IRenderingRule rule,
Object ref)
|
static IRenderingRulesEngine |
getRenderingRulesEngine(javax.servlet.http.HttpServletRequest req)
Pulls an instance of the RenderingRulesEngine from the request. |
static IRenderingRulesEngine |
getRenderingRulesEngine(IRequest req)
Pulls an instance of the RenderingRulesEngine from the request. |
static String |
processMatchingElement(ComponentElement ce,
ContextAttributes contextAttributes)
Attempts to see if a given ComponentElement was matched by any rendering rules, and if so, return the fragment content as a string. |
String |
processPatternMatchElement(IRenderingRule rr,
PatternMatchComponentElement pmce,
ContextAttributes contextAttributes)
Renders output for a RenderingRule match by doing a JSP include of the referenced transformation fragment. |
String |
processPatternMatchElement(com.ibm.hats.transform.MatchingElement me,
ContextAttributes contextAttributes)
Attempts to see if a given ComponentElement was matched by any rendering rules, and if so, return the fragment content as a string. |
static void |
setRenderingRulesEngine(javax.servlet.http.HttpServletRequest req,
IRenderingRulesEngine rre)
Deprecated. - use setRenderingRulesEngine(IRequest req, IRenderingRulesEngine rre) |
static void |
setRenderingRulesEngine(IRequest req,
IRenderingRulesEngine renderingRuleEngine)
Puts an instance of the RenderingRulesEngine in the request. |
| Methods inherited from class com.ibm.hats.transform.AbstractRenderingRulesEngine |
|---|
getApplyRenderingRules, getMatchingComponentElement, getMatchingElement, getMatchingRenderingRule, getNumElementsFound, newInstance, newInstance, preProcessHostTransformation, processScreen, processScreen, setApplyRenderingRules |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String CLASS_NAME
| Constructor Detail |
|---|
public RenderingRulesEngine(IRenderingRuleSet ruleSet,
HsrScreen hostScreen,
BlockScreenRegion region,
ContextAttributes contextAttributes)
ruleSet - RenderingRules to applyhostScreen - HostScreen to search for patterns onregion - not currently usedcontextAttributes - not currently used
public RenderingRulesEngine(IRenderingRuleSet ruleSet,
HsrScreen hostScreen,
BlockScreenRegion region,
ContextAttributes contextAttributes,
int screenId)
| Method Detail |
|---|
public String processPatternMatchElement(IRenderingRule rr,
PatternMatchComponentElement pmce,
ContextAttributes contextAttributes)
processPatternMatchElement in class com.ibm.hats.transform.AbstractRenderingRulesEnginerr - matched rulepmce - element which matchedcontextAttributes - contains the request and page context needed for JSP inclusion
public String processPatternMatchElement(com.ibm.hats.transform.MatchingElement me,
ContextAttributes contextAttributes)
IRenderingRulesEngine
processPatternMatchElement in interface IRenderingRulesEngineprocessPatternMatchElement in class com.ibm.hats.transform.AbstractRenderingRulesEngineme - matching element to match againstcontextAttributes - context attribute information (see class ContextAttributes for more detail)
public RenderingItem[] getRenderingItemsFromRenderingRule(IRenderingRule rule,
Object ref)
getRenderingItemsFromRenderingRule in class com.ibm.hats.transform.AbstractRenderingRulesEngine
public static String processMatchingElement(ComponentElement ce,
ContextAttributes contextAttributes)
ce - The ComponentElement to match on.contextAttributes - Useful information about the environment.
RenderingRulesEngine,
RenderingRulesEngine.processPatternMatchElement(IRenderingRule, PatternMatchComponentElement, ContextAttributes)public static IRenderingRulesEngine getRenderingRulesEngine(javax.servlet.http.HttpServletRequest req)
req - The HttpServletRequest object.
public static IRenderingRulesEngine getRenderingRulesEngine(IRequest req)
req -
public static void setRenderingRulesEngine(javax.servlet.http.HttpServletRequest req,
IRenderingRulesEngine rre)
req - rre -
public static void setRenderingRulesEngine(IRequest req,
IRenderingRulesEngine renderingRuleEngine)
req - renderingRuleEngine -
|
HATS 7.5.1 (201005110649) | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||