Rev 6618 | Blame | Compare with Previous | Last modification | View Log | RSS feed
<%@LANGUAGE="VBSCRIPT"%><%'====================================================='' RequestTop10Changes.asp''=====================================================%><%Option explicit' Good idea to set when using redirectResponse.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 rsTempDim parIntervalDim BaseId'------------ Constants Declaration -----------'------------ Variable Init -------------------parInterval = RequestDefault("Interval", 7)'----------------------------------------------%><%'------------------------------------------------------------------------------------------------------------------------' 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 formQueryStringDim qs' For each package ID in a release' For each package version across all projects and releases (have to do this due to schema limitations)' If the package version extension is the same as that being used currently in the release' If the package version is locked, and is not a ripple' Increment a count for this package ID' Return the 10 package IDs with the highest countsqs = " SELECT ordered_changed.pkg_id, ordered_changed.pkg_name || pv_outer.v_ext as pkg_name, pv_outer.v_ext, pv_outer.pv_id, pv_outer.pkg_version, ordered_changed.NumberOfChanges" _& " FROM RELEASE_CONTENT rc_outer, PACKAGE_VERSIONS pv_outer, " _& " ( " _& " SELECT * FROM ( " _& " SELECT changed.pkg_name, changed.pkg_id, COUNT(changed.pkg_name) as NumberOfChanges FROM ( " _& " SELECT PACKAGES.pkg_name, PACKAGES.pkg_id " _& " FROM PACKAGE_VERSIONS changed_package_versions, PACKAGES " _& " WHERE changed_package_versions.pkg_id = PACKAGES.pkg_id " _& " AND changed_package_versions.MODIFIED_STAMP >= (ORA_SYSDATE - :DAYS) " _& " AND changed_package_versions.build_type <> 'Y' " _& " AND changed_package_versions.dlocked = 'Y' " _& " AND changed_package_versions.pkg_id IN ( " _& " SELECT pkg_id FROM PACKAGE_VERSIONS WHERE pv_id IN ( " _& " SELECT pv_id " _& " FROM RELEASE_CONTENT " _& " WHERE RELEASE_CONTENT.rtag_id = :rtag_id " _& " ) " _& " ) " _& " AND changed_package_versions.v_ext IN ( " _& " SELECT v_ext FROM PACKAGE_VERSIONS, RELEASE_CONTENT " _& " WHERE PACKAGE_VERSIONS.pv_id = RELEASE_CONTENT.pv_id " _& " AND PACKAGE_VERSIONS.pkg_id = changed_package_versions.pkg_id " _& " AND RELEASE_CONTENT.rtag_id = :rtag_id " _& " ) " _& " ) changed " _& " GROUP BY changed.pkg_name, changed.pkg_id " _& " ORDER BY NumberOfChanges DESC " _& " ) WHERE ROWNUM < 21 " _& " ) ordered_changed " _& " WHERE " _& " ordered_changed.pkg_id = pv_outer.pkg_id " _& " AND rc_outer.rtag_id = :rtag_id " _& " AND rc_outer.pv_id = pv_outer.pv_id " _& " order by upper(pkg_name) "formQueryString = qsEnd Function'------------------------------------------------------------------------------------------------------------------------%><%'------------------------ MAIN LINE ---------------------------------'--------------------------------------------------------------------OraDatabase.Parameters.Add "RTAG_ID", Request("rtag_id"), ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "DAYS", parInterval, ORAPARM_INPUT, ORATYPE_NUMBERSet rsTemp = OraDatabase.DbCreateDynaset( formQueryString, cint(0))OraDatabase.Parameters.Remove "DAYS"OraDatabase.Parameters.Remove "RTAG_ID"%><!-- RequestTop10Changes.asp --><table width="100%" border="0" cellspacing="1" cellpadding="1" class='etable'><%If rsTemp.RecordCount < 1 Then %><tr class="form_field_grey_bg"><td nowrap class="body_row">None Found</td></tr><% Else %><tr class="form_field_bg"><td class="form_field_bg"><table width="100%" border="0" cellspacing="1" cellpadding="1"><tr><th nowrap class="body_row" valign="top">Package Name</th><th nowrap class="body_row" valign="top" width="1%">Changes<%=Quick_Help("Top10ChangeCounts")%></th></tr><%While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))BaseId = "TOP10_I" & parInterval & "_" & Request("rtag_id") & "_" & rsTemp("pv_id")%><tr class="csvData form_field_grey_bg"><td nowrap class="body_row"><a href="javascript://rtag_id=<%=Request("rtag_id")%>&pv_id=<%=rsTemp("pv_id")%>;" class="txt_linked" onClick="ToggleLoadControl('<%=BaseId%>','RequestPackageVersionHistoryMetrics.asp?rtag_id=<%=Request("rtag_id")%>&pv_id=<%=rsTemp("pv_id")%>&mode=1&interval=<%=parInterval%>');"><img id='IMG_<%=BaseId%>' src="images/bt_plus.gif" border="0" align="absmiddle" hspace="3"><img src="images/i_world.gif" border="0" align="absmiddle" hspace="3"></a><a href ="view_by_version.asp?pkg_id=<%=rsTemp("pkg_id")%>&fpkgversion=*<%=rsTemp("v_ext")%>"><%=rsTemp("pkg_name")%></a></td><td nowrap class="body_row tright"><%=rsTemp("NumberOfChanges")%></td></tr><tr class="form_field_bg" id="TGL_<%=BaseId%>" style="display:none;"><td nowrap class="body_row"><div class='subSectionIndent' id='<%=BaseId%>'><%=enumLOADING%></div></td></tr><%rsTemp.MoveNextWEnd%></table></td></tr><%End If%></table><br><%rsTemp.CloseSet rsTemp = nothing%><%Call Destroy_All_Objects%>