<page xmlns="http://bali.us.oracle.com/cabo/baja" 
      xmlns:baja="http://bali.us.oracle.com/cabo/baja"
      xmlns:marlin="http://bali.us.oracle.com/cabo/marlin" 
      xmlns:html="http://www.w3.org/TR/REC-html40"
      xmlns:data="http://bali.us.oracle.com/cabo/marlin">

  <baja:head xmlns="http://bali.us.oracle.com/cabo/marlin"
             xmlns:uix="http://bali.us.oracle.com/cabo/marlin"
             xmlns:html="http://www.w3.org/TR/REC-html40">
    <dataScope>
      <contents>
        <html:title>
          <text data:text="title@headerInfo"/>
        </html:title>
       </contents>
       <provider>
        <data name="headerInfo">
          <method class="oracle.sysman.eml.admin.rep.CompTargetManager"
                  method="getHeader" />
        </data>
       </provider>
    </dataScope>
  </baja:head>

  <baja:content xmlns="http://bali.us.oracle.com/cabo/marlin">

   <dataScope>
    <contents>
     <form name="compTargetNewMets" method="post" >
      <contents>

       <pageLayout> 
        <mediumAdvertisement>
         <include baja:node="../../oemBanner" />
        </mediumAdvertisement>

        <globalButtons>
         <include baja:node="../../globalButtonBar" />
        </globalButtons>

         <tabs>
           <include baja:node="../../globalTabs" />
         </tabs>


        <pageHeader>
         <include baja:node="header"/>
        </pageHeader>

        <location>
         <include baja:node="compTargetsTrainData"/>
        </location> 

        <contentFooter>
         <include baja:node="compTargetsNavBar"/>
        </contentFooter>

        <copyright>
         <include baja:node="../../copyright" />
        </copyright>
   
        <contents>
            
         <!--  composite target's new metrics definition -->
         <spacer height="10"/>
         <header marlin:text="header@headerInfo" >
          <contents>

           <tableLayout width="98%">
            <contents>
             <rowLayout hAlign="right">
              <contents>
               <cellFormat>
                <contents>
                 <styledText text=""/>
                </contents>
               </cellFormat>
               <cellFormat>
                <contents>
                 <include baja:node="compTargetsNavBar"/>
                </contents>
               </cellFormat>
              </contents>
             </rowLayout>
            </contents>
           </tableLayout>

           <switcher childName="false" data:childName="error@defNewMetrics">
            <case name="false">
             <stackLayout>
              <contents>
               <tableLayout rendered="false"
                            marlin:rendered="errorOccurred@defNewMetrics"
                            cellSpacing="5"
                            width="100%">
                 <contents>
                   <rowLayout vAlign="top">
                     <contents>
                       <cellFormat vAlign="top">
                         <contents>
                           <messageBox data:message="GEN_ERROR_HEADER@resourceBundle"
                                       messageType="error">
                             <contents marlin:childData="errorData@defNewMetrics">
                               <link data:text="label" data:longDesc="message"
                                     data:destination="destination"/>
                             </contents>
                           </messageBox>
                         </contents>
                       </cellFormat>
                     </contents>
                   </rowLayout>
                 </contents>
               </tableLayout>
    
                   <styledText styleClass="OraInstructionText"
                               data:text="DEFINE_NEW_METRICS_PROMPT@resourceBundle"/>
                   <spacer height="5"/>

                   <switcher data:childName="hasSummaryMetrics@defNewMetrics">
                    <case name="true">
                     <inlineMessage width="100%" marlin:messageType="metricsMsgType@defNewMetrics"
                                    marlin:anchor="metricsAnchor@defNewMetrics"
                                    marlin:message="metricsInlineMsg@defNewMetrics">
                      <contents>
                        <shuttle name="NewMetrics"
                                     data:leadingHeader="AVAILABLE_METRICS@mntrResourceBundle"
                                     data:trailingHeader="SELECTED_METRICS@mntrResourceBundle"
                                     reorderable="false"
                                     size="10">
                          <leading>
                            <list multiple="true" data:shortDesc="AVAILABLE_METRICS@mntrResourceBundle" >
                              <contents marlin:childData="newMetrics@defNewMetrics">
                                <option marlin:text="available" marlin:value="availID"/>
                              </contents>
                             </list>
                           </leading>
                           <trailing>
                             <list multiple="true" data:shortDesc="SELECTED_METRICS@mntrResourceBundle" >
                               <contents marlin:childData="selectedMetrics@defNewMetrics">
                                 <option marlin:text="available" marlin:value="availID"/>
                               </contents>
                             </list>
                           </trailing>
                           <filter>
                             <rowLayout>
                               <contents>
                                 <styledText data:text="TYPE@mntrResourceBundle"
                                             labeledNodeId="selItemTypeChoice"
                                                  styleClass="OraPromptText"/>
                                 <spacer width="10"/>
                                 <choice name="selItemTypeChoice" columns="50"
                                         id="selItemTypeChoice"
                                         onChange="submitForm('compTargetNewMets', true, {event:'Go'})">
                                   <contents marlin:childData="selectedTargetTypes@defNewMetrics">
                                     <option marlin:text="available" marlin:value="availID" marlin:selected="selected"/>
                                    </contents>
                                  </choice> 
                                </contents>
                             </rowLayout>
                           </filter>
                         </shuttle> 
                      </contents>
                     </inlineMessage>
                    </case>
                    <case name="false">
                     <stackLayout>
                      <contents>
                       <spacer height="15"/>
                       <styledText data:text="NO_SUMMARY_METRICS_MESSAGE@resourceBundle"
                                   styleClass="OraErrorText"/>
                      </contents>
                     </stackLayout>
                    </case>
                   </switcher>

                   <tip data:rendered="hasSummaryMetrics@defNewMetrics">
                    <contents>
                     <styledText data:text="DEFINE_NEW_METRICS_HELP@resourceBundle"/>
                    </contents>
                   </tip>

              </contents>
             </stackLayout>
            </case>
            <case name="true">
             <stackLayout>
              <contents>
               <messageBox data:message="errMsg@defNewMetrics"
                           messageType="error"
                           data:text="errHeader@defNewMetrics"/>
               <spacer height="10"/>
               <styledText data:text="CACHE_ERROR_CONTINUE_MSG@resourceBundle"
                           data:destination="restartDest@defNewMetrics"/>
              </contents>
             </stackLayout>
            </case>
           </switcher>
          </contents>
         </header>
        </contents>         
       </pageLayout>
      </contents>
     </form> 
    </contents>
    <provider>

    <data name="resourceBundle">
     <bundle class="oracle.sysman.eml.admin.rep.AdminResourceBundle"/>
    </data>

    <data name="commonResourceBundle">
     <bundle class="oracle.sysman.resources.CommonResourceBundle"/>
    </data>

    <data name="mntrResourceBundle">
     <bundle class="oracle.sysman.resources.MntrResourceBundle"/>
    </data>

     <data name="columnHeaderData">
      <inline>
       <!--<column data:text="NAME@resourceBundle" width="25%"/>-->
       <column data:text="METRIC@resourceBundle" width="25%"/>
      </inline>
     </data>

     <data name="defNewMetrics">
      <method class="oracle.sysman.eml.admin.rep.CompTargetManager"
                  method="getNewMetricsData" />
     </data>         

    <data name="headerInfo">
     <method class="oracle.sysman.eml.admin.rep.CompTargetManager"
             method="getHeader" />
    </data>

    </provider>
   </dataScope>

  </baja:content>

  <handlers> 
    <event name="*">
     <method class="oracle.sysman.eml.admin.rep.CompTargetManager"
              method="handleDefaultEvent"/>
    </event>
    <event name="Cancel">
      <method class="oracle.sysman.eml.admin.rep.CompTargetManager"
              method="handleCancel"/>
    </event>

    <event name="goto">
      <method class="oracle.sysman.eml.admin.rep.CompTargetManager"
              method="handleNewMetricsEvents"/>
    </event>

    <event name="Remove">
      <method class="oracle.sysman.eml.admin.rep.CompTargetManager"
              method="handleNewMetricsEvents"/>
    </event>

    <event name="addRows">
      <method class="oracle.sysman.eml.admin.rep.CompTargetManager"
              method="handleNewMetricsEvents"/>
    </event>
    <event name="Go">
      <method class="oracle.sysman.eml.admin.rep.CompTargetManager"
              method="handleNewMetricsEvents"/>
    </event>
  </handlers>
    
</page>

