| 125 |
ghuddy |
1 |
<%@LANGUAGE="VBSCRIPT"%>
|
|
|
2 |
<%
|
|
|
3 |
'=====================================================
|
|
|
4 |
'| |
|
|
|
5 |
'| RequestTop10ChangesInLastWeek.asp |
|
|
|
6 |
'| |
|
|
|
7 |
'=====================================================
|
|
|
8 |
%>
|
|
|
9 |
<%
|
|
|
10 |
Option explicit
|
|
|
11 |
' Good idea to set when using redirect
|
|
|
12 |
Response.Expires = 0 ' always load the page, dont store
|
|
|
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 |
<%
|
|
|
20 |
'------------ Variable Definition -------------
|
|
|
21 |
Dim rsTemp
|
|
|
22 |
Dim parInterval
|
|
|
23 |
'------------ Constants Declaration -----------
|
|
|
24 |
'------------ Variable Init -------------------
|
|
|
25 |
parInterval = Request("Interval")
|
|
|
26 |
'----------------------------------------------
|
|
|
27 |
%>
|
|
|
28 |
<%
|
|
|
29 |
'------------------------------------------------------------------------------------------------------------------------
|
|
|
30 |
' Thus function formulates a query that is intended to find the top 10 packages that have changed the most in a period of
|
|
|
31 |
' time, limited in scope to those packages that have at least one version in the specified release.
|
|
|
32 |
' The function relies upon the user of this ASP file having setup the Interval parameter as needed (see RequestReleasePackages.asp)
|
|
|
33 |
Function formQueryString
|
|
|
34 |
|
|
|
35 |
Dim qs
|
|
|
36 |
Dim date_Interval_expression
|
|
|
37 |
|
|
|
38 |
' Insert the correct date interval condition
|
|
|
39 |
Select Case parInterval
|
|
|
40 |
Case 1
|
|
|
41 |
date_Interval_expression = " AND changed_package_versions.MODIFIED_STAMP > (ORA_SYSDATE - interval '7' day)"
|
|
|
42 |
Case 2
|
| 151 |
ghuddy |
43 |
date_Interval_expression = " AND changed_package_versions.MODIFIED_STAMP > (ORA_SYSDATE - interval '30' day)"
|
| 125 |
ghuddy |
44 |
Case 3
|
| 151 |
ghuddy |
45 |
date_Interval_expression = " AND changed_package_versions.MODIFIED_STAMP > (ORA_SYSDATE - interval '90' day)"
|
| 125 |
ghuddy |
46 |
Case Else
|
|
|
47 |
Call RaiseMsg(enum_MSG_ERROR, "Internal Error, date interval not specified.")
|
|
|
48 |
End Select
|
|
|
49 |
|
|
|
50 |
' For each package ID in a release
|
|
|
51 |
' For each package version across all projects and releases (have to do this due to schema limitations)
|
|
|
52 |
' If the package version extension is the same as that being used currently in the release
|
|
|
53 |
' If the package version is locked, and is not a ripple
|
|
|
54 |
' Increment a count for this package ID
|
|
|
55 |
' Return the 10 package IDs with the highest counts
|
|
|
56 |
qs = " SELECT ordered_changed.pkg_id, ordered_changed.pkg_name, pv_outer.pv_id, pv_outer.pkg_version, ordered_changed.NumberOfChanges" _
|
|
|
57 |
& " FROM RELEASE_CONTENT rc_outer, PACKAGE_VERSIONS pv_outer, " _
|
|
|
58 |
& " ( " _
|
|
|
59 |
& " SELECT * FROM ( " _
|
|
|
60 |
& " SELECT changed.pkg_name, changed.pkg_id, COUNT(changed.pkg_name) as NumberOfChanges FROM ( " _
|
|
|
61 |
& " SELECT PACKAGES.pkg_name, PACKAGES.pkg_id " _
|
|
|
62 |
& " FROM PACKAGE_VERSIONS changed_package_versions, PACKAGES " _
|
|
|
63 |
& " WHERE changed_package_versions.pkg_id = PACKAGES.pkg_id " & date_Interval_expression _
|
|
|
64 |
& " AND changed_package_versions.build_type <> 'Y' " _
|
|
|
65 |
& " AND changed_package_versions.dlocked = 'Y' " _
|
|
|
66 |
& " AND changed_package_versions.pkg_id IN ( " _
|
|
|
67 |
& " SELECT pkg_id FROM PACKAGE_VERSIONS WHERE pv_id IN ( " _
|
|
|
68 |
& " SELECT pv_id " _
|
|
|
69 |
& " FROM RELEASE_CONTENT " _
|
|
|
70 |
& " WHERE RELEASE_CONTENT.rtag_id = :rtag_id " _
|
|
|
71 |
& " ) " _
|
|
|
72 |
& " ) " _
|
|
|
73 |
& " AND changed_package_versions.v_ext IN ( " _
|
|
|
74 |
& " SELECT v_ext FROM PACKAGE_VERSIONS, RELEASE_CONTENT " _
|
|
|
75 |
& " WHERE PACKAGE_VERSIONS.pv_id = RELEASE_CONTENT.pv_id " _
|
|
|
76 |
& " AND PACKAGE_VERSIONS.pkg_id = changed_package_versions.pkg_id " _
|
|
|
77 |
& " AND RELEASE_CONTENT.rtag_id = :rtag_id " _
|
|
|
78 |
& " ) " _
|
|
|
79 |
& " ) changed " _
|
|
|
80 |
& " GROUP BY changed.pkg_name, changed.pkg_id " _
|
|
|
81 |
& " ORDER BY NumberOfChanges DESC " _
|
|
|
82 |
& " ) WHERE ROWNUM < 11 " _
|
|
|
83 |
& " ) ordered_changed " _
|
|
|
84 |
& " WHERE " _
|
|
|
85 |
& " ordered_changed.pkg_id = pv_outer.pkg_id " _
|
|
|
86 |
& " AND rc_outer.rtag_id = :rtag_id " _
|
|
|
87 |
& " AND rc_outer.pv_id = pv_outer.pv_id "
|
|
|
88 |
|
|
|
89 |
formQueryString = qs
|
|
|
90 |
End Function
|
|
|
91 |
|
|
|
92 |
|
|
|
93 |
|
|
|
94 |
'------------------------------------------------------------------------------------------------------------------------
|
|
|
95 |
%>
|
|
|
96 |
<%
|
|
|
97 |
'------------------------ MAIN LINE ---------------------------------
|
|
|
98 |
'--------------------------------------------------------------------
|
|
|
99 |
%>
|
|
|
100 |
<table width="100%" border="0" cellspacing="1" cellpadding="1">
|
|
|
101 |
|
|
|
102 |
<tr>
|
|
|
103 |
<td background="images/bg_form_lightbluedark.gif">
|
|
|
104 |
<table width="100%" border="0" cellspacing="1" cellpadding="1">
|
|
|
105 |
<tr>
|
|
|
106 |
<td nowrap class="body_txt" valign="top" width="70%" background="images/bg_form_lightbluedark.gif">Package Name</td>
|
|
|
107 |
<td nowrap class="body_txt" valign="top" width="30%" background="images/bg_form_lightbluedark.gif">Changes<%=Quick_Help("Top10ChangeCounts")%></td>
|
|
|
108 |
</tr>
|
|
|
109 |
|
|
|
110 |
<%
|
|
|
111 |
OraDatabase.Parameters.Add "RTAG_ID", Request("rtag_id"), ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
112 |
|
|
|
113 |
Set rsTemp = OraDatabase.DbCreateDynaset( formQueryString, cint(0))
|
|
|
114 |
|
|
|
115 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
|
|
116 |
|
|
|
117 |
If rsTemp.RecordCount < 1 Then
|
|
|
118 |
%>
|
|
|
119 |
<tr>
|
|
|
120 |
<td colspan="3" background="images/bg_form_lightgray.gif" nowrap> </td>
|
|
|
121 |
</tr>
|
|
|
122 |
<%
|
|
|
123 |
Else
|
|
|
124 |
|
|
|
125 |
While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
|
|
|
126 |
%>
|
|
|
127 |
<tr>
|
|
|
128 |
<td nowrap class="body_txt" background="images/bg_form_lightgray.gif">
|
|
|
129 |
<a class="txt_linked" href="dependencies.asp?pv_id=<%=rsTemp("pv_id")%>&rtag_id=<%=Request("rtag_id")%>">
|
|
|
130 |
<%=rsTemp("pkg_name")%>
|
|
|
131 |
</a>
|
|
|
132 |
</td>
|
|
|
133 |
|
|
|
134 |
<td nowrap class="body_txt" background="images/bg_form_lightgray.gif">
|
|
|
135 |
<%=rsTemp("NumberOfChanges")%>
|
|
|
136 |
</td>
|
|
|
137 |
</tr>
|
|
|
138 |
<%rsTemp.MoveNext
|
|
|
139 |
WEnd
|
|
|
140 |
rsTemp.Close
|
|
|
141 |
Set rsTemp = nothing
|
|
|
142 |
|
|
|
143 |
End If
|
|
|
144 |
%>
|
|
|
145 |
</table>
|
|
|
146 |
</td>
|
|
|
147 |
</tr>
|
|
|
148 |
</table>
|
|
|
149 |
<br>
|
|
|
150 |
|
|
|
151 |
<%
|
|
|
152 |
Call Destroy_All_Objects
|
|
|
153 |
%>
|