<?xml version = '1.0' encoding = 'UTF-8' ?>
<!-- 
     TODO get a registered targetNamespace to replace

     http://smp.xmlns.oracle.com/em/templates
 -->
<templateDefinition xmlns:baja="http://xmlns.oracle.com/cabo/baja"
                    xmlns:ctrl="http://xmlns.oracle.com/cabo/baja"
                    xmlns:data="http://xmlns.oracle.com/cabo/marlin"
                    xmlns:html="http://www.w3.org/TR/REC-html40"
                    xmlns:iasTemplates="http://smp.xmlns.oracle.com/em/templates"
                    xmlns:marlin="http://xmlns.oracle.com/cabo/marlin"
                    xmlns:ui="http://xmlns.oracle.com/cabo/marlin"
                    localName="iasPageLayout"
                    targetNamespace="http://smp.xmlns.oracle.com/em/templates"
                    xmlns="http://xmlns.oracle.com/cabo/marlin">
  <author>
William Voss (bevoss)
  </author>
  <version>
1.0
  </version>
  <documentation>

First attempt to create a generic IAS PageLayout element.
Builds on emdwPageLayout for SMP wide attributes.

Currently adds a switcher and an automatic messageBox

Clients should use the new attribte errorCase which can be 
either 
       errorCase="errNode" 
or 
       errorCase="okNode"
if not specified, the default is "okNode"

  </documentation>
  <templates xmlns="http://xmlns.oracle.com/uix/ui">
    <templateImport source="emdwPageLayout.uit"/>
  </templates>
  <type base="iasTemplates:emdwPageLayout">
    <attribute javaType="string" name="errorCase"/>
  </type>
  <content>
    <iasTemplates:emdwPageLayout xmlns="http://xmlns.oracle.com/cabo/marlin">
      <attributeMap>
        <rootAttributeMap/>
      </attributeMap>
      <childMap>
        <rootChildMap/>
      </childMap>
      <contents>
        <switcher childName="okNode"
                  data:childName="errorCase@ui:rootAttr">
          <case name="okNode">
            <dataScope><contents>
              <rootChild name="contents"/>
            </contents></dataScope>
          </case>
          <case name="errNode">
            <dataScope>
              <contents><stackLayout><contents>
                <spacer height="5"/>
                <header data:icon="ALERT_ICON@alertData"
                        data:text="ALERT_HEADER@alertData"/>
                <rowLayout><contents>
                  <spacer height="20" width="45"/>
                  <styledText styleClass="OraDataText"
                              data:text="ALERT_MESSAGE@alertData"/>
                </contents></rowLayout>
              </contents></stackLayout></contents>
              <provider>
                <data name="alertData">
                  <method class="oracle.sysman.ias.util.IASUtil"
                          method="getAlertData"/>
                </data>
                <data name="ResourceBundle">
                  <bundle class="oracle.sysman.ias.ias.IASMsg"/>
                </data>
              </provider>
            </dataScope>
          </case>
          <!-- End of "errNode" case -->
        </switcher>
      </contents>
      <contentFooter>
        <switcher childName="okNode"
                  data:childName="errorCase@ui:rootAttr">
          <case name="okNode">
            <dataScope><contents>
              <rootChild name="contentFooter"/>
            </contents></dataScope>
          </case>
          <case name="errNode">
            <dataScope>
              <contents><pageButtonBar><contents>
                <button data:destination="ALERT_BUTTON_DEST@alertData"
                        id="backButton"
                        data:text="ALERT_BUTTON_TEXT@alertData"/>
              </contents></pageButtonBar></contents>
              <provider>
                <data name="alertData">
                  <method class="oracle.sysman.ias.util.IASUtil"
                          method="getAlertData"/>
                </data>
              </provider>
            </dataScope>
          </case>
        </switcher>
      </contentFooter>
    </iasTemplates:emdwPageLayout>
  </content>
</templateDefinition>
