Subversion Repositories DevTools

Rev

Details | 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
127
         Get_Run_Level = "Actively engaged in a build"
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 ----------
177 brianf 157
shref_base = "http://" & archive_server & "/abtlog/"
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>
381
                              <td align="right" valign="bottom"></td>
382
                           </tr>
383
                        </table>
384
                     </td>
385
                     <td width="1%"></td>
121 hknight 386
                  </tr>
387
                  <tr>
127 ghuddy 388
                     <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
389
                     <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
390
                     <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 391
                  </tr>
392
                  <tr>
127 ghuddy 393
                     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
394
                     <td bgcolor="#FFFFFF" valign="top">
395
                        <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
396
                        <!--#include file="messages/_msg_inline.asp"-->
397
                        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
398
                        <br>
399
                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
400
                           <%
401
                           Dim indefinitelyPaused
402
                           indefinitelyPaused = FALSE
403
                           ' Insert a warning into the page if the build daemons are indefintely paused.
404
                           query_string = " select * from run_level_schedule rls where rls.indefinite_pause = 'P'"
405
 
406
                           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
407
                           If rsQry.RecordCount > 0 Then
408
                              indefinitelyPaused = TRUE %>
409
                              <tr>
410
                                 <span class='err_alert'>
411
                                    <font size='2'><b>WARNING: Build Daemons are all stopped - please contact an administrator</b></font>
412
                                 </span>
413
                              </tr>
414
                           <%End If
415
 
416
                           rsQry.Close()
417
                           Set rsQry = nothing
418
                           %>
419
                           <td width="9%" valign="top"></td>
420
                           <tr>
163 brianf 421
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Daemon Host</td>
127 ghuddy 422
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">GBE Machtype</td>
423
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Mode</td>
424
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Run Level</td>
425
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Current Package</td>
147 ghuddy 426
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Last Change<br>Delta (secs)</td>
127 ghuddy 427
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Switch State</td>
428
                           </tr>
429
                           <%
133 ghuddy 430
                           ' Get the number of release configurations for this RTAG_ID, and iterate through them
163 brianf 431
                           query_string = " select * from release_config rc, gbe_machtype gm, build_machine_config bm"&_
127 ghuddy 432
                                          "  where rc.rtag_id = "& parRtagId &_
433
                                          "    and gm.gbe_id = rc.gbe_id"&_
163 brianf 434
                                          "    and rc.daemon_hostname = bm.machine_hostname(+)" &_
127 ghuddy 435
                                          "  order by rc.daemon_hostname"
133 ghuddy 436
 
127 ghuddy 437
                           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
133 ghuddy 438
 
127 ghuddy 439
                           Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
440
                              rcon_id = rsQry("rcon_id")
133 ghuddy 441
 
442
                              Dim pkgName
443
                              Dim currentRunLevel
171 brianf 444
                              Dim daemonState
445
                              Dim delta
133 ghuddy 446
 
447
                              ' For this release configuration, get its entry from the run_level table. This table may not
448
                              ' have an entry so we must handle that outcome too.
147 ghuddy 449
                              query_string = " select rl.pause, rl.current_run_level, rl.current_pkg_id_being_built, "&_
450
                                             "        TRUNC (86400*(SYSDATE - rl.KEEP_ALIVE)) as delta" &_
451
                                             "   from run_level rl"&_
133 ghuddy 452
                                             "  where rl.rcon_id = "& rcon_id
453
 
454
                              Set rsQry2 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
455
 
456
                              currentRunLevel = -1
457
                              If (rsQry2.RecordCount > 0) Then
458
                                 ' Get the run level from the run_level table
459
                                 currentRunLevel = rsQry2("current_run_level")
460
                              End If
461
 
171 brianf 462
                              daemonState = NULL
463
                              If (rsQry2.RecordCount > 0) Then                                
464
                                daemonState = rsQry2("pause")
465
                              End If
466
 
467
                              delta = NULL
468
                              If (rsQry2.RecordCount > 0) Then
469
                                delta = rsQry2("delta")
470
                              End If
471
 
133 ghuddy 472
                              ' If we got an entry from the run_level table, try and use the pkg_id it contains, to obtain a
473
                              ' package name from the packages table
474
                              Dim rsQry3
475
                              pkgName = NULL
476
                              If (rsQry2.RecordCount > 0) AND NOT IsNull(rsQry2("current_pkg_id_being_built")) Then
477
 
478
                                 query_string = " select pkg_name from run_level rl, packages pk"&_
479
                                                "  where rl.rcon_id = "& rcon_id &_
480
                                                "   and  rl.current_pkg_id_being_built = pk.pkg_id"
481
 
482
                                 Set rsQry3 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
483
                                 If (rsQry3.RecordCount > 0) Then
484
                                    pkgName = rsQry3("pkg_name")
485
                                 End If
486
                                 rsQry3.Close()
487
                                 Set rsQry3 = nothing
488
                              End If
489
 
490
                              ' --- Now render HTML for this release configuration ---
127 ghuddy 491
                              %>
492
                              <tr>
493
                                 <td colspan="6" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
494
                              </tr>
495
                              <tr>
163 brianf 496
                                 <td nowrap class="body_rowg"><%=rsQry("display_name")%></td>
127 ghuddy 497
                                 <td nowrap class="body_rowg"><%=rsQry("gbe_value")%></td>
498
                                 <td nowrap class="body_rowg"><%=Get_Daemon_Mode(rsQry("daemon_mode"))%></td>
171 brianf 499
                                 <td nowrap class="body_rowg"><%=Get_Run_Level(currentRunLevel, indefinitelyPaused,daemonState)%></td>
133 ghuddy 500
                                 <td nowrap class="body_rowg"><%=Get_Package_Name(pkgName)%></td>
171 brianf 501
                                 <td nowrap class="body_rowg"><%=delta%></td>
127 ghuddy 502
                                 <td nowrap class="body_rowg">
503
                                    <%
133 ghuddy 504
                                    If (rsQry2.RecordCount > 0) AND NOT indefinitelyPaused  Then
127 ghuddy 505
                                       If objAccessControl.UserLogedIn Then
171 brianf 506
                                          If IsNull(daemonState) Then
127 ghuddy 507
                                             Call Action_Buttons ( "Daemon Pause" )
171 brianf 508
                                          ElseIf daemonState = 1 Then
509
                                             Call Action_Buttons ( "Daemon Resume" )
510
                                          ElseIf daemonState = 2 Then
511
                                             Call Action_Buttons ( "Daemon Start" )
127 ghuddy 512
                                          Else
513
                                             Call Action_Buttons ( "Daemon Resume" )
514
                                          End If
515
                                       Else
171 brianf 516
                                          If IsNull(daemonState) Then
127 ghuddy 517
                                             Call Action_Buttons ( "Daemon Pause Disabled" )
171 brianf 518
                                          ElseIf daemonState = 1 Then
519
                                             Call Action_Buttons ( "Daemon Resume Disabled" )
520
                                          ElseIf daemonState = 2 Then
521
                                             Call Action_Buttons ( "Daemon Start Disabled" )
127 ghuddy 522
                                          Else
523
                                             Call Action_Buttons ( "Daemon Resume Disabled" )
524
                                          End If
525
                                       End If
526
                                    Else
527
                                       %>Unavailable<%
528
                                    End If
529
                                    %>
530
                                 </td>
531
                              </tr>
532
                              <%
133 ghuddy 533
                              rsQry2.Close()
534
                              Set rsQry2 = nothing
127 ghuddy 535
                              rsQry.MoveNext
536
                           Loop
537
                           %>
171 brianf 538
                           <tr>
539
                             <td valign="bottom" background="images/bg_table_col.gif" class="body_col"></td>
540
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col"></td>
541
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col"></td>
542
                             <td valign="bottom" background="images/bg_table_col.gif" class="body_col"></td>
543
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col"></td>
544
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col"></td>
545
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col">
546
                             <%
547
                               If (rsQry.RecordCount > 0) AND NOT indefinitelyPaused  Then
548
                                 If objAccessControl.UserLogedIn Then
549
                                   Call Action_Buttons ( "Daemon Control All" )
550
                                 Else 
551
                                   Call Action_Buttons ( "Daemon Control All Disabled" )
552
                                 End If
553
                               Else
554
                                 %>&nbsp<%
555
                               End If
556
                             %>
557
                             </td>
558
                           </tr>
559
                           <%
560
                             rsQry.Close()
561
                             Set rsQry = nothing
562
                           %>
127 ghuddy 563
                        </table>
564
                     </td>
565
                     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
121 hknight 566
                  </tr>
567
                  <tr>
127 ghuddy 568
                     <input type="hidden" name="action" value="true">
569
                     <%=objPMod.ComposeHiddenTags()%>
570
                     <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
571
                     <td background="images/lbox_bg_blue.gif"></td>
572
                     <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 573
                  </tr>
127 ghuddy 574
               </table>
147 ghuddy 575
 
576
               <table width="10" border="0" cellspacing="0" cellpadding="0">
577
                  <tr>
578
                     <td width="1%"></td>
579
                     <td width="100%">
580
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
581
                           <tr>
582
                              <td nowrap class="form_ttl"><p>&nbsp;</p>
583
                                 <p>DAEMON INSTRUCTIONS FOR THIS RELEASE</p>
584
                              </td>
585
                              <td align="right" valign="bottom"></td>
586
                           </tr>
587
                        </table>
588
                     </td>
589
                     <td width="1%"></td>
590
                  </tr>
591
                  <tr>
592
                     <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
593
                     <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
594
                     <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
595
                  </tr>
596
                  <tr>
597
                     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
598
                     <td bgcolor="#FFFFFF" valign="top">
599
                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
600
                           <tr>
601
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">OPERATION</td>
602
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">PACKAGE</td>
603
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">VERSION</td>
604
                              <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>
605
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">REPEAT</td>
606
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">IN PROGRESS</td>
607
                           </tr>
608
                           <%
609
                           Dim PkgId
610
                           Dim PkgVersion
611
                           Dim UserName
612
                           Dim UserEmail
613
                           Dim bInProgress
614
                           Dim bIsOverdue
615
                           Dim bIsReady
616
 
617
                           Set rsQry = OraDatabase.DbCreateDynaset( "SELECT DAEMON_INSTRUCTIONS_ID,"&_
618
                                                                  "       OP_CODE,"&_
619
                                                                  "       RTAG_ID,"&_
620
                                                                  "       PV_ID,"&_
621
                                                                  "       SCHEDULED_DATETIME,"&_
622
                                                                  "       REPEAT_SECS,"&_
623
                                                                  "       ADDED_DATETIME,"&_
624
                                                                  "       USER_ID,"&_
625
                                                                  "       IN_PROGRESS,"&_
626
                                                                  "       (CASE WHEN SCHEDULED_DATETIME <= SYSDATE THEN 1 ELSE 0 END) AS READY,"&_
627
                                                                  "       (CASE WHEN (SCHEDULED_DATETIME + (1/144)) < SYSDATE THEN 1 ELSE 0 END) AS OVERDUE"&_
628
                                                                  "  FROM DAEMON_INSTRUCTIONS "&_
629
                                                                  "  WHERE RTAG_ID = "& parRtagId &_
630
                                                                  "  ORDER BY PV_ID, SCHEDULED_DATETIME, DAEMON_INSTRUCTIONS_ID", ORADYN_DEFAULT )
631
                           While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
632
 
633
                              If IsNull(rsQry("IN_PROGRESS")) OR rsQry("IN_PROGRESS") = "0" Then
634
                                 bInProgress = False
635
                              Else
636
                                 bInProgress = True
637
                              End If
638
 
639
                              ' only flag as overdue if time threshold has been met but the daemon has not marked the instruction as being in progress.
640
                              If rsQry("OVERDUE") AND NOT bInProgress Then
641
                                 bIsOverdue = True
642
                              Else
643
                                 bIsOverdue = False
644
                              End If
645
 
646
                              If rsQry("READY") Then
647
                                 bIsReady = True
648
                              Else
649
                                 bIsReady = False
650
                              End If
651
 
652
                              ' Get as much info about the package as we can
653
                              PkgId = 0
654
                              PkgName = "N/A"
655
                              PkgVersion = "N/A"
656
                              If (NOT IsNull(rsQry("PV_ID"))) AND (rsQry("PV_ID") <> "") Then
657
                                 Call Get_Pkg_Short_Info(rsQry("PV_ID"), PkgId, PkgName, PkgVersion, NULL, NULL, NULL)
658
                              End If
659
 
660
                              %>
661
                              <tr>
662
 
663
                                 <td align="left" valign="top" class="body_txt">
664
                                    <%=DaemonInstructionOperationName(rsQry("OP_CODE"))%>
665
                                 </td>
666
 
667
                                 <td align="left" valign="top" class="body_txt">
668
                                    <%If (NOT IsNull(rsQry("PV_ID"))) AND (rsQry("PV_ID") <> "") Then%>
669
                                       <a href='fixed_issues.asp?rtag_id=<%=rsQry("RTAG_ID")%>&pv_id=<%=rsQry("PV_ID")%>'><%=PkgName%>
670
                                    <%Else%>
671
                                       <%=PkgName%>
672
                                    <%End If%>
673
                                 </td>
674
 
675
                                 <td align="left" valign="top" class="body_txt">
676
                                    <%=PkgVersion%>
677
                                 </td>
678
 
679
                                 <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>
680
 
681
                                 <td align="left" valign="top" class="body_txt"><%=DaemonInstructionRepeatString(rsQry("OP_CODE"), rsQry("REPEAT_SECS"))%></td>
682
 
683
                                 <td align="left" valign="top" class="body_txt">
684
                                    <%If bInProgress Then%>
685
                                       YES
686
                                    <%Else%>
687
                                       NO
688
                                    <%End If%>
689
                                 </td>
690
                              </tr>
691
                              <tr>
692
                                 <td colspan="6" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
693
                              </tr>
694
                              <%
695
                              rsQry.MoveNext()
696
                           Wend
697
                           rsQry.Close()
698
                           Set rsQry = nothing
699
                           %>
700
                        </table>
701
                     </td>
702
                     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
703
                  </tr>
704
                  <tr>
705
                     <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
706
                     <td background="images/lbox_bg_blue.gif"></td>
707
                     <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
708
                  </tr>
709
               </table>
710
 
127 ghuddy 711
            </td>
712
            <td width="1" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
713
         </tr>
714
         <tr>
715
            <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>
716
            <td background="images/bg_lght_gray.gif" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="350"></td>
717
         </tr>
718
      </table>
719
      <!-- FOOTER -->
720
      <!--#include file="_footer.asp"-->
721
   </body>
119 ghuddy 722
</html>
723
<%
724
Call Destroy_All_Objects
725
%>