Subversion Repositories DevTools

Rev

Rev 29 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|                                wFTP                                                   |
'|                                                   |
'=====================================================
%>
<%
Option explicit
Response.Expires = 0
%>
<!--#include file="common/globals.asp"-->
<!--#include file="common/config.asp"-->
<!--#include file="common/common_subs.asp"-->
<!--#include file="common/_popup_window_common.asp"-->
<!--#include file="class/classTabControl.asp"-->
<!--#include file="class/classTemplateManager.asp"-->
<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_general.asp"-->
<%
'------------ VARIABLE DEFINITION -------------
Dim objTabControl
Dim objTemplateManager
Dim rsQry
Dim OsTab
'------------ CONSTANTS DECLARATION -----------
'------------ VARIABLE INIT -------------------

Call GetMainDBParameters ( dbPARproj_id, dbPARbranch_id, dbPARbom_id, dbPARnode_id, dbPARos_id, dbPARprod_id )
parNode_id = dbPARnode_id
parOs_id = dbPARos_id
'------------ CONDITIONS ----------------------
'----------------------------------------------
%>
<%
'--------------------------------------------------------------------------------------------------------------------------
Function GenerateFTPscript ( nOsId )
        Dim rsQry, query, returnString
        Dim     projName, branchName, osName
        Dim PkgName, PkgVersion, Ext, Description, PkgHealthTag, CmdInterface, Owner, IsInterface, PkgFlag, VersionFlag
        
        OraDatabase.Parameters.Add "OS_ID", nOsId,      ORAPARM_INPUT, ORATYPE_NUMBER 
                
        Set rsQry = OraDatabase.DbCreateDynaset( GetQuery("NodeSpecDetails.sql"), ORADYN_DEFAULT )              
        
        'returnString = NULL
        
        projName        =       rsQry("proj_name")
        branchName      =       rsQry("branch_name")
        osName  =       rsQry("os_name")
        

        If osName = "Solaris" Then
                osName = "sparc"
        Else
                osName = "win32"
        End If

        OraDatabase.Parameters.Remove "OS_ID"   
        
        rsQry.Close
        Set rsQry = Nothing
        
        OraDatabase.Parameters.Add "OS_ID", nOsId,      ORAPARM_INPUT, ORATYPE_NUMBER 
        
        Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("ProductsList.sql"), ORADYN_DEFAULT )
        

        returnString    =       returnString    +       "#FTP Script for WIN32" + VBNewLine
        returnString    =       returnString    +       "#ftp -s:<SCRIPT_FILE>" + VBNewLine
        returnString    =       returnString    +       "open auperaunx26" + VBNewLine
        returnString    =       returnString    +       "<USERNAME>" + VBNewLine
        returnString    =       returnString    +       "<PASSWORD>" + VBNewLine
        returnString    =       returnString    +       "binary" + VBNewLine
        returnString    =       returnString    +       "prompt" + VBNewLine
        returnString    =       returnString    +       "cd /export" + VBNewLine
        returnString    =       returnString    +       "cd deploy" + VBNewLine
        returnString    =       returnString    +       "cd releases" + VBNewLine
        returnString    =       returnString    +       "cd "&chr(34)&projName&chr(34) + VBNewLine
        returnString    =       returnString    +       "cd "&chr(34)&branchName&chr(34) + VBNewLine

        While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
                
                If osName = "win32" Then
                        returnString = returnString     +       "mget "&chr(34)&rsQry("pkg_name")&"/"&osName&"/"&rsQry("pkg_version")&"/release/"&rsQry("pkg_name")&"-"&rsQry("pkg_version")&".exe"&chr(34)&""& VbNewLine
                Else
                        returnString = returnString     +       "mget "&chr(34)&rsQry("pkg_name")&"/"&osName&"/"&rsQry("pkg_version")&"/release/"&rsQry("pkg_name")&"-"&rsQry("pkg_version")&".pkg.gz"&chr(34)&""& VbNewLine
                End If
                
                rsQry.MoveNext()
        WEnd
        
        returnString    =       returnString    +       "bye" + VBNewLine
        
        rsQry.Close
        Set rsQry = Nothing
        



        Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("ProductsList.sql"), ORADYN_DEFAULT )

        
        projName = Replace(projName, " ", "\ ")
        projName = Replace(projName, "(", "\(")
        projName = Replace(projName, ")", "\)")

        branchName = Replace(branchName, " ", "\ ")

        returnString = returnString + VBNewLine + VBNewLine + VBNewLine
        returnString    =       returnString    +       "#FTP script for SPARC" + VBNewLine
        returnString    =       returnString    +       "#ftp -n -v auperaunx26 < <SCRIPT_FILE>" + VBNewLine
        returnString    =       returnString    +       "user" + VBNewLine
        returnString    =       returnString    +       "<USERNAME>" + VBNewLine
        returnString    =       returnString    +       "binary" + VBNewLine
        returnString    =       returnString    +       "prompt" + VBNewLine
        returnString    =       returnString    +       "cd /export" + VBNewLine
        returnString    =       returnString    +       "cd deploy" + VBNewLine
        returnString    =       returnString    +       "cd releases" + VBNewLine
        returnString    =       returnString    +       "cd "&projName + VBNewLine
        returnString    =       returnString    +       "cd "&branchName + VBNewLine

        While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
                returnString    =       returnString    +       "cd "&rsQry("pkg_name") + VBNewLine     
                returnString    =       returnString    +       "cd "&osName + VBNewLine        
                returnString    =       returnString    +       "cd "&rsQry("pkg_version") + VBNewLine
                returnString    =       returnString    +       "cd release" + VBNewLine
                
                If osName = "win32" Then
                        returnString    =       returnString    +       "get "&rsQry("pkg_name")&"-"&rsQry("pkg_version")&".exe" + VBNewLine
                Else
                        returnString    =       returnString    +       "get "&rsQry("pkg_name")&"-"&rsQry("pkg_version")&".pkg.gz" + VBNewLine
                End If
                
                returnString    =       returnString    +       "cd .." + VBNewLine     
                returnString    =       returnString    +       "cd .." + VBNewLine
                returnString    =       returnString    +       "cd .." + VBNewLine
                returnString    =       returnString    +       "cd .." + VBNewLine

                rsQry.MoveNext()
        WEnd
        OraDatabase.Parameters.Remove "OS_ID"
        returnString    =       returnString    +       "bye" + VBNewLine
        
        rsQry.Close
        Set rsQry = Nothing
        
        ' Return string 
        GenerateFTPscript = returnString
        
End Function
'--------------------------------------------------------------------------------------------------------------------------
%>
<%
'------------ RUN BEFORE PAGE RENDER ----------


'----------------------------------------------
%>
<html>
<head>
<title>Deployment Manager</title>
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="scripts/deployment_manager.css" rel="stylesheet" type="text/css">
<script language="JavaScript" src="scripts/common.js"></script>
</head>

<body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" onLoad="self.focus();">
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
  <tr>
    <td bgcolor="#FFFFFF" class="body_txt"><span class="body_h1"><img src="icons/i_linkarrow_black.gif" width="11" height="11" align="absmiddle">&nbsp;FTP Script Export </span> <br>
    Click on the text to select.</td>
  </tr>
</table>
<table width="100%"  border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td width="1" background="images/bg_blue.gif"><img src="images/spacer.gif" width="10" height="35"></td>
    <td width="100%" background="images/bg_blue.gif" valign="bottom">
        <!-- TAB CONTROLS ++++++++++++++++++++++ -->
                <%
                '[1] Tab Name
                '[2] Tab Link
                '[3] JavaScript Event e.g. "onClick='...'"
                '[4] Tab Image Selected
                '[5] Tab Image Diselected
                '[6] Tab Image Disabled
                '[7] Tab Hint
                '[8] Force Disable. Values: Y, N(default)
                
                
                OraDatabase.Parameters.Add "NODE_ID", parNode_id, ORAPARM_INPUT, ORATYPE_NUMBER 
                
                Set rsQry = OraDatabase.DbCreateDynaset( GetQuery ("OsList.sql"), ORADYN_DEFAULT )
                
                OraDatabase.Parameters.Remove "NODE_ID"
                
                
                Set objTabControl = New TabControl
                objTabControl.TemplateDoc = ReadFile( Server.MapPath("controls/ERGTabStyleWinXP/tab_style.html") ) ' Supply tab style definition
                objTabControl.TabStyle = "StyleWinXP"
                
                If Request("ostab") <> "" Then
                        OsTab = CDbl( Request("ostab") )
                Else
                        OsTab = 0
                End If
                
                
                While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
                        
                        objTabControl.Add ( Array( rsQry("os_name"), SCRIPT_NAME &"?ostab="& rsQry("os_id") &"&"& objPMod.ComposeURL() , "", "", "", "", "", "" ) )
                        
                        If OsTab = 0 Then
                                OsTab = CDbl( rsQry("os_id"))
                                objTabControl.SelectByName rsQry("os_name")
                                
                        ElseIf OsTab = CDbl(rsQry("os_id")) Then
                                OsTab = rsQry("os_id")
                                objTabControl.SelectByName rsQry("os_name")
                                
                        End If
                        
                        
                        rsQry.MoveNext()
                WEnd
                
                rsQry.Close()
                Set rsQry = nothing
                
                
                objTabControl.Render ()
                %>
                <!-- END OF TAB CONTROLS +++++++++++++++ -->
        </td>
    <td width="1" background="images/bg_blue.gif"></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><br><textarea name="textfield" cols="70" rows="20" wrap="OFF" class="body_cmd" onFocus="this.select()"><%=GenerateFTPscript( OsTab )%></textarea></td>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>
<%
'------------ RUN AFTER PAGE RENDER -----------
'----------------------------------------------
%><!--#include file="common/globals_destructor.asp"-->