Subversion Repositories DevTools

Rev

Blame | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'   sdk_add_release
'   Add and SDK to a given Release
'   Called with two parameters
'   The page will either:
'       add the SDKTAG to the Release - and then redirect to the dependencies tab
'   or
'       Fail in adding the SDK to the Release - and display a page of conflicting package-versions
'  
'=====================================================
%>
<%
Option explicit
' Good idea to set when using redirect
Response.Expires = 0   ' always load the page, dont store
%>

<!--#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/common_dbedit.asp"-->
<%
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_login.asp"-->
<!--#include file="_access_control_general.asp"-->
<!--#include file="_access_control_project.asp"-->
<%
'------------ Variable Definition -------------
Dim sdkAdded
Dim rsView
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
sdkAdded = FALSE

'----------------------------------------------
%>
<%
'-------------------------------------------------
' Function:     AddReleaseSDK    
' Description:  Add the nominated sdktag to the release
' Returns:      Number of Packages Inserted
'                < 0 - Error. Conflict list populated
'                      rsView is set to a list of PV_ID that cause the conflict
'                = 0 - No packages inserted
'                > 0 - Number of packages inserted 

Function AddReleaseSDK   ( nRtagId, nSdktagId  )
    OraDatabase.Parameters.Add "RTAG_ID",        nRtagId,                   ORAPARM_INPUT, ORATYPE_NUMBER
    OraDatabase.Parameters.Add "SDKTAG_ID",      nSdktagId,                 ORAPARM_INPUT, ORATYPE_NUMBER
    OraDatabase.Parameters.Add "USER_ID",        objAccessControl.UserId,   ORAPARM_INPUT, ORATYPE_NUMBER
    OraDatabase.Parameters.Add "INSERT_COUNT",   NULL,                      ORAPARM_OUTPUT, ORATYPE_NUMBER
    OraDatabase.Parameters.Add "CONFLICT_LIST",  NULL,                      ORAPARM_OUTPUT, ORATYPE_CURSOR

    objEH.TryORA ( OraSession )
    On Error Resume Next

    OraDatabase.ExecuteSQL _
    " BEGIN "&_
    "    PK_RELEASE.ADD_RELEASE_SDK ( :RTAG_ID, :SDKTAG_ID, :USER_ID, :INSERT_COUNT, :CONFLICT_LIST ); "&_
    " END; "

    objEH.CatchORA ( OraSession )

     '  INSERT_COUNT < 0 - Error. Conflict list populated
     '  INSERT_COUNT = 0 - No packages inserted
     '  INSERT_COUNT > 0 - Number of packages inserted 
     AddReleaseSDK = OraDatabase.Parameters("INSERT_COUNT").Value

    ' NULL Conflict list indicates that the operation did not fail
    ' There may have been no items to insert 
    If NOT isNull(OraDatabase.Parameters("CONFLICT_LIST").Value) Then
        Set rsView = OraDatabase.Parameters("CONFLICT_LIST").Value
        AddReleaseSDK = -1
    End If

    OraDatabase.Parameters.Remove "RTAG_ID"
    OraDatabase.Parameters.Remove "REF_RTAG_ID"
    OraDatabase.Parameters.Remove "USER_ID"
    OraDatabase.Parameters.Remove "INSERT_COUNT"
    OraDatabase.Parameters.Remove "CONFLICT_LIST"
End Function
%>
<%
'-----------------------  MAIN LINE  ---------------------------

'------ ACCESS CONTROL ----------
'If NOT canShowControlInProject("AddReleaseSDK") Then
'   Err.Raise 8, "User not authorized to add an SDK.<br>"& objPMod.ComposeURL()
'End If
'--------------------------------

If (Request("rtag_id") <> "")  AND  (Request("sdktag_id") <> "") Then

   '--- Process submition ---
   sdkAdded = AddReleaseSDK ( Request("rtag_id"), Request("sdktag_id")  )

   If sdkAdded >= 0 Then
      Response.Redirect( "dependencies.asp?rtag_id="& Request("rtag_id") )
   End If

Else

   Err.Raise 8, "This page requires more paramaters to run.<br>"& objPMod.ComposeURL()

End If

'----------------------------------------------------------------
%>


<html>
<head>
<title>Release Manager</title>
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
<link rel="stylesheet" href="images/navigation.css" type="text/css">
<script language="JavaScript" src="images/common.js"></script>

</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" >
<!-- BODY ---->


<table width="100%" height="98%"  border="0" cellpadding="0" cellspacing="0">
   <tr>
      <td align="center" valign="middle" background="images/bg_form_lightgray.gif">
         <table width="650" border="0" cellspacing="0" cellpadding="0">
            <tr>
               <td>
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
                     <tr>
                        <td align="left" valign="top" width="1%" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
                        <td background="images/lbox_bg_blue.gif"><!-- Heading -->
                        <img src="images/h_trsp_dot.gif" width="1" height="20">
                        <!-- END Heading --></td>
                        <td align="right" valign="top" width="1%" background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
                     </tr>
                     <tr>
                        <td width="1%" bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
                        <td bgcolor="#FFFFFF" valign="top">
                           <!-- Body -->
                           <table width="100%" border="0" cellspacing="1" cellpadding="2">
                              <form name="form" method="get" action="<%=ScriptName%>">
                                 <tr>
                                    <td width="1%"><img src="images/h_trsp_dot.gif" width="1" height="10"></td>
                                    <td width="1%" nowrap class="form_group" valign="bottom"></td>
                                    <td nowrap width="100%" align="right" class="form_step"></td>
                                 </tr>
                                 <tr>
                                    <td width="1%">&nbsp;</td>
                                    <td colspan="2" width="1%" nowrap class="form_field">
                                       <table width="100%"  border="0" cellspacing="0" cellpadding="10">
                                          <tr>
                                             <td background="images/bg_form_lightbluedark.gif"><p class="err_ttl">Please note:</p></td>
                                          </tr>
<%While ((NOT rsView.BOF) AND (NOT rsView.EOF))%>

                                          <tr>
                                             <td background="images/bg_form_lightgray.gif" class="form_item">
                                                <%
                                                Response.write "PVID:" & rsView(0)
                                                %>
                                             </td>
                                          </tr>
<%rsView.MoveNext%>
<%WEnd%>
                                          <tr>
                                             <td background="images/bg_form_lightgray.gif" class="form_item">This action will be cancelled ? </td>
                                          </tr>
                                       </table>
                                    </td>
                                 </tr>
                                 <tr>
                                    <td width="1%">&nbsp;</td>
                                    <td width="1%" nowrap class="form_field"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
                                    <td nowrap width="100%" class="body_scol">
                                       <br>
                                       <input type="reset" name="btn" value="   OK   " class="form_btn" onClick="history.back();">
                                       <br><br>
                                    </td>
                                 </tr>
                                 <%=objPMod.ComposeHiddenTags()%>
                              </form>
                           </table>
                           <!-- END Body-->
                        </td>
                        <td width="1%" background="images/lbox_bgside_white.gif">&nbsp;</td>
                     </tr>
                     <tr>
                        <td width="1%" background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
                        <td background="images/lbox_bg_blue.gif"></td>
                        <td width="1%" background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
                     </tr>
                  </table>
               </td>
            </tr>
         </table>
      </td>
   </tr>
</table>
</body>
</html>


<!-- DESTRUCTOR ------->
<!--#include file="common/destructor.asp"-->