Rev 6688 | Blame | Compare with Previous | Last modification | View Log | RSS feed
<%@LANGUAGE="VBSCRIPT"%><%'=====================================================' gotoLatestInRelease.asp'' This page will redirect the user the current version of a package within a release' It may be used to provide a dynamic link to a user'' Can also provide text output for the purposes of scripting'' Requires one of' rtag_id=nnn ' Release Tag' pname=aaaa&rname=aaaa ' Project Name and Release Name'' Requires one of:' pv_id=nnn' pkg_id=nn' pkgName=aaaa' Optional: page=name' If page is 'show' then the version of the package will be retuened as a single line of text'=====================================================%><!--#include file="common/conf.asp"--><!--#include file="common/globals.asp"--><!--#include file="common/qstr.asp"--><!--#include file="common/common_subs.asp"--><%Dim Query_StringDim pvIdDim pkgVersionDim parPageDim parPkgIdDim parPkgNameDim parProjNameDim parRelNameDim urlparPage = RequestDefault("page", "dependencies.asp")parPkgId = Request("pkg_id")parPkgName = Request("pkgName")parProjName = Request("pname")parRelName = Request("rname")'' Determine the release (rtag_id)' If we have an rtg_id, then ist simple, otherwise we need to locate it'If DB_RTAG_ID = -1 ThenOraDatabase.Parameters.Add "PROJ_NAME", parProjName, ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "REL_NAME", parRelName, ORAPARM_INPUT, ORATYPE_NUMBERQuery_String = "select rt.rtag_id from release_tags rt, projects p" &_" where p.PROJ_ID = rt.PROJ_ID" &_" and Upper(p.PROJ_NAME) = Upper(:PROJ_NAME)" &_" and Upper(rt.RTAG_NAME) = Upper(:REL_NAME)"Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))If rsTemp.RecordCount > 0 ThenDB_RTAG_ID = (rsTemp.Fields("rtag_id"))End IfOraDatabase.Parameters.Remove "REL_NAME"OraDatabase.Parameters.Remove "PROJ_NAME"End IfOraDatabase.Parameters.Add "PKG_NAME", parPkgName, ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "PKG_ID", parPkgId, ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "PV_ID", DB_PV_ID, ORAPARM_INPUT, ORATYPE_NUMBEROraDatabase.Parameters.Add "RTAG_ID", DB_RTAG_ID, ORAPARM_INPUT, ORATYPE_NUMBERIf parPkgName <> "" ThenQuery_String = "select rc.pv_id, pv.pkg_version from" &_" release_content rc, PACKAGE_VERSIONS pv, PACKAGES p" &_" WHERE rc.rtag_id = :RTAG_ID" &_" and rc.PV_ID = pv.pv_id" &_" and pv.pkg_id = p.pkg_id" &_" and ( p.pkg_name = :PKG_NAME or p.pkg_name || NVL(pv.V_EXT,'') = :PKG_NAME)"ElseIf DB_PV_ID <> -1 ThenQuery_String = "select rc.pv_id, pv.pkg_version from" &_" release_content rc, PACKAGE_VERSIONS pv" &_" WHERE rc.rtag_id = :RTAG_ID" &_" and rc.PV_ID = pv.pv_id" &_" and pv.pkg_id = ( select pkg_id from PACKAGE_VERSIONS where pv_id = :PV_ID)" &_" and NVL(pv.V_EXT,'.NULL') = ( select NVL(v_ext,'.NULL') from PACKAGE_VERSIONS where pv_id = :PV_ID)"ElseQuery_String = "select rc.pv_id, pv.PKG_VERSION from" &_" release_content rc, PACKAGE_VERSIONS pv" &_" WHERE rc.rtag_id = :RTAG_ID" &_" and rc.PV_ID = pv.pv_id" &_" and pv.pkg_id = :PKG_ID"End IfSet rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))If rsTemp.RecordCount > 0 ThenpvId = (rsTemp.Fields("pv_id"))pkgVersion = (rsTemp.Fields("pkg_version"))End IfOraDatabase.Parameters.Remove "PKG_NAME"OraDatabase.Parameters.Remove "PKG_ID"OraDatabase.Parameters.Remove "PV_ID"OraDatabase.Parameters.Remove "RTAG_ID"' Determine output mode' show or redirectuionIf parPage = "show" ThenResponse.Write pkgVersion & vbCrLfResponse.EndEnd Ifurl = parPage & "?rtag_id=" & DB_RTAG_ID & "&pv_id=" & pvIdResponse.Redirect url%>