Subversion Repositories DevTools

Rev

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