Subversion Repositories DevTools

Rev

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

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