<!--
 * Copyright (c) 2001, 2007, Oracle. All rights reserved.  
 *
 *      NAME
 *       patchAddMultipleHosts.uix
 *
 *      NOTES
 *       search for Hosts to add to destination; allow multi-selection
 *
 * MODIFIED (MM/DD/YY)  VERSION
 *    srukum 09/04/07 - Fixing ADA bugs
 *    somukh 06/29/05 - Bug - 4442997 
 *    kchias 01/28/04 - bugfix 3243463
 *    kchias 10/04/03 - title
 *    kchias 07/10/03 - bugfix 2966548
 *    kchias 12/05/02 - bugfix 2694584
 *    kchias 11/20/02 - bugfix-2677323
 *    kchias 10/02/02 - ADA compliant
 *    kchias 09/12/02 - kchiasso_ecm_patch_aug2702
 *
 *  @author  kChiasson
 *
-->
<page xmlns="http://bali.us.oracle.com/cabo/baja" xmlns:baja="http://bali.us.oracle.com/cabo/baja" xmlns:uix="http://bali.us.oracle.com/cabo/marlin" xmlns:html="http://www.w3.org/TR/REC-html40">
 <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:noScript>
	JavaScript is not supported by your browser. Oracle requires JavaScript
	support to completely render this page
	</html:noScript>
      <head xmlns="http://xmlns.oracle.com/uix/ui"
         uix:title="pageTitle@getPageTitle"/>
      </contents>
      <provider>
        <data name="getPageTitle">
          <method class="oracle.sysman.eml.ecm.patch.PatchData" method="getPageTitle"/>
        </data>
      </provider>
    </dataScope>
 </baja:head>

    <!-- special handler to load help topic -->
    <handlers>
    <event name="null">
      <method class="oracle.sysman.eml.ecm.OnlineHelp"
              method="loadPatchHelpTopic"/>
    </event>
   </handlers>

  <baja:content xmlns="http://bali.us.oracle.com/cabo/marlin" xmlns:marlin="http://bali.us.oracle.com/cabo/marlin">
  <dataScope>
   <contents>
   
    <script>
     <contents>
      // clear out the previous selections
      function clearParams()
      {
       with(document.patchAddMultipleHosts)
       {
        hostNameText.value = "";
        operatingSystemText.value = "";
       }
      }
     </contents>
    </script>
    <html:noScript>
      "This page uses JavaScript to clear previous selections. Your browser either does not support JavaScript, or it is disabled.  Please enable JavaScript, or upgrade your browser."
    </html:noScript>
    
    <form name="patchAddMultipleHosts" >
     <contents>
      <formValue name="blockStart" uix:value="blockStart@patchList"/>
      <formValue name="anchor" uix:value="anchor@patchList"/>

        <pageLayout xmlns="http://bali.us.oracle.com/cabo/marlin"
            uix:title="pageHeader@getHeaderTitle">

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

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

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

           <pageButtons>
            <pageButtonBar>
            <contents>
                <submitButton name = "event"
                                value="tableCancel" 
                                uix:text="BTN_CANCEL@PatchResourceBundle"/>
                <submitButton name="event"
                                 value="tableAdd"
                                 uix:text="BTN_OK@PatchResourceBundle"/>
            </contents>
            </pageButtonBar>
           </pageButtons>
        
          <location>
            <include baja:node="patchWiz_Train"/>
          </location>

          <copyright>
            <include baja:node="../../../copyright" />
          </copyright>

       <contents>
        <messageBox automatic="true" />
         <!-- make sure valid patch data -->
         <switcher uix:childName="status@searchList" childName="success">
          <case name="failure">
           <messageBox automatic="false"
                       uix:text="errHdr@searchList"
                       uix:message="errMsg@searchList"
                       messageType="error" />
          </case>
          <case name="success">
           <stackLayout>
            <contents>
            
                <rowLayout>
                <contents>
                  <styledText styleClass="OraInstructionText" uix:text="HDR_MULTADDHOSTS@PatchResourceBundle"/>
                </contents>
                </rowLayout>

              <header uix:text="HDR_SEARCHCRITERIA@ResourceBundle">
               <contents>
                <tableLayout width="65%">
                 <contents>

                   <rowLayout>
                   <contents>

                    <rowLayout hAlign="right">
                    <contents>
                    <cellFormat wrappingDisabled="true">
                     <contents>
                     <spacer width="10"/>
                     <styledText labeledNodeId="hostNameText" styleClass="OraPromptText" uix:text="LBL_HOSTNAME@ResourceBundle"/>
                    </contents>
                   </cellFormat>
                    </contents>
                   </rowLayout>

                   <rowLayout hAlign="right">
                    <contents>
                     <spacer width="10"/>
                     <choice name="hostNameQuery" shortDesc="hostQuery"
                             uix:selectedValue="hostNameQuery@searchData">
                      <contents>
                       <option uix:text="OPT_CONTAINS@ResourceBundle"
                                value="OPT_CONTAINS"/>
                       <option uix:text="OPT_EXACT@ResourceBundle"
                                value="OPT_EXACT"/>
                       <option uix:text="OPT_NOTEXACT@ResourceBundle"
                                value="OPT_NOTEXACT"/>
                       <option uix:text="OPT_NOTCONTAINS@ResourceBundle"
                                value="OPT_NOTCONTAINS"/>
                      </contents>
                    </choice>
                   </contents>
                  </rowLayout>

                  <rowLayout hAlign="right">
                   <contents>
                    <spacer width="10"/>
                    <messageTextInput required="no"
                               name="hostNameText"
                               id="hostNameText"
                               uix:text="hostNameText@searchData"
                               columns="20"/>
                   </contents>
                  </rowLayout>

                 </contents>
                </rowLayout>


                   <rowLayout>
                   <contents>

                    <rowLayout hAlign="right">
                    <contents>
                    <cellFormat wrappingDisabled="true">
                     <contents>
                     <spacer width="10"/>
                     <styledText labeledNodeId="operatingSystemText" styleClass="OraPromptText" uix:text="LBL_OPERATINGSYSTEM@ResourceBundle" />
                    </contents>
                   </cellFormat>
                    </contents>
                   </rowLayout>

                   <rowLayout hAlign="right">
                    <contents>
                     <spacer width="10"/>
                     <choice name="operatingSystemQuery" shortDesc="OSQuery" 
                             uix:selectedValue="operatingSystemQuery@searchData">
                      <contents>
                       <option uix:text="OPT_CONTAINS@ResourceBundle"
                                value="OPT_CONTAINS"/>
                       <option uix:text="OPT_NOTCONTAINS@ResourceBundle" 
                                value="OPT_NOTCONTAINS"/>
                      </contents>
                    </choice>
                   </contents>
                  </rowLayout>

                  <rowLayout hAlign="right">
                   <contents>
                    <spacer width="10"/>
                    <messageTextInput required="no"
                               name="operatingSystemText"
                               id="operatingSystemText"
                               uix:text="operatingSystemText@searchData"
                               columns="20"/>
                   </contents>
                  </rowLayout>

                 </contents>
                </rowLayout>

                </contents>
               </tableLayout>

              </contents>
              </header>
 
             <tableLayout width="45%" >
              <contents>
               <spacer height="5"/>
               <rowLayout hAlign="right">
                <contents>
                 <cellFormat wrappingDisabled="true">
                  <contents>
                   <submitButton name="event"
                                 value="doSearch"
                                 uix:text="BTN_SEARCH@ResourceBundle"/>
                   <spacer width="8"/>
                   <button uix:text="BTN_CLEAR@ResourceBundle"
                           onClick="clearParams();" />
                   <spacer width="8"/>
                  </contents>
                 </cellFormat>
                </contents>
               </rowLayout>
              </contents>
             </tableLayout>

             <header uix:text="HDR_RESULTS@ResourceBundle">
              <contents>
            
               <table name="resultsTable"
                      width="100%"
                      formSubmitted="true"
                      minValue="1"
                      uix:value="value@searchList"
                      uix:maxValue="maxValue@searchList"
                      uix:blockSize="blockSize@searchList"
                      uix:alternateText="MSG_PRESSSEARCH@ResourceBundle"
                      uix:tableData="tabledata@searchList"
                      uix:summary="TBLSUM_RESULTSTABLE@ResourceBundle">

                <tableFormat tableBanding="rowBanding"/>

                 <tableSelection>
                    <multipleSelection uix:shortDesc="MLTSEL_RESULTSTABLE@PatchResourceBundle" uix:selected="IS_SELECTED" >
                    </multipleSelection>
                  </tableSelection>

                <columnHeaderData>

                <col id="hostname" uix:text="LBL_HOSTNAME@ResourceBundle"         uix:sort="SORT_HOSTNAME@searchList"         value="LBL_HOSTNAME"/>
                <col id="os"       uix:text="LBL_OPERATINGSYSTEM@ResourceBundle"  uix:sort="SORT_OPERATINGSYSTEM@searchList"  value="LBL_OPERATINGSYSTEM"/>
                <col id="hidden" />
                </columnHeaderData>

<!--                   <boundText select="text"/>
-->
                <columnHeaderStamp>
                 <sortableHeader uix:text="text"
                                uix:value="value"
                                uix:sortable="sort">
                   <boundAttribute name="sortable">
                    <defaulting>
                        <dataObject uix:source="(value)@sortColumnHeader"/>
                        <dataObject select="sort"/>
                    </defaulting>
                   </boundAttribute>
                 </sortableHeader>
                </columnHeaderStamp>

                <contents>
                 <link headers="hostname" select="LBL_HOSTNAME"
                       uix:text="LBL_HOSTNAME"
                       uix:destination="LBL_HOSTNAME^"/>
                 <styledText headers="os" uix:text="LBL_OPERATINGSYSTEM"/>
                 
                 <formValue headers="hidden" name="HOST_NAME_KEY" uix:value="LBL_HOSTNAME"/>
 
                </contents>
               </table>
              </contents>
             </header>

                 <header uix:text="PW_STAGINGDIR@PatchResourceBundle">
                  <contents>

                     <rowLayout>
                     <contents>
                            <formattedText styleClass="OraInstructionText" uix:text="dirHdr@defaultDir" />
                     </contents>
                     </rowLayout>

                     <rowLayout>
                     <contents>
                        <spacer height="5"/>
                     </contents>
                     </rowLayout>

                     <rowLayout>
                     <contents>
                     <messageTextInput
                        uix:prompt="PW_DIR@PatchResourceBundle"
                        name="defDir"
                        id="defDir"
                        uix:text="defDir@defaultDir"
                        uix:tip="INFO_DIREXISTS@PatchResourceBundle"
                        columns="40">
                      </messageTextInput>
                     </contents>
                     </rowLayout>
                
                  </contents>
                 </header>

            </contents>

          </stackLayout>
        </case>
       </switcher>

      </contents>
     </pageLayout>
    </contents>
   </form>
  </contents>
  <provider>
   <data name="searchCallbackText">
    <inline innerQuery="select t.target_name as LBL_HOSTNAME,  
         os.property_value || ' ' || v.property_value || ' ' || pl.property_value as LBL_OPERATINGSYSTEM 
         from mgmt_targets t, 
            mgmt_target_properties os, 
            mgmt_target_properties v, 
            mgmt_target_properties pl 
         where t.target_type = 'host' and 
            t.target_guid = os.target_guid and 
            os.property_name = 'OS' and 
            t.target_guid = v.target_guid and 
            v.property_name = 'Version' and 
            t.target_guid = pl.target_guid and 
            pl.property_name = 'OS_patchlevel'" />
   </data>

    <data name="columnListInfo">
     <inline>
      <column displayName="LBL_HOSTNAME"
              filterOp="hostNameQuery"
              filterVal="hostNameText"
              destLink="monitoring/hostOverview$target=LBL_HOSTNAME$ctxType=All Targets$type=host?event=doLoad"/>
      <column displayName="LBL_OPERATINGSYSTEM"
              filterOp="operatingSystemQuery"
              filterVal="operatingSystemText"/>
      </inline>
    </data>

    <data name="ResourceBundle">
        <bundle class = "oracle.sysman.eml.ecm.search.util.SearchResourceBundle"/>
    </data>

    <data name="PatchResourceBundle">
        <bundle class = "oracle.sysman.eml.ecm.patch.util.PatchResourceBundle"/>
    </data>

    <data name="searchData">
        <method class="oracle.sysman.eml.ecm.search.SearchData"
             method="populateSearchData"/>
    </data>
    <data xmlns="http://bali.us.oracle.com/cabo/marlin" name="searchList">
        <method class="oracle.sysman.eml.ecm.search.SearchData"
             method="populateResultsTable"/>
    </data>

    <data name="sortColumnHeader">
        <method class="oracle.sysman.eml.ecm.search.SearchData"
             method="getSortColumnHeader"/>
    </data>

    <data name="getHeaderTitle">
        <method class="oracle.sysman.eml.ecm.patch.PatchData" method="getPageTitle"/>
    </data>

    <data name="defaultDir">
        <method class="oracle.sysman.eml.ecm.patch.PatchData" 
            method="getDefaultDirectory"/>
    </data>

    <data name="getPatchDestContextPath">
        <method class="oracle.sysman.eml.ecm.ContextPathData" 
            method="getPatchDestContextPath"/>
    </data>

   </provider>
  </dataScope>
 </baja:content>

 <handlers>


  <event name="sort">
   <method class="oracle.sysman.eml.ecm.search.SearchHandler"
           method="doSort"/>

  </event>
  <event name="doSearch">
   <method class="oracle.sysman.eml.ecm.search.SearchHandler"
           method="doSearch"/>
  </event>
  
  <event name="doSQLSearch">
   <method class="oracle.sysman.eml.ecm.search.SearchHandler"
           method="doSQLSearch"/>
  </event>
  
  <!-- This handles the next/prev buttons in the results table -->
  <event name="goto">
   <method class="oracle.sysman.eml.ecm.search.SearchHandler"
           method ="tableGoto"/>
  </event>

  <event name="tableAdd">
   <method class="oracle.sysman.eml.ecm.patch.PatchWizardHandler"
           method ="doTableAdd"/>
  </event>
  
  <event name="tableCancel">
   <method class="oracle.sysman.eml.ecm.patch.PatchWizardHandler"
           method ="doTableCancel"/>
  </event>
  
  <event name="cancel">
     <method class="oracle.sysman.eml.ecm.patch.PatchWizardHandler"
        method="returnToCaller"/>
  </event>

 </handlers>
</page>

