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
'------------ ACCESS CONTROL ------------------
21
%>
22
<!--#include file="_access_control_general.asp"-->
23
<!--#include file="_access_control_login.asp"-->
24
<%
25
'------------ VARIABLE DEFINITION -------------
26
Dim rsQry, healthTag, cmdInterface, pkgOwner, isInterface, package, procDesc
27
Dim sMessage
28
Dim Query_String
29
Dim RecordCount
161 iaugusti 30
Dim bmcon_id
129 ghuddy 31
Dim gbe_id
161 iaugusti 32
Dim gbe_value
129 ghuddy 33
Dim daemon_mode
119 ghuddy 34
Dim gbe_buildfilter
4296 dpurdie 35
Dim bShowEmpty
119 ghuddy 36
'------------ CONSTANTS DECLARATION -----------
37
'------------ VARIABLE INIT -------------------
38
sMessage = NULL
39
 
40
parRtag_id = Request("rtag_id")
41
 
42
Set objFormCollector = CreateObject("Scripting.Dictionary")
43
'------------ CONDITIONS ----------------------
44
'----------------------------------------------
45
%>
46
<%
47
'--------------------------------------------------------------------------------------------------------------------------
4296 dpurdie 48
'-------------------------------------------------
49
' Function:     GetMachHost    
50
' Description:  Determine the current Display Host Information for a given BMCON_ID
51
' Arguments:    abmcon_id   - A BMCON_ID
52
'
53
' Returns:      An array with 5 elements in it - do be used in creating a multicolum drop down list
54
'                   
161 iaugusti 55
Function GetMachHost (abmcon_id)
129 ghuddy 56
   Dim rsQry, query
57
 
161 iaugusti 58
   OraDatabase.Parameters.Add "bmcon_id",  abmcon_id,   ORAPARM_INPUT, ORATYPE_NUMBER
129 ghuddy 59
 
4296 dpurdie 60
   query = "SELECT bm.bmcon_id," &_
61
                  "display_name," &_
62
                  "gbe_value," &_
63
                  "COALESCE(SUBSTR(description,1,INSTR(description,CHR(10),1,1)),description) as description," &_
64
                  "DECODE(:bmcon_id, bm.bmcon_id, 'selected', NULL) AS SELECTED" &_
65
           " FROM build_machine_config bm," &_
66
           "      gbe_machtype gb " &_
67
           " WHERE bm.gbe_id = gb.gbe_id" &_
68
           " ORDER by bm.display_name"
129 ghuddy 69
 
70
   Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
71
   If (NOT rsQry.BOF) AND (NOT rsQry.EOF) Then
161 iaugusti 72
      GetMachHost = rsQry.GetRows()
129 ghuddy 73
   Else
161 iaugusti 74
      GetMachHost = NULL
129 ghuddy 75
   End If
76
 
77
   rsQry.Close()
78
   Set rsQry = Nothing
79
 
4293 dpurdie 80
   OraDatabase.Parameters.Remove "bmcon_id"
119 ghuddy 81
End Function
161 iaugusti 82
 
119 ghuddy 83
'--------------------------------------------------------------------------------------------------------------------------
84
%>
85
<%
86
'------------ RUN BEFORE PAGE RENDER ----------
87
 
88
If CBool(Request("action")) Then
89
 
4296 dpurdie 90
    If  Request("bmcon_id") = "" Then
91
        sMessage = "Select a Build Machine before updating the entry"
92
    Else
119 ghuddy 93
 
4296 dpurdie 94
       '    Add or Update after the users edit session
95
       If Request("rcon_id") <> "" Then
119 ghuddy 96
 
4296 dpurdie 97
          OraDatabase.Parameters.Add "RCON_ID",         Request("rcon_id"),         ORAPARM_INPUT, ORATYPE_NUMBER
98
          OraDatabase.Parameters.Add "BMCON_ID",        Request("bmcon_id"),        ORAPARM_INPUT, ORATYPE_NUMBER
99
          OraDatabase.Parameters.Add "DAEMON_MODE",     Request("daemon_mode"),     ORAPARM_INPUT, ORATYPE_VARCHAR2
100
          OraDatabase.Parameters.Add "GBE_BUILDFILTER", Request("gbe_buildfilter"), ORAPARM_INPUT, ORATYPE_VARCHAR2
119 ghuddy 101
 
4296 dpurdie 102
          objEH.TryORA ( OraSession )
103
          On Error Resume Next
119 ghuddy 104
 
4296 dpurdie 105
          OraDatabase.ExecuteSQL "BEGIN  PK_BUILDAPI.UPDATE_DAEMON_CONFIG(:RCON_ID, :BMCON_ID, :DAEMON_MODE, :GBE_BUILDFILTER);  END;"
106
          OraSession.CommitTrans
119 ghuddy 107
 
4296 dpurdie 108
          objEH.CatchORA ( OraSession )
129 ghuddy 109
 
4296 dpurdie 110
          OraDatabase.Parameters.Remove "RCON_ID"
111
          OraDatabase.Parameters.Remove "BMCON_ID"
112
          OraDatabase.Parameters.Remove "DAEMON_MODE"
113
          OraDatabase.Parameters.Remove "GBE_BUILDFILTER"
129 ghuddy 114
 
4296 dpurdie 115
          If objEH.Finally Then
116
             Call OpenInParentWindow ("release_config.asp?rtag_id="&parRtag_id)
117
             Call CloseWindow()
118
          End If
129 ghuddy 119
 
4296 dpurdie 120
          rsQry.Close
121
          Set rsQry = nothing
129 ghuddy 122
 
4296 dpurdie 123
       Else
124
          OraDatabase.Parameters.Add "RTAG_ID",         Request("rtag_id"),         ORAPARM_INPUT, ORATYPE_NUMBER
125
          OraDatabase.Parameters.Add "BMCON_ID",        Request("bmcon_id"),        ORAPARM_INPUT, ORATYPE_NUMBER
126
          OraDatabase.Parameters.Add "DAEMON_MODE",     Request("daemon_mode"),     ORAPARM_INPUT, ORATYPE_VARCHAR2
127
          OraDatabase.Parameters.Add "GBE_BUILDFILTER", Request("gbe_buildfilter"), ORAPARM_INPUT, ORATYPE_VARCHAR2
129 ghuddy 128
 
4296 dpurdie 129
          objEH.TryORA ( OraSession )
130
          On Error Resume Next
129 ghuddy 131
 
4296 dpurdie 132
          OraDatabase.ExecuteSQL "BEGIN  PK_BUILDAPI.ADD_DAEMON_CONFIG(:RTAG_ID, :BMCON_ID, :DAEMON_MODE, :GBE_BUILDFILTER);  END;"
129 ghuddy 133
 
4296 dpurdie 134
          objEH.CatchORA ( OraSession )
129 ghuddy 135
 
4296 dpurdie 136
          OraDatabase.Parameters.Remove "RTAG_ID"
137
          OraDatabase.Parameters.Remove "BMCON_ID"
138
          OraDatabase.Parameters.Remove "DAEMON_MODE"
139
          OraDatabase.Parameters.Remove "GBE_BUILDFILTER"
129 ghuddy 140
 
4296 dpurdie 141
          If objEH.Finally Then
142
             Call OpenInParentWindow ("release_config.asp?rtag_id="&parRtag_id)
143
             Call CloseWindow()
144
          End If
129 ghuddy 145
 
4296 dpurdie 146
          rsQry.Close
147
          Set rsQry = nothing
129 ghuddy 148
 
4296 dpurdie 149
       End If
150
    End If
119 ghuddy 151
End If
152
'----------------------------------------------
153
%>
154
<html>
155
<head>
156
<title>Release Manager</title>
157
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
158
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
159
<link href="images/release_manager_style.css" rel="stylesheet" type="text/css">
160
<script language="JavaScript" src="scripts/common.js"></script>
161
</head>
162
 
161 iaugusti 163
<body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" onLoad="self.focus();FormName.bmcon_id.focus();">
119 ghuddy 164
<table width="100%"  border="0" cellspacing="0" cellpadding="10">
129 ghuddy 165
   <tr>
166
      <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>
167
         Add a new DAEMON or edit an existing DAEMON.
119 ghuddy 168
      </td>
129 ghuddy 169
   </tr>
119 ghuddy 170
 
129 ghuddy 171
   <%
172
   '-- FROM START --------------------------------------------------------------------------------------------------------------
173
   objFormComponent.FormName = "FormName"
174
   objFormComponent.Action = ScriptName
175
   objFormComponent.OnSubmit = "ShowProgress();"
176
   Call objFormComponent.FormStart()
119 ghuddy 177
 
129 ghuddy 178
   %>
179
   <tr>
180
      <td background="images/bg_login.gif">
181
         <table width="50%"  border="0" cellspacing="0" cellpadding="0">
182
            <tr>
183
               <td><%=ProgressBar()%></td>
184
               <td align="right"><input name="btn" type="submit" class="form_btn" value="Add/Update">
185
                  <input name="btn" type="reset" class="form_btn" value="Cancel" onClick="self.close();">
186
               </td>
187
            </tr>
188
         </table>
189
      </td>
190
   </tr>
191
   <tr>
192
      <td>
193
         <!-- NEW PRODUCT ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
194
         <%Call Messenger ( sMessage , 3, "100%" )%>
195
         <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
196
         <!--#include file="messages/_msg_inline.asp"-->
197
         <%
4296 dpurdie 198
         '  Determine if any daemons have been configured in this release
199
         '  Will be used to determine if a new entry should be a MASTER or a SLAVE
200
         '
4293 dpurdie 201
         Query_String = "select * " &_
4296 dpurdie 202
                        " from release_config rc," &_
203
                        "      gbe_machtype gbe " &_
4293 dpurdie 204
                        " where rc.rtag_id = "& parRtag_id &_
205
                        "   and gbe.gbe_id = rc.gbe_id"
119 ghuddy 206
 
129 ghuddy 207
         Set rsQry = OraDatabase.DbCreateDynaset( Query_String, cint(0))
119 ghuddy 208
 
129 ghuddy 209
         RecordCount = rsQry.RecordCount
4296 dpurdie 210
         If RecordCount = 0 Then
211
            daemon_mode = "M"
212
         else   
213
            daemon_mode = "S"
214
         End If
129 ghuddy 215
         rsQry.Close()
119 ghuddy 216
 
129 ghuddy 217
         Set rsQry = Nothing
218
         %>
4296 dpurdie 219
         <%If Request("rcon_id") <> "" Then%>
220
             <input type="hidden" name="rcon_id" value="<%=Request("rcon_id")%>">
129 ghuddy 221
         <%
4296 dpurdie 222
            ' Edit an existing entry
223
            '   May have a link into the build_machine_config - or it may not
224
            '   Check first
129 ghuddy 225
            Dim rsTemp
4296 dpurdie 226
            bShowEmpty = TRUE
119 ghuddy 227
 
4293 dpurdie 228
            Query_String = "SELECT * " &_
4296 dpurdie 229
                           " FROM RELEASE_CONFIG rc," &_
230
                           "      gbe_machtype gb" &_
231
                           " WHERE rc.rcon_id = "& Request("rcon_id") &_
232
                           "   AND rc.gbe_id = gb.gbe_id"
119 ghuddy 233
 
129 ghuddy 234
            Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
119 ghuddy 235
 
4296 dpurdie 236
            If rsTemp.RecordCount > 0 Then
237
                bmcon_id        =  rsTemp("bmcon_id")
238
                daemon_mode     =  rsTemp("daemon_mode")
239
                gbe_id          =  rsTemp("gbe_id")
240
                gbe_value       =  rsTemp("gbe_value")
241
                gbe_buildfilter =  rsTemp("gbe_buildfilter")
242
            End If
119 ghuddy 243
 
129 ghuddy 244
            rsTemp.Close()
245
            Set rsTemp = Nothing
4296 dpurdie 246
 
247
            If NOT isNULL(bmcon_id) AND bmcon_id <> "" Then
248
 
249
                '   Extract information from the machine config
250
                Query_String = "SELECT * " &_
251
                               " FROM build_machine_config bc, " &_
252
                               "      gbe_machtype gb " &_
253
                               "WHERE bc.bmcon_id = " & bmcon_id &_
254
                               "  AND bc.gbe_id = gb.gbe_id"
255
 
256
                Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
257
 
258
                If rsTemp.RecordCount > 0 Then
259
                    bmcon_id        =  rsTemp("bmcon_id")
260
                    gbe_id          =  rsTemp("gbe_id")
261
                    gbe_value       =  rsTemp("gbe_value")
262
                    bShowEmpty      = FALSE
263
                End If
264
 
265
                rsTemp.Close()
266
                Set rsTemp = Nothing
267
            End If
129 ghuddy 268
         End   If
269
         %>
270
         <table width="50%" border="0">
271
            <tr>
161 iaugusti 272
               <td><span class="body_txt">Daemon Host</span></td>
129 ghuddy 273
               <td>
4296 dpurdie 274
                  <%=objFormComponent.Combo_Multi ( "bmcon_id", GetMachHost(bmcon_id), bShowEmpty, "class='body_txt'",3,"20,20,50")%>
129 ghuddy 275
               </td>
276
            </tr>
277
            <tr>
278
               <td><span class="body_txt">Daemon Mode</span></td>
161 iaugusti 279
               <td>
280
                 <select name="daemon_mode" class='body_txt'>
281
                   <option value=M <%=iif(daemon_mode="M","selected","")%>>MASTER</option>
282
                   <option value=S <%=iif(daemon_mode="S","selected","")%>>SLAVE</option>
283
                 </select>
284
               </td>
129 ghuddy 285
            </tr>
286
            <tr>
287
               <tr>
288
                  <td><span class="body_txt">GBE_BUILDFILTER</span></td>
289
                  <td><input name="gbe_buildfilter" type="text" class="body_txt" size="80" value="<%=gbe_buildfilter%>"></td>
290
               </tr>
291
            </tr>
292
            <tr>
293
               <td>&nbsp;</td>
294
               <td>&nbsp;</td>
295
            </tr>
296
         </table>
297
      </td>
298
   </tr>
299
   <%=objPMod.ComposeHiddenTags()%>
300
   <input type="hidden" name="action" value="true">
119 ghuddy 301
 
129 ghuddy 302
   <%
303
   Call objFormComponent.FormEnd()
304
   '-- FROM END ----------------------------------------------------------------------------------------------------------------
305
   %>
119 ghuddy 306
</table>
307
</body>
308
</html>
309
<%
310
'------------ RUN AFTER PAGE RENDER -----------
311
Set objFormCollector = Nothing
312
'----------------------------------------------
313
Call Destroy_All_Objects
314
%>