Subversion Repositories DevTools

Rev

Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|                                wNodeSpec                                              |
'|                                                   |
'=====================================================
%>
<%
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 GenerateOsSpec ( nOsId )
        Dim rsQry, query, returnString
        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
        
        returnString = returnString &_
        "#Copyright ERG Transit Systems (c) 1998-2006, All Rights Reserved"& VBNewline &_
        "#----------------------------------------------------------------"& VBNewline &_
        "#**** Source Information ****"& VBNewline &_
        "#"& VBNewline &_
        "#Source File Name: "& rsQry("node_spec_file")& VBNewline &_
        "#"& VBNewline &_
        "#Source File Type: PERL Module File (.pm)"& VBNewline &_
        "#"& VBNewline &_
        "#Author: Deployment Manager"& VBNewline &_
        "#"& VBNewline &_
        "#Purpose: This file contains the package specification for"& VBNewline &_ 
        "#      "& rsQry("node_name") &" node."& VBNewline &_
        "#"& VBNewline &_
        "#      The data is provided in the form of two PERL preinitialised"& VBNewline &_
        "#      HASH of HASHES"& VBNewline &_
        "#"& VBNewline &_
        "#      The first hash contains all details regarding the persistant"& VBNewline &_
        "#      processes running on the node. It contains the following fields,"& VBNEWline &_
        "#"& VBNEWline &_
        "#      -PkgOnwer"& VBNEWline &_
        "#      -PkgHealthTag"& VBNEWline &_
        "#      -PkgDesc"& VBNEWline &_
        "#      -CmdInterface"& VBNEWline &_
        "#"& VBNEWline &_
        "#      The second hash contains all details regarding the deployed"& VBNewline &_
        "#      packages installed on the node. It contains the following fields,"& VBNewline &_
        "#"& VBNEWline &_
        "#      -ERGPkgFlag"& VBNEWline &_
        "#      -CheckVersionFlag"& VBNEWline &_
        "#      -PkgVersion"& VBNEWline &_
        "#      -PkgBuildNo"& VBNEWline &_
        "#      -PkgDesc"& VBNEWline &_
        "#"& VBNEWline &_
        "#----------------------------------------------------------------"& VBNewline & VBNewline
        
        
        returnString = returnString &_
        "%pkgmnt::G_NodeDmInfo = ("& VBNewLine &_
        "       BomName         => '"& rsQry("bom_name") &"',"& VBNewLine &_
        "       BranchName      => '"& rsQry("branch_name") &"',"& VBNewLine &_
        "       NodeName        => '"& rsQry("node_name") &"',"& VBNewLine &_
        "       OsName          => '"& rsQry("os_name") &"',"& VBNewLine &_
        "       ProjectName     =>  '"& rsQry("proj_name") &"',"& VBNewLine &_
        "       _ForceVersion   => {},"& VBNewLine &_
        "       _NoAdd          => {}"& VBNewLine &_
        ");"& VBNewLine & VBNewLine 
        
        returnString = returnString &_
        "$pkgmnt::G_NodeSBOMVersion = '"& rsQry("sbom_version") &"';"& VBNewLine & VBNewLine &_
        "$pkgmnt::G_NodeName = '"& rsQry("node_name") &"';"& VBNewLine & VBNewLine 
        
        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("OsProcessConfig.sql"), ORADYN_DEFAULT )      
        
        
        If rsQry.Recordcount <> 0 Then
                returnString = returnString &_
                "%pkgmnt::G_NodeProcessHash = ("& VBNewLine 
        Else
                returnString = returnString &_
                "%pkgmnt::G_NodeProcessHash = ("
        
        End If
        
        While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
                PkgHealthTag = rsQry("pkg_health_tag")
                CmdInterface = rsQry("cmd_interface")
                Owner = rsQry("pkg_owner")
                IsInterface = rsQry("is_interface")
                PkgName = rsQry("pkg_name")
        

                
                returnString = returnString &_
                        ""& PkgHealthTag &" => {"& VBNewLine &_
            "   CmdInterface    => '"& CmdInterface &"',"& VBNewLine &_
            "   IsInterface     => '"& IsInterface &"',"& VBNewLine &_ 
            "   Pkg             => '"& PkgName &"',"& VBNewLine &_
            "   PkgHealthTag    => '"& PkgHealthTag &"',"& VBNewLine &_
            "   PkgOnwer        => '"& Owner &"'"& VBNewLine &_
            "   },"& VBNewLine                                          
                                                
                rsQry.MoveNext()
        WEnd    

        ' Format final output
        If NOT IsNull(returnString) And rsQry.Recordcount <> 0 Then
                returnString = Left ( returnString, InStrRev( returnString, "," ) - 1 ) & VBNewLine
        End If  
        
        returnString = returnString &_
        ");" & VBNewLine & VBNewLine 
                
        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 ("ExportOsProductList.sql"), ORADYN_DEFAULT )
        
        returnString = returnString &_
        "%pkgmnt::G_NodePkgHash = ("& VBNewLine 
        
        While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
                If IsNull(rsQry("sunos_electronic_name")) Then
                        PkgName = rsQry("pkg_name")
                Else
                        PkgName = rsQry("sunos_electronic_name")                        
                End If
                
                PkgVersion = rsQry("pkg_version")
                Ext = rsQry("v_ext")
                Description = rsQry("pv_description")
                
                If InStr(1, PkgName, "ERG") = 1 Or PkgName = "AceTao"  Then
                        PkgFlag = "T"
                        VersionFlag = "T"
                Else
                        PkgFlag = "F"
                        VersionFlag = "F"               
                End If
                
                ' Format Description
                If NOT IsNull(Description) Then
                        Description = Replace ( Description, VBNewLine, "" )
                        Description = Replace ( Description, """", "" )
                End if
                
                ' Format Extension
                If NOT IsNull(Ext) Then
                        ' Remove first dot from extension
                        If InStr( 1, Ext, "." ) = 1 Then
                                Ext = Right( Ext, Len(Ext) - 1 )
                        End If
                        
                End If
                

                
                returnString = returnString &_
                        ""& PkgName &" => {"& VBNewLine &_
            "          CheckVersionFlag  => '"& VersionFlag &"',"& VBNewLine &_
            "          ERGPkgFlag        => '"& PkgFlag &"',"& VBNewLine 
                
                returnString = returnString &_
            "          PkgDesc           => '"& Description &"', "& VBNewLine
                        
                If IsNull(Ext) Then
                        returnString = returnString &_
                    "          PkgProjAcronym    => '???',"&  VBNewLine &_ 
                                "          PkgVersion        => '"& PkgVersion &"'"&  VBNewLine 
                Else
                        returnString = returnString &_
                "          PkgProjAcronym    => '"& Ext &"',"&  VBNewLine &_
                                "          PkgVersion        => '"& Left(PkgVersion, Len(PkgVersion) - Len(Ext) - 1 ) &"'"&  VBNewLine
                End If
                
                
           returnString = returnString &_
                    "   },"& VBNewLine
                
                
                
                rsQry.MoveNext()
        WEnd
        
        OraDatabase.Parameters.Remove "OS_ID"
        
        rsQry.Close
        Set rsQry = Nothing
        
        
        ' Format final output
        If NOT IsNull(returnString) Then
                returnString = Left ( returnString, InStrRev( returnString, "," ) - 1 ) & VBNewLine
        End If
        
        returnString = returnString &_
        ");" & VBNewLine & VBNewLine & "1;" & VBNewLine         
        
        
        ' Return string 
        GenerateOsSpec = 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();FormName.os_name.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;Node Spec 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_green.gif"><img src="images/spacer.gif" width="10" height="35"></td>
    <td width="100%" background="images/bg_green.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_green.gif"></td>
  </tr>
  <tr>
    <td>&nbsp;</td>
    <td><br><textarea name="textfield" cols="70" rows="20" wrap="OFF" class="body_cmd" onFocus="this.select()"><%=GenerateOsSpec( OsTab )%></textarea></td>
    <td>&nbsp;</td>
  </tr>
</table>
</body>
</html>
<%
'------------ RUN AFTER PAGE RENDER -----------
'----------------------------------------------
%><!--#include file="common/globals_destructor.asp"-->