﻿<?xml version="1.0" encoding="UTF-8"?>
<?xfa generator="AdobeLiveCycleDesigner_V8.0" APIVersion="2.5.6154.0"?>
<xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/">
   <template xmlns="http://www.xfa.org/schema/xfa-template/2.5/">
   <subform>
      <pageSet>
         <pageArea name="snippet">
            <desc>
               <text name="name">Adobe LiveCycle Workflow-Felder</text>
               <text name="description">Verwenden Sie diese Felder in einem Formular, mit dem Sie in Adobe LiveCycle Workflow Server 7.0 arbeiten möchten. Dadurch wird Ihr Formular für E-Mail und Web aktiviert.</text>
               <text name="version">8.0.1291.1.339988.325709</text>
            </desc>
            <field name="AWS_SUBMIT" x="69.85mm" w="28.575mm" h="9mm">
               <ui>
                  <button/>
               </ui>
               <font typeface="Myriad Pro"/>
               <caption>
                  <value>
                     <text>Senden</text>
                  </value>
                  <para vAlign="middle" hAlign="center"/>
                  <font typeface="Myriad Pro">
                     <fill/>
                  </font>
               </caption>
               <border hand="right">
                  <?templateDesigner StyleID apbx2?>
                  <edge stroke="raised">
                     <color/>
                  </edge>
                  <fill>
                     <color value="212,208,200"/>
                     <solid/>
                  </fill>
                  <edge stroke="raised">
                     <color/>
                  </edge>
                  <edge stroke="raised">
                     <color/>
                  </edge>
                  <edge stroke="raised">
                     <color/>
                  </edge>
                  <corner>
                     <color/>
                  </corner>
                  <corner>
                     <color/>
                  </corner>
                  <corner>
                     <color/>
                  </corner>
                  <corner>
                     <color/>
                  </corner>
               </border>
               <bind match="none"/>
               <event activity="click">
                  <script contentType="application/x-javascript">if (xfa.host.name == "Acrobat")
{
	// get the local URL of the PDF, to check to see if it's a file on disk or from the web. 
	var sURL = event.target.URL;
	if (sURL == null) sURL = "";

	// can only email if there is a Workflow Server email address and doc loaded from disk (not in a browser)  
	if ((sURL.indexOf("file://") == 0) )
	{
		if (AWS_STATUS.rawValue == "Submitted"){ 
			app.alert("This workflow item has already been submitted.");
			bSubmit = false;
		}
		else {
			// set this boolean to false if any of the criteria fails
			var bEmail = true;

			// check for empty agent email address
			var _mailTo = AWS_MAILTO.rawValue;
			if (_mailTo == null) _mailTo="";
			if (_mailTo == ""){

				// prompt for an email address to send the submit
				AWS_MAILTO.rawValue = app.response("Dieses Formular enthält keine E-Mail-Adresse für einen Workflow-Server. Geben Sie die E-Mail-Adresse des Workflow-Servers jetzt ein.", "Arbeitselement senden - Info"); 
				if (AWS_MAILTO.rawValue == ""){ 
					bEmail = false;
				}
			}

			// check for either a taskId or process type, if no taskId, prompt for Process Type
			if (bEmail){
				var _taskId = AWS_TASKID.rawValue;
				if (_taskId == null) _taskId = "";
				var _processType = AWS_PROCESSTYPE.rawValue;
				if (_processType == null) _processType = "";

				if ( (_taskId == "") &amp;&amp; (_processType == "") ){
					// prompt for process type
					AWS_PROCESSTYPE.rawValue = app.response("Dieses Formular enthält keine Aufgaben-ID bzw. keinen Vorgangstyp. Geben Sie den Vorgangstyp ein, den Sie mit diesem Formular starten möchten.", "Arbeitselement senden - Info"); 
					if (AWS_PROCESSTYPE.rawValue == ""){
						bEmail = false;
					}
				}

			}
			
			if (bEmail){
				event.target.submitForm({cURL: "mailto:"+AWS_MAILTO.rawValue,
				 						 bEmpty: true,		// Post all fields (true), or do Not post all fields (false)
				 						 cSubmitAs: "XDP",	// Post XDP format 
				 						 cCharset: "utf-8"});
				// set status to "Submitted" so that another send is not attempted via email.
				AWS_STATUS.rawValue = "Submitted";
			}		
		}
	}
	else{
		// normal web acrobat submit
		FSSUBMIT_.execEvent("click");
	}
}
else // other web rendering submit
{
	FSSUBMIT_.execEvent("click");
}</script>
               </event>
               <value/>
            </field>
            <field h="9mm" name="AWS_ACTION" w="62mm">
               <ui>
                  <choiceList>
                     <border>
                        <edge stroke="lowered"/>
                        <edge stroke="lowered"/>
                        <edge stroke="lowered"/>
                        <edge stroke="lowered"/>
                     </border>
                     <margin/>
                  </choiceList>
               </ui>
               <font typeface="Myriad Pro">
                  <fill/>
               </font>
               <calculate override="warning"/>
               <border hand="right">
                  <edge cap="butt" presence="hidden" stroke="lowered">
                     <color/>
                  </edge>
                  <fill>
                     <solid/>
                     <color/>
                  </fill>
                  <edge cap="butt" presence="hidden" stroke="lowered">
                     <color/>
                  </edge>
                  <edge cap="butt" presence="hidden" stroke="lowered">
                     <color/>
                  </edge>
                  <edge cap="butt" presence="hidden" stroke="lowered">
                     <color/>
                  </edge>
                  <corner>
                     <color/>
                  </corner>
                  <corner>
                     <color/>
                  </corner>
                  <corner>
                     <color/>
                  </corner>
                  <corner>
                     <color/>
                  </corner>
               </border>
               <margin bottomInset="0.9906mm" leftInset="0.9906mm" rightInset="0.9906mm" topInset="0.9906mm"/>
               <para vAlign="middle"/>
               <caption reserve="12.7mm">
                  <font typeface="Myriad Pro">
                     <fill/>
                  </font>
                  <value>
                     <text>Aktion</text>
                  </value>
                  <para vAlign="middle"/>
               </caption>
               <items/>
               <items presence="hidden" save="1"/>
               <event activity="ready" ref="$form">
                  <script contentType="application/x-javascript" runAt="both">var sChoice = AWS_CHOICE.rawValue;
if (sChoice == null) sChoice = "";

if (sChoice.length &gt; 0) {
    // Set the contents of the AWS_ACTION drop-down list box
    // equal to list in the AWS_CHOICE text box.
    // This is required when the form is opened for the very
    // first time.
	
    // Populate action list array from the comma delimited string in AWS_CHOICE
    var astrChoiceList;
    var choices;

    // Clear drop-down list box
    AWS_ACTION.clearItems();

	astrChoiceList = AWS_CHOICE.rawValue;

    // add each choice to AWS_ACTION
    choices = astrChoiceList.split(",");
    var numchoices = choices.length;

    for (var i = 0; i &lt; numchoices; i++)
    {
    	AWS_ACTION.addItem(choices[i], choices[i]);
    }

    // Automatically select the first item
    // only if the array is not empty
    if (numchoices &gt; 0)
    {
		AWS_ACTION.rawValue = choices[0];
    }
}
else{
	AWS_ACTION.presence = "hidden";
}</script>
               </event>
               <bind match="global"/>
               <validate scriptTest="warning"/>
               <value/>
            </field>
            <field h="6mm" name="FSSUBMIT_" presence="invisible" relevant="+interactive" w="3.175mm" x="90.25mm" y="12.7mm">
               <ui>
                  <button/>
               </ui>
               <font typeface="Myriad Pro"/>
               <caption>
                  <value>
                     <text>Senden</text>
                  </value>
                  <para hAlign="center" vAlign="middle"/>
                  <font typeface="Myriad Pro">
                     <fill/>
                  </font>
               </caption>
               <calculate override="warning"/>
               <bind match="none"/>
               <border>
                  <edge stroke="raised"/>
                  <fill>
                     <color value="212,208,200"/>
                  </fill>
                  <edge stroke="raised"/>
                  <edge stroke="raised"/>
                  <edge stroke="raised"/>
                  <corner/>
                  <corner/>
                  <corner/>
                  <corner/>
               </border>
               <margin bottomInset="0mm" leftInset="0mm" rightInset="0mm" topInset="0mm"/>
               <event activity="click">
                  <submit textEncoding="UTF-8" xdpContent="pdf datasets xfdf"/>
               </event>
            </field>
            <field h="6mm" name="AWS_PROCESSTYPE" presence="invisible" relevant="+interactive" w="10.875mm" y="12.7mm" x="76.2mm">
               <value>
                  <text maxChars="255"/>
               </value>
               <ui>
                  <textEdit>
                     <border>
                        <edge/>
                        <edge/>
                        <edge/>
                        <edge/>
                        <fill>
                           <color value="192,192,192"/>
                        </fill>
                     </border>
                     <margin/>
                  </textEdit>
               </ui>
               <traversal passThrough="1"/>
               <caption reserve="15.875mm">
                  <font typeface="Myriad Pro">
                     <fill/>
                  </font>
                  <value>
                     <text>AWS_PROCESSTYPE</text>
                  </value>
                  <para vAlign="middle"/>
               </caption>
               <font typeface="Myriad Pro">
                  <fill/>
               </font>
               <calculate override="warning">
                  <script contentType="application/x-javascript"/>
               </calculate>
               <border hand="right">
                  <edge cap="butt" presence="hidden" stroke="lowered"/>
                  <edge cap="butt" presence="hidden" stroke="lowered"/>
                  <edge cap="butt" presence="hidden" stroke="lowered"/>
                  <edge cap="butt" presence="hidden" stroke="lowered"/>
                  <corner/>
                  <corner/>
                  <corner/>
                  <corner/>
               </border>
               <margin bottomInset="0mm" leftInset="0mm" rightInset="0mm" topInset="0mm"/>
               <bind match="global"/>
               <para vAlign="middle"/>
            </field>
            <field h="6mm" name="AWS_ASSIGNED_ID" presence="invisible" relevant="+interactive" w="3.175mm" y="12.7mm" x="95.25mm">
                <value>
                   <text maxChars="255"/>
                </value>
                <ui>
                   <textEdit>
                      <border>
                         <edge/>
                         <edge/>
                         <edge/>
                         <edge/>
                         <fill>
                            <color value="192,192,192"/>
                         </fill>
                      </border>
                      <margin/>
                   </textEdit>
                </ui>
                <traversal passThrough="1"/>
                <caption reserve="15.875mm">
                   <font typeface="Myriad Pro">
                      <fill/>
                   </font>
                   <value>
                      <text>AWS_ASSIGNED_ID</text>
                   </value>
                   <para vAlign="middle"/>
                </caption>
                <font typeface="Myriad Pro">
                   <fill/>
                </font>
                <calculate override="warning">
                   <script contentType="application/x-javascript"/>
                </calculate>
                <border hand="right">
                   <edge cap="butt" presence="hidden" stroke="lowered"/>
                   <edge cap="butt" presence="hidden" stroke="lowered"/>
                   <edge cap="butt" presence="hidden" stroke="lowered"/>
                   <edge cap="butt" presence="hidden" stroke="lowered"/>
                   <corner/>
                   <corner/>
                   <corner/>
                   <corner/>
                </border>
                <margin bottomInset="0mm" leftInset="0mm" rightInset="0mm" topInset="0mm"/>
                <bind match="global"/>
                <para vAlign="middle"/>
             </field>

            <field h="5.9944mm" name="AWS_TASKID" presence="invisible" w="15.875mm" x="19.05mm" y="12.7mm">
               <ui>
                  <textEdit>
                     <border>
                        <edge/>
                        <edge/>
                        <edge/>
                        <edge/>
                        <corner/>
                        <corner/>
                        <corner/>
                        <fill/>
                     </border>
                     <margin/>
                  </textEdit>
               </ui>
               <font typeface="Myriad Pro">
                  <fill/>
               </font>
               <margin bottomInset="0mm" leftInset="0mm" rightInset="0mm" topInset="0mm"/>
               <para vAlign="middle"/>
               <caption reserve="15.875mm">
                  <font typeface="Myriad Pro">
                     <fill/>
                  </font>
                  <para vAlign="middle"/>
                  <value>
                     <text>AWS_TASKID</text>
                  </value>
               </caption>
               <value>
                  <text maxChars="255"/>
               </value>
               <calculate override="warning"/>
               <bind match="global"/>
            </field>
            <field " h="6mm" name="AWS_CHOICE" presence="invisible" relevant="+interactive" w="15.875mm" y="12.7mm" x="57.15mm">
               <value>
                  <text maxChars="255"/>
               </value>
               <ui>
                  <textEdit>
                     <border>
                        <edge/>
                        <edge/>
                        <edge/>
                        <edge/>
                        <fill>
                           <color value="192,192,192"/>
                        </fill>
                     </border>
                     <margin/>
                  </textEdit>
               </ui>
               <traversal passThrough="1"/>
               <caption reserve="15.875mm">
                  <font typeface="Myriad Pro">
                     <fill/>
                  </font>
                  <value>
                     <text>AWS_CHOICE</text>
                  </value>
                  <para vAlign="middle"/>
               </caption>
               <font typeface="Myriad Pro">
                  <fill/>
               </font>
               <calculate override="warning">
                  <script contentType="application/x-javascript"/>
               </calculate>
               <border hand="right">
                  <edge cap="butt" presence="hidden" stroke="lowered"/>
                  <edge cap="butt" presence="hidden" stroke="lowered"/>
                  <edge cap="butt" presence="hidden" stroke="lowered"/>
                  <edge cap="butt" presence="hidden" stroke="lowered"/>
                  <corner/>
                  <corner/>
                  <corner/>
                  <corner/>
               </border>
               <margin bottomInset="0mm" leftInset="0mm" rightInset="0mm" topInset="0mm"/>
               <bind match="global"/>
               <para vAlign="middle"/>
            </field>
            <field h="6mm" name="AWS_STATUS" presence="invisible" relevant="+interactive" w="15.875mm" y="12.7mm">
               <value>
                  <text maxChars="255"/>
               </value>
               <ui>
                  <textEdit>
                     <border>
                        <edge/>
                        <edge/>
                        <edge/>
                        <edge/>
                        <fill>
                           <color value="192,192,192"/>
                        </fill>
                     </border>
                     <margin/>
                  </textEdit>
               </ui>
               <traversal passThrough="1"/>
               <caption reserve="15.875mm">
                  <font typeface="Myriad Pro">
                     <fill/>
                  </font>
                  <value>
                     <text>AWS_STATUS</text>
                  </value>
                  <para vAlign="middle"/>
               </caption>
               <font typeface="Myriad Pro">
                  <fill/>
               </font>
               <calculate override="warning"/>
               <border hand="right">
                  <edge cap="butt" presence="hidden" stroke="lowered"/>
                  <edge cap="butt" presence="hidden" stroke="lowered"/>
                  <edge cap="butt" presence="hidden" stroke="lowered"/>
                  <edge cap="butt" presence="hidden" stroke="lowered"/>
                  <corner/>
                  <corner/>
                  <corner/>
                  <corner/>
               </border>
               <margin bottomInset="0mm" leftInset="0mm" rightInset="0mm" topInset="0mm"/>
               <para vAlign="middle"/>
               <event activity="preSave" ref="$host">
                  <script contentType="application/x-javascript">AWS_STATUS.rawValue = "";</script>
               </event>
               <bind match="none"/>
            </field>
            <field h="5.9944mm" name="AWS_MAILTO" presence="invisible" w="15.875mm" x="38.1mm" y="12.7mm">
               <ui>
                  <textEdit>
                     <border>
                        <edge/>
                        <edge/>
                        <edge/>
                        <edge/>
                        <corner/>
                        <corner/>
                        <corner/>
                        <fill/>
                     </border>
                     <margin/>
                  </textEdit>
               </ui>
               <font typeface="Myriad Pro">
                  <fill/>
               </font>
               <margin bottomInset="0mm" leftInset="0mm" rightInset="0mm" topInset="0mm"/>
               <para vAlign="middle"/>
               <caption reserve="15.875mm">
                  <font typeface="Myriad Pro">
                     <fill/>
                  </font>
                  <para vAlign="middle"/>
                  <value>
                     <text>AWS_MAILTO</text>
                  </value>
               </caption>
               <value>
                  <text maxChars="255"/>
               </value>
               <calculate override="warning"/>
               <bind match="global"/>
            </field>
         </pageArea>
      </pageSet>
   </subform>
</template></xdp:xdp>
