Package lumis.doui
Class DouiLogicTagProcessor
- java.lang.Object
-
- lumis.doui.DouiLogicTagProcessor
-
public class DouiLogicTagProcessor extends Object
Responsible for processing the logic tag in the douidefinition file. For the process to conclude successfully, the logic tags must obey the following syntax:<doui:douiDefinition xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:doui="http://www.lumis.com.br/lumisportal/xsd/doui" xmlns:control="http://www.lumis.com.br/douicontrols" xmlns:logic="http://www.lumis.com.br/lumisportal/xsd/doui/logic"> <service id="myId"> ... </service> <interfaces> ... <logic:choose> <logic:when test="empty param.lumItemId"> ... </logic:when> <logic:when test="param.instanceId eq 'add'"> ... </logic:when> <logic:otherwise> ... </logic:otherwise> </logic:choose> ... </interfaces> </doui:doui:douiDefinition>
The process will happen top down, and in finding the firstwhen
that has its test true, all other tags for the currentchoose
will be ignored.- Since:
- 5.6.0
- Version:
- $Revision: 11804 $ $Date: 2010-07-29 10:06:21 -0300 (Thu, 29 Jul 2010) $
-
-
Field Summary
Fields Modifier and Type Field Description static String
CONTAINS_TAG_NODE_ATTRIBUTE
Identifies the xml node attribute that will determine if the service interface contains a logic tag.
-
Constructor Summary
Constructors Constructor Description DouiLogicTagProcessor(Node serviceInterfaceDefinitionNode)
Only constructor that receives the service interface definition as a node.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
doProcessTags(LumisExpressionEvaluatorImpl evaluator, VariableResolver variableResolver)
Processes the doui logic tags present in the service definition node.String
getTagPrefix()
Retrives the prefix of the doui logic tags present in the service interface definition.boolean
hasTagOcurrences()
Retrieves if the node contains any ocurrences of the doui logic tags.
-
-
-
Field Detail
-
CONTAINS_TAG_NODE_ATTRIBUTE
public static final String CONTAINS_TAG_NODE_ATTRIBUTE
Identifies the xml node attribute that will determine if the service interface contains a logic tag.- Since:
- 5.6.0
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
DouiLogicTagProcessor
public DouiLogicTagProcessor(Node serviceInterfaceDefinitionNode) throws PortalException
Only constructor that receives the service interface definition as a node.- Parameters:
serviceInterfaceDefinitionNode
- service definition node that needs to be processed.- Throws:
PortalException
- If an exception occurs during xml processing.- Since:
- 5.6.0
-
-
Method Detail
-
hasTagOcurrences
public boolean hasTagOcurrences()
Retrieves if the node contains any ocurrences of the doui logic tags.- Returns:
- true if the service node interface contains any doui logic tags, false otherwise.
- Since:
- 5.6.0
-
getTagPrefix
public String getTagPrefix()
Retrives the prefix of the doui logic tags present in the service interface definition.- Returns:
null
if the service interface definition if the douidefinition file did not contain the logic namespace, otherwise, returns the prefix for that namespace.- Since:
- 5.6.0
-
doProcessTags
public void doProcessTags(LumisExpressionEvaluatorImpl evaluator, VariableResolver variableResolver) throws PortalException
Processes the doui logic tags present in the service definition node. Once if finds the firstwhen
, in thechoose
tag, that has its test true, it will ignore the remainingwhen
and theotherwise
tags.- Parameters:
evaluator
- the Expression Language evaluator to use when processing the doui logic tags.variableResolver
- the Variable Resolver that will acuratly resolve the variables when processing the doui logic tags.- Throws:
PortalException
- If an exception occurs during xml processing or el evaluation.- Since:
- 5.6.0
-
-