Subversion Repositories DevTools

Rev

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

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