Subversion Repositories DevTools

Rev

Rev 6538 | Rev 6545 | 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>
6544 dpurdie 198
    <script language="JavaScript" type="text/JavaScript">
199
    $(document).ready(function() {
200
        // Attach function to toggle checkbox
201
        // toggle all visible checkboxes
202
         $('#toggleDirect').click(function(){
203
            var state = this.checked;
204
            var list = $('.directInclude:visible');
205
            list.prop('checked', state);
206
            isChecked('pv_id_list','IncludeSubmit');
207
         });
208
    });
209
    </script>
5357 dpurdie 210
      <!-- DROPDOWN MENUS -->
211
      <!--#include file="_menu_def.asp"-->
212
      <script language="JavaScript1.2" src="images/popup_menu.js"></script>
213
   </head>
214
   <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="isChecked('pv_id_list','submit');">
215
      <!-- HEADER -->
216
      <!--#include file="_header.asp"-->
217
      <!-- BODY ---->
218
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
219
         <tr>
6175 dpurdie 220
            <td width="146px" class="panel_bg" valign="top"><%Call BuildMenuPane%></td>
5357 dpurdie 221
            <td width="100%" rowspan="1" align="center" valign="top" bgcolor="#EEEFEF">
222
               <!-- FORM START -->
223
               <%
224
               objFormComponent.FormName = "FormName"
225
               objFormComponent.Action = ScriptName &"?rtag_id="& parRtagId
226
               Call objFormComponent.FormStart()
227
               %>
228
               <table width="10" border="0" cellspacing="0" cellpadding="0">
229
                  <tr>
230
                     <td width="1%"></td>
231
                     <td width="100%">
232
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
233
                           <tr>
234
                              <td nowrap class="body_txt"></td>
235
                           </tr>
236
                        </table>
237
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
238
                           <tr>
239
                              <td nowrap class="form_ttl"><p>&nbsp;</p>
240
                                 <p>BUILD STATUS INFORMATION</p>
241
                              </td>
242
                              <td align="right" valign="bottom"></td>
243
                           </tr>
244
                        </table>
245
                     </td>
246
                     <td width="1%"></td>
247
                  </tr>
248
                  <tr>
249
                     <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
250
                     <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
251
                     <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
252
                  </tr>
253
                  <tr>
254
                     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
255
                     <td bgcolor="#FFFFFF" valign="top">
256
                        <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
257
                        <!--#include file="messages/_msg_inline.asp"-->
258
                        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
259
                        <br>
260
                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
261
                        <tr><td colspan=4 class='err_alert'>
262
                              <font size='2'><b>Packages Excluded From Build</b></font>
263
                           </td>
264
                           </tr>
6544 dpurdie 265
                           <td><input id="toggleDirect" type="checkbox" title="Toggle all visible directly excluded packages"></td>
266
                           <td colspan=3 class="body_row">
267
                           <fieldset class="fset" align="right" style=" border: 1px groove;">
5357 dpurdie 268
                                Show
269
                                <input type="checkbox" checked value=0 name="showManual"   id="manualCause"   onClick="toggleDispClass('manualCause',1);">Manual Exclusions
270
                                <input type="checkbox" checked value=0 name="showCause"    id="rootCause"     onClick="toggleDispClass('rootCause',1);">Config Errors
271
                                <input type="checkbox" checked value=0 name="showNoEnv"    id="rootNoEnv"     onClick="toggleDispClass('rootNoEnv',1);">Env Errors
272
                                <input type="checkbox" checked value=0 name="showFile"     id="rootFile"      onClick="toggleDispClass('rootFile',1);">Build Errors
273
                                <input type="checkbox" checked value=0 name="showIndirect" id="rootIndirect"  onClick="toggleDispClass('rootIndirect',1);">Indirect Exclusions
274
                           </fieldset>
275
                           </td>
276
                           </tr>
277
 
278
                           <tr>
279
                              <td background="images/bg_table_col.gif" class="err_alert"><b>Directly</b></td>
280
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Package</td>
281
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Version</td>
282
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Root Cause</td>
283
                           </tr>
284
                           <tr>
285
                           <%
6440 dpurdie 286
                           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 287
                                          "   from do_not_ripple dnr, package_versions pv, packages pkg"&_
288
                                          "  where dnr.rtag_id = "& parRtagId &_
289
                                          "    and pv.pv_id    = dnr.pv_id"&_
290
                                          "    and pkg.pkg_id  = pv.pkg_id"&_
6440 dpurdie 291
                                          "    and nvl(dnr.root_pv_id, -1) < 0 " &_
5357 dpurdie 292
                                          "  order by pkg_name"
293
                           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
294
                           '--- Render rows ---
295
                           Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
296
                            Dim rowClass
297
                            Dim rowData
298
                            '
299
                            ' Manually excluded packages have no root_cause or root_file or root_pv_id
300
                            '
301
                            ' root_file, if supplied, indicates a build failure log file exists
302
                            ' this should always prevail over the textual root_cause
303
                            '
304
                            If (IsNull(rsQry("root_file")) AND IsNull(rsQry("root_cause"))) Then
305
                                rowData = "Manually Excluded"
306
                                rowClass = "manualCause"
307
 
308
                            ElseIf IsNull(rsQry("root_file")) Then
309
                               rowData = rsQry("root_cause")
310
                               If InStr(rowData, "no build env") Then
311
                                   rowClass = "rootNoEnv"
312
                               Else
313
                                   rowClass = "rootCause"
314
                               End If
315
 
316
                            Else
317
                                rowClass = "rootFile"
318
                                rowData = "<a class=""txt_linked"" title=""" & rsQry("root_file") &_
319
                                          " Log file may have expired."" " &_
320
                                          "href=""" & shref_base & rsQry("root_file") & """>" &_
321
                                          "Build Failure Log File</a>"
322
                            End If
6440 dpurdie 323
 
324
                            Dim checkBoxData
325
                            If NiceInt(rsQry("root_pv_id"), -1) = -1   Then
326
                                checkBoxData = "onClick=""isChecked('pv_id_list','IncludeSubmit');"""
327
                            Else
328
                                checkBoxData = "disabled"    
329
                            End If
330
 
5357 dpurdie 331
                           %>
332
                              <tr class="<%=rowClass%>">
333
                                 <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
334
                              </tr>
335
                              <tr class="<%=rowClass%>">
336
                                 <td nowrap width="1%">
337
                                    <!-- The use of the isChecked() javascript function below, enables the submit button if any checkboxes are checked, -->
338
                                    <!-- else it will disable the submit button. The function is badly named, but nevertheless, that is what it does.   -->
339
                                    <a name="PkgName_<%=rsQry("pkg_name")%>">
6544 dpurdie 340
                                    <input class="directInclude" type="checkbox" value="<%=rsQry("pv_id")%>" name="pv_id_list" id="pv_id_list" <%=checkBoxData%>>
5357 dpurdie 341
                                    </a>
342
                                 </td>
343
                                 <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>
344
                                 <td nowrap class="body_rowg"><%=rsQry("pkg_version")%></td>
345
                                 <td nowrap class="body_rowg"><%=rowData%></td>
346
                              </tr>
347
                           <%
348
                            rsQry.MoveNext
349
                           Loop%>
350
                           <tr>
351
                              <td background="images/bg_table_col.gif" class="err_alert"><b>Indirectly</b></td>
352
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Package</td>
353
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Version</td>
354
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Root Cause Package</td>
355
                           </tr>
356
                           <%
357
                           query_string = " select pv.pv_id, pkg.pkg_name, pv.pkg_version, qkg.pkg_name, dnr.rtag_id, pv.pv_description"&_
358
                                          "   from do_not_ripple dnr, package_versions pv, package_versions qv, packages pkg, packages qkg"&_
359
                                          "  where dnr.rtag_id = "& parRtagId &_
360
                                          "    and pv.pv_id    = dnr.pv_id"&_
361
                                          "    and pkg.pkg_id  = pv.pkg_id"&_
362
                                          "    and qv.pv_id    = dnr.root_pv_id"&_
363
                                          "    and qkg.pkg_id  = qv.pkg_id"&_
6440 dpurdie 364
                                          "    and nvl(dnr.root_pv_id, -1) > 0"&_
5357 dpurdie 365
                                          "  order by pkg.pkg_name"
366
                           Dim rsQry2
367
                           Set rsQry2 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
368
                           '--- Render rows ---
369
                           Do While (NOT rsQry2.BOF) AND (NOT rsQry2.EOF)%>
370
                              <tr class="rootIndirect">
371
                                 <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
372
                              </tr>
373
                              <tr class="rootIndirect">
374
 
375
                                 <td nowrap width="1%">
376
                                    <input type="checkbox" value=0 disabled=true name="notused" id="notused">
377
                                 </td>
378
                                 <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>
379
                                 <td nowrap class="body_rowg"><%=rsQry2(2)%></td>
380
                                 <td nowrap class="body_rowg"><a href="#PkgName_<%=rsQry2(3)%>" style="text-decoration: none;">&raquo;&nbsp;<%=rsQry2(3)%></a></td>
381
                              </tr>
382
                              <%
383
                              rsQry2.MoveNext
384
                           Loop%>
385
                        </table>
386
                     </td>
387
                     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
388
                  </tr>
389
                  <%If rsQry.RecordCount > 0 Then%>
390
                     <tr>
391
                        <td background="images/bg_action_norm.gif"></td>
392
                        <td align="right" background="images/bg_action_norm.gif">
393
                           <%
394
                           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'})""" ))
395
                           Response.Write(objPMod.ComposeHiddenTags())
396
                           %>
397
                        </td>
398
                        <td background="images/bg_action_norm.gif"><img src="images/h_trsp_dot.gif" width="5" height="30"></td>
399
                     </tr>
400
                  <%End If%>
401
                  <tr>
402
                     <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
403
                     <td background="images/lbox_bg_blue.gif"></td>
404
                     <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
405
                  </tr>
406
               </table>
407
               <!-- ACTION BUTTONS ---------------------------------------------->
408
               <input type="hidden" name="action" value="include">
409
               <!-- ACTION BUTTONS END  ------------------------------------------>
410
               <%Call objFormComponent.FormEnd()%>
411
               <!-- FORM END ----------------------------------------------------->
412
            </td>
413
            <td width="1" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
414
         </tr>
415
         <%
416
         rsQry.Close()
417
         Set rsQry = nothing
418
         rsQry2.Close()
419
         Set rsQry2 = nothing
420
         %>
421
         <tr>
422
            <td width="1" background="images/bg_home_orange.gif" valign="top"></td>
423
            <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
424
               <table width="10" border="0" cellspacing="0" cellpadding="0">
425
                  <tr>
426
                     <td width="1%"></td>
427
                     <td width="100%">
428
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
429
                           <tr>
430
                              <td nowrap class="form_ttl"><p>&nbsp;</p>
431
                                 <p>DAEMON STATUS INFORMATION</p>
432
                              </td>
433
                              <td  valign="bottom" class="body_rowg">
6166 dpurdie 434
                                Last Build: <%=GetLastBuildAge(parRtagId)%> [<%=GetModifiedSeqNo(parRtagId)%>]
5357 dpurdie 435
                              </td>
436
                              <td align="right" valign="bottom">
6166 dpurdie 437
                                <a class="txt_linked" href="<%=scriptName%>?rtag_id=<%=parRtagId%>" title="Refresh Page">[Refresh]</a></td>
5357 dpurdie 438
                              </td>
439
                           </tr>
440
                        </table>
441
                     </td>
442
                     <td width="1%"></td>
443
                  </tr>
444
                  <tr>
445
                     <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
446
                     <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
447
                     <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
448
                  </tr>
449
                  <tr>
450
                     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
451
                     <td bgcolor="#FFFFFF" valign="top">
452
                        <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
453
                        <!--#include file="messages/_msg_inline.asp"-->
454
                        <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
455
                        <br>
456
                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
457
                           <%
6267 dpurdie 458
                           Dim bInactiveMachine : bInactiveMachine = false
459
                           Dim indefinitelyPaused : indefinitelyPaused = Indefinitely_Paused()
5357 dpurdie 460
                           ' Insert a warning into the page if the build daemons are indefintely paused.
6166 dpurdie 461
                           If indefinitelyPaused Then %>
5357 dpurdie 462
                              <tr>
463
                                 <span class='err_alert'>
464
                                    <font size='2'><b>WARNING: Build Daemons are all stopped - please contact an administrator</b></font>
465
                                 </span>
466
                              </tr>
467
                           <%End If
468
                           %>
469
                           <td width="9%" valign="top"></td>
470
                           <tr>
471
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Daemon Host</td>
472
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Machine Type</td>
473
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Mode</td>
474
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Run Level</td>
475
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Current Package</td>
6538 dpurdie 476
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Est Duration<%=Quick_Help("h_buildtime")%></td>
5623 dpurdie 477
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Last Change<%=Quick_Help("h_lastchange")%></td>
5357 dpurdie 478
                              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Control State</td>
479
                           </tr>
480
                           <%
481
                           ' Get the number of release configurations for this RTAG_ID, and iterate through them
6267 dpurdie 482
                           query_string = " select rc.rcon_id, display_name, gbe_value, daemon_mode, NVL(ACTIVE, 'U') as ACTIVE" &_
483
                                          " from release_config rc, gbe_machtype gm, build_machine_config bm"&_
5357 dpurdie 484
                                          "  where rc.rtag_id = "& parRtagId &_
485
                                          "    and gm.gbe_id = rc.gbe_id"&_
486
                                          "    and rc.bmcon_id=bm.bmcon_id(+)" &_
487
                                          "  order by bm.display_name, rc.rcon_id"
488
 
489
                           Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
490
 
491
                           Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
492
                              rcon_id = rsQry("rcon_id")
493
 
494
                              Dim pkgName
495
                              Dim pkgPvid
6538 dpurdie 496
                              Dim pkgBuildTime
5357 dpurdie 497
                              Dim currentRunLevel
498
                              Dim daemonState
499
                              Dim delta
500
                              Dim pkgId
6267 dpurdie 501
                              Dim bActive : bActive = rsQry("active")
6268 dpurdie 502
                              If bActive = "N" Then bInactiveMachine = true
5357 dpurdie 503
 
504
                              ' For this release configuration, get its entry from the run_level table. This table may not
505
                              ' have an entry so we must handle that outcome too.
506
                              query_string = " select rl.pause, rl.current_run_level, rl.current_pkg_id_being_built, "&_
507
                                             "        TRUNC (86400*(SYSDATE - rl.KEEP_ALIVE)) as delta" &_
508
                                             "   from run_level rl"&_
509
                                             "  where rl.rcon_id = "& rcon_id
510
 
511
                              Set rsQry2 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
512
 
513
                              currentRunLevel = -1
514
                              pkgId = Null
515
                              pkgName = NULL
516
                              pkgPvid = NULL
6538 dpurdie 517
                              pkgBuildTime = NULL
5357 dpurdie 518
                              daemonState = 0
519
                              delta = NULL
520
 
521
                              If (rsQry2.RecordCount > 0) Then
522
                                ' Get the run level from the run_level table
523
                                currentRunLevel = rsQry2("current_run_level")
524
                                pkgId = rsQry2("current_pkg_id_being_built")
525
 
526
                                daemonState = rsQry2("pause")
527
                                If IsNull(daemonState) Then daemonState = 0
528
                                If daemonState = "2" Then pkgId = Null
529
 
530
                                delta = rsQry2("delta")
6267 dpurdie 531
 
5357 dpurdie 532
                              End If
533
 
534
                              ' If we got an entry from the run_level table, try and use the pkg_id it contains, to obtain a
535
                              ' package name from the packages table
536
                              Dim rsQry3
537
                              If NOT IsNull(pkgId) Then
6538 dpurdie 538
                                 query_string = " select pkg_name,rl.current_pv_id, pv.build_time from run_level rl, packages pk, package_versions pv"&_
5357 dpurdie 539
                                                "  where rl.rcon_id = "& rcon_id &_
6538 dpurdie 540
                                                "   and  rl.current_pkg_id_being_built = pk.pkg_id" &_
541
                                                "   and  rl.current_pv_id = pv.pv_id"
5357 dpurdie 542
 
543
                                 Set rsQry3 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
544
                                 If (rsQry3.RecordCount > 0) Then
545
                                    pkgName = rsQry3("pkg_name")
546
                                    pkgPvid = rsQry3("current_pv_id")
6538 dpurdie 547
                                    pkgBuildTime = rsQry3("build_time")
5357 dpurdie 548
                                 End If
549
                                 rsQry3.Close()
550
                                 Set rsQry3 = nothing
551
                              End If
552
 
553
                              ' --- Now render HTML for this release configuration ---
554
                              %>
555
                              <tr>
6538 dpurdie 556
                                 <td colspan="8" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
5357 dpurdie 557
                              </tr>
558
                              <tr>
559
                                 <td nowrap class="body_rowg"><%=rsQry("display_name")%></td>
560
                                 <td nowrap class="body_rowg"><%=rsQry("gbe_value")%></td>
561
                                 <td nowrap class="body_rowg"><%=Get_Daemon_Mode(rsQry("daemon_mode"))%></td>
6267 dpurdie 562
                                 <td nowrap class="body_rowg"><%=Get_Run_Level(currentRunLevel, indefinitelyPaused, daemonState, bActive)%></td>
563
                                 <td nowrap class="body_rowg"><%=Get_Package_Name(pkgName,parRtagId,pkgPvid, bActive)%></td>
6538 dpurdie 564
                                 <td nowrap class="body_rowg"><%=IIF(rsQry("daemon_mode") = "M", pkgBuildTime, "")%></td>
5357 dpurdie 565
                                 <td nowrap class="body_rowg"><%=PrettyDelta(delta, daemonState,pkgName )%></td>
566
                                 <td nowrap class="body_rowg">
567
                                    <%
6166 dpurdie 568
                                    If (rsQry2.RecordCount > 0) AND NOT indefinitelyPaused  Then
5905 dpurdie 569
                                       If canActionControlInProject("BuildControl") Then
6267 dpurdie 570
                                          If bActive = "U" Then
571
                                          ElseIf bActive = "N" Then
572
                                             Call Action_Buttons ( "Daemon Unavailable" )
573
                                          ElseIf daemonState = 0 Then
5357 dpurdie 574
                                             Call Action_Buttons ( "Daemon Pause" )
575
                                          ElseIf daemonState = 1 Then
576
                                             Call Action_Buttons ( "Daemon Resume" )
577
                                          ElseIf daemonState = 2 Then
578
                                             Call Action_Buttons ( "Daemon Start" )
579
                                          Else
580
                                             Call Action_Buttons ( "Daemon Resume" )
581
                                          End If
582
                                       Else
6267 dpurdie 583
                                          If bActive = "U" Then
584
                                          ElseIf bActive = "N" Then
585
                                             Call Action_Buttons ( "Daemon Unavailable" )
586
                                          ElseIf daemonState = 0 Then
5357 dpurdie 587
                                             Call Action_Buttons ( "Daemon Pause Disabled" )
588
                                          ElseIf daemonState = 1 Then
589
                                             Call Action_Buttons ( "Daemon Resume Disabled" )
590
                                          ElseIf daemonState = 2 Then
591
                                             Call Action_Buttons ( "Daemon Start Disabled" )
592
                                          Else
593
                                             Call Action_Buttons ( "Daemon Resume Disabled" )
594
                                          End If
595
                                       End If
596
                                    Else
597
                                       %>Unavailable<%
598
                                    End If
599
                                    %>
600
                                 </td>
601
                              </tr>
602
                              <%
603
                              rsQry2.Close()
604
                              Set rsQry2 = nothing
605
                              rsQry.MoveNext
606
                           Loop
607
                           %>
608
                           <tr>
6538 dpurdie 609
                             <td nowrap background="images/bg_table_col.gif" class="body_col" colspan=7>
6267 dpurdie 610
                             <%If CheckConfigErrors(parRtagId) OR bInactiveMachine Then%><span class="err_alert">&nbsp;Daemon configuration errors detected</span>
6166 dpurdie 611
                                <a class="txt_linked" href="release_config.asp?rtag_id=<%=parRtagId%>">
612
                                    <img src="images/i_link.gif" hspace="2" border="0" align="absmiddle" title="Goto Configuration">
613
                                </a>
614
                             <%End If%>
615
                             </td>
5357 dpurdie 616
                             <td valign="bottom" nowrap background="images/bg_table_col.gif" class="body_col">
617
                             <%
6538 dpurdie 618
                               If (rsQry.RecordCount > 0) AND NOT indefinitelyPaused Then
6166 dpurdie 619
                                 If objAccessControl.UserLogedIn AND canActionControlInProject("BuildControl") Then
5357 dpurdie 620
                                   Call Action_Buttons ( "Daemon Control All" )
621
                                 Else 
622
                                   Call Action_Buttons ( "Daemon Control All Disabled" )
623
                                 End If
624
                               Else
625
                                 %>&nbsp<%
626
                               End If
627
                             %>
628
                             </td>
629
                           </tr>
630
                           <%
631
                             rsQry.Close()
632
                             Set rsQry = nothing
633
                           %>
634
                        </table>
635
                     </td>
636
                     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
637
                  </tr>
638
                  <tr>
639
                     <input type="hidden" name="action" value="true">
640
                     <%=objPMod.ComposeHiddenTags()%>
641
                     <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
642
                     <td background="images/lbox_bg_blue.gif"></td>
643
                     <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
644
                  </tr>
645
               </table>
646
 
647
               <!-- Daemon Instructions Display -->
648
               <table width="10" border="0" cellspacing="0" cellpadding="0">
649
                  <tr>
650
                     <td width="1%"></td>
651
                     <td width="100%">
652
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
653
                           <tr>
654
                              <td nowrap class="form_ttl"><p>&nbsp;</p>
655
                                 <p>DAEMON INSTRUCTIONS FOR THIS RELEASE</p>
656
                              </td>
657
                              <td align="right" valign="bottom"></td>
658
                           </tr>
659
                        </table>
660
                     </td>
661
                     <td width="1%"></td>
662
                  </tr>
663
                  <tr>
664
                     <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
665
                     <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
666
                     <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
667
                  </tr>
668
                  <tr>
669
                     <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" ></td>
670
                     <td bgcolor="#FFFFFF" valign="top">
671
                        <table width="100%" border="0" cellspacing="2" cellpadding="0">
672
                           <tr>
673
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Operation</td>
674
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Package</td>
675
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Version</td>
5684 dpurdie 676
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Scheduled Time<%=Quick_Help("SchedTime")%>
5357 dpurdie 677
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">Repeat</td>
678
                              <td align="left" nowrap background="images/bg_table_col.gif" class="body_col">In Progress</td>
679
                           </tr>
680
                           <%
681
                           Dim PkgVersion
682
                           Dim UserName
683
                           Dim UserEmail
684
                           Dim bInProgress
685
                           Dim bIsOverdue
686
                           Dim bIsReady
687
 
688
                           Set rsQry = OraDatabase.DbCreateDynaset( "SELECT DAEMON_INSTRUCTIONS_ID,"&_
689
                                                                  "       OP_CODE,"&_
690
                                                                  "       RTAG_ID,"&_
691
                                                                  "       PV_ID,"&_
692
                                                                  "       SCHEDULED_DATETIME,"&_
693
                                                                  "       REPEAT_SECS,"&_
694
                                                                  "       ADDED_DATETIME,"&_
695
                                                                  "       USER_ID,"&_
696
                                                                  "       IN_PROGRESS,"&_
697
                                                                  "       (CASE WHEN SCHEDULED_DATETIME <= SYSDATE THEN 1 ELSE 0 END) AS READY,"&_
698
                                                                  "       (CASE WHEN (SCHEDULED_DATETIME + (1/144)) < SYSDATE THEN 1 ELSE 0 END) AS OVERDUE"&_
699
                                                                  "  FROM DAEMON_INSTRUCTIONS "&_
700
                                                                  "  WHERE RTAG_ID = "& parRtagId &_
701
                                                                  "  ORDER BY PV_ID, SCHEDULED_DATETIME, DAEMON_INSTRUCTIONS_ID", ORADYN_DEFAULT )
702
                           While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
703
 
704
                              If IsNull(rsQry("IN_PROGRESS")) OR rsQry("IN_PROGRESS") = "0" Then
705
                                 bInProgress = False
706
                              Else
707
                                 bInProgress = True
708
                              End If
709
 
710
                              ' only flag as overdue if time threshold has been met but the daemon has not marked the instruction as being in progress.
711
                              If rsQry("OVERDUE") AND NOT bInProgress Then
712
                                 bIsOverdue = True
713
                              Else
714
                                 bIsOverdue = False
715
                              End If
716
 
717
                              If rsQry("READY") Then
718
                                 bIsReady = True
719
                              Else
720
                                 bIsReady = False
721
                              End If
722
 
723
                              ' Get as much info about the package as we can
724
                              PkgId = 0
725
                              PkgName = "N/A"
726
                              PkgVersion = "N/A"
727
                              If (NOT IsNull(rsQry("PV_ID"))) AND (rsQry("PV_ID") <> "") Then
728
                                 Call Get_Pkg_Short_Info(rsQry("PV_ID"), PkgId, PkgName, PkgVersion, NULL, NULL, NULL)
729
                              End If
730
 
731
                              %>
732
                              <tr>
733
 
734
                                 <td align="left" valign="top" class="body_txt">
735
                                    <%=DaemonInstructionOperationName(rsQry("OP_CODE"))%>
736
                                 </td>
737
 
738
                                 <td align="left" valign="top" class="body_txt">
739
                                    <%If (NOT IsNull(rsQry("PV_ID"))) AND (rsQry("PV_ID") <> "") Then%>
740
                                       <a href='fixed_issues.asp?rtag_id=<%=rsQry("RTAG_ID")%>&pv_id=<%=rsQry("PV_ID")%>'><%=PkgName%>
741
                                    <%Else%>
742
                                       <%=PkgName%>
743
                                    <%End If%>
744
                                 </td>
745
 
746
                                 <td align="left" valign="top" class="body_txt">
747
                                    <%=PkgVersion%>
748
                                 </td>
749
 
5632 dpurdie 750
                                 <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 751
 
752
                                 <td align="left" valign="top" class="body_txt"><%=DaemonInstructionRepeatString(rsQry("OP_CODE"), rsQry("REPEAT_SECS"))%></td>
753
 
754
                                 <td align="left" valign="top" class="body_txt">
755
                                    <%If bInProgress Then%>
756
                                       YES
757
                                    <%Else%>
758
                                       NO
759
                                    <%End If%>
760
                                 </td>
761
                              </tr>
762
                              <tr>
763
                                 <td colspan="6" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
764
                              </tr>
765
                              <%
766
                              rsQry.MoveNext()
767
                           Wend
768
                           rsQry.Close()
769
                           Set rsQry = nothing
770
                           %>
771
                        </table>
772
                     </td>
773
                     <td background="images/lbox_bgside_white.gif">&nbsp;</td>
774
                  </tr>
775
                  <tr>
776
                     <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
777
                     <td background="images/lbox_bg_blue.gif"></td>
778
                     <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
779
                  </tr>
780
               </table>
781
 
782
            </td>
783
            <td width="1" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
784
         </tr>
785
         <tr>
786
            <td valign="bottom" align="center" background="images/bg_home_orange.gif">
787
                <img src="images/img_gear.gif" width="86" height="99" vspace="20" hspace="30">
788
            </td>
789
            <td background="images/bg_lght_gray.gif" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="350">
790
            </td>
791
         </tr>
792
      </table>
793
      <!-- FOOTER -->
794
      <!--#include file="_footer.asp"-->
795
   </body>
796
</html>