Subversion Repositories DevTools

Rev

Rev 1325 | Rev 3894 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'|                                                   |
121 hknight 5
'|              Build Status Information             |
119 ghuddy 6
'|                                                   |
7
'=====================================================
8
%>
9
<%
10
Option explicit
11
' Good idea to set when using redirect
121 hknight 12
Response.Expires = 0  ' always load the page, dont store
119 ghuddy 13
%>
14
<!--#include file="common/conf.asp"-->
15
<!--#include file="common/globals.asp"-->
16
<!--#include file="common/formating.asp"-->
17
<!--#include file="common/qstr.asp"-->
18
<!--#include file="common/common_subs.asp"-->
19
<!--#include file="common/_form_window_common.asp"-->
20
<!--#include file="_action_buttons.asp"-->
21
<!--#include file="class/classActionButtonControl.asp"-->
147 ghuddy 22
<!--#include file="common/daemon_instructions.asp"-->
119 ghuddy 23
<%
24
' Set rfile parameter. This is a return page after Login
25
Call objPMod.StoreParameter ( "rfile", "rtree.asp" )
26
objPMod.PersistInQryString("proj_id")
27
'------------ ACCESS CONTROL ------------------
133 ghuddy 28
'Let users view the build status without being logged in, but as soon as they try and submit the form, check
29
'their login status.
30
If Request("action") <> "" AND NOT objAccessControl.UserLogedIn Then%>
31
<!--#include file="_access_control_login.asp"-->
32
<!--#include file="_access_control_project.asp"-->
33
<%End If%>
119 ghuddy 34
<!--#include file="_access_control_general.asp"-->
35
<%
36
'------------ Variable Definition -------------
37
Dim objSortHelper
38
Dim rsQry
39
Dim parRtagId
40
Dim parSourceRtagId
41
Dim query_string
42
Dim objBtnControl
133 ghuddy 43
Dim rcon_id
177 brianf 44
Dim shref_base
119 ghuddy 45
'------------ Constants Declaration -----------
46
'------------ Variable Init -------------------
47
parRtagId = Request("rtag_id")
48
objPMod.PersistInQryString("rtag_id")
49
Set objBtnControl = New ActionButtonControl
50
'----------------------------------------------
51
%>
52
<%
53
'--------------------------------------------------------------------------------------------------------------------------
54
Sub GetFormDetails ( parRtagId, ByRef outobjDetails )
133 ghuddy 55
   Dim rsQry, query
56
   OraDatabase.Parameters.Add "RTAG_ID",   parRtagId,    ORAPARM_INPUT, ORATYPE_NUMBER
57
   query = _
58
   " SELECT * "&_
59
   "  FROM RELEASE_TAGS rt"&_
60
   " WHERE rt.RTAG_ID = :RTAG_ID"
127 ghuddy 61
 
133 ghuddy 62
   Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
127 ghuddy 63
 
133 ghuddy 64
   OraDatabase.Parameters.Remove "RTAG_ID"
127 ghuddy 65
 
133 ghuddy 66
   If rsQry.RecordCount > 0 Then
67
      outobjDetails.Item ("rtag_id") = rsQry("rtag_id")
68
      outobjDetails.Item ("rtag_name") = rsQry("rtag_name")
69
   Else
70
      Err.Raise 8, "Sub GetFormDetails in "& ScriptName, "Empty record set returned. parRtagId="& parRtagId
71
   End If
127 ghuddy 72
 
133 ghuddy 73
   rsQry.Close
74
   Set rsQry = Nothing
119 ghuddy 75
End Sub
76
'--------------------------------------------------------------------------------------------------------------------------
77
Sub RipplePackage (flag)
127 ghuddy 78
 
133 ghuddy 79
   On Error Resume Next
80
   objEH.ErrorRedirect = TRUE
81
   OraDatabase.Parameters.Add "PV_ID_LIST",  Request("pv_id_list"),  ORAPARM_INPUT, ORATYPE_VARCHAR2
82
   OraDatabase.Parameters.Add "RTAG_ID",     parRtag_id,  ORAPARM_INPUT, ORATYPE_NUMBER
83
   OraDatabase.Parameters.Add "USER_ID",     objAccessControl.UserId,  ORAPARM_INPUT, ORATYPE_NUMBER
119 ghuddy 84
 
133 ghuddy 85
   objEH.TryORA ( OraSession )
127 ghuddy 86
 
133 ghuddy 87
   If flag Then
88
      OraDatabase.ExecuteSQL _
89
      "BEGIN  Ripple_Package( :PV_ID_LIST, :RTAG_ID, :USER_ID );  END;"
90
   Else
91
      OraDatabase.ExecuteSQL _
92
      "BEGIN  UnRipple_Package( :PV_ID_LIST, :RTAG_ID, :USER_ID );  END;"
93
   End If
127 ghuddy 94
 
133 ghuddy 95
   objEH.CatchORA ( OraSession )
127 ghuddy 96
 
133 ghuddy 97
   OraDatabase.Parameters.Remove "PV_ID_LIST"
98
   OraDatabase.Parameters.Remove "RTAG_ID"
99
   OraDatabase.Parameters.Remove "USER_ID"
119 ghuddy 100
 
101
End Sub
102
'--------------------------------------------------------------------------------------------------------------------------
103
Function Get_Daemon_Mode( cMode )
104
 
127 ghuddy 105
   If cMode = "S" Then
106
      Get_Daemon_Mode = "Slave"
107
   ElseIf cMode = "M" Then
108
      Get_Daemon_Mode = "Master"
109
   End If
110
 
119 ghuddy 111
End Function
112
'--------------------------------------------------------------------------------------------------------------------------
171 brianf 113
Function Get_Run_Level( nLevel, indefinitePause, astate)
119 ghuddy 114
 
127 ghuddy 115
   If indefinitePause Then
116
      Get_Run_Level = "<span class='err_alert'>Stopped</span>"
171 brianf 117
   ElseIf astate = 1 Then      ' if build daemon paused
118
      Get_Run_Level = "Paused"
119
   ElseIf astate = 2 Then      ' if build daemon disabled
120
      Get_Run_Level = "Disabled"
121
   ElseIf IsNull(astate) Then  ' if build daemon enabled
133 ghuddy 122
      If nLevel = 1 Then
127 ghuddy 123
         Get_Run_Level = "Cannot Continue"
124
      ElseIf nLevel = 2 Then
125
         Get_Run_Level = "Paused"
126
      ElseIf nLevel = 3 Then
1325 dpurdie 127
         Get_Run_Level = "Building"
127 ghuddy 128
      ElseIf nLevel = 4 Then
129
         Get_Run_Level = "Idle"
133 ghuddy 130
      ElseIf nLevel = 5 Then
127 ghuddy 131
         Get_Run_Level = "Waiting"
135 mhunt 132
      ElseIf nLevel = 6 Then
133
         Get_Run_Level = "Publishing"
127 ghuddy 134
      Else
135
         Get_Run_Level = "<span class='err_alert'>Unknown!</span>"
136
      End If
137
   End If
119 ghuddy 138
 
139
End Function
177 brianf 140
 
119 ghuddy 141
'--------------------------------------------------------------------------------------------------------------------------
142
Function Get_Package_Name( sPackageName )
143
 
121 hknight 144
  If IsNull(sPackageName) Then
145
    Get_Package_Name = "None"
146
  Else
147
    Get_Package_Name = sPackageName
148
  End If
119 ghuddy 149
 
150
End Function
151
'--------------------------------------------------------------------------------------------------------------------------
177 brianf 152
 
153
 
119 ghuddy 154
%>
155
<%
156
'------------ RUN BEFORE PAGE RENDER ----------
181 brianf 157
shref_base = "http://" & archive_server & "/devl/abtlog/"
177 brianf 158
 
119 ghuddy 159
' --- Get Form details from DB ---
160
Call GetFormDetails ( Request("rtag_id"), objFormCollector )
161
 
162
' --- Load Validation Rules ---
121 hknight 163
'Call objForm.LoadValidationRules ( Array("rtag_name","rtag_description", "config_spec_branch"), OraDatabase )    ' Load Validation Rules
119 ghuddy 164
 
165
' --- Enter Form Validation Rule Changes here... ----
166
'----------------------------------------------------
167
 
168
' --- RUN onPostBack ---
133 ghuddy 169
If Request("action") <> "" AND objAccessControl.UserLogedIn Then
119 ghuddy 170
 
121 hknight 171
  If objEH.Finally Then
172
    If Request("action") = "include" Then
173
      Call RipplePackage (True)
174
    Else
175
      Call OpenInWindow ( "dependencies.asp?rtag_id="& parRtagId )
176
    End If
177
  End If
127 ghuddy 178
 
119 ghuddy 179
End If
180
 
181
'----------------------------------------------
182
%>
183
<html>
127 ghuddy 184
   <head>
185
      <title>Release Manager</title>
186
      <meta http-equiv="Pragma" content="no-cache">
187
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
188
      <link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
189
      <link rel="stylesheet" href="images/navigation.css" type="text/css">
190
      <script language="JavaScript" src="images/common.js"></script>
157 ghuddy 191
      <!-- TIPS -->
192
      <script language="JavaScript" src="images/tipster.js"></script>
193
      <script language="JavaScript" src="images/_help_tips.js"></script>
127 ghuddy 194
      <!-- DROPDOWN MENUS -->
195
      <!--#include file="_menu_def.asp"-->
196
      <script language="JavaScript1.2" src="images/popup_menu.js"></script>
197
   </head>
198
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="isChecked('pv_id_list','submit');">
199
      <!-- MENU LAYERS -------------------------------------->
200
      <div id="popmenu" class="menuskin" onmouseover="clearhidemenu();highlightmenu(event,'on')" onmouseout="highlightmenu(event,'off');dynamichide(event)"></div>
201
      <!-- TIPS LAYERS -------------------------------------->
202
      <div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
203
      <!----------------------------------------------------->
204
      <!-- HEADER -->
205
      <!--#include file="_header.asp"-->
206
      <!-- BODY ---->
207
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
208
         <%
209
         '-- FORM START ---------------------------------------------------------------------------------------------------------
210
         objFormComponent.FormName = "FormName"
211
         objFormComponent.Action = ScriptName &"?rtag_id="& parRtagId
212
         Call objFormComponent.FormStart()
213
         %>
214
         <tr>
215
            <td width="1" background="images/bg_home_orange.gif" valign="top"></td>
216
            <td width="100%" rowspan="1" align="center" valign="top" bgcolor="#EEEFEF">
217
               <table width="10" border="0" cellspacing="0" cellpadding="0">
121 hknight 218
                  <tr>
127 ghuddy 219
                     <td width="1%"></td>
220
                     <td width="100%">
221
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
222
                           <tr>
223
                              <td nowrap class="body_txt"></td>
224
                           </tr>
225
                        </table>
226
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
227
                           <tr>
228
                              <td nowrap class="form_ttl"><p>&nbsp;</p>
229
                                 <p>BUILD STATUS INFORMATION</p>
230
                              </td>
231
                              <td align="right" valign="bottom"></td>
232
                           </tr>
233
                        </table>
234
                     </td>
235
                     <td width="1%"></td>
121 hknight 236
                  </tr>
237
                  <tr>
127 ghuddy 238
                     <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
239
                     <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
240
                     <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
121 hknight 241
                  </tr>
242
                  <tr>
127 ghuddy 243
                     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
244
                     <td bgcolor="#FFFFFF" valign="top">
245
                        <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
246
                        <!--#include file="messages/_msg_inline.asp"-->
247
                        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
248
                        <br>
249
                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
250
                           <span class='err_alert'>
251
                              <font size='2'><b>Packages Excluded From Build (Daemon Build Failure)</b></font>
252
                           </span>
253
                           <tr>
254
                              <td background="images/bg_table_col.gif" class="err_alert"><b>Directly</b></td>
255
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">PACKAGE NAME</td>
256
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">PACKAGE VERSION</td>
157 ghuddy 257
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">ROOT CAUSE
258
                              </td>
127 ghuddy 259
                           </tr>
260
                           <%
261
                           query_string = " select pkg.pkg_name, pv.pkg_version, pv.pv_id, dnr.rtag_id, dnr.root_cause, dnr.root_file, pv.pv_description"&_
262
                                          "   from do_not_ripple dnr, package_versions pv, packages pkg"&_
263
                                          "  where dnr.rtag_id = "& parRtagId &_
264
                                          "    and pv.pv_id    = dnr.pv_id"&_
265
                                          "    and pkg.pkg_id  = pv.pkg_id"&_
266
                                          "    and dnr.root_pv_id is null"&_
267
                                          "  order by pkg_name"
268
                           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
269
                           '--- Render rows ---
270
                           Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
271
                           %>
272
                              <tr>
273
                                 <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
274
                              </tr>
275
                              <tr>
276
                                 <td nowrap width="1%">
277
                                    <!-- The use of the isChecked() javascript function below, enables the submit button if any checkboxes are checked, -->
278
                                    <!-- else it will disable the submit button. The function is badly named, but nevertheless, that is what it does.   -->
279
                                    <input type="checkbox" value="<%=rsQry("pv_id")%>" name="pv_id_list" id="pv_id_list" onClick="isChecked('pv_id_list','submit');">
280
                                 </td>
281
                                 <td nowrap class="body_rowg"><a class="txt_linked" href="dependencies.asp?pv_id=<%=rsQry("pv_id")%>&rtag_id=<%=rsQry("rtag_id")%>" title="<%=rsQry("pv_description")%>"><%=rsQry("pkg_name")%></a></td>
282
                                 <td nowrap class="body_rowg"><%=rsQry("pkg_version")%></td>
283
                                 <%
284
                                 ' root_file, if supplied, indicates a build failure log file exists
285
                                 ' this should always prevail over the textual root_cause
286
                                 If IsNull(rsQry("root_file")) Then%>
287
                                    <td nowrap class="body_rowg"><%=rsQry("root_cause")%></td>
288
                                 <%Else%>
289
                                    <td nowrap class="body_rowg">
177 brianf 290
                                       <a class="txt_linked" title="<%=rsQry("root_file")%> Log file may have expired." href="<%=shref_base & rsQry("root_file")%>">
127 ghuddy 291
                                          Build Failure Log File
292
                                       </a>
293
                                    </td>
294
                                 <%End If%>
295
                              </tr>
296
                              <%
297
                              rsQry.MoveNext
298
                           Loop%>
299
                           <tr>
300
                              <td background="images/bg_table_col.gif" class="err_alert"><b>Indirectly</b></td>
301
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">PACKAGE NAME</td>
302
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">PACKAGE VERSION</td>
303
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">ROOT CAUSE PACKAGE NAME</td>
304
                           </tr>
305
                           <%
306
                           query_string = " select pv.pv_id, pkg.pkg_name, pv.pkg_version, qkg.pkg_name, dnr.rtag_id, pv.pv_description"&_
307
                                          "   from do_not_ripple dnr, package_versions pv, package_versions qv, packages pkg, packages qkg"&_
308
                                          "  where dnr.rtag_id = "& parRtagId &_
309
                                          "    and pv.pv_id    = dnr.pv_id"&_
310
                                          "    and pkg.pkg_id  = pv.pkg_id"&_
311
                                          "    and qv.pv_id    = dnr.root_pv_id"&_
312
                                          "    and qkg.pkg_id  = qv.pkg_id"&_
313
                                          "    and dnr.root_pv_id is not null"&_
314
                                          "  order by pkg.pkg_name"
315
                           Dim rsQry2
316
                           Set rsQry2 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
317
                           '--- Render rows ---
318
                           Do While (NOT rsQry2.BOF) AND (NOT rsQry2.EOF)%>
319
                              <tr>
320
                                 <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
321
                              </tr>
322
                              <tr>
323
                                 <td nowrap width="1%">
324
                                    <input type="checkbox" value=0 disabled=true name="notused" id="notused">
325
                                 </td>
326
                                 <td nowrap class="body_rowg"><a class="txt_linked" href="dependencies.asp?pv_id=<%=rsQry2(0)%>&rtag_id=<%=rsQry2(4)%>" title="<%=rsQry2(5)%>"><%=rsQry2(1)%></a></td>
327
                                 <td nowrap class="body_rowg"><%=rsQry2(2)%></td>
328
                                 <td nowrap class="body_rowg"><%=rsQry2(3)%></td>
329
                              </tr>
330
                              <%
331
                              rsQry2.MoveNext
332
                           Loop%>
333
                        </table>
334
                     </td>
335
                     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
121 hknight 336
                  </tr>
127 ghuddy 337
                  <%If rsQry.RecordCount > 0 Then%>
338
                     <tr>
339
                        <td background="images/bg_action_norm.gif"></td>
340
                        <td align="right" background="images/bg_action_norm.gif">
341
                           <%
342
                           Response.Write(objFormComponent.SubmitButton ( "Include", "name='submit' id='submit' class='form_btn' disabled style='color:silver' onClick='return confirmAction(""Are you sure you want to include these packages for building?"")'" ))
343
                           Response.Write(objPMod.ComposeHiddenTags())
344
                           %>
345
                        </td>
346
                        <td background="images/bg_action_norm.gif"><img src="images/h_trsp_dot.gif" width="5" height="30"></td>
347
                     </tr>
348
                  <%End If%>
121 hknight 349
                  <tr>
127 ghuddy 350
                     <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
351
                     <td background="images/lbox_bg_blue.gif"></td>
352
                     <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
121 hknight 353
                  </tr>
127 ghuddy 354
               </table>
355
               <!-- ACTION BUTTONS ---------------------------------------------->
356
               <input type="hidden" name="action" value="include">
357
               <!-- ACTION BUTTONS END  ------------------------------------------>
358
            </td>
359
            <td width="1" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
360
         </tr>
361
         <%
362
         Call objFormComponent.FormEnd()
363
         rsQry.Close()
364
         Set rsQry = nothing
365
         rsQry2.Close()
366
         Set rsQry2 = nothing
367
         '-- FORM END ----------------------------------------------------------------------------------------------------------------
368
         %>
369
         <tr>
370
            <td width="1" background="images/bg_home_orange.gif" valign="top"></td>
371
            <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
372
               <table width="10" border="0" cellspacing="0" cellpadding="0">
121 hknight 373
                  <tr>
127 ghuddy 374
                     <td width="1%"></td>
375
                     <td width="100%">
376
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
377
                           <tr>
378
                              <td nowrap class="form_ttl"><p>&nbsp;</p>
379
                                 <p>DAEMON STATUS INFORMATION</p>
380
                              </td>
2362 dpurdie 381
                              <td align="right" valign="bottom">
382
                                <a class="txt_linked" href="build_status.asp?rtag_id=<%=parRtagId%>" title="Refresh Page">[Refresh]</a></td>
383
                              </td>
127 ghuddy 384
                           </tr>
385
                        </table>
386
                     </td>
387
                     <td width="1%"></td>
121 hknight 388
                  </tr>
389
                  <tr>
127 ghuddy 390
                     <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
391
                     <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
392
                     <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
121 hknight 393
                  </tr>
394
                  <tr>
127 ghuddy 395
                     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
396
                     <td bgcolor="#FFFFFF" valign="top">
397
                        <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
398
                        <!--#include file="messages/_msg_inline.asp"-->
399
                        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
400
                        <br>
401
                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
402
                           <%
403
                           Dim indefinitelyPaused
404
                           indefinitelyPaused = FALSE
405
                           ' Insert a warning into the page if the build daemons are indefintely paused.
406
                           query_string = " select * from run_level_schedule rls where rls.indefinite_pause = 'P'"
407
 
408
                           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
409
                           If rsQry.RecordCount > 0 Then
410
                              indefinitelyPaused = TRUE %>
411
                              <tr>
412
                                 <span class='err_alert'>
413
                                    <font size='2'><b>WARNING: Build Daemons are all stopped - please contact an administrator</b></font>
414
                                 </span>
415
                              </tr>
416
                           <%End If
417
 
418
                           rsQry.Close()
419
                           Set rsQry = nothing
420
                           %>
421
                           <td width="9%" valign="top"></td>
422
                           <tr>
163 brianf 423
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Daemon Host</td>
127 ghuddy 424
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">GBE Machtype</td>
425
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Mode</td>
426
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Run Level</td>
427
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Current Package</td>
147 ghuddy 428
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Last Change<br>Delta (secs)</td>
127 ghuddy 429
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Switch State</td>
430
                           </tr>
431
                           <%
133 ghuddy 432
                           ' Get the number of release configurations for this RTAG_ID, and iterate through them
163 brianf 433
                           query_string = " select * from release_config rc, gbe_machtype gm, build_machine_config bm"&_
127 ghuddy 434
                                          "  where rc.rtag_id = "& parRtagId &_
435
                                          "    and gm.gbe_id = rc.gbe_id"&_
163 brianf 436
                                          "    and rc.daemon_hostname = bm.machine_hostname(+)" &_
183 brianf 437
                                          "  order by rc.daemon_hostname,rc.rcon_id"
133 ghuddy 438
 
127 ghuddy 439
                           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
133 ghuddy 440
 
127 ghuddy 441
                           Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
442
                              rcon_id = rsQry("rcon_id")
133 ghuddy 443
 
444
                              Dim pkgName
445
                              Dim currentRunLevel
171 brianf 446
                              Dim daemonState
447
                              Dim delta
133 ghuddy 448
 
449
                              ' For this release configuration, get its entry from the run_level table. This table may not
450
                              ' have an entry so we must handle that outcome too.
147 ghuddy 451
                              query_string = " select rl.pause, rl.current_run_level, rl.current_pkg_id_being_built, "&_
452
                                             "        TRUNC (86400*(SYSDATE - rl.KEEP_ALIVE)) as delta" &_
453
                                             "   from run_level rl"&_
133 ghuddy 454
                                             "  where rl.rcon_id = "& rcon_id
455
 
456
                              Set rsQry2 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
457
 
458
                              currentRunLevel = -1
459
                              If (rsQry2.RecordCount > 0) Then
460
                                 ' Get the run level from the run_level table
461
                                 currentRunLevel = rsQry2("current_run_level")
462
                              End If
463
 
171 brianf 464
                              daemonState = NULL
465
                              If (rsQry2.RecordCount > 0) Then                                
466
                                daemonState = rsQry2("pause")
467
                              End If
468
 
469
                              delta = NULL
470
                              If (rsQry2.RecordCount > 0) Then
471
                                delta = rsQry2("delta")
472
                              End If
473
 
133 ghuddy 474
                              ' If we got an entry from the run_level table, try and use the pkg_id it contains, to obtain a
475
                              ' package name from the packages table
476
                              Dim rsQry3
477
                              pkgName = NULL
478
                              If (rsQry2.RecordCount > 0) AND NOT IsNull(rsQry2("current_pkg_id_being_built")) Then
479
 
480
                                 query_string = " select pkg_name from run_level rl, packages pk"&_
481
                                                "  where rl.rcon_id = "& rcon_id &_
482
                                                "   and  rl.current_pkg_id_being_built = pk.pkg_id"
483
 
484
                                 Set rsQry3 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
485
                                 If (rsQry3.RecordCount > 0) Then
486
                                    pkgName = rsQry3("pkg_name")
487
                                 End If
488
                                 rsQry3.Close()
489
                                 Set rsQry3 = nothing
490
                              End If
491
 
492
                              ' --- Now render HTML for this release configuration ---
127 ghuddy 493
                              %>
494
                              <tr>
495
                                 <td colspan="6" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
496
                              </tr>
497
                              <tr>
163 brianf 498
                                 <td nowrap class="body_rowg"><%=rsQry("display_name")%></td>
127 ghuddy 499
                                 <td nowrap class="body_rowg"><%=rsQry("gbe_value")%></td>
500
                                 <td nowrap class="body_rowg"><%=Get_Daemon_Mode(rsQry("daemon_mode"))%></td>
171 brianf 501
                                 <td nowrap class="body_rowg"><%=Get_Run_Level(currentRunLevel, indefinitelyPaused,daemonState)%></td>
133 ghuddy 502
                                 <td nowrap class="body_rowg"><%=Get_Package_Name(pkgName)%></td>
183 brianf 503
                                 <%If (delta > 600) AND IsNull(pkgName) Then%>
504
                                   <td nowrap class="body_rowg" style=color:Red><%=delta%></td>
505
                                 <%else%>
506
                                   <td nowrap class="body_rowg"><%=delta%></td>
507
                                 <%end if%>
508
 
127 ghuddy 509
                                 <td nowrap class="body_rowg">
510
                                    <%
133 ghuddy 511
                                    If (rsQry2.RecordCount > 0) AND NOT indefinitelyPaused  Then
127 ghuddy 512
                                       If objAccessControl.UserLogedIn Then
171 brianf 513
                                          If IsNull(daemonState) Then
127 ghuddy 514
                                             Call Action_Buttons ( "Daemon Pause" )
171 brianf 515
                                          ElseIf daemonState = 1 Then
516
                                             Call Action_Buttons ( "Daemon Resume" )
517
                                          ElseIf daemonState = 2 Then
518
                                             Call Action_Buttons ( "Daemon Start" )
127 ghuddy 519
                                          Else
520
                                             Call Action_Buttons ( "Daemon Resume" )
521
                                          End If
522
                                       Else
171 brianf 523
                                          If IsNull(daemonState) Then
127 ghuddy 524
                                             Call Action_Buttons ( "Daemon Pause Disabled" )
171 brianf 525
                                          ElseIf daemonState = 1 Then
526
                                             Call Action_Buttons ( "Daemon Resume Disabled" )
527
                                          ElseIf daemonState = 2 Then
528
                                             Call Action_Buttons ( "Daemon Start Disabled" )
127 ghuddy 529
                                          Else
530
                                             Call Action_Buttons ( "Daemon Resume Disabled" )
531
                                          End If
532
                                       End If
533
                                    Else
534
                                       %>Unavailable<%
535
                                    End If
536
                                    %>
537
                                 </td>
538
                              </tr>
539
                              <%
133 ghuddy 540
                              rsQry2.Close()
541
                              Set rsQry2 = nothing
127 ghuddy 542
                              rsQry.MoveNext
543
                           Loop
544
                           %>
171 brianf 545
                           <tr>
546
                             <td valign="bottom" background="images/bg_table_col.gif" class="body_col"></td>
547
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col"></td>
548
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col"></td>
549
                             <td valign="bottom" background="images/bg_table_col.gif" class="body_col"></td>
550
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col"></td>
551
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col"></td>
552
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col">
553
                             <%
554
                               If (rsQry.RecordCount > 0) AND NOT indefinitelyPaused  Then
555
                                 If objAccessControl.UserLogedIn Then
556
                                   Call Action_Buttons ( "Daemon Control All" )
557
                                 Else 
558
                                   Call Action_Buttons ( "Daemon Control All Disabled" )
559
                                 End If
560
                               Else
561
                                 %>&nbsp<%
562
                               End If
563
                             %>
564
                             </td>
565
                           </tr>
566
                           <%
567
                             rsQry.Close()
568
                             Set rsQry = nothing
569
                           %>
127 ghuddy 570
                        </table>
571
                     </td>
572
                     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
121 hknight 573
                  </tr>
574
                  <tr>
127 ghuddy 575
                     <input type="hidden" name="action" value="true">
576
                     <%=objPMod.ComposeHiddenTags()%>
577
                     <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
578
                     <td background="images/lbox_bg_blue.gif"></td>
579
                     <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
121 hknight 580
                  </tr>
127 ghuddy 581
               </table>
147 ghuddy 582
 
583
               <table width="10" border="0" cellspacing="0" cellpadding="0">
584
                  <tr>
585
                     <td width="1%"></td>
586
                     <td width="100%">
587
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
588
                           <tr>
589
                              <td nowrap class="form_ttl"><p>&nbsp;</p>
590
                                 <p>DAEMON INSTRUCTIONS FOR THIS RELEASE</p>
591
                              </td>
592
                              <td align="right" valign="bottom"></td>
593
                           </tr>
594
                        </table>
595
                     </td>
596
                     <td width="1%"></td>
597
                  </tr>
598
                  <tr>
599
                     <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
600
                     <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
601
                     <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
602
                  </tr>
603
                  <tr>
604
                     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
605
                     <td bgcolor="#FFFFFF" valign="top">
606
                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
607
                           <tr>
608
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">OPERATION</td>
609
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">PACKAGE</td>
610
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">VERSION</td>
611
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">SCHEDULED TIME<br>(<SPAN style=color:Red>Red</SPAN> = overdue)<br>(<SPAN style=color:Green>Green</SPAN> = ready)</td>
612
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">REPEAT</td>
613
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">IN PROGRESS</td>
614
                           </tr>
615
                           <%
616
                           Dim PkgId
617
                           Dim PkgVersion
618
                           Dim UserName
619
                           Dim UserEmail
620
                           Dim bInProgress
621
                           Dim bIsOverdue
622
                           Dim bIsReady
623
 
624
                           Set rsQry = OraDatabase.DbCreateDynaset( "SELECT DAEMON_INSTRUCTIONS_ID,"&_
625
                                                                  "       OP_CODE,"&_
626
                                                                  "       RTAG_ID,"&_
627
                                                                  "       PV_ID,"&_
628
                                                                  "       SCHEDULED_DATETIME,"&_
629
                                                                  "       REPEAT_SECS,"&_
630
                                                                  "       ADDED_DATETIME,"&_
631
                                                                  "       USER_ID,"&_
632
                                                                  "       IN_PROGRESS,"&_
633
                                                                  "       (CASE WHEN SCHEDULED_DATETIME <= SYSDATE THEN 1 ELSE 0 END) AS READY,"&_
634
                                                                  "       (CASE WHEN (SCHEDULED_DATETIME + (1/144)) < SYSDATE THEN 1 ELSE 0 END) AS OVERDUE"&_
635
                                                                  "  FROM DAEMON_INSTRUCTIONS "&_
636
                                                                  "  WHERE RTAG_ID = "& parRtagId &_
637
                                                                  "  ORDER BY PV_ID, SCHEDULED_DATETIME, DAEMON_INSTRUCTIONS_ID", ORADYN_DEFAULT )
638
                           While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
639
 
640
                              If IsNull(rsQry("IN_PROGRESS")) OR rsQry("IN_PROGRESS") = "0" Then
641
                                 bInProgress = False
642
                              Else
643
                                 bInProgress = True
644
                              End If
645
 
646
                              ' only flag as overdue if time threshold has been met but the daemon has not marked the instruction as being in progress.
647
                              If rsQry("OVERDUE") AND NOT bInProgress Then
648
                                 bIsOverdue = True
649
                              Else
650
                                 bIsOverdue = False
651
                              End If
652
 
653
                              If rsQry("READY") Then
654
                                 bIsReady = True
655
                              Else
656
                                 bIsReady = False
657
                              End If
658
 
659
                              ' Get as much info about the package as we can
660
                              PkgId = 0
661
                              PkgName = "N/A"
662
                              PkgVersion = "N/A"
663
                              If (NOT IsNull(rsQry("PV_ID"))) AND (rsQry("PV_ID") <> "") Then
664
                                 Call Get_Pkg_Short_Info(rsQry("PV_ID"), PkgId, PkgName, PkgVersion, NULL, NULL, NULL)
665
                              End If
666
 
667
                              %>
668
                              <tr>
669
 
670
                                 <td align="left" valign="top" class="body_txt">
671
                                    <%=DaemonInstructionOperationName(rsQry("OP_CODE"))%>
672
                                 </td>
673
 
674
                                 <td align="left" valign="top" class="body_txt">
675
                                    <%If (NOT IsNull(rsQry("PV_ID"))) AND (rsQry("PV_ID") <> "") Then%>
676
                                       <a href='fixed_issues.asp?rtag_id=<%=rsQry("RTAG_ID")%>&pv_id=<%=rsQry("PV_ID")%>'><%=PkgName%>
677
                                    <%Else%>
678
                                       <%=PkgName%>
679
                                    <%End If%>
680
                                 </td>
681
 
682
                                 <td align="left" valign="top" class="body_txt">
683
                                    <%=PkgVersion%>
684
                                 </td>
685
 
686
                                 <td align="left" valign="top" class="body_txt" <%If bIsOverdue Then%>style=color:Red<%Elseif bIsReady Then%>style=color:Green<%End If%>><%=EuroDateTime(rsQry("SCHEDULED_DATETIME"))%></td>
687
 
688
                                 <td align="left" valign="top" class="body_txt"><%=DaemonInstructionRepeatString(rsQry("OP_CODE"), rsQry("REPEAT_SECS"))%></td>
689
 
690
                                 <td align="left" valign="top" class="body_txt">
691
                                    <%If bInProgress Then%>
692
                                       YES
693
                                    <%Else%>
694
                                       NO
695
                                    <%End If%>
696
                                 </td>
697
                              </tr>
698
                              <tr>
699
                                 <td colspan="6" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
700
                              </tr>
701
                              <%
702
                              rsQry.MoveNext()
703
                           Wend
704
                           rsQry.Close()
705
                           Set rsQry = nothing
706
                           %>
707
                        </table>
708
                     </td>
709
                     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
710
                  </tr>
711
                  <tr>
712
                     <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
713
                     <td background="images/lbox_bg_blue.gif"></td>
714
                     <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
715
                  </tr>
716
               </table>
717
 
127 ghuddy 718
            </td>
719
            <td width="1" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
720
         </tr>
721
         <tr>
722
            <td valign="bottom" align="center" background="images/bg_home_orange.gif"><img src="images/img_vtree.gif" width="86" height="99" vspace="20" hspace="30"></td>
723
            <td background="images/bg_lght_gray.gif" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="350"></td>
724
         </tr>
725
      </table>
726
      <!-- FOOTER -->
727
      <!--#include file="_footer.asp"-->
728
   </body>
119 ghuddy 729
</html>
730
<%
731
Call Destroy_All_Objects
732
%>