Subversion Repositories DevTools

Rev

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