Subversion Repositories DevTools

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5478 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
'   unused_packages.asp
5
'   Display unused packages in the current release
6
'   Does not include packages marked as deployable ?
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
Const allowNoPackage = TRUE     ' Allow page display without pvid being present
14
Server.ScriptTimeout=300        ' To enable the script timeout to 5 mins
15
%>
16
<!--#include file="common/conf.asp"-->
17
<!--#include file="common/globals.asp"-->
18
<!--#include file="common/formating.asp"-->
19
<!--#include file="common/qstr.asp"-->
20
<!--#include file="common/common_subs.asp"-->
21
<!--#include file="common/common_dbedit.asp"-->
22
<!--#include file="common/_package_common.asp"-->
23
<!--#include file="common/release_changed.asp"-->
24
<%
25
'------------ ACCESS CONTROL ------------------
26
%>
27
<!--#include file="_access_control_general.asp"-->
28
<%
29
'------------ Variable Definition -------------
30
Dim	rsQry
31
Dim enableRemoval : enableRemoval = FALSE
32
Dim enabledText : enabledText = "disabled "
33
 
34
'------------ Constants Declaration -----------
35
'------------ Variable Init -------------------
36
'----------------------------------------------
37
'------------------------- MAIN LINE ---------------------------
38
 
39
If Request("action") = "RemovePackages" AND Request("list_pv_id") <> "" Then
40
    Dim pvidArray, nPvId
41
    pvidArray = Split(Request("list_pv_id"), ",")
42
    For Each nPvId in pvidArray
43
 
44
        nPvId = Trim(nPvId)
45
 
46
        Dim objRC: Set objRC = New ReleaseChanged
47
        Call objRC.Get_Package_Info (parRtag_id,nPvId)
48
        Dim bReleased: bReleased = objRC.IsReleased(parRtag_id,nPvId)
49
 
50
        OraDatabase.Parameters.Add "PV_ID",       nPvId,                  ORAPARM_INPUT, ORATYPE_NUMBER
51
        OraDatabase.Parameters.Add "RTAG_ID",     parRtag_id,             ORAPARM_INPUT, ORATYPE_NUMBER
52
        OraDatabase.Parameters.Add "USER_ID",     objAccessControl.UserId,ORAPARM_INPUT, ORATYPE_NUMBER
53
        OraDatabase.Parameters.Add "RETURN_CODE", NULL,                   ORAPARM_OUTPUT, ORATYPE_NUMBER
54
        OraDatabase.Parameters.Add "FORCE_REMOVE","N",                    ORAPARM_INPUT, ORATYPE_NUMBER
55
 
56
        objEH.TryORA ( OraSession )
57
        On Error Resume Next
58
 
59
        OraDatabase.ExecuteSQL _
60
        "BEGIN "&_
61
        "   :RETURN_CODE := PK_ENVIRONMENT.REMOVE_PACKAGE ( :PV_ID, :RTAG_ID, :USER_ID, :FORCE_REMOVE );"&_
62
        "END; "
63
 
64
        objEH.CatchORA ( OraSession )
65
 
66
        OraDatabase.Parameters.Remove "PV_ID"
67
        OraDatabase.Parameters.Remove "RTAG_ID"
68
        OraDatabase.Parameters.Remove "USER_ID"
69
        OraDatabase.Parameters.Remove "FORCE_REMOVE"
70
        OraDatabase.Parameters.Remove "RETURN_CODE"
71
 
72
        If Not objEH.LastOraFailed Then
73
         If bReleased Then
74
           Call objRC.Run_ReleaseChanged(parRtag_id,nPvId,enumRELEASE_CHANGE_MODE_PKG_REMOVED,false)
75
         End If  
76
        End If  
77
 
78
        Set objRC = Nothing
79
 
80
   Next
81
End If
82
'---------------------------------------------------------------
83
%>
84
<html>
85
<head>
86
<title><%=Title(parRtag_id)%></title>
87
<link rel="shortcut icon" href="<%=FavIcon%>"/>
88
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
89
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
90
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
91
<link rel="stylesheet" href="images/navigation.css" type="text/css">
92
<script language="JavaScript" src="images/common.js"></script>
93
<script language="JavaScript" src="scripts/remote_scripting.js"></script>
94
<!--#include file="_jquery_includes.asp"-->
95
<!-- TIPS -->
96
<script language="JavaScript" src="images/tipster.js"></script>
97
<script language="JavaScript" src="images/_help_tips.js"></script>
98
 
99
<!-- DROPDOWN MENUS -->
100
<!--#include file="_menu_def.asp"-->
101
<script language="JavaScript1.2" src="images/popup_menu.js"></script>
102
</head>
103
<body bgcolor="White" text="Black" leftmargin=0 topmargin=0 onLoad="ProgressBar.style.visibility='hidden'">
104
<!-- MENU LAYERS -------------------------------------->
105
<div id="popmenu" class="menuskin" onMouseover="clearhidemenu();highlightmenu(event,'on')" onMouseout="highlightmenu(event,'off');dynamichide(event)"></div>
106
<!-- TIPS LAYERS -------------------------------------->
107
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
108
<!----------------------------------------------------->
109
<!-- HEADER -->
110
<!--#include file="_header.asp"-->
111
<!-- BODY ---->
112
<table width="100%" border="0" cellspacing="0" cellpadding="0">
113
	<tr>
114
		<td valign="top" width="1" background="images/bg_bage.gif">
115
		<!-- LEFT -->
116
		<!--#include file="_environment.asp"-->
117
		</td>
118
		<td width="1" bgcolor="#999999"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
119
		<td valign="top" width="100%">
120
		<!-- MIDDLE -->
121
          <%
122
          ' Determine if the current user can remove packages from this release
123
          If releaseIsWritable(ReleaseMode) Then
124
              enableRemoval = TRUE
125
              enabledText = ""
126
          End If
127
 
128
          Dim Query_String
129
          Query_String = ReadFile( rootPath & "queries\rep_obsolete_packages.sql" )
130
          OraDatabase.Parameters.Add "RTAG_ID", parRtag_id, ORAPARM_INPUT, ORATYPE_NUMBER
131
          %>
132
          <form method="post" name="removePackages">
133
          <table class="embedded_table" width="10%">
134
             <tr>
135
                <td width="1%" nowrap class="body_colb">&nbsp;</td>
136
                <td width="1%" nowrap class="body_colb">Package Name and Version&nbsp;&nbsp;&nbsp;</td>
137
                <td width="1%" nowrap class="body_colb">Released&nbsp;&nbsp;&nbsp;</td>
138
                <td width="1%" nowrap class="body_colb">Added to Release&nbsp;&nbsp;&nbsp;</td>
139
                <td width="1%" nowrap class="body_colb"></td>
140
             </tr>
141
             <tr>
142
                <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
143
             </tr>
144
             <%
145
             Dim currView_id
146
             currView_id = -1
147
             Dim rsRep
148
             Set rsRep = OraDatabase.DbCreateDynaset( Query_String, 0 )
149
 
150
             If rsRep.RecordCount = 0 Then
151
                With Response
152
                   .write "<tr>"
153
                   .write "<td colspan='5' class='body_row'>Found 0 records</td>"
154
                   .write "</tr>"
155
                End With
156
             End If
157
 
158
             While ((NOT rsRep.BOF) AND (NOT rsRep.EOF))
159
                ' -------- GROUP BY BASE VIEW  -----------------
160
                If CDbl(currView_id) <> CDbl(rsRep("view_id")) Then
161
                   %>
162
                   <tr>
163
                      <td colspan="4" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
164
                      <td></td>
165
                   </tr>
166
                   <tr>
167
                      <td nowrap class="body_scol"><%=rsRep("view_name")%></td>
168
                      <td class="body_scol"></td>
169
                      <td class="body_scol"></td>
170
                      <td class="body_scol"></td>
171
                      <td class="body_scol"></td>
172
                   </tr>
173
                   <%
174
                   currView_id = CDbl(rsRep("view_id"))
175
                End If
176
                ' -------- END GROUP ------------------------
177
                %>
178
                <tr>
179
                   <td class="body_row"></td>
180
                   <td nowrap class="body_row"><a href="used_by.asp?pv_id=<%=rsRep("pv_id")%>&rtag_id=<%=parRtag_id%>" class="txt_linked"><%=rsRep("pkg_name") &" "& rsRep("pkg_version")%></a></td>
181
                   <td nowrap class="body_row"><%=EuroDate( rsRep("modified_stamp") )%> by <a href="mailto:<%=rsRep("modifier_email")%>" class="txt_linked"><%=rsRep("modifier")%></a>&nbsp;&nbsp;&nbsp;</td>
182
                   <td nowrap class="body_row"><%=EuroDate( rsRep("insert_stamp") )%> by <a href="mailto:<%=rsRep("insertor_email")%>" class="txt_linked"><%=rsRep("insertor")%></a>&nbsp;&nbsp;&nbsp;</td>
183
                   <td nowrap class="body_row"><input type="checkbox" name="list_pv_id" <%=enabledText%> value="<%=rsRep("pv_id")%>"></td>
184
                </tr>
185
                <%  rsRep.MoveNext
186
             WEnd
187
             %>
188
             <tr>
189
                <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
190
             </tr>
191
             <tr>
192
                <td class="body_scol"></td>
193
                <td class="body_scol"></td>
194
                <td class="body_scol"></td>
195
                <td class="body_scol" colspan=2 style="text-align:right">
196
                    <input type="submit" value="Remove from Release" <%=enabledText%> onclick="return vixConfirm('Remove all selected packages from this Release',{post: 'removePackages'})">
197
                </td>
198
             </tr>
199
             <tr>
200
                <td colspan="5" background="images/bg_rep_line.gif"><img src="images/spacer.gif" width="1" height="1"></td>
201
             </tr>
202
             <tr>
203
                <td colspan="5" class=body_txt>
204
                These packages are not used within this Release. There is no package that lists any of these packages as a dependent.
205
                <p>The named packages can be removed without breaking the build, although they may be required for test purposes.
206
                <p>Packages in the 'PRODUCTS' or 'AUTO PRODUCTS' view are not shown in this list. 
207
                <br>It is assumed that they are to be deployed and as such do not need to be used.
208
                <p>Removing one or more packages may result in other packages nolonger being used.
209
                </td>
210
             </tr>
211
          </table>
212
          <input type="hidden" name="action" value="RemovePackages">
213
          </form>
214
        <!-- End of Middle -->
215
		</td>
216
	</tr>
217
</table>
218
 
219
<!-- FOOTER -->
220
<!--#include file="_footer.asp"-->
221
</body>
222
</html>
223
<%
224
Call Destroy_All_Objects
225
%>