Subversion Repositories DevTools

Rev

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