lumis.doui
Class DouiLogicTagProcessor

Package class diagram package DouiLogicTagProcessor
java.lang.Object
  extended by 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 first when that has its test true, all other tags for the current choose will be ignored.

Since:
5.6.0

Field Summary
static String CONTAINS_TAG_NODE_ATTRIBUTE
          Identifies the xml node attribute that will determine if the service interface contains a logic tag.
 
Constructor Summary
DouiLogicTagProcessor(Node serviceInterfaceDefinitionNode)
          Only constructor that receives the service interface definition as a node.
 
Method Summary
 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.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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 first when, in the choose tag, that has its test true, it will ignore the remaining when and the otherwise 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


Lumisportal  6.2.0.120405 - Copyright © 2006–2012 Lumis EIP Tecnologia da Informação LTDA. All Rights Reserved.