Subversion Repositories DevTools

Rev

Rev 125 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'|                                                   |
'|      RequestPackageVersionHistoryMetrics.asp      |
'|                                                   |
'=====================================================
%>
<%
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"-->
<%
'------------ Variable Definition -------------
Dim rsTemp
Dim rsMetrics
Dim parPvId
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
parPvId = Request("pv_id")
'----------------------------------------------
%>
<%
'------------------------------------------------------------------------------------------------------------------------
' Thus function formulates a query that is intended to find the top 10 packages that have changed the most in a period of
' time, limited in scope to those packages that have at least one version in the specified release.
' The function relies upon the user of this ASP file having setup the Interval parameter as needed (see RequestReleasePackages.asp)
Function formQueryString2

   Dim qs

   qs  = " SELECT pv_id, last_pv_id, pkg_id, pkg_version, v_ext, created_stamp, modified_stamp FROM package_versions " _
       & " CONNECT BY NOCYCLE PRIOR last_pv_id = pv_id            " _
       & " START WITH pv_id = :PV_ID                              " _
       & " ORDER BY pv_id DESC                                    "

   formQueryString2 = qs
End Function



'------------------------------------------------------------------------------------------------------------------------
%>
<%
'------------------------ MAIN LINE ---------------------------------
'--------------------------------------------------------------------
%>
<table width="100%" border="0" cellspacing="1" cellpadding="1">
   <tr>
      <td background="images/bg_form_lightbluedark.gif">
         <table width="100%" border="0" cellspacing="1" cellpadding="1">
            <tr>
               <td nowrap class="body_txt" valign="top" background="images/bg_form_lightbluedark.gif">Package Version&nbsp&nbsp</td>
               <td nowrap class="body_txt" valign="top" background="images/bg_form_lightbluedark.gif">Autobuilt&nbsp&nbsp</td>
               <td nowrap class="body_txt" valign="top" background="images/bg_form_lightbluedark.gif">Lines Of Code&nbsp&nbsp</td>
               <td nowrap class="body_txt" valign="top" background="images/bg_form_lightbluedark.gif">Unit Tested&nbsp&nbsp</td>
               <td nowrap class="body_txt" valign="top" background="images/bg_form_lightbluedark.gif">Autotested&nbsp&nbsp</td>
               <td nowrap class="body_txt" valign="top" background="images/bg_form_lightbluedark.gif">Branches&nbsp&nbsp</td>
               <td nowrap class="body_txt" valign="top" background="images/bg_form_lightbluedark.gif">Last Modified&nbsp&nbsp</td>
            </tr>

            <%
            ' Get the list of ancestor versions
            OraDatabase.Parameters.Add "PV_ID", Request("pv_id"),    ORAPARM_INPUT, ORATYPE_NUMBER

            Set rsTemp = OraDatabase.DbCreateDynaset( formQueryString2, cint(0))

            OraDatabase.Parameters.Remove "PV_ID"

            If rsTemp.RecordCount < 1 Then
            %>
               <tr>
                  <td colspan="7" background="images/bg_form_lightgray.gif" nowrap>&nbsp;</td>
               </tr>
            <%
            Else

               While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))

                  OraDatabase.Parameters.Add "PV_ID", rsTemp("pv_id"),    ORAPARM_INPUT, ORATYPE_NUMBER

                  Set rsMetrics = OraDatabase.DbCreateDynaset( GetQuery("PackageVersionMetrics.sql"), cint(0))

                  OraDatabase.Parameters.Remove "PV_ID"
                  If rsMetrics.RecordCount > 0 Then
                  %>
                     <tr>
                        <td nowrap class="body_txt" background="images/bg_form_lightgray.gif">
                           <a class="txt_linked" href="dependencies.asp?pv_id=<%=rsTemp("pv_id")%>">
                              <%=rsMetrics("pkg_name")%>
                              <%=VBNEWLine%><%=rsMetrics("pkg_version")%>
                           </a>
                           &nbsp&nbsp&nbsp
                        </td>
                        <td nowrap class="body_txt" background="images/bg_form_lightgray.gif">
                           <%If rsMetrics("is_autobuildable") = "Y" Then%>Yes<%Else%>No<%End If%>
                        </td>
                        <td nowrap class="body_txt" background="images/bg_form_lightgray.gif"><%=rsMetrics("code_lines")%></td>
                        <td nowrap class="body_txt" background="images/bg_form_lightgray.gif">
                           <%If rsMetrics("unit_tested") = "Y" Then%>Yes<%Else%>No<%End If%>
                        </td>
                        <td nowrap class="body_txt" background="images/bg_form_lightgray.gif">
                           <%If rsMetrics("autotested") = "Y" Then%>Yes<%Else%>No<%End If%>
                        </td>
                        <td nowrap class="body_txt" background="images/bg_form_lightgray.gif"><%=rsMetrics("branches")%></td>
                        <td nowrap class="body_txt" background="images/bg_form_lightgray.gif"><%=EuroDate(rsTemp("modified_stamp"))%></td>
                     </tr>
                  <%
                  End If
                  rsTemp.MoveNext
                  rsMetrics.Close
               WEnd
               rsTemp.Close
               Set rsTemp = nothing

            End If
            %>
         </table>
      </td>
   </tr>
</table>
<br>

<%
Call Destroy_All_Objects
%>