Subversion Repositories DevTools

Rev

Blame | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|                                wAddDaemon                                     |
'|                                                   |
'=====================================================
%>
<%
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     daemon_hostname
Dim     gbe_id
Dim     daemon_mode
Dim gbe_buildfilter
'------------ 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

parRtag_id = Request("rtag_id")

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("rcon_id") <> "" Then

                objEH.Try()
                        
                OraDatabase.Parameters.Add "DAEMON_HOSTNAME",   Request("daemon_hostname"), ORAPARM_INPUT, ORATYPE_VARCHAR2
                OraDatabase.Parameters.Add "RCON_ID",                   Request("rcon_id"),                     ORAPARM_INPUT, ORATYPE_NUMBER
                OraDatabase.Parameters.Add "GBE_ID",                    Request("gbe_id"),                      ORAPARM_INPUT, ORATYPE_NUMBER
                OraDatabase.Parameters.Add "GBE_BUILDFILTER",   Request("gbe_buildfilter"), ORAPARM_INPUT, ORATYPE_VARCHAR2
                
                OraSession.BeginTrans
                
                OraDatabase.ExecuteSQL _
                "BEGIN  PK_BUILDAPI.UPDATE_DAEMON(:DAEMON_HOSTNAME, :RCON_ID, :GBE_ID, :GBE_BUILDFILTER);  END;"        
                OraSession.CommitTrans
        
                objEH.Catch()
                OraDatabase.Parameters.Remove "DAEMON_HOSTNAME"
                OraDatabase.Parameters.Remove "RCON_ID"
                OraDatabase.Parameters.Remove "GBE_ID"
                OraDatabase.Parameters.Remove "GBE_BUILDFILTER"
   
                If objEH.Finally Then
                        Call OpenInParentWindow ("release_config.asp?rtag_id="&parRtag_id)
                        Call CloseWindow()
                End If
                                
                rsQry.Close
                Set rsQry = nothing     
                

        Else
                
                objEH.Try()
                
                OraDatabase.Parameters.Add "DAEMON_HOSTNAME",   Request("daemon_hostname"), ORAPARM_INPUT, ORATYPE_VARCHAR2
                OraDatabase.Parameters.Add "RTAG_ID",                   Request("rtag_id"),                     ORAPARM_INPUT, ORATYPE_NUMBER
                OraDatabase.Parameters.Add "GBE_ID",                    Request("gbe_id"),                      ORAPARM_INPUT, ORATYPE_NUMBER
                OraDatabase.Parameters.Add "GBE_BUILDFILTER",   Request("gbe_buildfilter"), ORAPARM_INPUT, ORATYPE_VARCHAR2
                
                OraSession.BeginTrans
                
                OraDatabase.ExecuteSQL _
                "BEGIN  PK_BUILDAPI.ADD_DAEMON(:DAEMON_HOSTNAME, :RTAG_ID, :GBE_ID, :GBE_BUILDFILTER);  END;"   
                OraSession.CommitTrans
                
                objEH.Catch()

                OraDatabase.Parameters.Remove "DAEMON_HOSTNAME"
                OraDatabase.Parameters.Remove "RTAG_ID"
                OraDatabase.Parameters.Remove "GBE_ID"
                OraDatabase.Parameters.Remove "GBE_BUILDFILTER"
                
                If objEH.Finally Then
                        Call OpenInParentWindow ("release_config.asp?rtag_id="&parRtag_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.daemon_hostname.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 DAEMON</span> <br>
    Add a new DAEMON or edit an existing DAEMON.
      </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"--> 
<%
Query_String = "select * from release_config rc, gbe_machtype gbe "&_
                        " where rc.rtag_id = "& parRtag_id &" and gbe.gbe_id = rc.gbe_id"
Set rsQry = OraDatabase.DbCreateDynaset( Query_String, cint(0))

RecordCount = rsQry.RecordCount

rsQry.Close()

Set rsQry = Nothing


%>      
<br>
<%

If Request("rcon_id") <> "" Then
%>
<input type="hidden" name="rcon_id" value="<%=Request("rcon_id")%>">
<%
        
Dim rsTemp

Query_String = "SELECT * FROM RELEASE_CONFIG WHERE RCON_ID = "& Request("rcon_id")

Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))

daemon_mode     =       rsTemp("daemon_mode")

daemon_hostname =       rsTemp("daemon_hostname")
gbe_id  =       rsTemp("gbe_id")
gbe_buildfilter = rsTemp("gbe_buildfilter")

rsTemp.Close()
Set rsTemp = Nothing

End     If
%>
<table width="50%" border="0">
  <tr>
    <td><span class="body_txt">Daemon HostName</span></td>
    <td><input name="daemon_hostname" type="text" class="body_txt" value="<%=daemon_hostname%>">
        </td>
  </tr>
  <tr>
    <td><span class="body_txt">Daemon Mode</span></td>
<%If RecordCount = 0 OR daemon_mode = "M" Then%>
    <td><input name="daemon_mode" size="6" type="text" class="form_ivalue" value="MASTER" readonly>
<%Else%>
        <td><input name="daemon_mode" size="6" type="text" class="form_ivalue" value="SLAVE" readonly>
<%End If%>
        </td>
  </tr>
  <tr>
    <td><span class="body_txt">GBE_MACHTYPE</span></td>
    <td><%=objFormComponent.Combo ( "gbe_id", GetMachtype( gbe_id ), FALSE, "class='body_txt'" )%></td>
  
  <tr>
    <td><span class="body_txt">GBE_BUILDFILTER</span></td>
    <td><input name="gbe_buildfilter" type="text" class="body_txt" size="80" value="<%=gbe_buildfilter%>"></td>
  </tr>   </tr>      
  <tr>
    <td>&nbsp;</td>
    <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
%>