Subversion Repositories DevTools

Rev

Rev 5506 | Rev 5623 | 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
'=====================================================
4
'|                                                   |
5
'|              Build Status Information             |
6
'|                                                   |
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," &_
184
                      "       TO_CHAR(rl.LAST_BUILD, 'HH:MM:SS PM') as last_build_hours," &_
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.
250
      Response.Redirect(ScriptName & "?rtag_id=" & parRtagId)
251
    Else
252
      Call OpenInWindow ( "dependencies.asp?rtag_id="& parRtagId )
253
    End If
254
  End If
255
 
256
End If
257
 
258
'----------------------------------------------
259
%>
260
<script language="JavaScript" type="text/JavaScript">
261
 
262
window.addEventListener ?
263
window.addEventListener("load",InitShow,false) :
264
window.attachEvent && window.attachEvent("onload",InitShow);
265
 
266
function InitShow(e)
267
{
268
    toggleDispClass('rootCause',0);
269
    toggleDispClass('rootNoEnv',0);
270
    toggleDispClass('rootFile',0);
271
    toggleDispClass('rootIndirect',0);
272
    toggleDispClass('manualCause',0);
273
}
274
 
275
function toggleDispClass(cname,flip)
276
{
277
    var cookieName = 'RELMGR_BUILDSTATUS';
278
    var cv = JSON.parse(getCookie(cookieName));
279
    if (!cv)
280
        cv = new Object;
281
    if (!cv.BuildStatus)
282
        cv.BuildStatus = new Object;
283
 
284
    var state = cv.BuildStatus[cname];
285
    if (state === undefined)
286
        state = true;
287
 
288
    if (flip>0)
289
        state = !state;
290
 
291
    cv.BuildStatus[cname] = state;
292
 
293
    // Reflect the current state in the checkbox
294
    var de = document.getElementById(cname);
295
    if (de)
296
        de.checked = state;
297
 
298
    var elements = new Array();
299
    elements = getElementsByClassName(cname);
300
    for(i in elements ){
301
        if (state) {
302
            elements[i].style.display = "";
303
        }
304
        else {
305
            elements[i].style.display = "none";
306
        }
307
    }
308
    setCookie(cookieName, JSON.stringify(cv), 365 );
309
}
310
 
311
</script>
312
 
313
<html>
314
   <head>
315
      <title>Release Manager</title>
316
      <link rel="shortcut icon" href="<%=FavIcon%>"/>
317
      <meta http-equiv="Pragma" content="no-cache">
318
      <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
319
      <link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
320
      <link rel="stylesheet" href="images/navigation.css" type="text/css">
321
      <script language="JavaScript" src="images/common.js"></script>
322
      <!--#include file="_jquery_includes.asp"-->
323
      <!-- TIPS -->
324
      <script type="text/javascript" src="scripts/json2.js"></script>
325
      <script language="JavaScript" src="images/tipster.js"></script>
326
      <script language="JavaScript" src="images/_help_tips.js"></script>
327
      <script language="JavaScript" type="text/JavaScript">
328
      formTips.tips.h_shedtime       = stdTip(200, 'Color Code', '<SPAN style=color:Red>Red</SPAN> = overdue<br><SPAN style=color:Green>Green</SPAN> = ready' );
329
      </script>
330
      <!-- DROPDOWN MENUS -->
331
      <!--#include file="_menu_def.asp"-->
332
      <script language="JavaScript1.2" src="images/popup_menu.js"></script>
333
   </head>
334
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="isChecked('pv_id_list','submit');">
335
      <!-- MENU LAYERS -------------------------------------->
336
      <div id="popmenu" class="menuskin" onmouseover="clearhidemenu();highlightmenu(event,'on')" onmouseout="highlightmenu(event,'off');dynamichide(event)"></div>
337
      <!-- TIPS LAYERS -------------------------------------->
338
      <div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
339
      <!----------------------------------------------------->
340
      <!-- HEADER -->
341
      <!--#include file="_header.asp"-->
342
      <!-- BODY ---->
343
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
344
         <tr>
345
            <td width="1" background="images/bg_home_orange.gif" valign="top"></td>
346
            <td width="100%" rowspan="1" align="center" valign="top" bgcolor="#EEEFEF">
347
               <!-- FORM START -->
348
               <%
349
               objFormComponent.FormName = "FormName"
350
               objFormComponent.Action = ScriptName &"?rtag_id="& parRtagId
351
               Call objFormComponent.FormStart()
352
               %>
353
               <table width="10" border="0" cellspacing="0" cellpadding="0">
354
                  <tr>
355
                     <td width="1%"></td>
356
                     <td width="100%">
357
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
358
                           <tr>
359
                              <td nowrap class="body_txt"></td>
360
                           </tr>
361
                        </table>
362
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
363
                           <tr>
364
                              <td nowrap class="form_ttl"><p>&nbsp;</p>
365
                                 <p>BUILD STATUS INFORMATION</p>
366
                              </td>
367
                              <td align="right" valign="bottom"></td>
368
                           </tr>
369
                        </table>
370
                     </td>
371
                     <td width="1%"></td>
372
                  </tr>
373
                  <tr>
374
                     <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
375
                     <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
376
                     <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
377
                  </tr>
378
                  <tr>
379
                     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
380
                     <td bgcolor="#FFFFFF" valign="top">
381
                        <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
382
                        <!--#include file="messages/_msg_inline.asp"-->
383
                        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
384
                        <br>
385
                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
386
                        <tr><td colspan=4 class='err_alert'>
387
                              <font size='2'><b>Packages Excluded From Build</b></font>
388
                           </td>
389
                           </tr>
390
                           <td></td>
391
                           <td  colspan=3 class="body_row">
392
                           <fieldset class="fset" align="right" style=" border: 1px groove; ">
393
                                Show
394
                                <input type="checkbox" checked value=0 name="showManual"   id="manualCause"   onClick="toggleDispClass('manualCause',1);">Manual Exclusions
395
                                <input type="checkbox" checked value=0 name="showCause"    id="rootCause"     onClick="toggleDispClass('rootCause',1);">Config Errors
396
                                <input type="checkbox" checked value=0 name="showNoEnv"    id="rootNoEnv"     onClick="toggleDispClass('rootNoEnv',1);">Env Errors
397
                                <input type="checkbox" checked value=0 name="showFile"     id="rootFile"      onClick="toggleDispClass('rootFile',1);">Build Errors
398
                                <input type="checkbox" checked value=0 name="showIndirect" id="rootIndirect"  onClick="toggleDispClass('rootIndirect',1);">Indirect Exclusions
399
                           </fieldset>
400
                           </td>
401
                           </tr>
402
 
403
                           <tr>
404
                              <td background="images/bg_table_col.gif" class="err_alert"><b>Directly</b></td>
405
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Package</td>
406
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Version</td>
407
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Root Cause</td>
408
                           </tr>
409
                           <tr>
410
                           <%
411
                           query_string = " select pkg.pkg_name, pv.pkg_version, pv.pv_id, dnr.rtag_id, dnr.root_cause, dnr.root_file, pv.pv_description"&_
412
                                          "   from do_not_ripple dnr, package_versions pv, packages pkg"&_
413
                                          "  where dnr.rtag_id = "& parRtagId &_
414
                                          "    and pv.pv_id    = dnr.pv_id"&_
415
                                          "    and pkg.pkg_id  = pv.pkg_id"&_
416
                                          "    and dnr.root_pv_id is null"&_
417
                                          "  order by pkg_name"
418
                           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
419
                           '--- Render rows ---
420
                           Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
421
                            Dim rowClass
422
                            Dim rowData
423
                            '
424
                            ' Manually excluded packages have no root_cause or root_file or root_pv_id
425
                            '
426
                            ' root_file, if supplied, indicates a build failure log file exists
427
                            ' this should always prevail over the textual root_cause
428
                            '
429
                            If (IsNull(rsQry("root_file")) AND IsNull(rsQry("root_cause"))) Then
430
                                rowData = "Manually Excluded"
431
                                rowClass = "manualCause"
432
 
433
                            ElseIf IsNull(rsQry("root_file")) Then
434
                               rowData = rsQry("root_cause")
435
                               If InStr(rowData, "no build env") Then
436
                                   rowClass = "rootNoEnv"
437
                               Else
438
                                   rowClass = "rootCause"
439
                               End If
440
 
441
                            Else
442
                                rowClass = "rootFile"
443
                                rowData = "<a class=""txt_linked"" title=""" & rsQry("root_file") &_
444
                                          " Log file may have expired."" " &_
445
                                          "href=""" & shref_base & rsQry("root_file") & """>" &_
446
                                          "Build Failure Log File</a>"
447
                            End If
448
                           %>
449
                              <tr class="<%=rowClass%>">
450
                                 <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
451
                              </tr>
452
                              <tr class="<%=rowClass%>">
453
                                 <td nowrap width="1%">
454
                                    <!-- The use of the isChecked() javascript function below, enables the submit button if any checkboxes are checked, -->
455
                                    <!-- else it will disable the submit button. The function is badly named, but nevertheless, that is what it does.   -->
456
                                    <a name="PkgName_<%=rsQry("pkg_name")%>">
457
                                    <input type="checkbox" value="<%=rsQry("pv_id")%>" name="pv_id_list" id="pv_id_list" onClick="isChecked('pv_id_list','IncludeSubmit');">
458
                                    </a>
459
                                 </td>
460
                                 <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>
461
                                 <td nowrap class="body_rowg"><%=rsQry("pkg_version")%></td>
462
                                 <td nowrap class="body_rowg"><%=rowData%></td>
463
                              </tr>
464
                           <%
465
                            rsQry.MoveNext
466
                           Loop%>
467
                           <tr>
468
                              <td background="images/bg_table_col.gif" class="err_alert"><b>Indirectly</b></td>
469
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Package</td>
470
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Version</td>
471
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Root Cause Package</td>
472
                           </tr>
473
                           <%
474
                           query_string = " select pv.pv_id, pkg.pkg_name, pv.pkg_version, qkg.pkg_name, dnr.rtag_id, pv.pv_description"&_
475
                                          "   from do_not_ripple dnr, package_versions pv, package_versions qv, packages pkg, packages qkg"&_
476
                                          "  where dnr.rtag_id = "& parRtagId &_
477
                                          "    and pv.pv_id    = dnr.pv_id"&_
478
                                          "    and pkg.pkg_id  = pv.pkg_id"&_
479
                                          "    and qv.pv_id    = dnr.root_pv_id"&_
480
                                          "    and qkg.pkg_id  = qv.pkg_id"&_
481
                                          "    and dnr.root_pv_id is not null"&_
482
                                          "  order by pkg.pkg_name"
483
                           Dim rsQry2
484
                           Set rsQry2 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
485
                           '--- Render rows ---
486
                           Do While (NOT rsQry2.BOF) AND (NOT rsQry2.EOF)%>
487
                              <tr class="rootIndirect">
488
                                 <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
489
                              </tr>
490
                              <tr class="rootIndirect">
491
 
492
                                 <td nowrap width="1%">
493
                                    <input type="checkbox" value=0 disabled=true name="notused" id="notused">
494
                                 </td>
495
                                 <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>
496
                                 <td nowrap class="body_rowg"><%=rsQry2(2)%></td>
497
                                 <td nowrap class="body_rowg"><a href="#PkgName_<%=rsQry2(3)%>" style="text-decoration: none;">&raquo;&nbsp;<%=rsQry2(3)%></a></td>
498
                              </tr>
499
                              <%
500
                              rsQry2.MoveNext
501
                           Loop%>
502
                        </table>
503
                     </td>
504
                     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
505
                  </tr>
506
                  <%If rsQry.RecordCount > 0 Then%>
507
                     <tr>
508
                        <td background="images/bg_action_norm.gif"></td>
509
                        <td align="right" background="images/bg_action_norm.gif">
510
                           <%
511
                           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'})""" ))
512
                           Response.Write(objPMod.ComposeHiddenTags())
513
                           %>
514
                        </td>
515
                        <td background="images/bg_action_norm.gif"><img src="images/h_trsp_dot.gif" width="5" height="30"></td>
516
                     </tr>
517
                  <%End If%>
518
                  <tr>
519
                     <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
520
                     <td background="images/lbox_bg_blue.gif"></td>
521
                     <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
522
                  </tr>
523
               </table>
524
               <!-- ACTION BUTTONS ---------------------------------------------->
525
               <input type="hidden" name="action" value="include">
526
               <!-- ACTION BUTTONS END  ------------------------------------------>
527
               <%Call objFormComponent.FormEnd()%>
528
               <!-- FORM END ----------------------------------------------------->
529
            </td>
530
            <td width="1" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
531
         </tr>
532
         <%
533
         rsQry.Close()
534
         Set rsQry = nothing
535
         rsQry2.Close()
536
         Set rsQry2 = nothing
537
         %>
538
         <tr>
539
            <td width="1" background="images/bg_home_orange.gif" valign="top"></td>
540
            <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
541
               <table width="10" border="0" cellspacing="0" cellpadding="0">
542
                  <tr>
543
                     <td width="1%"></td>
544
                     <td width="100%">
545
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
546
                           <tr>
547
                              <td nowrap class="form_ttl"><p>&nbsp;</p>
548
                                 <p>DAEMON STATUS INFORMATION</p>
549
                              </td>
550
                              <td  valign="bottom" class="body_rowg">
551
                                Last Build: <%=GetLastBuildAge(parRtagId)%>
552
                                 [<%=GetModifiedSeqNo(parRtagId)%>]
553
                              </td>
554
                              <td align="right" valign="bottom">
555
                                <a class="txt_linked" href="build_status.asp?rtag_id=<%=parRtagId%>" title="Refresh Page">[Refresh]</a></td>
556
                              </td>
557
                           </tr>
558
                        </table>
559
                     </td>
560
                     <td width="1%"></td>
561
                  </tr>
562
                  <tr>
563
                     <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
564
                     <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
565
                     <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
566
                  </tr>
567
                  <tr>
568
                     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
569
                     <td bgcolor="#FFFFFF" valign="top">
570
                        <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
571
                        <!--#include file="messages/_msg_inline.asp"-->
572
                        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
573
                        <br>
574
                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
575
                           <%
576
                           Dim indefinitelyPaused
577
                           indefinitelyPaused = FALSE
578
                           ' Insert a warning into the page if the build daemons are indefintely paused.
579
                           query_string = " select * from run_level_schedule rls where rls.indefinite_pause = 'P'"
580
 
581
                           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
582
                           If rsQry.RecordCount > 0 Then
583
                              indefinitelyPaused = TRUE %>
584
                              <tr>
585
                                 <span class='err_alert'>
586
                                    <font size='2'><b>WARNING: Build Daemons are all stopped - please contact an administrator</b></font>
587
                                 </span>
588
                              </tr>
589
                           <%End If
590
 
591
                           rsQry.Close()
592
                           Set rsQry = nothing
593
                           %>
594
                           <td width="9%" valign="top"></td>
595
                           <tr>
596
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Daemon Host</td>
597
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Machine Type</td>
598
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Mode</td>
599
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Run Level</td>
600
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Current Package</td>
601
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Last Change<br>Delta (secs)</td>
602
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Control State</td>
603
                           </tr>
604
                           <%
605
                           ' Get the number of release configurations for this RTAG_ID, and iterate through them
606
                           query_string = " select * from release_config rc, gbe_machtype gm, build_machine_config bm"&_
607
                                          "  where rc.rtag_id = "& parRtagId &_
608
                                          "    and gm.gbe_id = rc.gbe_id"&_
609
                                          "    and rc.bmcon_id=bm.bmcon_id(+)" &_
610
                                          "  order by bm.display_name, rc.rcon_id"
611
 
612
                           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
613
 
614
                           Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
615
                              rcon_id = rsQry("rcon_id")
616
 
617
                              Dim pkgName
618
                              Dim pkgPvid
619
                              Dim currentRunLevel
620
                              Dim daemonState
621
                              Dim delta
622
                              Dim pkgId
623
 
624
                              ' For this release configuration, get its entry from the run_level table. This table may not
625
                              ' have an entry so we must handle that outcome too.
626
                              query_string = " select rl.pause, rl.current_run_level, rl.current_pkg_id_being_built, "&_
627
                                             "        TRUNC (86400*(SYSDATE - rl.KEEP_ALIVE)) as delta" &_
628
                                             "   from run_level rl"&_
629
                                             "  where rl.rcon_id = "& rcon_id
630
 
631
                              Set rsQry2 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
632
 
633
                              currentRunLevel = -1
634
                              pkgId = Null
635
                              pkgName = NULL
636
                              pkgPvid = NULL
637
                              daemonState = 0
638
                              delta = NULL
639
 
640
                              If (rsQry2.RecordCount > 0) Then
641
                                ' Get the run level from the run_level table
642
                                currentRunLevel = rsQry2("current_run_level")
643
                                pkgId = rsQry2("current_pkg_id_being_built")
644
 
645
                                daemonState = rsQry2("pause")
646
                                If IsNull(daemonState) Then daemonState = 0
647
                                If daemonState = "2" Then pkgId = Null
648
 
649
                                delta = rsQry2("delta")
650
                              End If
651
 
652
                              ' If we got an entry from the run_level table, try and use the pkg_id it contains, to obtain a
653
                              ' package name from the packages table
654
                              Dim rsQry3
655
                              If NOT IsNull(pkgId) Then
656
                                 query_string = " select pkg_name,rl.current_pv_id from run_level rl, packages pk"&_
657
                                                "  where rl.rcon_id = "& rcon_id &_
658
                                                "   and  rl.current_pkg_id_being_built = pk.pkg_id"
659
 
660
                                 Set rsQry3 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
661
                                 If (rsQry3.RecordCount > 0) Then
662
                                    pkgName = rsQry3("pkg_name")
663
                                    pkgPvid = rsQry3("current_pv_id")
664
                                 End If
665
                                 rsQry3.Close()
666
                                 Set rsQry3 = nothing
667
                              End If
668
 
669
                              ' --- Now render HTML for this release configuration ---
670
                              %>
671
                              <tr>
672
                                 <td colspan="7" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
673
                              </tr>
674
                              <tr>
675
                                 <td nowrap class="body_rowg"><%=rsQry("display_name")%></td>
676
                                 <td nowrap class="body_rowg"><%=rsQry("gbe_value")%></td>
677
                                 <td nowrap class="body_rowg"><%=Get_Daemon_Mode(rsQry("daemon_mode"))%></td>
678
                                 <td nowrap class="body_rowg"><%=Get_Run_Level(currentRunLevel, indefinitelyPaused,daemonState)%></td>
679
                                 <td nowrap class="body_rowg"><%=Get_Package_Name(pkgName,parRtagId,pkgPvid)%></td>
680
                                 <td nowrap class="body_rowg"><%=PrettyDelta(delta, daemonState,pkgName )%></td>
681
                                 <td nowrap class="body_rowg">
682
                                    <%
683
                                    If (rsQry2.RecordCount > 0) AND NOT indefinitelyPaused  Then
684
                                       If objAccessControl.UserLogedIn AND canActionControlInProject("BuildControl") Then
685
                                          If daemonState = 0 Then
686
                                             Call Action_Buttons ( "Daemon Pause" )
687
                                          ElseIf daemonState = 1 Then
688
                                             Call Action_Buttons ( "Daemon Resume" )
689
                                          ElseIf daemonState = 2 Then
690
                                             Call Action_Buttons ( "Daemon Start" )
691
                                          Else
692
                                             Call Action_Buttons ( "Daemon Resume" )
693
                                          End If
694
                                       Else
695
                                          If daemonState = 0 Then
696
                                             Call Action_Buttons ( "Daemon Pause Disabled" )
697
                                          ElseIf daemonState = 1 Then
698
                                             Call Action_Buttons ( "Daemon Resume Disabled" )
699
                                          ElseIf daemonState = 2 Then
700
                                             Call Action_Buttons ( "Daemon Start Disabled" )
701
                                          Else
702
                                             Call Action_Buttons ( "Daemon Resume Disabled" )
703
                                          End If
704
                                       End If
705
                                    Else
706
                                       %>Unavailable<%
707
                                    End If
708
                                    %>
709
                                 </td>
710
                              </tr>
711
                              <%
712
                              rsQry2.Close()
713
                              Set rsQry2 = nothing
714
                              rsQry.MoveNext
715
                           Loop
716
                           %>
717
                           <tr>
718
                             <td valign="bottom" 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" nowrap background="images/bg_table_col.gif" class="body_col"></td>
721
                             <td valign="bottom" 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"></td>
724
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col">
725
                             <%
726
                               If (rsQry.RecordCount > 0) AND NOT indefinitelyPaused  Then
727
                                 If objAccessControl.UserLogedIn AND canActionControlInProject("BuildControl") Then
728
                                   Call Action_Buttons ( "Daemon Control All" )
729
                                 Else 
730
                                   Call Action_Buttons ( "Daemon Control All Disabled" )
731
                                 End If
732
                               Else
733
                                 %>&nbsp<%
734
                               End If
735
                             %>
736
                             </td>
737
                           </tr>
738
                           <%
739
                             rsQry.Close()
740
                             Set rsQry = nothing
741
                           %>
742
                        </table>
743
                     </td>
744
                     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
745
                  </tr>
746
                  <tr>
747
                     <input type="hidden" name="action" value="true">
748
                     <%=objPMod.ComposeHiddenTags()%>
749
                     <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
750
                     <td background="images/lbox_bg_blue.gif"></td>
751
                     <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
752
                  </tr>
753
               </table>
754
 
755
               <!-- Daemon Instructions Display -->
756
               <table width="10" border="0" cellspacing="0" cellpadding="0">
757
                  <tr>
758
                     <td width="1%"></td>
759
                     <td width="100%">
760
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
761
                           <tr>
762
                              <td nowrap class="form_ttl"><p>&nbsp;</p>
763
                                 <p>DAEMON INSTRUCTIONS FOR THIS RELEASE</p>
764
                              </td>
765
                              <td align="right" valign="bottom"></td>
766
                           </tr>
767
                        </table>
768
                     </td>
769
                     <td width="1%"></td>
770
                  </tr>
771
                  <tr>
772
                     <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
773
                     <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
774
                     <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
775
                  </tr>
776
                  <tr>
777
                     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" ></td>
778
                     <td bgcolor="#FFFFFF" valign="top">
779
                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
780
                           <tr>
781
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Operation</td>
782
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Package</td>
783
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Version</td>
784
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Scheduled Time<%=Quick_Help("h_shedtime")%>
785
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Repeat</td>
786
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">In Progress</td>
787
                           </tr>
788
                           <%
789
                           Dim PkgVersion
790
                           Dim UserName
791
                           Dim UserEmail
792
                           Dim bInProgress
793
                           Dim bIsOverdue
794
                           Dim bIsReady
795
 
796
                           Set rsQry = OraDatabase.DbCreateDynaset( "SELECT DAEMON_INSTRUCTIONS_ID,"&_
797
                                                                  "       OP_CODE,"&_
798
                                                                  "       RTAG_ID,"&_
799
                                                                  "       PV_ID,"&_
800
                                                                  "       SCHEDULED_DATETIME,"&_
801
                                                                  "       REPEAT_SECS,"&_
802
                                                                  "       ADDED_DATETIME,"&_
803
                                                                  "       USER_ID,"&_
804
                                                                  "       IN_PROGRESS,"&_
805
                                                                  "       (CASE WHEN SCHEDULED_DATETIME <= SYSDATE THEN 1 ELSE 0 END) AS READY,"&_
806
                                                                  "       (CASE WHEN (SCHEDULED_DATETIME + (1/144)) < SYSDATE THEN 1 ELSE 0 END) AS OVERDUE"&_
807
                                                                  "  FROM DAEMON_INSTRUCTIONS "&_
808
                                                                  "  WHERE RTAG_ID = "& parRtagId &_
809
                                                                  "  ORDER BY PV_ID, SCHEDULED_DATETIME, DAEMON_INSTRUCTIONS_ID", ORADYN_DEFAULT )
810
                           While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
811
 
812
                              If IsNull(rsQry("IN_PROGRESS")) OR rsQry("IN_PROGRESS") = "0" Then
813
                                 bInProgress = False
814
                              Else
815
                                 bInProgress = True
816
                              End If
817
 
818
                              ' only flag as overdue if time threshold has been met but the daemon has not marked the instruction as being in progress.
819
                              If rsQry("OVERDUE") AND NOT bInProgress Then
820
                                 bIsOverdue = True
821
                              Else
822
                                 bIsOverdue = False
823
                              End If
824
 
825
                              If rsQry("READY") Then
826
                                 bIsReady = True
827
                              Else
828
                                 bIsReady = False
829
                              End If
830
 
831
                              ' Get as much info about the package as we can
832
                              PkgId = 0
833
                              PkgName = "N/A"
834
                              PkgVersion = "N/A"
835
                              If (NOT IsNull(rsQry("PV_ID"))) AND (rsQry("PV_ID") <> "") Then
836
                                 Call Get_Pkg_Short_Info(rsQry("PV_ID"), PkgId, PkgName, PkgVersion, NULL, NULL, NULL)
837
                              End If
838
 
839
                              %>
840
                              <tr>
841
 
842
                                 <td align="left" valign="top" class="body_txt">
843
                                    <%=DaemonInstructionOperationName(rsQry("OP_CODE"))%>
844
                                 </td>
845
 
846
                                 <td align="left" valign="top" class="body_txt">
847
                                    <%If (NOT IsNull(rsQry("PV_ID"))) AND (rsQry("PV_ID") <> "") Then%>
848
                                       <a href='fixed_issues.asp?rtag_id=<%=rsQry("RTAG_ID")%>&pv_id=<%=rsQry("PV_ID")%>'><%=PkgName%>
849
                                    <%Else%>
850
                                       <%=PkgName%>
851
                                    <%End If%>
852
                                 </td>
853
 
854
                                 <td align="left" valign="top" class="body_txt">
855
                                    <%=PkgVersion%>
856
                                 </td>
857
 
858
                                 <td align="left" valign="top" class="body_txt" <%If bIsOverdue Then%>style=color:Red<%Elseif bIsReady Then%>style=color:Green<%End If%>><%=EuroDateTime(rsQry("SCHEDULED_DATETIME"))%></td>
859
 
860
                                 <td align="left" valign="top" class="body_txt"><%=DaemonInstructionRepeatString(rsQry("OP_CODE"), rsQry("REPEAT_SECS"))%></td>
861
 
862
                                 <td align="left" valign="top" class="body_txt">
863
                                    <%If bInProgress Then%>
864
                                       YES
865
                                    <%Else%>
866
                                       NO
867
                                    <%End If%>
868
                                 </td>
869
                              </tr>
870
                              <tr>
871
                                 <td colspan="6" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
872
                              </tr>
873
                              <%
874
                              rsQry.MoveNext()
875
                           Wend
876
                           rsQry.Close()
877
                           Set rsQry = nothing
878
                           %>
879
                        </table>
880
                     </td>
881
                     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
882
                  </tr>
883
                  <tr>
884
                     <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
885
                     <td background="images/lbox_bg_blue.gif"></td>
886
                     <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
887
                  </tr>
888
               </table>
889
 
890
            </td>
891
            <td width="1" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
892
         </tr>
893
         <tr>
894
            <td valign="bottom" align="center" background="images/bg_home_orange.gif">
895
                <img src="images/img_gear.gif" width="86" height="99" vspace="20" hspace="30">
896
            </td>
897
            <td background="images/bg_lght_gray.gif" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="350">
898
            </td>
899
         </tr>
900
      </table>
901
      <!-- FOOTER -->
902
      <!--#include file="_footer.asp"-->
903
   </body>
904
</html>
905
<%
906
Call Destroy_All_Objects
907
%>