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