Subversion Repositories DevTools

Rev

Rev 1281 | Blame | Compare with Previous | Last modification | View Log | RSS feed

<%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
'                                  Import Dependency
'               --- PROCESS FORM ---
'=====================================================
%>
<%
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"-->
<%
' Set rfile parameter. This is a return page after Login
Call objPMod.StoreParameter ( "rfile", "dependencies.asp" )
'------------ ACCESS CONTROL ------------------
%>
<!--#include file="_access_control_login.asp"-->
<!--#include file="_access_control_general.asp"-->
<!--#include file="_access_control_project.asp"-->
<%
'------------ Variable Definition -------------
Dim parFromRtag_id
Dim parToRtag_id
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
parFromRtag_id = QStrPar("FROMrtag_id")
parToRtag_id = QStrPar("ToRtag_id")
'----------------------------------------------
%>
<%
Function Import_Dependency ( NNFromRtag_id, NNToRtag_id )
        
        On Error Resume Next
        objEH.ErrorRedirect = TRUE
        
        
        OraDatabase.Parameters.Add "PV_ID", NNFromRtag_id,      ORAPARM_INPUT, ORATYPE_NUMBER 
        OraDatabase.Parameters.Add "RTAG_ID", NNToRtag_id,      ORAPARM_INPUT, ORATYPE_NUMBER 
        OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId,  ORAPARM_INPUT, ORATYPE_NUMBER 
        
        
        objEH.TryORA ( OraSession )
        
        ' Remove old Work in Progress Contents
        OraDatabase.ExecuteSQL _
        "INSERT INTO RELEASE_CONTENT rc ( RTAG_ID, PV_ID, BASE_VIEW_ID, INSERT_STAMP, INSERTOR_ID, PKG_STATE )"&_
        "SELECT DISTINCT"&_
        "  :RTAG_ID,"&_
        "   qry.DPV_ID,"&_
        "   7,"&_
        "   ORA_SYSDATE,"&_
        "   1,"&_
        "   0"&_
    " FROM ("&_
        "               SELECT dep.*,"&_
        "                          LEVEL AS LEVEL_NUM"&_
        "                 FROM PACKAGE_DEPENDENCIES dep"&_
        "               START WITH dep.PV_ID IN ( :PV_ID ) "&_
        "               CONNECT BY PRIOR dep.DPV_ID = dep.PV_ID"&_
        "       ) qry,"&_
        "       PACKAGES pkg,"&_
        "       PACKAGE_VERSIONS pv"&_
        " WHERE qry.PV_ID = pv.PV_ID AND pv.PKG_ID = pkg.PKG_ID"&_
        " and qry.dpv_id NOT IN (select pv_id from release_content where rtag_id = :RTAG_ID)"


        


        
        objEH.CatchORA ( OraSession )
        
        
        
        OraDatabase.Parameters.Remove "PV_ID"
        OraDatabase.Parameters.Remove "RTAG_ID"
        OraDatabase.Parameters.Remove "USER_ID"
End Function

%>
<%
'-----------------------  MAIN LINE  ---------------------------
'--- Process submition ---
If (parFromRtag_id <> "") AND (parToRtag_id <> "") Then
        ' All mandatory parameters FOUND

        
        'COMPLETE THE REQUEST...
        Call Import_Dependency ( parFromRtag_id, parToRtag_id )
        
        
        If objEH.Finally Then
                Response.Redirect("dependencies.asp?rtag_id="& parToRtag_id )
        End If
        
        
Else
        Response.write "Some mandatory parameters are missing!" & "<br>" 'TODO
        Response.write QSTR_All 
End If
%>


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