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