Subversion Repositories DevTools

Rev

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

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