Subversion Repositories DevTools

Rev

Rev 119 | Blame | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|              Build Status Information             |
'|                                                   |
'=====================================================
%>
<%
Option explicit
' Good idea to set when using redirect
Response.Expires = 0  ' always load the page, dont store
%>
<!--#include file="common/conf.asp"-->
<!--#include file="common/globals.asp"-->
<!--#include file="common/formating.asp"-->
<!--#include file="common/qstr.asp"-->
<!--#include file="common/common_subs.asp"-->
<!--#include file="common/_form_window_common.asp"-->
<!--#include file="_action_buttons.asp"-->
<!--#include file="class/classActionButtonControl.asp"-->
<%
' Set rfile parameter. This is a return page after Login
Call objPMod.StoreParameter ( "rfile", "rtree.asp" )
objPMod.PersistInQryString("proj_id")
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_general.asp"-->
<%
'------------ Variable Definition -------------
Dim objSortHelper
Dim rsQry
Dim parRtagId
Dim parSourceRtagId
Dim query_string
Dim objBtnControl
Dim  rcon_id
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
parRtagId = Request("rtag_id")
objPMod.PersistInQryString("rtag_id")
Set objBtnControl = New ActionButtonControl
'----------------------------------------------
%>
<%
'--------------------------------------------------------------------------------------------------------------------------
Sub GetFormDetails ( parRtagId, ByRef outobjDetails )
  Dim rsQry, query
  OraDatabase.Parameters.Add "RTAG_ID",   parRtagId,    ORAPARM_INPUT, ORATYPE_NUMBER 
  query = _
  " SELECT * "&_
  "  FROM RELEASE_TAGS rt"&_
  " WHERE rt.RTAG_ID = :RTAG_ID"
  
  Set rsQry = OraDatabase.DbCreateDynaset( query, ORADYN_DEFAULT )
  
  OraDatabase.Parameters.Remove "RTAG_ID"
  
  If rsQry.RecordCount > 0 Then
    outobjDetails.Item ("rtag_id") = rsQry("rtag_id")
    outobjDetails.Item ("rtag_name") = rsQry("rtag_name")
  Else
    Err.Raise 8, "Sub GetFormDetails in "& ScriptName, "Empty record set returned. parRtagId="& parRtagId
  End If
  
  rsQry.Close
  Set rsQry = Nothing
End Sub
'--------------------------------------------------------------------------------------------------------------------------
Sub RipplePackage (flag)
  
  On Error Resume Next
  objEH.ErrorRedirect = TRUE
  OraDatabase.Parameters.Add "PV_ID_LIST",     Request("pv_id_list"),  ORAPARM_INPUT, ORATYPE_VARCHAR2
  OraDatabase.Parameters.Add "RTAG_ID",     parRtag_id,  ORAPARM_INPUT, ORATYPE_NUMBER 
  OraDatabase.Parameters.Add "USER_ID",     objAccessControl.UserId,  ORAPARM_INPUT, ORATYPE_NUMBER 

  objEH.TryORA ( OraSession )
  
  If flag Then
    OraDatabase.ExecuteSQL _
    "BEGIN  Ripple_Package( :PV_ID_LIST, :RTAG_ID, :USER_ID );  END;"
  Else
    OraDatabase.ExecuteSQL _
    "BEGIN  UnRipple_Package( :PV_ID_LIST, :RTAG_ID, :USER_ID );  END;"
  End If
  
  objEH.CatchORA ( OraSession )
  
  OraDatabase.Parameters.Remove "PV_ID_LIST"
  OraDatabase.Parameters.Remove "RTAG_ID"
  OraDatabase.Parameters.Remove "USER_ID"

End Sub
'--------------------------------------------------------------------------------------------------------------------------
Function Get_Daemon_Mode( cMode )

  If cMode = "S" Then
    Get_Daemon_Mode = "Slave"
  ElseIf cMode = "M" Then
    Get_Daemon_Mode = "Master"
  End If
    
End Function
'--------------------------------------------------------------------------------------------------------------------------
Function Get_Run_Level( nLevel )

  If nLevel <= 1 Then
    Get_Run_Level = "Cannot Continue"
  ElseIf nLevel = 2 Then
    Get_Run_Level = "Paused"
  ElseIf nLevel = 3 Then 
    Get_Run_Level = "Actively engaged in a build"
  ElseIf nLevel = 4 Then
    Get_Run_Level = "Idle"
  ElseIf nLevel >= 5 Then
    Get_Run_Level = "Waiting"
  Else
    Get_Run_Level = "<span class='err_alert'>Unknown!</span>"
  End If

End Function
'--------------------------------------------------------------------------------------------------------------------------
Function Get_Package_Name( sPackageName )

  If IsNull(sPackageName) Then
    Get_Package_Name = "None"
  Else
    Get_Package_Name = sPackageName
  End If

End Function
'--------------------------------------------------------------------------------------------------------------------------
%>
<%
'------------ RUN BEFORE PAGE RENDER ----------
' --- Get Form details from DB ---
Call GetFormDetails ( Request("rtag_id"), objFormCollector )

' --- Load Validation Rules ---
'Call objForm.LoadValidationRules ( Array("rtag_name","rtag_description", "config_spec_branch"), OraDatabase )    ' Load Validation Rules

' --- Enter Form Validation Rule Changes here... ----
'----------------------------------------------------

' --- RUN onPostBack ---
If Request("action") <> "" Then

  If objEH.Finally Then
    If Request("action") = "include" Then
      Call RipplePackage (True)
    Else
      Call OpenInWindow ( "dependencies.asp?rtag_id="& parRtagId )
    End If
  End If
    
End If

'----------------------------------------------
%>
<html>
  <head>
    <title>Release Manager</title>
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
    <link rel="stylesheet" href="images/navigation.css" type="text/css">
    <script language="JavaScript" src="images/common.js"></script>
    <!-- DROPDOWN MENUS -->
    <!--#include file="_menu_def.asp"-->
    <script language="JavaScript1.2" src="images/popup_menu.js"></script>
  </head>
  <body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" onload="isChecked('pv_id_list','submit');">
    <!-- MENU LAYERS -------------------------------------->
    <div id="popmenu" class="menuskin" onmouseover="clearhidemenu();highlightmenu(event,'on')" onmouseout="highlightmenu(event,'off');dynamichide(event)"></div>
    <!-- TIPS LAYERS -------------------------------------->
    <div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
    <!----------------------------------------------------->
    <!-- HEADER -->
    <!--#include file="_header.asp"-->
    <!-- BODY ---->
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
<%
'-- FORM START ---------------------------------------------------------------------------------------------------------
objFormComponent.FormName = "FormName"
objFormComponent.Action = ScriptName &"?rtag_id="& parRtagId
Call objFormComponent.FormStart()
%>
      <tr>
        <td width="1" background="images/bg_home_orange.gif" valign="top">
        </td>
        <td width="100%" rowspan="1" align="center" valign="top" bgcolor="#EEEFEF">
          <table width="10" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="1%"></td>
              <td width="100%">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td nowrap class="body_txt">
                    </td>
                  </tr>
                </table>
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td nowrap class="form_ttl"><p>&nbsp;</p>
                      <p>BUILD STATUS INFORMATION</p>
                    </td>
                    <td align="right" valign="bottom"></td>
                  </tr>
                </table>
              </td>
              <td width="1%"></td>
            </tr>
            <tr>
              <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
              <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
              <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
            </tr>
            <tr>
              <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
              <td bgcolor="#FFFFFF" valign="top">
                <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
                <!--#include file="messages/_msg_inline.asp"-->
                <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
                <br>
                <!-- BUTTONS CONTROL +++++++++++++++++++ -->
                <!-- +++++++++++++++++++++++++++++++++++ -->
                <table width="100%" border="0" cellspacing="2" cellpadding="0">
                  <span class='err_alert'>
                    <font size='2'><b>Packages Excluded From Build (Daemon Build Failure)</b></font>
                  </span>
                  <tr>
                    <td background="images/bg_table_col.gif" class="err_alert"><b>Directly</b></td>
                    <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">PACKAGE NAME</td>
                    <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">PACKAGE VERSION</td>
                    <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">ROOT CAUSE</td>
                  </tr>
<%
query_string = "select pkg.pkg_name, pv.pkg_version, pv.pv_id, dnr.rtag_id, dnr.root_cause, dnr.root_file, pv.pv_description from do_not_ripple dnr, package_versions pv, packages pkg "&_
" where dnr.rtag_id = "& parRtagId &" and pv.pv_id = dnr.pv_id and pkg.pkg_id = pv.pkg_id and dnr.root_pv_id is null order by pkg_name"
Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
'--- Render rows ---
Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
%>
                  <tr>
                    <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
                  </tr>
                  <tr>
                    <td nowrap width="1%">
                      <input type="checkbox" value="<%=rsQry("pv_id")%>" name="pv_id_list" id="pv_id_list" onClick="isChecked('pv_id_list','submit');">
                    </td>
                    <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>
                    <td nowrap class="body_rowg"><%=rsQry("pkg_version")%></td>
<%
' root_file, if supplied, indicates a build failure log file exists
' this should always prevail over the textual root_cause
If IsNull(rsQry("root_file")) Then
%>
                    <td nowrap class="body_rowg"><%=rsQry("root_cause")%></td>
<%
Else
%>
                    <td nowrap class="body_rowg"><a class="txt_linked" title="<%=rsQry("root_file")%> Log file may have expired." href="file://///auperaunx26/abtlog/<%=rsQry("root_file")%>">Build Failure Log File</a></td>
<%
End If
%>
                  </tr>
<%
  rsQry.MoveNext
  Loop
%>
                  <tr>
                    <td background="images/bg_table_col.gif" class="err_alert"><b>Indirectly</b></td>
                    <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">PACKAGE NAME</td>
                    <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">PACKAGE VERSION</td>
                    <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">ROOT CAUSE PACKAGE NAME</td>
                  </tr>
<%
query_string = "select pv.pv_id, pkg.pkg_name, pv.pkg_version, qkg.pkg_name, dnr.rtag_id, pv.pv_description from do_not_ripple dnr, package_versions pv, package_versions qv, packages pkg, packages qkg "&_
" where dnr.rtag_id = "& parRtagId &" and pv.pv_id = dnr.pv_id and pkg.pkg_id = pv.pkg_id and dnr.root_pv_id is not null and qv.pv_id=dnr.root_pv_id and qkg.pkg_id=qv.pkg_id order by pkg.pkg_name"
Dim rsQry2
Set rsQry2 = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
'--- Render rows ---
Do While (NOT rsQry2.BOF) AND (NOT rsQry2.EOF)
%>
                  <tr>
                    <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
                  </tr>
                  <tr>
                    <td nowrap width="1%">
                      <input type="checkbox" value=0 disabled=true name="notused" id="notused">
                    </td>
                    <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>
                    <td nowrap class="body_rowg"><%=rsQry2(2)%></td>
                    <td nowrap class="body_rowg"><%=rsQry2(3)%></td>
                  </tr>
<%
  rsQry2.MoveNext
  Loop
%>
                </table>
              </td>
              <td background="images/lbox_bgside_white.gif">&nbsp;</td>
            </tr>
<%
If rsQry.RecordCount > 0 Then
%>
            <tr>
              <td background="images/bg_action_norm.gif"></td>
              <td align="right" background="images/bg_action_norm.gif">
<%
  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?"")'" ))
  Response.Write(objPMod.ComposeHiddenTags())
%>
              </td>
              <td background="images/bg_action_norm.gif"><img src="images/h_trsp_dot.gif" width="5" height="30"></td>
            </tr>
<%
End If
%>
            <tr>
              <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
              <td background="images/lbox_bg_blue.gif"></td>
              <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
            </tr>
          </table>
    <!-- ACTION BUTTONS ---------------------------------------------->
          <input type="hidden" name="action" value="include"> 
    <!-- ACTION BUTTONS END  ------------------------------------------>
        </td>
        <td width="1" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
      </tr>
  <%
  Call objFormComponent.FormEnd()
  rsQry.Close()
  Set rsQry = nothing  
  rsQry2.Close()
  Set rsQry2 = nothing  
  '-- FORM END ----------------------------------------------------------------------------------------------------------------
  %>
      <tr>
        <td width="1" background="images/bg_home_orange.gif" valign="top">
        </td>
        <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
          <table width="10" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="1%"></td>
              <td width="100%">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td nowrap class="form_ttl"><p>&nbsp;</p>
                      <p>DAEMON STATUS INFORMATION
                      </p>
                    </td>
                    <td align="right" valign="bottom"></td>
                  </tr>
                </table>
              </td>
              <td width="1%"></td>
            </tr>
            <tr>
              <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
              <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
              <td align="right" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
            </tr>
            <tr>
              <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
              <td bgcolor="#FFFFFF" valign="top">
                <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
                <!--#include file="messages/_msg_inline.asp"-->
                <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
                <br>
                <!-- BUTTONS CONTROL +++++++++++++++++++ -->
                <!-- +++++++++++++++++++++++++++++++++++ -->
                <table width="100%" border="0" cellspacing="2" cellpadding="0">
              </td>
              <td width="9%" valign="top"></td>
            </tr>
            <tr>
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Hostname</td>
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">GBE Machtype</td>
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Mode</td>
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Run Level</td>
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Current Package</td>
              <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Switch State</td>
            </tr>
<%
query_string = "select * from release_config rc, run_level rl, packages pkg, gbe_machtype gm "&_
" where rc.rtag_id = "& parRtagId &" and rc.rcon_id = rl.rcon_id(+) and "&_
" pkg.pkg_id(+) = rl.current_pkg_id_being_built and gm.gbe_id = rc.gbe_id order by rc.daemon_hostname"
Set rsQry = OraDatabase.DbCreateDynaset( query_string, ORADYN_DEFAULT )
'--- Render rows ---
Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
  rcon_id = rsQry("rcon_id")
%>
            <tr>
              <td colspan="6" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
            </tr>
            <tr>
              <td nowrap class="body_rowg"><%=rsQry("daemon_hostname")%></td>
              <td nowrap class="body_rowg"><%=rsQry("gbe_value")%></td>
              <td nowrap class="body_rowg"><%=Get_Daemon_Mode(rsQry("daemon_mode"))%></td>
              <td nowrap class="body_rowg"><%=Get_Run_Level(rsQry("current_run_level"))%></td>
              <td nowrap class="body_rowg"><%=Get_Package_Name(rsQry("pkg_name"))%></td>
              <td nowrap class="body_rowg">
<%
  If NOT IsNull(rsQry("current_run_level")) Then
    If objAccessControl.UserLogedIn Then
      If IsNull(rsQry("pause")) Then
        Call Action_Buttons ( "Daemon Pause" )
      Else
        Call Action_Buttons ( "Daemon Resume" )
      End If
    Else
      If IsNull(rsQry("pause")) Then
        Call Action_Buttons ( "Daemon Pause Disabled" )
      Else
        Call Action_Buttons ( "Daemon Resume Disabled" )
      End If
    End If
  Else
%>Unavailable<%
  End If
%>
              </td>
            </tr>
<%
  rsQry.MoveNext
  Loop  
rsQry.Close()
Set rsQry = nothing  
%>
          </table>
        </td>
        <td background="images/lbox_bgside_white.gif">&nbsp;</td>
      </tr>
      <tr>
        <input type="hidden" name="action" value="true">
        <%=objPMod.ComposeHiddenTags()%>
        <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
        <td background="images/lbox_bg_blue.gif"></td>
        <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
      </tr>
    </table> 
    <!-- ACTION BUTTONS ---------------------------------------------->
    <!-- ACTION BUTTONS END  ------------------------------------------> </td>
    <td width="1" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
    </tr>
    <tr>
      <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>
      <td background="images/bg_lght_gray.gif" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="350"></td>
    </tr>
    </table> 
    <!-- FOOTER -->
    <!--#include file="_footer.asp"-->
  </body>
</html>
<%
Call Destroy_All_Objects
%>