Package lumis.doui

Class 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
    Version:
    $Revision: 11804 $ $Date: 2010-07-29 10:06:21 -0300 (Thu, 29 Jul 2010) $
    • 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