Subversion Repositories DevTools

Rev

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

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|                   wAddBuildMachine                |
'|                                                   |
'=====================================================
%>
<%
Option explicit
Response.Expires = 0
%>
<!--#include file="common/conf.asp"-->
<!--#include file="common/globals.asp"-->
<!--#include file="common/formating.asp"-->
<!--#include file="common/qstr.asp"-->
<!--#include file="common/common_subs.asp"-->
<!--#include file="common/_form_window_common.asp"-->


<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_general.asp"-->
<!--#include file="_access_control_login.asp"-->
<%
'------------ VARIABLE DEFINITION -------------
Dim rsQry, healthTag, cmdInterface, pkgOwner, isInterface, package, procDesc
Dim sMessage
Dim GBE_MACHTYPE
Dim Query_String
Dim RecordCount

Dim display_name
Dim machine_hostname
Dim gbe_id
Dim description

'------------ CONSTANTS DECLARATION -----------
Const LIMG_PRODUCT = "<img src='icons/i_product.gif' width='19' height='19' hspace='2' align='absmiddle'>"
Const LIMG_PRODUCT_UNPACKAGED = "<img src='icons/i_product_unpackaged.gif' width='19' height='19' hspace='2' align='absmiddle' title='Product is unofficial'>"
Const LIMG_PRODUCT_PATCH = "<img src='icons/i_patch_small.gif' hspace='2' align='absmiddle'>"
'------------ VARIABLE INIT -------------------
sMessage = NULL


Set objFormCollector = CreateObject("Scripting.Dictionary")
'------------ CONDITIONS ----------------------
'----------------------------------------------
%>
<%
'--------------------------------------------------------------------------------------------------------------------------
Function GetMachType ( ngbe_id )
   Dim rsQry, query

   OraDatabase.Parameters.Add "gbe_id",   ngbe_id,   ORAPARM_INPUT, ORATYPE_NUMBER

   query = GetQuery ("GBE_MACHTYPECombo.sql")

   Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
   If (NOT rsQry.BOF) AND (NOT rsQry.EOF) Then
      GetMachType = rsQry.GetRows()
   Else
      GetMachType = NULL
   End If

   rsQry.Close()
   Set rsQry = Nothing

   OraDatabase.Parameters.Remove "gbe_id"
End Function
'--------------------------------------------------------------------------------------------------------------------------
%>
<%
'------------ RUN BEFORE PAGE RENDER ----------

If CBool(Request("action")) Then

   If Request("bmcon_id") <> "" Then

      OraDatabase.Parameters.Add "BMCON_ID",              Request("bmcon_id"),              ORAPARM_INPUT, ORATYPE_NUMBER
      OraDatabase.Parameters.Add "DISPLAY_NAME",          Request("display_name"),          ORAPARM_INPUT, ORATYPE_VARCHAR2
      OraDatabase.Parameters.Add "MACHINE_HOSTNAME",      Request("machine_hostname"),      ORAPARM_INPUT, ORATYPE_VARCHAR2
      OraDatabase.Parameters.Add "GBE_ID",                Request("gbe_id"),                ORAPARM_INPUT, ORATYPE_NUMBER
      OraDatabase.Parameters.Add "DESCRIPTION",           Request("description"),           ORAPARM_INPUT, ORATYPE_VARCHAR2

      objEH.TryORA ( OraSession )
      On Error Resume Next

      OraDatabase.ExecuteSQL _
      "BEGIN  PK_BUILDAPI.UPDATE_BUILD_MACHINE(:BMCON_ID, :DISPLAY_NAME, :MACHINE_HOSTNAME, :GBE_ID, :DESCRIPTION);  END;"

      objEH.CatchORA ( OraSession )

      OraDatabase.Parameters.Remove "BMCON_ID"
      OraDatabase.Parameters.Remove "DISPLAY_NAME"
      OraDatabase.Parameters.Remove "MACHINE_HOSTNAME"
      OraDatabase.Parameters.Remove "GBE_ID"
      OraDatabase.Parameters.Remove "DESCRIPTION"

      If objEH.Finally Then
         Call OpenInParentWindow ("admin_build_machine.asp?bmcon_id="&Request("bmcon_id"))
         Call CloseWindow()
      End If

      rsQry.Close
      Set rsQry = nothing

   Else
      OraDatabase.Parameters.Add "DISPLAY_NAME",          Request("display_name"),          ORAPARM_INPUT, ORATYPE_VARCHAR2
      OraDatabase.Parameters.Add "MACHINE_HOSTNAME",      Request("machine_hostname"),      ORAPARM_INPUT, ORATYPE_VARCHAR2
      OraDatabase.Parameters.Add "GBE_ID",                Request("gbe_id"),                ORAPARM_INPUT, ORATYPE_NUMBER
      OraDatabase.Parameters.Add "DESCRIPTION",           Request("description"),           ORAPARM_INPUT, ORATYPE_VARCHAR2

      objEH.TryORA ( OraSession )
      On Error Resume Next

      OraDatabase.ExecuteSQL _
      "BEGIN  PK_BUILDAPI.ADD_BUILD_MACHINE(:DISPLAY_NAME, :MACHINE_HOSTNAME, :GBE_ID, :DESCRIPTION);  END;"

      objEH.CatchORA ( OraSession )

      OraDatabase.Parameters.Remove "DISPLAY_NAME"
      OraDatabase.Parameters.Remove "MACHINE_HOSTNAME"
      OraDatabase.Parameters.Remove "GBE_ID"
      OraDatabase.Parameters.Remove "DESCRIPTION"

      If objEH.Finally Then
         Call OpenInParentWindow ("admin_build_machine.asp?bmcon_id="&Request("bmcon_id"))
         Call CloseWindow()
      End If

      rsQry.Close
      Set rsQry = nothing

   End If

End If


'----------------------------------------------
%>
<html>
<head>
<title>Release Manager</title>
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="images/release_manager_style.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.display_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;Add/Update Build Machine</span> <br>
         Add a new Build Machine or edit an existing Build Machine.
      </td>
   </tr>

   <%
   '-- FROM START --------------------------------------------------------------------------------------------------------------
   objFormComponent.FormName = "FormName"
   objFormComponent.Action = ScriptName
   objFormComponent.OnSubmit = "ShowProgress();"
   Call objFormComponent.FormStart()

   %>
   <tr>
      <td background="images/bg_login.gif">
         <table width="50%"  border="0" cellspacing="0" cellpadding="0">
            <tr>
               <td><%=ProgressBar()%></td>
               <td align="right"><input name="btn" type="submit" class="form_btn" value="Add/Update">
                  <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();">
               </td>
            </tr>
         </table>
      </td>
   </tr>
   <tr>
      <td>
         <!-- NEW PRODUCT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
         <%Call Messenger ( sMessage , 3, "100%" )%>
         <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
         <!--#include file="messages/_msg_inline.asp"-->
         <br>
         <%
         If Request("bmcon_id") <> "" Then
            %>
            <input type="hidden" name="bmcon_id" value="<%=Request("bmcon_id")%>">
            <%
            Dim rsTemp

            Query_String = "select * from build_machine_config bm, gbe_machtype gbe "&_
              " where bm.bmcon_id = "& Request("bmcon_id") &_
              " and gbe.gbe_id = bm.gbe_id"
              
            Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))

            display_name            =   rsTemp("display_name")
            machine_hostname        =   rsTemp("machine_hostname")
            gbe_id   =   rsTemp("gbe_id")
            description = rsTemp("description")

            rsTemp.Close()
            Set rsTemp = Nothing      

          End If%>
         
         <table width="50%" border="0">
            <tr>
               <td><span class="body_txt">Display Name</span></td>
               <td>
                  <input name="display_name" type="text" class="body_txt" value="<%=display_name%>" size=24 maxlength=20>
               </td>
            </tr>
            <tr>
               <td><span class="body_txt">Machine HostName</span></td>
               <td>
                  <input name="machine_hostname" type="text" class="body_txt" value="<%=machine_hostname%>" size=60 maxlength=50>
               </td>
            </tr>
            <tr>
               <td><span class="body_txt">GBE_MACHTYPE</span></td>
               <td><%=objFormComponent.Combo ( "gbe_id", GetMachtype( gbe_id ), FALSE, "size=1 class='body_txt'" )%></td>
            </tr>
            <tr>
               <td><span class="body_txt">Description</span></td>
               <td>
                  <textarea name="Description" cols=50 rows=5 class='body_txt'><%=Description%></textarea>
               </td>
            </tr>
            <tr>
               <td>&nbsp;</td>
            </tr>
         </table>
      </td>
   </tr>
   <%=objPMod.ComposeHiddenTags()%>
   <input type="hidden" name="action" value="true">

   <%
   Call objFormComponent.FormEnd()
   '-- FROM END ----------------------------------------------------------------------------------------------------------------
   %>
</table>
</body>
</html>
<%
'------------ RUN AFTER PAGE RENDER -----------
Set objFormCollector = Nothing
'----------------------------------------------
Call Destroy_All_Objects
%>