Cernunnos Manual


<argument-iterator>

Description:

Iterates over the command line arguments. For each argument, this task sets the request attribute under ATTRIBUTE_NAME to the current argument, then invokes SUBTASKS.

Reagents:

Name XPath Description Reagent Type Expected Type Required
ATTRIBUTE_NAME @attribute-name Optional name under which each argument will be registered as a request attribute. If omitted, the name 'Attributes.STRING' will be used. PHRASE java.lang.String No
SUBTASKS * The set of tasks that are children of this task. NODE_LIST java.util.List No

Examples:

Invokes 'is-admin.crn' to deturmine if the user is an administrator, then either (1) deletes the file(s) specified on the command prompt or (2) gives the user appropriate feedback:

 
       
        <choose> 
          <when test="${crn(is-admin.crn)}"> 
            <argument-iterator> 
              <delete-file file="${Attributes.STRING}"/> 
            </argument-iterator> 
          </when>  
          <otherwise> 
            <echo-ln>You are not authorized to perform the specified action.</echo-ln> 
          </otherwise> 
        </choose>