Subversion Repositories DevTools

Rev

Rev 5952 | Rev 5980 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
5357 dpurdie 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
5931 dpurdie 4
'   _destroy_package.asp
5
'   Intended to be invoked within an Iframe
5357 dpurdie 6
'=====================================================
7
%>
8
<%
9
Option explicit
5931 dpurdie 10
Response.Expires = 0
5357 dpurdie 11
%>
12
<!--#include file="common/conf.asp"-->
13
<!--#include file="common/globals.asp"-->
14
<!--#include file="common/formating.asp"-->
15
<!--#include file="common/qstr.asp"-->
16
<!--#include file="common/common_subs.asp"-->
5931 dpurdie 17
<!--#include file="common/_form_window_common.asp"-->
5357 dpurdie 18
<%
19
'------------ ACCESS CONTROL ------------------
20
%>
21
<!--#include file="_access_control_general.asp"-->
22
<%
5931 dpurdie 23
'------------ VARIABLE DEFINITION -------------
24
Dim sMessage, sMessageType
25
Dim parPvId
26
Dim rsQry, rsView
27
Dim Qstring
28
Dim pName, pVersion
29
Dim illAdvised, canDoBad
30
'------------ CONSTANTS DECLARATION -----------
31
'------------ VARIABLE INIT -------------------
32
sMessage = NULL
33
sMessageType = 3
34
parPvId = Request("pv_id")
35
canDoBad = canShowControlInProject ("DestroyPackage")
36
illAdvised = FALSE
37
Set objFormCollector = CreateObject("Scripting.Dictionary")
38
'------------ CONDITIONS ----------------------
5357 dpurdie 39
'----------------------------------------------
40
%>
41
<%
5931 dpurdie 42
'------------------------------------------------------------------------------------------------------------------------------------------
43
'
44
' Add a line of text to the System Message
45
'   eLevel - 1 == Critical, 2==Warning, 3==Note
46
Sub sMessageAdd(eLevel, text)
47
    If NOT isNull(sMessage) Then
48
        sMessage = sMessage & "<br>"
49
    End If
50
    sMessage = sMessage & text
5357 dpurdie 51
 
5931 dpurdie 52
    If eLevel < sMessageType  Then
53
        sMessageType = eLevel
54
    End If
55
End Sub
56
 
57
Sub DestroyPackage ( nPvId, cOverrideWarnings, outSet )
58
 
5357 dpurdie 59
   OraDatabase.Parameters.Add "PV_ID",             nPvId,             ORAPARM_INPUT,  ORATYPE_NUMBER
5931 dpurdie 60
   OraDatabase.Parameters.Add "RTAG_ID",           parRtag_Id,        ORAPARM_INPUT,  ORATYPE_NUMBER
61
   OraDatabase.Parameters.Add "OVERRIDE_WARNINGS", cOverrideWarnings, ORAPARM_INPUT,  ORATYPE_NUMBER
62
   OraDatabase.Parameters.Add "RESULTS",          NULL,               ORAPARM_OUTPUT, ORATYPE_CURSOR
5357 dpurdie 63
 
5931 dpurdie 64
   objEH.ErrorRedirect = FALSE
5357 dpurdie 65
   objEH.TryORA ( OraSession )
66
   On Error Resume Next
67
 
68
   OraDatabase.ExecuteSQL _
69
   "BEGIN "&_
5931 dpurdie 70
   " PK_PACKAGE.destroy_package_extended (:PV_ID, :RTAG_ID, :OVERRIDE_WARNINGS, :RESULTS ); "&_
5357 dpurdie 71
   "END; "
72
 
73
   objEH.CatchORA ( OraSession )
74
 
5931 dpurdie 75
    ' NULL RESULTS list indicates that the operation did not generate any errors
76
    outSet = nothing
77
    If NOT isNull(OraDatabase.Parameters("RESULTS").Value) Then
78
        Set outSet = OraDatabase.Parameters("RESULTS").Value
79
    End If
5357 dpurdie 80
 
81
   OraDatabase.Parameters.Remove "PV_ID"
5952 dpurdie 82
   OraDatabase.Parameters.Remove "RTAG_ID"
5357 dpurdie 83
   OraDatabase.Parameters.Remove "OVERRIDE_WARNINGS"
5931 dpurdie 84
   OraDatabase.Parameters.Remove "RESULTS"
5357 dpurdie 85
End Sub
5902 dpurdie 86
 
5931 dpurdie 87
Function getRecordCount( obj )
88
    getRecordCount = 0
89
    If NOT isNull(obj) Then
90
        If isObject(obj) Then
91
            getRecordCount = obj.RecordCount
5902 dpurdie 92
        End If
93
    End If
94
End Function
5357 dpurdie 95
 
5931 dpurdie 96
'------------ RUN BEFORE PAGE RENDER ----------
5357 dpurdie 97
' Setup persistance object
98
Call objPMod.StoreParameter ( "bfile", Request("bfile") )
99
Call objPMod.StoreParameter ( "rfile", Request("rfile") )
100
Call objPMod.StoreParameter ( "rtag_id", Request("rtag_id") )
101
Call objPMod.StoreParameter ( "pv_id", Request("pv_id") )
102
Call objPMod.StoreParameter ( "pkg_id", Request("pkg_id") )
103
Call objPMod.StoreParameter ( "OLDpv_id", Request("OLDpv_id") )
104
Call objPMod.StoreParameter ( "FLuser_name", Request("FLuser_name") )
105
Call objPMod.StoreParameter ( "FLpkg_version", Request("FLpkg_version") )
106
Call objPMod.StoreParameter ( "listby", Request("listby") )
5933 dpurdie 107
Call objPMod.StoreParameter ( "index", Request("index") )
5931 dpurdie 108
'   Basic sanity checks
5902 dpurdie 109
'
5931 dpurdie 110
If objAccessControl.UserId = "" Then
111
    sMessageAdd 1, "No longer logged in"
5902 dpurdie 112
End If
113
 
5931 dpurdie 114
If parPvId = "" Then
115
    sMessageAdd 1, "Internal: PVID not provided"
5902 dpurdie 116
End If
117
 
5931 dpurdie 118
If CBool(Request("action")) AND isNULL(sMessage) Then
119
    '
120
    '   Attempt to desroy the package    
121
    DestroyPackage parPvId, RequestDefault("destroy", 1), rsView
122
    If getRecordCount(rsView) = 0 Then
123
        If Request("bfile") <> "" Then
124
            OpenInParentWindow(objPMod.GetParamValue("bfile") &"?DESTROYED=OK"& objPMod.ComposeURLWithout("bfile,pv_id"))
125
        Else
126
            ReloadParentWindow()
127
        End If
5957 dpurdie 128
        Call Destroy_All_Objects
5931 dpurdie 129
        Response.End
130
    End If
5357 dpurdie 131
Else
5931 dpurdie 132
    '
133
    '   Show the current set of reasons for NOT destroying the package
134
    DestroyPackage parPvId, 0, rsView
135
End If
5357 dpurdie 136
 
5931 dpurdie 137
'   Need to generate a display
138
'   Get the Package Version information
139
'
140
Qstring = "SELECT p.pkg_name, pv.pkg_version" &_
141
          " FROM packages p, package_versions pv" &_
142
          " WHERE p.pkg_id = pv.pkg_id" &_
143
          "   AND pv.pv_id = " & parPvId
5357 dpurdie 144
 
5931 dpurdie 145
Set rsQry = OraDatabase.DbCreateDynaset( Qstring, cint(0))
146
If rsQry.RecordCount = 0 Then
147
    sMessageAdd 1, "Package Version no longer exists"
5357 dpurdie 148
End If
5931 dpurdie 149
pName = rsQry("pkg_name")
150
pVersion = rsQry("pkg_version") 
151
rsQry.Close
152
Set rsQry = nothing
5357 dpurdie 153
 
5931 dpurdie 154
'----------------------------------------------
5357 dpurdie 155
%>
156
<html>
157
<head>
158
<title>Release Manager</title>
159
<link rel="shortcut icon" href="<%=FavIcon%>"/>
160
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
161
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5931 dpurdie 162
<link href="images/release_manager_style.css" rel="stylesheet" type="text/css">
5357 dpurdie 163
<script language="JavaScript" src="images/common.js"></script>
164
</head>
5931 dpurdie 165
<body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" >
166
<table class="full_table body_txt" border="0" cellspacing="0" cellpadding="10">
167
   <tr>
168
      <td bgcolor="#FFFFFF" class="body_txt nowrap">
169
        <%=enum_IMG_Critical%><span>You are about to destroy <%=pName%>&nbsp;<%=pVersion%>. You cannot undo this operation.</span>
170
      </td>
171
   </tr>
172
   <%
173
   '-- FROM START --------------------------------------------------------------------------------------------------------------
174
   objFormComponent.FormName = "FormName"
175
   objFormComponent.FormClass = "form_tight"
176
   objFormComponent.Action = ScriptName
177
   Call objFormComponent.FormStart()
178
   %>
179
   <tr>
180
      <td>
181
         <!-- NEW PRODUCT +++++++++++++++++++++++++++++++++++++++++++++++ -->
182
         <%Call Messenger ( sMessage , sMessageType, "100%" )%>
183
         <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
184
         <!--#include file="messages/_msg_inline.asp"-->
5357 dpurdie 185
 
5931 dpurdie 186
         <%If IsObject(rsView) Then %>
187
         <%If rsView.RecordCount > 0 Then %>
188
         <table width="50%" border="0" class=body_txt>
189
            <tr>
190
               <td colspan=3><b>This package is in use</b></th>
191
            </tr>
192
            <%
193
            Do Until ((rsView.BOF) OR (rsView.EOF))
194
                 Dim mtype
195
                 mtype = rsView("mtype")
196
                 Response.Write "<tr><td nowrap>"
197
                 If mtype <> "A" Then
198
                    Response.Write enum_imgCritical
199
                    illAdvised = TRUE
200
                 End If
201
                 Response.Write "<td nowrap>" & rsView("MSG") & "</td>"  
202
                 Response.Write "</tr>"          
203
                 rsView.MoveNext
204
              Loop
205
            %>
206
         </table>
207
         <%ElseIf isNULL(sMessage) Then%>
208
         There is no reasons that this package cannot be destroyed.
209
         <%End If%>
210
         <%End If%>
211
      </td>
212
   </tr>
213
<%If illAdvised Then %>
214
    <%If canDoBad Then %>
215
          <td bgcolor="#FFFFFF">
216
            <table class="full_table body_txt" >
217
                <tr>
218
                    <td>Destroy this version, even though it will affect other packages and releases. The package will be removed from:
219
                    <ul>
220
                        <li>All packages that depend on this version
221
                        <li>All SDKs that use this version
222
                        <li>All SBOMS that use this version
223
                    </ul>
224
                    This is strongly discouraged.
225
                    </td>
226
                    <td><input name=destroy value=2 type="checkbox"></td>
227
                </tr>
228
            </table>
229
          </td>
230
    <%Else%>
231
          <td bgcolor="#FFFFFF">
232
            You do not have permission to destroy this package. The side effects of destroying
233
            this package are wide ranging.
234
          </td>
235
    <%End If%>
236
<%End If%>
5357 dpurdie 237
   <tr>
5931 dpurdie 238
      <td bgcolor="#FFFFFF">
239
         <table class=full_table >
5357 dpurdie 240
            <tr>
5931 dpurdie 241
               <td><%=ProgressBar()%></td>
242
               <td align="right">
243
                  <%If isNULL(sMessage) Then%>
244
                  <input name="btn" type="submit" class="form_btn" value="Destroy">
245
                  <%End If%>
246
                  <input name="btn" type="reset" class="form_btn" value="Cancel" onclick="parent.closeIFrame();">
5357 dpurdie 247
               </td>
248
            </tr>
249
         </table>
250
      </td>
251
   </tr>
5931 dpurdie 252
   <%=objPMod.ComposeHiddenTags()%>
253
   <input type="hidden" name="action" value="true">
254
   <%
255
   Call objFormComponent.FormEnd()
256
   '-- FROM END ----------------------------------------------------------------------------------------------------------------
257
   %>
5357 dpurdie 258
</table>
259
</body>
260
</html>
5931 dpurdie 261
<%
262
'------------ RUN AFTER PAGE RENDER -----------
263
Set objFormCollector = Nothing
264
'----------------------------------------------
265
On Error Resume Next
266
rsView.Close
267
Set rsView = nothing
268
Call Destroy_All_Objects
269
%>
5357 dpurdie 270
 
271