<!--
 * Copyright (c) 2001, 2006, Oracle. All rights reserved.  
 *
 *      NAME
 *       cloneWiz_SelectDestination.uix
 *
 *      NOTES
 *       Table of input fields to specify destination  
 *

 * MODIFIED   (MM/DD/YY)  VERSION
 *    amani    07/31/06 - Backport amani_bug-4870299 from main
 *    amani  05/02/06 - For OAC fix
 *    audupi   07/12/05 - 4463483 - Including summary for tables
 *    audupi   07/07/05 - 4467739 - Addition of maximum length for text-input
 *    audupi   06/30/05 - 4463454 - Removal of duplicate id
 *    spahuja  05/18/05 - making username passwd as noAutoComplete 
 *    audupi   05/13/05 - 4253303 - UI changes 
 *    anusharm 04/12/05 - correcting lov 
 *    anusharm 04/05/05 - ui review 
 *    anusharm 03/25/05 - 
 *    anusharm 02/14/05 - changing lov 
 *    anusharm 11/02/04 - adding tip for rac cloning
 *    kchiasso 12/05/03 - bugfix 3300285 
 *    kchiasso 10/22/03 - bug# 3211721 
 *    kchiasso 10/14/03 - if rac home 
 *    kchiasso 09/23/03 - dont clear uname
 *    kchiasso 08/20/03 - 
 *    kchiasso 08/19/03 - 
 *    kchiasso 07/01/03 - add help
 *    kchiasso 06/26/03 - lbl change
 *    kchiasso 06/09/03 -
 *    kchiasso 06/04/03 - 
 *    kchiasso 02/19/03 - 
 *    kchiasso 02/04/03 - remove ^M
 *    kchiasso 02/03/03 - kchiasso_new_clonehome
 *  @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: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">


    <html:meta content="no-cache" http-equiv="pragma"/>
    <html:meta content="no-cache" http-equiv="Cache-Control"/>
    <html:meta content="-1" http-equiv="Expires"/>

   <dataScope>
      <contents>
      <head xmlns="http://xmlns.oracle.com/uix/ui"
         uix:title="pageTitle@getPageTitle"/>
      </contents>
      <provider>
        <data name="getPageTitle">
          <method class="oracle.sysman.eml.ecm.cloneHome.CloneHomeData" 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="loadCloneHomeHelpTopic"/>
    </event>
   </handlers>


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

   <body>
   <contents>
 
   <dataScope>
      <contents>

<script>
<contents>

 



 function setHostRedirValue(lovName)
  {
    // save the selector - what table entry
    top.hostSel = lovName;
    // also set the selector for username
    idx = lovName.lastIndexOf(":");
    rowSel = lovName.substr(idx)
    top.usernameSel =  "selectDestTable:username"+rowSel;
    
    // pass the hostName to the LOV 
    var hostName = document.cloneWiz_SelectDestination[top.hostSel].value;
     
    // create the path to use to invoke the LOV page
    var contextpath = document.cloneWiz_SelectDestination.contextPath.value;
    var path = contextpath + "ecm/cloneHome/searchSelectHostLov";
    var params = "$searchHostName="+hostName;
    var imagepath = document.cloneWiz_SelectDestination.imagePath.value;
    var redir = imagepath + "cabo/jsps/frameRedirect.jsp?redirect="+path+params;

    // set hidden param to use in openWindow
    document.cloneWiz_SelectDestination.hostRedir.value=redir;
  }

 function hostListCallBack(lovwin, event)
  {
    // set the hostname selected from the LOV window
    var retVal = lovwin.returnValue;
//    alert("callBack "+retVal);

    if (retVal!=(void 0))
    {
        // set the value in the table
        // parse return to get hostname + username
        i = retVal.indexOf("+");
        var hostName = retVal.substr(0,i);
        var uname = retVal.substr(i+1);
        document.cloneWiz_SelectDestination[top.hostSel].value = hostName;

//        var uname = retVal.substr(i+1);
//        document.cloneWiz_SelectDestination[top.usernameSel].value = uname;
    }
    
  }

function tableLov(lovName) 
{ 
    setHostRedirValue(lovName);
    //alert("redirTo: "+ document.cloneWiz_SelectDestination.hostRedir.value);

    openWindow(top,
               document.cloneWiz_SelectDestination.hostRedir.value,
               'lovWindow',
               {width:500, height:400},
                true,
                'dialog',
                hostListCallBack);

    return false;
    
}


</contents>
</script>

        <form name="cloneWiz_SelectDestination" method="POST">
        <contents>
            <formValue name="FromURLHidden" uix:value="calledFrom@getInfo"/>
            <formValue id="dep1" name="blockStart" uix:value="blockStart@destList"/>
            <formValue name="contextPath" uix:value="contextPath@getContextPath"/>
            <formValue name="imagePath" uix:value="imagePath@getImagePath"/>
            <formValue name="hostRedir"/>


        <pageLayout xmlns="http://bali.us.oracle.com/cabo/marlin"
            uix:title="pageTitle@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>
            <include baja:node="cloneWiz_Footer"/>
          </pageButtons>

          <pageStatus>
           <labeledFieldLayout width="0" fieldWidth="0" labelWidth="0" columns="0" uix:rendered="ioh@destList" >
            <contents>
                    <styledText styleClass="OraDataPrompt" uix:text="LBL_SRCHOST@ResourceBundle" uix:rendered="ioh@destList"/>
                    <rowLayout>
                    <contents>
                        <styledText styleClass="OraDataText" uix:text="srcHost@destList" uix:rendered="ioh@destList"/>
                    </contents>
                    </rowLayout>
                    <styledText styleClass="OraDataPrompt" uix:text="LBL_SRCLOC@ResourceBundle" uix:rendered="ioh@destList"/>
                    <rowLayout>
                    <contents>
                        <styledText styleClass="OraDataText" uix:text="srcLoc@destList" uix:rendered="ioh@destList"/>
                    </contents>
                    </rowLayout>
		    <styledText styleClass="OraDataPrompt" uix:text="OH_SPACE@ResourceBundle" uix:rendered="ioh@destList"/>
                    <rowLayout>
                    <contents>
                        <styledText styleClass="OraDataText" uix:text="homeSpaceReq@destList" uix:rendered="ioh@destList"/>
                    </contents>
                    </rowLayout>
            </contents>
            </labeledFieldLayout>
          </pageStatus>

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

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


        <contents>

           <messageBox automatic="true" />

           <switcher uix:childName="status@destList" childName="success">
            <case name="failure">
                <messageBox automatic="false"
                    uix:text="errHdr@destList"
                    uix:message="errMsg@destList"
                    messageType="error" />
            </case>
            <case name="success">


            <stackLayout>
            <contents>

            <separator > 
            </separator>
 
            <switcher uix:childName="isRacHome@destList" childName="false">
              <case name="true">
                <styledText styleClass="OraInstructionText" uix:text="INSTR_ONEDEST@ResourceBundle" /> 
              </case>
              <case name="false">
                <styledText styleClass="OraInstructionText" uix:text="INSTR_DEST@ResourceBundle" /> 
              </case>
            </switcher>

            <styledText styleClass="OraInstructionText" uix:text="tip@destList" />
            <styledText styleClass="OraInstructionText" uix:text="ractip@destList" uix:rendered="disable@destList" />

             <table name="selectDestTable"
                   width="100%" minValue="1"
                   formSubmitted="true"
                   uix:columnHeaderData="columnHeaderData@destList"
                   uix:tableData="tableData@destList"
                   uix:maxValue="maxValue@destList"
                   uix:blockSize="blockSize@destList"
                   uix:value="value@destList"
                   uix:summary="SUMMARY_DESTSTABLE@ResourceBundle">

             <tableFormat tableBanding="rowBanding"/>
                <columnHeaderStamp>
                  <sortableHeader uix:text="columnHeaderText"
                                  uix:value="value"
                                  uix:sortable="sort">
                        <boundAttribute name="sortable">
                        <defaulting>
                            <dataObject uix:source="(value)@sortColumnHeader"/>
                            <dataObject select="sort"/>
                        </defaulting>
                        </boundAttribute>
                 </sortableHeader>
                </columnHeaderStamp>
             

            <columnHeaderData>
                <col  id="hdrhost" uix:sort="SORT_host@destList"     value="host"   uix:columnHeaderText="HDR_HOST@ResourceBundle" />
                <col  id="hdrdir" uix:sort="SORT_directory@destList"  value="directory"   uix:columnHeaderText="HDR_LOC@ResourceBundle"/>
                <col  id="hdrhome" uix:sort="SORT_home@destList"     value="home"   uix:columnHeaderText="HDR_HOME@ResourceBundle"/>
                <col  id="hdruname" uix:sort="SORT_username@destList" value="username"   uix:columnHeaderText="HDR_UNAME@ResourceBundle"/>
                <col  id="hdrpw" sort="no" uix:columnHeaderText="HDR_PW@ResourceBundle"/>
                <col  id="hdrwdir" sort="no" uix:columnHeaderText="HDR_WORKINGDIR@ResourceBundle"/>
	    </columnHeaderData>
                <!--      uix:onClick="selectDestTable@lovJS" -->
		<!--	  uix:destination="selectDestTable@lovJS" -->

            <columnFooter>
		<submitButton name="event" value="addNewRow" uix:text="BTN_ADDROW@ResourceBundle" uix:disabled="isRacHome@destList"/>
            </columnFooter>
            
            <contents>               
                <lovField name="host"
                          headers="hdrhost"
                          uix:onClick="selectDestTable@lovJS"
                          uix:text="host"
                          columns="17"
                          uix:shortDesc="DESC_HOST@ResourceBundle"
			  uix:disabled="disable@destList"
			  uix:searchDesc="STEP_PAGE_DESTINATION@ResourceBundle"
			  maximumLength="64">
                          <!--boundAttribute name="id">
                            <concat>
                                ID<dataObject select="LOVId" />
                            </concat>
                          </boundAttribute-->
                </lovField> 
                <textInput uix:text="directory"
                           headers="hdrdir"
                           name="directory"
                           columns="24"
                           uix:shortDesc="DESC_DIR@ResourceBundle"
                           uix:disabled="disable@destList"
                           maximumLength="255"/>
                <textInput uix:text="home"
                           headers="hdrhome"
                           name="home"
                           columns="21"
                           uix:shortDesc="DESC_HOME@ResourceBundle"
                           uix:disabled="disable@destList"
                           maximumLength="64"/>
                <textInput uix:text="username"
                           headers="hdruname"
                           name="username"
                           columns="17"
                           uix:shortDesc="DESC_UNAME@ResourceBundle"
			   noAutoComplete="true"
                           maximumLength="32"/>
                <textInput uix:text="password"
                           headers="hdrpw"
                           name="password"
                           columns="14"
                           uix:shortDesc="DESC_PW@ResourceBundle"
			   noAutoComplete="true"
                           secret="true"
                           maximumLength="32"/>
                <textInput uix:text="workingDir"
                           headers="hdrwdir"
                           name="workingDir"
                           columns="14"
                           uix:shortDesc="DESC_WORKINGDIR@ResourceBundle"
                           maximumLength="255"/>
			   

<!-- 
  preserve the following hidden data for review 
-->
                <formValue name="spaceHome" uix:value="spaceHome"/>
                <formValue name="spaceWorkDir" uix:value="spaceWorkDir"/>
                <formValue name="messages" uix:value="messages"/>

            </contents>
            </table>

            </contents>
            </stackLayout>

            </case>
            </switcher>

        </contents>
        </pageLayout>

     </contents>
     </form>


     </contents>

      <provider>

      <data name="destList">
        <method class="oracle.sysman.eml.ecm.cloneHome.CloneHomeData"
           method="populateDestTable"/>
      </data>

      <data name="lovJS">
        <method class="oracle.sysman.eml.ecm.cloneHome.CallLOV" 
        method="getLovJS" /> 
      </data> 

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

      <data name="EngResourceBundle">
       <bundle class = "oracle.sysman.eml.ecm.EcmEnglishMessages"/>
      </data>

      <data name="navStep">
        <method class="oracle.sysman.eml.ecm.cloneHome.CloneHomeData"
         method="getWizardStep"/>
      </data>

      <data name="getPageTitle">
          <method class="oracle.sysman.eml.ecm.cloneHome.CloneHomeData" 
          method="getPageTitle"/>
      </data>

      <data name="getHeaderTitle">
          <method class="oracle.sysman.eml.ecm.cloneHome.CloneHomeData" 
          method="getHeaderTitle"/>
      </data>

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

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

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

       
      </provider>
    </dataScope>

    </contents>
     </body>

 </baja:content>
 
   <handlers>

      <!-- This handles the next/prev buttons in the results table -->
      <event name="goto" source="selectDestTable">
        <method class="oracle.sysman.eml.ecm.cloneHome.CloneHomeHandler"
          method ="tableGoto"/>
      </event>

      <event name="goto" source="homeNav">
        <method class="oracle.sysman.eml.ecm.cloneHome.CloneHomeHandler"
         method="stepNext"/>
      </event>

     <event name="cancel">
       <method class="oracle.sysman.eml.ecm.cloneHome.CloneHomeHandler"
        method="returnToCaller"/>
     </event>


     <event name="addNewRow">
       <method class="oracle.sysman.eml.ecm.cloneHome.CloneHomeHandler"
        method="doAddRow"/>
     </event>


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

 </handlers>

</page>
