Subversion Repositories DevTools

Rev

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