Subversion Repositories DevTools

Rev

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