<page xmlns="http://xmlns.oracle.com/uix/controller"
      xmlns:baja="http://xmlns.oracle.com/uix/controller"
      xmlns:uix="http://xmlns.oracle.com/uix/ui" 
      xmlns:html="http://www.w3.org/TR/REC-html40">

    <baja:head  xmlns="http://xmlns.oracle.com/uix/ui">
        <dataScope>
            <contents>
                <head xmlns="http://xmlns.oracle.com/uix/ui"  uix:title="pageTitle@getPageTitle"/>
            </contents>
            <provider>
                <data name="getPageTitle">
                    <method class="oracle.sysman.eml.admin.rep.proxy.CacheData" method="getPageTitle"/>
                </data>
            </provider>
        </dataScope>
    </baja:head>
    
    <baja:content xmlns="http://xmlns.oracle.com/uix/ui">
        <dataScope>
            <contents>
            
            <script>
            <contents>
                
                function clearAruParams()
                {
                    with (document.aruFileUpload)
                    {
                        uploadDirectoryTest.value = ""
                        fileProducts.value = ""
                        fileReleases.value = ""
                        filePlatforms.value = ""
                        fileLanguages.value = ""
                        fileProductGroups.value = ""
                        fileProductReleases.value = ""
                        fileComponentReleases.value = ""
                        filePatchAdvisories.value = ""
                    }
                }
                
                function updateAruParams()
                {
                    var uploadDir = document.aruFileUpload.uploadDirectory.value
                    with (document.aruFileUpload)
                    {
                        fileProducts.value = uploadDir + "/aru_products.xml"
                        fileReleases.value = uploadDir + "/aru_releases.xml"
                        filePlatforms.value = uploadDir + "/aru_platforms.xml"
                        fileLanguages.value = uploadDir + "/aru_languages.xml"
                        fileProductGroups.value = uploadDir + "/aru_product_groups.xml"
                        fileProductReleases.value = uploadDir + "/aru_product_releases.xml"
                        fileComponentReleases.value = uploadDir + "/aru_component_releases.xml"
                        filePatchAdvisories.value = uploadDir + "/query_advisories.xml"
                    }
                }
            
                function clearParams()
                {
                    with (document.urlCacheUploadForm)
                    {
                        if (usingMode == "inspect")
                        {
                            stream.value = "";
                        }
                    }
                }
                
                function clickInspect()
                {
                    clearParams();
                    return true;
                }
                
                function clearFileName()
                {
                    with (document.urlCacheUploadForm)
                    {
                        if (usingMode == "upload")
                        {
                            fileU.value = "";
                        }
                    }
                }
                
                function getUrlValue()
                {
                    var url = document.urlCacheUploadForm.url.value;
                    return url;
                }
                
                function setURLValueFromCacheForm()
                {
                    document.urlFileUpload.url.value = document.urlCacheUploadForm.url.value;
                    return true;
                }
                
                function setCacheRedirValue()
                {
                    var contextpath = document.urlCacheUploadForm.contextPath.value;
                    var path = contextpath + "admin/rep/proxy/cacheListLov";
                    var imagepath = document.urlCacheUploadForm.imagePath.value;
                    var redir = imagepath + "cabo/jsps/frameRedirect.jsp?redirect="+path;
                    
                    // set hidden param to use in openWindow
                    document.urlCacheUploadForm.cacheRedir.value=redir;
                    //document.proxySetupForm.host.value=hostName;
                }
                
                function delimitSpaceToCaret(chkStr)
                {
                    var newStr = "";
                    var cmpStr = "";
                    var space = " ";
                    var caret = "^";
                    
                    strBegLoc = 0;
                    spcLoc = chkStr.indexOf(space);
                    while ( spcLoc > -1)
                    {
                        newStr = newStr+chkStr.substr(strBegLoc,spcLoc)+caret;
                        cmpStr = chkStr.substr(strBegLoc+spcLoc+1);
                        spcLoc = cmpStr.indexOf(space);
                        strBegLoc = newStr.length;
                    }
                    // add the last chunk
                    if (cmpStr.length > 0)
                        newStr = newStr+cmpStr;
                    
                    if (newStr.length > 0)
                     return newStr;
                    else
                     return chkStr;
                }
                
                function cacheListCallBack(lovwin, event)
                {
                    var h = lovwin.retCache;
                    if (h !=(void 0))
                    {
                        document.urlCacheUploadForm.url.value = h;
                    }
                }
            
            </contents>
            </script>
    
            <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>
                <copyright>
                    <include baja:node="/copyright" />
                </copyright>
                <uix:start>
                    <include baja:node="../adminSideNav" />
                </uix:start>
                <location>
                    <include baja:node="/breadCrumbs" />
                </location>

                <contents>
                    
                <stackLayout>
                  <contents>
                    <messageBox automatic="true" />
                    <spacer height="10"/>
                    <subTabLayout>

                      <subTabs>
                        <subTabBar selectedIndex="2">
                          <contents>
                            <link uix:text="PRP_SUB_TAB_PATCH@ResourceBundle" destination="/console/ecm/patch/patchConfigParams" />
                            <link uix:text="PRP_SUB_TAB_PROXY@ResourceBundle" destination="/console/admin/rep/proxy/server"/>
                            <link uix:text="PRP_SUB_TAB_CACHE@ResourceBundle" destination="/console/admin/rep/proxy/cache"/>
                          </contents>
                        </subTabBar>
                      </subTabs>

                      <contents>
                    <spacer height="10"/>
                                        
                    <form name="urlCacheUploadForm"
                          method="GET"
                          usesUpload="true"
                          destination="?event=doUpdateUpload">
                        <contents>
                            
			<html:noScript>
			JavaScript is not supported by your browser. Oracle requires JavaScript support to completely render this page.
			</html:noScript>
                            <formValue name="cacheRedir" />
                            <formValue name="contextPath" uix:value="contextPath@getContextPath"/>
                            <formValue name="imagePath" uix:value="imagePath@getImagePath"/>
                            
                                <stackLayout>
                                    <contents>
                                     
                                        <styledText styleClass="OraTipText" uix:text="METALINK_TERMS_OF_USE@ResourceBundle"/>

                                        <spacer height="12" />
                                    
                                        <header uix:text="PRP_CB_CONN@ResourceBundle" size="1">
                                            <contents>
                                                <stackLayout>
                                                    <contents>
                                                        <messageCheckBox name="cbConnMethod" 
                                                                         uix:text="PRP_CB_CONN_TXT@ResourceBundle"
                                                                         uix:selectedValue="cbConnMethod@cacheData"
                                                                         value="true" 
                                                                         uix:tip="PRP_CB_CONN_TIP@ResourceBundle" />
                                                    </contents>
                                                </stackLayout>
                                            </contents>
                                        </header>
                                        
                                        <spacer height="12" />
                                        
                                        <header uix:text="PRP_CB_DUMP@ResourceBundle" size="1">
                                            <contents>
                                                <stackLayout>
                                                    <contents>
                                                        <messageCheckBox name="cbDumpDir" 
                                                                         uix:text="PRP_CB_DUMP_TXT@ResourceBundle"
                                                                         uix:selectedValue="cbDumpDir@cacheData"
                                                                         value="true" />
                                                        <spacer height="6" />
                                                        <textInput name="dumpDir" shortDesc="Directory" uix:text="dumpDir@cacheData" />
                                                    </contents>
                                                </stackLayout>
                                            </contents>
                                        </header>
                                        
                                        <spacer height="12" />
                                        
                                        <header uix:text="PRP_MC@ResourceBundle" size="1">
                                            <contents>
                                                <tableLayout width="100%" cellSpacing="1" borderWidth="1">
                                                    <contents>
                                                        <rowLayout>
                                                            <contents>
                                                                <cellFormat width="25%">
                                                                    <contents>
                                                                        <styledText styleClass="OraDataText" uix:text="PRP_MC_NAME@ResourceBundle" />
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="15%">
                                                                    <contents>
                                                                        <styledText styleClass="OraDataText" uix:text="PRP_MC_TIME@ResourceBundle" />
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="10%">
                                                                    <contents>
                                                                        <styledText styleClass="OraDataText" uix:text="PRP_MC_STATUS@ResourceBundle" />
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="50%">
                                                                    <contents>
                                                                        <styledText styleClass="OraDataText" uix:text="PRP_MC_LOCATION@ResourceBundle" />
                                                                    </contents>
                                                                </cellFormat>
                                                            </contents>
                                                        </rowLayout>
                                                        <rowLayout>
                                                            <contents>
                                                                <cellFormat width="25%">
                                                                    <contents>
                                                                        <styledText styleClass="OraInstructionText" text="aru_products.xml" />
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="15%">
                                                                    <contents>
                                                                        <styledText styleClass="OraInstructionText" uix:text="date@aru_products@cacheData" />
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="10%">
                                                                    <contents>
                                                                        <switcher uix:childName="status@aru_products@cacheData" >
                                                                            <case name="true">
                                                                                <image source="/em/images/ok.gif" uix:alt="OK" />
                                                                            </case>
                                                                            <case name="false">
                                                                                <image source="/em/images/no.gif" uix:alt="NO" />
                                                                            </case>
                                                                        </switcher>
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="50%">
                                                                    <contents>
                                                                        <fileUpload columns="40" name="aru_products" shortDesc="Products" />
                                                                    </contents>
                                                                </cellFormat>
                                                            </contents>
                                                        </rowLayout>
                                                        <rowLayout>
                                                            <contents>
                                                                <cellFormat width="25%">
                                                                    <contents>
                                                                        <styledText styleClass="OraInstructionText" text="aru_releases.xml" />
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="15%">
                                                                    <contents>
                                                                        <styledText styleClass="OraInstructionText" uix:text="date@aru_releases@cacheData" />
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="10%">
                                                                    <contents>
                                                                       <switcher uix:childName="status@aru_releases@cacheData" >
                                                                            <case name="true">
                                                                                <image source="/em/images/ok.gif" uix:alt="OK" />
                                                                            </case>
                                                                            <case name="false">
                                                                                <image source="/em/images/no.gif" uix:alt="NO" />
                                                                            </case>
                                                                        </switcher>
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="50%">
                                                                    <contents>
                                                                        <fileUpload columns="40" name="aru_releases" shortDesc="Releases" />
                                                                    </contents>
                                                                </cellFormat>
                                                            </contents>
                                                        </rowLayout>
                                                        <rowLayout>
                                                            <contents>
                                                                <cellFormat width="25%">
                                                                    <contents>
                                                                        <styledText styleClass="OraInstructionText" text="aru_platforms.xml" />
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="15%">
                                                                    <contents>
                                                                        <styledText styleClass="OraInstructionText" uix:text="date@aru_platforms@cacheData" />
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="10%">
                                                                    <contents>
                                                                        <switcher uix:childName="status@aru_platforms@cacheData" >
                                                                            <case name="true">
                                                                                <image source="/em/images/ok.gif" uix:alt="OK" />
                                                                            </case>
                                                                            <case name="false">
                                                                                <image source="/em/images/no.gif" uix:alt="NO" />
                                                                            </case>
                                                                        </switcher>
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="50%">
                                                                    <contents>
                                                                        <fileUpload columns="40" name="aru_platforms" shortDesc="Platforms"/>
                                                                    </contents>
                                                                </cellFormat>
                                                            </contents>
                                                        </rowLayout>
                                                        <rowLayout>
                                                            <contents>
                                                                <cellFormat width="25%">
                                                                    <contents>
                                                                        <styledText styleClass="OraInstructionText" text="aru_languages.xml" />
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="15%">
                                                                    <contents>
                                                                        <styledText styleClass="OraInstructionText" uix:text="date@aru_languages@cacheData" />
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="10%">
                                                                    <contents>
                                                                        <switcher uix:childName="status@aru_languages@cacheData" >
                                                                            <case name="true">
                                                                                <image source="/em/images/ok.gif" uix:alt="OK" />
                                                                            </case>
                                                                            <case name="false">
                                                                                <image source="/em/images/no.gif"  uix:alt="NO" />
                                                                            </case>
                                                                        </switcher>
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="50%">
                                                                    <contents>
                                                                        <fileUpload columns="40" name="aru_languages" shortDesc="Languages" />
                                                                    </contents>
                                                                </cellFormat>
                                                            </contents>
                                                        </rowLayout>
                                                        <rowLayout>
                                                            <contents>
                                                                <cellFormat width="25%">
                                                                    <contents>
                                                                        <styledText styleClass="OraInstructionText" text="aru_product_groups.xml" />
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="15%">
                                                                    <contents>
                                                                        <styledText styleClass="OraInstructionText" uix:text="date@aru_product_groups@cacheData" />
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="10%">
                                                                    <contents>
                                                                        <switcher uix:childName="status@aru_product_groups@cacheData" >
                                                                            <case name="true">
                                                                                <image source="/em/images/ok.gif" uix:alt="OK" />
                                                                            </case>
                                                                            <case name="false">
                                                                                <image source="/em/images/no.gif" uix:alt="NO" />
                                                                            </case>
                                                                        </switcher>
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="50%">
                                                                    <contents>
                                                                        <fileUpload columns="40" name="aru_product_groups" shortDesc="Product Groups" />
                                                                    </contents>
                                                                </cellFormat>
                                                            </contents>
                                                        </rowLayout>
                                                        <rowLayout>
                                                            <contents>
                                                                <cellFormat width="25%">
                                                                    <contents>
                                                                        <styledText styleClass="OraInstructionText" text="aru_product_releases.xml" />
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="15%">
                                                                    <contents>
                                                                        <styledText styleClass="OraInstructionText" uix:text="date@aru_product_releases@cacheData" />
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="10%">
                                                                    <contents>
                                                                        <switcher uix:childName="status@aru_product_releases@cacheData" >
                                                                            <case name="true">
                                                                                <image source="/em/images/ok.gif" uix:alt="OK" />
                                                                            </case>
                                                                            <case name="false">
                                                                                <image source="/em/images/no.gif" uix:alt="NO" />
                                                                            </case>
                                                                        </switcher>
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="50%">
                                                                    <contents>
                                                                        <fileUpload columns="40" name="aru_product_releases"  shortDesc="Product Releases"/>
                                                                    </contents>
                                                                </cellFormat>
                                                            </contents>
                                                        </rowLayout>
                                                        <rowLayout>
                                                            <contents>
                                                                <cellFormat width="25%">
                                                                    <contents>
                                                                        <styledText styleClass="OraInstructionText" text="aru_component_releases.xml" />
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="15%">
                                                                    <contents>
                                                                        <styledText styleClass="OraInstructionText" uix:text="date@aru_component_releases@cacheData" />
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="10%">
                                                                    <contents>
                                                                        <switcher uix:childName="status@aru_component_releases@cacheData" >
                                                                            <case name="true">
                                                                                <image source="/em/images/ok.gif" uix:alt="OK" />
                                                                            </case>
                                                                            <case name="false">
                                                                                <image source="/em/images/no.gif" uix:alt="NO" />
                                                                            </case>
                                                                        </switcher>
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="50%">
                                                                    <contents>
                                                                        <fileUpload columns="40" name="aru_component_releases" shortDesc="Component Releases"/>
                                                                    </contents>
                                                                </cellFormat>
                                                            </contents>
                                                        </rowLayout>
                                                        <rowLayout>
                                                            <contents>
                                                                <cellFormat width="25%" >
                                                                    <contents>
                                                                        <styledText styleClass="OraInstructionText" text="query_advisories.xml" />
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="15%">
                                                                    <contents>
                                                                        <styledText styleClass="OraInstructionText" uix:text="date@query_advisories@cacheData" />
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="10%">
                                                                    <contents>
                                                                        <switcher uix:childName="status@query_advisories@cacheData" >
                                                                            <case name="true">
                                                                                <image source="/em/images/ok.gif" uix:alt="OK" />
                                                                            </case>
                                                                            <case name="false">
                                                                                <image source="/em/images/no.gif" uix:alt="NO" />
                                                                            </case>
                                                                        </switcher>
                                                                    </contents>
                                                                </cellFormat>
                                                                <cellFormat width="50%">
                                                                    <contents>
                                                                        <fileUpload columns="40" name="query_advisories" shortDesc="Query Advisories"/>
                                                             </contents>
                                                                </cellFormat>
                                                            </contents>
                                                        </rowLayout>
                                                    </contents>
                                                </tableLayout>
                                            </contents>
                                        </header>
                                        
                                        <spacer height="10" />
                                       
                                        <tableLayout width="100%">
                                            <contents>
                                                <rowLayout>
                                                    <contents>
                                                        <cellFormat width="80%">
                                                            <contents>                                                                          
                                                                <messagePrompt uix:prompt="CACHE_UPDATE_UPLOAD_TIP@ResourceBundle"
                                                                               messageType="info" /> 
                                                            </contents>
                                                        </cellFormat>
                                                        <cellFormat width="20%">
                                                            <contents>
                                                                <flowLayout>
                                                                    <contents>
                                                                        <resetButton uix:text="BTN_REVERT@ResourceBundle" />
                                                                        <submitButton uix:text="CACHE_UPDATE_AND_UPLOAD@ResourceBundle"
                                                                                      name="event"
                                                                                      value="doUpdateUpload"
                                                                                      formName="urlCacheUploadForm" />
                                                                    </contents>
                                                                </flowLayout>
                                                            </contents>
                                                        </cellFormat>
                                                    </contents>
                                                </rowLayout>
                                            </contents>
                                        </tableLayout>

                            </contents>
                        </stackLayout>
                    
                </contents>
                </form>
                
                </contents>
                </subTabLayout>
                

                
              </contents>
              </stackLayout>				
                
            </contents>
        </pageLayout>
        
        </contents>
        
        <provider>
        
            <data name="ResourceBundle">
                <bundle class = "oracle.sysman.eml.ecm.patch.util.PatchResourceBundle"/>
            </data>
            
            <data name="cacheData">
                <method class="oracle.sysman.eml.admin.rep.proxy.CacheData" method="getData"/>
            </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>
            
        </provider>
            
    </dataScope>
</baja:content>

<handlers>

    <event name="doUpdateUpload">
        <method class="oracle.sysman.eml.admin.rep.proxy.CacheHandler" method="doUpdateUpload" />
    </event>
    
</handlers>

</page>
