Subversion Repositories DevTools

Rev

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