Rev 5980 | Rev 6181 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed
<%@LANGUAGE="VBSCRIPT"%><%'=====================================================' _destroy_package.asp' Intended to be invoked within an Iframe'=====================================================%><%Option explicitResponse.Expires = 0%><!--#include file="common/conf.asp"--><!--#include file="common/globals.asp"--><!--#include file="common/formating.asp"--><!--#include file="common/qstr.asp"--><!--#include file="common/common_subs.asp"--><!--#include file="common/_form_window_common.asp"--><%'------------ ACCESS CONTROL ------------------%><!--#include file="_access_control_login.asp"--><!--#include file="_access_control_general.asp"--><%'------------ VARIABLE DEFINITION -------------Dim sMessage, sMessageTypeDim parPvIdDim rsQry, rsViewDim QstringDim pName, pVersionDim illAdvised, canDoBad'------------ CONSTANTS DECLARATION -----------'------------ VARIABLE INIT -------------------sMessage = NULLsMessageType = 3parPvId = Request("pv_id")canDoBad = canShowControlInProject ("DestroyPackage")illAdvised = FALSESet objFormCollector = CreateObject("Scripting.Dictionary")'------------ CONDITIONS ----------------------'----------------------------------------------%><%'------------------------------------------------------------------------------------------------------------------------------------------'' Add a line of text to the System Message' eLevel - 1 == Critical, 2==Warning, 3==NoteSub sMessageAdd(eLevel, text)If NOT isNull(sMessage) ThensMessage = sMessage & "<br>"End IfsMessage = sMessage & textIf eLevel < sMessageType ThensMessageType = eLevelEnd IfEnd SubSub DestroyPackage ( nPvId, cOverrideWarnings, outSet )OraDatabase.Parameters.Add "PV_ID", nPvId, ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "RTAG_ID", parRtag_Id, ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "OVERRIDE_WARNINGS", cOverrideWarnings, ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "RESULTS", NULL, ORAPARM_OUTPUT, ORATYPE_CURSORobjEH.ErrorRedirect = FALSEobjEH.TryORA ( OraSession )On Error Resume NextOraDatabase.ExecuteSQL _"BEGIN "&_" PK_PACKAGE.destroy_package_extended (:PV_ID, :RTAG_ID, :OVERRIDE_WARNINGS, :RESULTS ); "&_"END; "objEH.CatchORA ( OraSession )' NULL RESULTS list indicates that the operation did not generate any errorsoutSet = nothingIf NOT isNull(OraDatabase.Parameters("RESULTS").Value) ThenSet outSet = OraDatabase.Parameters("RESULTS").ValueEnd IfOraDatabase.Parameters.Remove "PV_ID"OraDatabase.Parameters.Remove "RTAG_ID"OraDatabase.Parameters.Remove "OVERRIDE_WARNINGS"OraDatabase.Parameters.Remove "RESULTS"End SubFunction getRecordCount( obj )getRecordCount = 0If NOT isNull(obj) ThenIf isObject(obj) ThengetRecordCount = obj.RecordCountEnd IfEnd IfEnd Function'------------ RUN BEFORE PAGE RENDER ----------' Setup persistance objectCall objPMod.StoreParameter ( "bfile", Request("bfile") )Call objPMod.StoreParameter ( "rfile", Request("rfile") )Call objPMod.StoreParameter ( "rtag_id", Request("rtag_id") )Call objPMod.StoreParameter ( "pv_id", Request("pv_id") )Call objPMod.StoreParameter ( "pkg_id", Request("pkg_id") )Call objPMod.StoreParameter ( "OLDpv_id", Request("OLDpv_id") )Call objPMod.StoreParameter ( "FLuser_name", Request("FLuser_name") )Call objPMod.StoreParameter ( "FLpkg_version", Request("FLpkg_version") )Call objPMod.StoreParameter ( "listby", Request("listby") )Call objPMod.StoreParameter ( "index", Request("index") )' Basic sanity checks'If objAccessControl.UserId = "" ThensMessageAdd 1, "No longer logged in"End IfIf parPvId = "" ThensMessageAdd 1, "Internal: PVID not provided"End IfIf CBool(Request("action")) AND isNULL(sMessage) Then'' Attempt to destroy the packageDestroyPackage parPvId, RequestDefault("destroy", 1), rsViewIf getRecordCount(rsView) = 0 ThenIf Request("bfile") <> "" ThenOpenInParentWindow(objPMod.GetParamValue("bfile") &"?DESTROYED=OK"& objPMod.ComposeURLWithout("bfile,pv_id"))ElseReloadParentWindow()End IfCall Destroy_All_ObjectsResponse.EndEnd IfElse'' Show the current set of reasons for NOT destroying the packageDestroyPackage parPvId, 0, rsViewEnd If' Need to generate a display' Get the Package Version information'Qstring = "SELECT p.pkg_name, pv.pkg_version" &_" FROM packages p, package_versions pv" &_" WHERE p.pkg_id = pv.pkg_id" &_" AND pv.pv_id = " & parPvIdSet rsQry = OraDatabase.DbCreateDynaset( Qstring, cint(0))If rsQry.RecordCount = 0 ThensMessageAdd 1, "Package Version no longer exists"End IfpName = rsQry("pkg_name")pVersion = rsQry("pkg_version")rsQry.CloseSet rsQry = nothing'----------------------------------------------%><html><head><title>Release Manager</title><link rel="shortcut icon" href="<%=FavIcon%>"/><meta HTTP-EQUIV="Pragma" CONTENT="no-cache"><meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"><link href="images/release_manager_style.css" rel="stylesheet" type="text/css"><script language="JavaScript" src="images/common.js"></script></head><body background="images/bg_bage_0.gif" leftmargin="0" topmargin="0" ><table class="full_table body_txt" border="0" cellspacing="0" cellpadding="10"><tr><td bgcolor="#FFFFFF" class="body_txt nowrap"><%=enum_IMG_Critical%><span>You are about to destroy <%=pName%> <%=pVersion%>. You cannot undo this operation.</span></td></tr><%'-- FROM START --------------------------------------------------------------------------------------------------------------objFormComponent.FormName = "FormName"objFormComponent.FormClass = "form_tight"objFormComponent.Action = ScriptNameCall objFormComponent.FormStart()%><tr><td><!-- NEW PRODUCT +++++++++++++++++++++++++++++++++++++++++++++++ --><%Call Messenger ( sMessage , sMessageType, "100%" )%><!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ --><!--#include file="messages/_msg_inline.asp"--><%If IsObject(rsView) Then %><%If rsView.RecordCount > 0 Then %><table width="50%" border="0" class=body_txt><tr><td colspan=3><b>This package is in use</b></th></tr><%Do Until ((rsView.BOF) OR (rsView.EOF))Dim mtypemtype = rsView("mtype")Response.Write "<tr><td nowrap>"If mtype <> "A" ThenResponse.Write enum_imgCriticalillAdvised = TRUEEnd IfResponse.Write "<td nowrap>" & rsView("MSG") & "</td>"Response.Write "</tr>"rsView.MoveNextLoop%></table><%ElseIf isNULL(sMessage) Then%>There is no reasons that this package cannot be destroyed.<%End If%><%End If%></td></tr><%If illAdvised Then %><%If canDoBad Then %><td bgcolor="#FFFFFF"><table class="full_table body_txt" ><tr><td>Destroy this version, even though it will affect other packages and releases. The package will be removed from:<ul><li>All packages that depend on this version<li>All SDKs that use this version<li>All SBOMS that use this version</ul>This is strongly discouraged.</td><td><input name=destroy value=2 type="checkbox"></td></tr></table></td><%Else%><td bgcolor="#FFFFFF">You do not have permission to destroy this package. The side effects of destroyingthis package are wide ranging.</td><%End If%><%End If%><tr><td bgcolor="#FFFFFF"><table class=full_table ><tr><td><%=ProgressBar()%></td><td align="right"><%If isNULL(sMessage) Then%><input name="btn" type="submit" class="form_btn" value="Destroy"><%End If%><input name="btn" type="reset" class="form_btn" value="Cancel" onclick="parent.closeIFrame();"></td></tr></table></td></tr><%=objPMod.ComposeHiddenTags()%><input type="hidden" name="action" value="true"><%Call objFormComponent.FormEnd()'-- FROM END ----------------------------------------------------------------------------------------------------------------%></table></body></html><%'------------ RUN AFTER PAGE RENDER -----------Set objFormCollector = Nothing'----------------------------------------------On Error Resume NextrsView.CloseSet rsView = nothingCall Destroy_All_Objects%>