Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
129 ghuddy 5
'|                   wAddDaemon                      |
119 ghuddy 6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
Response.Expires = 0
12
%>
13
<!--#include file="common/conf.asp"-->
14
<!--#include file="common/globals.asp"-->
15
<!--#include file="common/formating.asp"-->
16
<!--#include file="common/qstr.asp"-->
17
<!--#include file="common/common_subs.asp"-->
18
<!--#include file="common/_form_window_common.asp"-->
19
 
20
 
21
<%
22
'------------ ACCESS CONTROL ------------------
23
%>
24
<!--#include file="_access_control_general.asp"-->
25
<!--#include file="_access_control_login.asp"-->
26
<%
27
'------------ VARIABLE DEFINITION -------------
28
Dim rsQry, healthTag, cmdInterface, pkgOwner, isInterface, package, procDesc
29
Dim sMessage
30
Dim GBE_MACHTYPE
31
Dim Query_String
32
Dim RecordCount
129 ghuddy 33
Dim daemon_hostname
34
Dim gbe_id
35
Dim daemon_mode
119 ghuddy 36
Dim gbe_buildfilter
37
'------------ CONSTANTS DECLARATION -----------
38
Const LIMG_PRODUCT = "<img src='icons/i_product.gif' width='19' height='19' hspace='2' align='absmiddle'>"
39
Const LIMG_PRODUCT_UNPACKAGED = "<img src='icons/i_product_unpackaged.gif' width='19' height='19' hspace='2' align='absmiddle' title='Product is unofficial'>"
40
Const LIMG_PRODUCT_PATCH = "<img src='icons/i_patch_small.gif' hspace='2' align='absmiddle'>"
41
'------------ VARIABLE INIT -------------------
42
sMessage = NULL
43
 
44
parRtag_id = Request("rtag_id")
45
 
46
Set objFormCollector = CreateObject("Scripting.Dictionary")
47
'------------ CONDITIONS ----------------------
48
'----------------------------------------------
49
%>
50
<%
51
'--------------------------------------------------------------------------------------------------------------------------
52
Function GetMachType ( ngbe_id )
129 ghuddy 53
   Dim rsQry, query
54
 
55
   OraDatabase.Parameters.Add "gbe_id",   ngbe_id,   ORAPARM_INPUT, ORATYPE_NUMBER
56
 
57
   query = GetQuery ("GBE_MACHTYPECombo.sql")
58
 
59
   Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
60
   If (NOT rsQry.BOF) AND (NOT rsQry.EOF) Then
61
      GetMachType = rsQry.GetRows()
62
   Else
63
      GetMachType = NULL
64
   End If
65
 
66
   rsQry.Close()
67
   Set rsQry = Nothing
68
 
69
   OraDatabase.Parameters.Remove "gbe_id"
119 ghuddy 70
End Function
71
'--------------------------------------------------------------------------------------------------------------------------
72
%>
73
<%
74
'------------ RUN BEFORE PAGE RENDER ----------
75
 
76
 
77
If CBool(Request("action")) Then
78
 
129 ghuddy 79
   If Request("rcon_id") <> "" Then
119 ghuddy 80
 
129 ghuddy 81
      OraDatabase.Parameters.Add "DAEMON_HOSTNAME",   Request("daemon_hostname"), ORAPARM_INPUT, ORATYPE_VARCHAR2
82
      OraDatabase.Parameters.Add "RCON_ID",         Request("rcon_id"),         ORAPARM_INPUT, ORATYPE_NUMBER
83
      OraDatabase.Parameters.Add "GBE_ID",         Request("gbe_id"),          ORAPARM_INPUT, ORATYPE_NUMBER
84
      OraDatabase.Parameters.Add "GBE_BUILDFILTER",   Request("gbe_buildfilter"), ORAPARM_INPUT, ORATYPE_VARCHAR2
119 ghuddy 85
 
129 ghuddy 86
      objEH.TryORA ( OraSession )
87
      On Error Resume Next
119 ghuddy 88
 
129 ghuddy 89
      OraDatabase.ExecuteSQL _
90
      "BEGIN  PK_BUILDAPI.UPDATE_DAEMON(:DAEMON_HOSTNAME, :RCON_ID, :GBE_ID, :GBE_BUILDFILTER);  END;"
91
      OraSession.CommitTrans
119 ghuddy 92
 
129 ghuddy 93
      objEH.CatchORA ( OraSession )
119 ghuddy 94
 
129 ghuddy 95
      OraDatabase.Parameters.Remove "DAEMON_HOSTNAME"
96
      OraDatabase.Parameters.Remove "RCON_ID"
97
      OraDatabase.Parameters.Remove "GBE_ID"
98
      OraDatabase.Parameters.Remove "GBE_BUILDFILTER"
99
 
100
      If objEH.Finally Then
101
         Call OpenInParentWindow ("release_config.asp?rtag_id="&parRtag_id)
102
         Call CloseWindow()
103
      End If
104
 
105
      rsQry.Close
106
      Set rsQry = nothing
107
 
108
   Else
109
      OraDatabase.Parameters.Add "DAEMON_HOSTNAME",   Request("daemon_hostname"), ORAPARM_INPUT, ORATYPE_VARCHAR2
110
      OraDatabase.Parameters.Add "RTAG_ID",         Request("rtag_id"),         ORAPARM_INPUT, ORATYPE_NUMBER
111
      OraDatabase.Parameters.Add "GBE_ID",         Request("gbe_id"),          ORAPARM_INPUT, ORATYPE_NUMBER
112
      OraDatabase.Parameters.Add "GBE_BUILDFILTER",   Request("gbe_buildfilter"), ORAPARM_INPUT, ORATYPE_VARCHAR2
113
 
114
      objEH.TryORA ( OraSession )
115
      On Error Resume Next
116
 
117
      OraDatabase.ExecuteSQL _
118
      "BEGIN  PK_BUILDAPI.ADD_DAEMON(:DAEMON_HOSTNAME, :RTAG_ID, :GBE_ID, :GBE_BUILDFILTER);  END;"
119
 
120
      objEH.CatchORA ( OraSession )
121
 
122
      OraDatabase.Parameters.Remove "DAEMON_HOSTNAME"
123
      OraDatabase.Parameters.Remove "RTAG_ID"
124
      OraDatabase.Parameters.Remove "GBE_ID"
125
      OraDatabase.Parameters.Remove "GBE_BUILDFILTER"
126
 
127
      If objEH.Finally Then
128
         Call OpenInParentWindow ("release_config.asp?rtag_id="&parRtag_id)
129
         Call CloseWindow()
130
      End If
131
 
132
      rsQry.Close
133
      Set rsQry = nothing
134
 
135
   End If
136
 
119 ghuddy 137
End If
138
 
139
 
140
'----------------------------------------------
141
%>
142
<html>
143
<head>
144
<title>Release Manager</title>
145
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
146
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
147
<link href="images/release_manager_style.css" rel="stylesheet" type="text/css">
148
<script language="JavaScript" src="scripts/common.js"></script>
149
</head>
150
 
151
<body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" onLoad="self.focus();FormName.daemon_hostname.focus();">
152
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
129 ghuddy 153
   <tr>
154
      <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>
155
         Add a new DAEMON or edit an existing DAEMON.
119 ghuddy 156
      </td>
129 ghuddy 157
   </tr>
119 ghuddy 158
 
129 ghuddy 159
   <%
160
   '-- FROM START --------------------------------------------------------------------------------------------------------------
161
   objFormComponent.FormName = "FormName"
162
   objFormComponent.Action = ScriptName
163
   objFormComponent.OnSubmit = "ShowProgress();"
164
   Call objFormComponent.FormStart()
119 ghuddy 165
 
129 ghuddy 166
   %>
167
   <tr>
168
      <td background="images/bg_login.gif">
169
         <table width="50%"  border="0" cellspacing="0" cellpadding="0">
170
            <tr>
171
               <td><%=ProgressBar()%></td>
172
               <td align="right"><input name="btn" type="submit" class="form_btn" value="Add/Update">
173
                  <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();">
174
               </td>
175
            </tr>
176
         </table>
177
      </td>
178
   </tr>
179
   <tr>
180
      <td>
181
         <!-- NEW PRODUCT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
182
         <%Call Messenger ( sMessage , 3, "100%" )%>
183
         <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
184
         <!--#include file="messages/_msg_inline.asp"-->
185
         <%
186
         Query_String = "select * from release_config rc, gbe_machtype gbe "&_
187
         " where rc.rtag_id = "& parRtag_id &" and gbe.gbe_id = rc.gbe_id"
119 ghuddy 188
 
129 ghuddy 189
         Set rsQry = OraDatabase.DbCreateDynaset( Query_String, cint(0))
119 ghuddy 190
 
129 ghuddy 191
         RecordCount = rsQry.RecordCount
119 ghuddy 192
 
129 ghuddy 193
         rsQry.Close()
119 ghuddy 194
 
129 ghuddy 195
         Set rsQry = Nothing
196
         %>
197
         <br>
198
         <%
199
         If Request("rcon_id") <> "" Then
200
            %>
201
            <input type="hidden" name="rcon_id" value="<%=Request("rcon_id")%>">
202
            <%
203
            Dim rsTemp
119 ghuddy 204
 
129 ghuddy 205
            Query_String = "SELECT * FROM RELEASE_CONFIG WHERE RCON_ID = "& Request("rcon_id")
119 ghuddy 206
 
129 ghuddy 207
            Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
119 ghuddy 208
 
129 ghuddy 209
            daemon_mode   =   rsTemp("daemon_mode")
119 ghuddy 210
 
129 ghuddy 211
            daemon_hostname   =   rsTemp("daemon_hostname")
212
            gbe_id   =   rsTemp("gbe_id")
213
            gbe_buildfilter = rsTemp("gbe_buildfilter")
119 ghuddy 214
 
129 ghuddy 215
            rsTemp.Close()
216
            Set rsTemp = Nothing
119 ghuddy 217
 
129 ghuddy 218
         End   If
219
         %>
220
         <table width="50%" border="0">
221
            <tr>
222
               <td><span class="body_txt">Daemon HostName</span></td>
223
               <td>
224
                  <input name="daemon_hostname" type="text" class="body_txt" value="<%=daemon_hostname%>">
225
               </td>
226
            </tr>
227
            <tr>
228
               <td><span class="body_txt">Daemon Mode</span></td>
229
               <%If RecordCount = 0 OR daemon_mode = "M" Then%>
230
                  <td>
231
                     <input name="daemon_mode" size="6" type="text" class="form_ivalue" value="MASTER" readonly>
232
                  </td>
233
               <%Else%>
234
                  <td>
235
                     <input name="daemon_mode" size="6" type="text" class="form_ivalue" value="SLAVE" readonly>
236
                  </td>
237
               <%End If%>
238
            </tr>
239
            <tr>
240
               <td><span class="body_txt">GBE_MACHTYPE</span></td>
241
               <td><%=objFormComponent.Combo ( "gbe_id", GetMachtype( gbe_id ), FALSE, "class='body_txt'" )%></td>
119 ghuddy 242
 
129 ghuddy 243
               <tr>
244
                  <td><span class="body_txt">GBE_BUILDFILTER</span></td>
245
                  <td><input name="gbe_buildfilter" type="text" class="body_txt" size="80" value="<%=gbe_buildfilter%>"></td>
246
               </tr>
247
            </tr>
248
            <tr>
249
               <td>&nbsp;</td>
250
               <td>&nbsp;</td>
251
            </tr>
252
         </table>
253
      </td>
254
   </tr>
255
   <%=objPMod.ComposeHiddenTags()%>
256
   <input type="hidden" name="action" value="true">
119 ghuddy 257
 
129 ghuddy 258
   <%
259
   Call objFormComponent.FormEnd()
260
   '-- FROM END ----------------------------------------------------------------------------------------------------------------
261
   %>
119 ghuddy 262
</table>
263
</body>
264
</html>
265
<%
266
'------------ RUN AFTER PAGE RENDER -----------
267
Set objFormCollector = Nothing
268
'----------------------------------------------
269
Call Destroy_All_Objects
270
%>
271
 
272