Subversion Repositories DevTools

Rev

Rev 5933 | Rev 5957 | 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
128
        Response.End
129
    End If
5357 dpurdie 130
Else
5931 dpurdie 131
    '
132
    '   Show the current set of reasons for NOT destroying the package
133
    DestroyPackage parPvId, 0, rsView
134
End If
5357 dpurdie 135
 
5931 dpurdie 136
'   Need to generate a display
137
'   Get the Package Version information
138
'
139
Qstring = "SELECT p.pkg_name, pv.pkg_version" &_
140
          " FROM packages p, package_versions pv" &_
141
          " WHERE p.pkg_id = pv.pkg_id" &_
142
          "   AND pv.pv_id = " & parPvId
5357 dpurdie 143
 
5931 dpurdie 144
Set rsQry = OraDatabase.DbCreateDynaset( Qstring, cint(0))
145
If rsQry.RecordCount = 0 Then
146
    sMessageAdd 1, "Package Version no longer exists"
5357 dpurdie 147
End If
5931 dpurdie 148
pName = rsQry("pkg_name")
149
pVersion = rsQry("pkg_version") 
150
rsQry.Close
151
Set rsQry = nothing
5357 dpurdie 152
 
5931 dpurdie 153
'----------------------------------------------
5357 dpurdie 154
%>
155
<html>
156
<head>
157
<title>Release Manager</title>
158
<link rel="shortcut icon" href="<%=FavIcon%>"/>
159
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
160
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
5931 dpurdie 161
<link href="images/release_manager_style.css" rel="stylesheet" type="text/css">
5357 dpurdie 162
<script language="JavaScript" src="images/common.js"></script>
163
</head>
5931 dpurdie 164
<body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" >
165
<table class="full_table body_txt" border="0" cellspacing="0" cellpadding="10">
166
   <tr>
167
      <td bgcolor="#FFFFFF" class="body_txt nowrap">
168
        <%=enum_IMG_Critical%><span>You are about to destroy <%=pName%>&nbsp;<%=pVersion%>. You cannot undo this operation.</span>
169
      </td>
170
   </tr>
171
   <%
172
   '-- FROM START --------------------------------------------------------------------------------------------------------------
173
   objFormComponent.FormName = "FormName"
174
   objFormComponent.FormClass = "form_tight"
175
   objFormComponent.Action = ScriptName
176
   Call objFormComponent.FormStart()
177
   %>
178
   <tr>
179
      <td>
180
         <!-- NEW PRODUCT +++++++++++++++++++++++++++++++++++++++++++++++ -->
181
         <%Call Messenger ( sMessage , sMessageType, "100%" )%>
182
         <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
183
         <!--#include file="messages/_msg_inline.asp"-->
5357 dpurdie 184
 
5931 dpurdie 185
         <%If IsObject(rsView) Then %>
186
         <%If rsView.RecordCount > 0 Then %>
187
         <table width="50%" border="0" class=body_txt>
188
            <tr>
189
               <td colspan=3><b>This package is in use</b></th>
190
            </tr>
191
            <%
192
            Do Until ((rsView.BOF) OR (rsView.EOF))
193
                 Dim mtype
194
                 mtype = rsView("mtype")
195
                 Response.Write "<tr><td nowrap>"
196
                 If mtype <> "A" Then
197
                    Response.Write enum_imgCritical
198
                    illAdvised = TRUE
199
                 End If
200
                 Response.Write "<td nowrap>" & rsView("MSG") & "</td>"  
201
                 Response.Write "</tr>"          
202
                 rsView.MoveNext
203
              Loop
204
            %>
205
         </table>
206
         <%ElseIf isNULL(sMessage) Then%>
207
         There is no reasons that this package cannot be destroyed.
208
         <%End If%>
209
         <%End If%>
210
      </td>
211
   </tr>
212
<%If illAdvised Then %>
213
    <%If canDoBad Then %>
214
          <td bgcolor="#FFFFFF">
215
            <table class="full_table body_txt" >
216
                <tr>
217
                    <td>Destroy this version, even though it will affect other packages and releases. The package will be removed from:
218
                    <ul>
219
                        <li>All packages that depend on this version
220
                        <li>All SDKs that use this version
221
                        <li>All SBOMS that use this version
222
                    </ul>
223
                    This is strongly discouraged.
224
                    </td>
225
                    <td><input name=destroy value=2 type="checkbox"></td>
226
                </tr>
227
            </table>
228
          </td>
229
    <%Else%>
230
          <td bgcolor="#FFFFFF">
231
            You do not have permission to destroy this package. The side effects of destroying
232
            this package are wide ranging.
233
          </td>
234
    <%End If%>
235
<%End If%>
5357 dpurdie 236
   <tr>
5931 dpurdie 237
      <td bgcolor="#FFFFFF">
238
         <table class=full_table >
5357 dpurdie 239
            <tr>
5931 dpurdie 240
               <td><%=ProgressBar()%></td>
241
               <td align="right">
242
                  <%If isNULL(sMessage) Then%>
243
                  <input name="btn" type="submit" class="form_btn" value="Destroy">
244
                  <%End If%>
245
                  <input name="btn" type="reset" class="form_btn" value="Cancel" onclick="parent.closeIFrame();">
5357 dpurdie 246
               </td>
247
            </tr>
248
         </table>
249
      </td>
250
   </tr>
5931 dpurdie 251
   <%=objPMod.ComposeHiddenTags()%>
252
   <input type="hidden" name="action" value="true">
253
   <%
254
   Call objFormComponent.FormEnd()
255
   '-- FROM END ----------------------------------------------------------------------------------------------------------------
256
   %>
5357 dpurdie 257
</table>
258
</body>
259
</html>
5931 dpurdie 260
<%
261
'------------ RUN AFTER PAGE RENDER -----------
262
Set objFormCollector = Nothing
263
'----------------------------------------------
264
On Error Resume Next
265
rsView.Close
266
Set rsView = nothing
267
Call Destroy_All_Objects
268
%>
5357 dpurdie 269
 
270