| Line 4... |
Line 4... |
| 4 |
' gotoLatestInRelease.asp
|
4 |
' gotoLatestInRelease.asp
|
| 5 |
'
|
5 |
'
|
| 6 |
' This page will redirect the user the current version of a package within a release
|
6 |
' This page will redirect the user the current version of a package within a release
|
| 7 |
' It may be used to provide a dynamic link to a user
|
7 |
' It may be used to provide a dynamic link to a user
|
| 8 |
'
|
8 |
'
|
| - |
|
9 |
' Can also provide text output for the purposes of scripting
|
| - |
|
10 |
'
|
| - |
|
11 |
' Requires one of
|
| - |
|
12 |
' rtag_id=nnn ' Release Tag
|
| - |
|
13 |
' pname=aaaa&rname=aaaa ' Project Name and Release Name
|
| - |
|
14 |
'
|
| 9 |
' Requires: rtag_id=nnn
|
15 |
' Requires one of:
|
| 10 |
' pv_id=nnn
|
16 |
' pv_id=nnn
|
| - |
|
17 |
' pkg_id=nn
|
| - |
|
18 |
' pkgName=aaaa
|
| 11 |
' Optional: page=name
|
19 |
' Optional: page=name
|
| - |
|
20 |
' If page is 'show' then the version of the package will be retuened as a single line of text
|
| 12 |
'=====================================================
|
21 |
'=====================================================
|
| 13 |
%>
|
22 |
%>
|
| 14 |
<!--#include file="common/conf.asp"-->
|
23 |
<!--#include file="common/conf.asp"-->
|
| 15 |
<!--#include file="common/globals.asp"-->
|
24 |
<!--#include file="common/globals.asp"-->
|
| 16 |
<!--#include file="common/qstr.asp"-->
|
25 |
<!--#include file="common/qstr.asp"-->
|
| 17 |
<!--#include file="common/common_subs.asp"-->
|
26 |
<!--#include file="common/common_subs.asp"-->
|
| 18 |
<%
|
27 |
<%
|
| 19 |
Dim Query_String
|
28 |
Dim Query_String
|
| 20 |
Dim pvId
|
29 |
Dim pvId
|
| - |
|
30 |
Dim pkgVersion
|
| 21 |
Dim parPage
|
31 |
Dim parPage
|
| - |
|
32 |
Dim parPkgId
|
| - |
|
33 |
Dim parPkgName
|
| - |
|
34 |
Dim parProjName
|
| - |
|
35 |
Dim parRelName
|
| 22 |
Dim url
|
36 |
Dim url
|
| 23 |
|
37 |
|
| 24 |
parPage = RequestDefault("page", "dependencies.asp")
|
38 |
parPage = RequestDefault("page", "dependencies.asp")
|
| - |
|
39 |
parPkgId = Request("pkg_id")
|
| - |
|
40 |
parPkgName = Request("pkgName")
|
| - |
|
41 |
parProjName = Request("pname")
|
| - |
|
42 |
parRelName = Request("rname")
|
| - |
|
43 |
|
| - |
|
44 |
'
|
| - |
|
45 |
' Determine the release (rtag_id)
|
| - |
|
46 |
' If we have an rtg_id, then ist simple, otherwise we need to locate it
|
| - |
|
47 |
'
|
| - |
|
48 |
If DB_RTAG_ID = -1 Then
|
| - |
|
49 |
OraDatabase.Parameters.Add "PROJ_NAME", parProjName, ORAPARM_INPUT, ORATYPE_NUMBER
|
| - |
|
50 |
OraDatabase.Parameters.Add "REL_NAME", parRelName, ORAPARM_INPUT, ORATYPE_NUMBER
|
| - |
|
51 |
Query_String = "select rt.rtag_id from release_tags rt, projects p" &_
|
| - |
|
52 |
" where p.PROJ_ID = rt.PROJ_ID" &_
|
| - |
|
53 |
" and Upper(p.PROJ_NAME) = Upper(:PROJ_NAME)" &_
|
| - |
|
54 |
" and Upper(rt.RTAG_NAME) = Upper(:REL_NAME)"
|
| - |
|
55 |
|
| - |
|
56 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| - |
|
57 |
If rsTemp.RecordCount > 0 Then
|
| - |
|
58 |
DB_RTAG_ID = (rsTemp.Fields("rtag_id"))
|
| - |
|
59 |
End If
|
| - |
|
60 |
OraDatabase.Parameters.Remove "REL_NAME"
|
| - |
|
61 |
OraDatabase.Parameters.Remove "PROJ_NAME"
|
| - |
|
62 |
End If
|
| 25 |
|
63 |
|
| - |
|
64 |
|
| - |
|
65 |
OraDatabase.Parameters.Add "PKG_NAME", parPkgName, ORAPARM_INPUT, ORATYPE_NUMBER
|
| - |
|
66 |
OraDatabase.Parameters.Add "PKG_ID", parPkgId, ORAPARM_INPUT, ORATYPE_NUMBER
|
| 26 |
OraDatabase.Parameters.Add "PV_ID", DB_PV_ID, ORAPARM_INPUT, ORATYPE_NUMBER
|
67 |
OraDatabase.Parameters.Add "PV_ID", DB_PV_ID, ORAPARM_INPUT, ORATYPE_NUMBER
|
| 27 |
OraDatabase.Parameters.Add "RTAG_ID", DB_RTAG_ID, ORAPARM_INPUT, ORATYPE_NUMBER
|
68 |
OraDatabase.Parameters.Add "RTAG_ID", DB_RTAG_ID, ORAPARM_INPUT, ORATYPE_NUMBER
|
| 28 |
|
69 |
|
| - |
|
70 |
If parPkgName <> "" Then
|
| 29 |
Query_String = "select rc.pv_id from" &_
|
71 |
Query_String = "select rc.pv_id, pv.pkg_version from" &_
|
| - |
|
72 |
" release_content rc, PACKAGE_VERSIONS pv, PACKAGES p" &_
|
| - |
|
73 |
" WHERE rc.rtag_id = :RTAG_ID" &_
|
| - |
|
74 |
" and rc.PV_ID = pv.pv_id" &_
|
| - |
|
75 |
" and pv.pkg_id = p.pkg_id" &_
|
| - |
|
76 |
" and ( p.pkg_name = :PKG_NAME or p.pkg_name || NVL(pv.V_EXT,'') = :PKG_NAME)"
|
| - |
|
77 |
|
| - |
|
78 |
ElseIf DB_PV_ID <> -1 Then
|
| - |
|
79 |
Query_String = "select rc.pv_id, pv.pkg_version from" &_
|
| 30 |
" release_content rc, PACKAGE_VERSIONS pv" &_
|
80 |
" release_content rc, PACKAGE_VERSIONS pv" &_
|
| 31 |
" WHERE rc.rtag_id = :RTAG_ID" &_
|
81 |
" WHERE rc.rtag_id = :RTAG_ID" &_
|
| 32 |
" and rc.PV_ID = pv.pv_id" &_
|
82 |
" and rc.PV_ID = pv.pv_id" &_
|
| 33 |
" and pv.pkg_id = ( select pkg_id from PACKAGE_VERSIONS where pv_id = :PV_ID)" &_
|
83 |
" and pv.pkg_id = ( select pkg_id from PACKAGE_VERSIONS where pv_id = :PV_ID)" &_
|
| 34 |
" and NVL(pv.V_EXT,'.NULL') = ( select NVL(v_ext,'.NULL') from PACKAGE_VERSIONS where pv_id = :PV_ID)"
|
84 |
" and NVL(pv.V_EXT,'.NULL') = ( select NVL(v_ext,'.NULL') from PACKAGE_VERSIONS where pv_id = :PV_ID)"
|
| - |
|
85 |
Else
|
| - |
|
86 |
Query_String = "select rc.pv_id, pv.PKG_VERSION from" &_
|
| - |
|
87 |
" release_content rc, PACKAGE_VERSIONS pv" &_
|
| - |
|
88 |
" WHERE rc.rtag_id = :RTAG_ID" &_
|
| - |
|
89 |
" and rc.PV_ID = pv.pv_id" &_
|
| - |
|
90 |
" and pv.pkg_id = :PKG_ID"
|
| - |
|
91 |
End If
|
| 35 |
|
92 |
|
| 36 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
93 |
Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
|
| 37 |
If rsTemp.RecordCount > 0 Then
|
94 |
If rsTemp.RecordCount > 0 Then
|
| 38 |
pvId = (rsTemp.Fields("pv_id"))
|
95 |
pvId = (rsTemp.Fields("pv_id"))
|
| - |
|
96 |
pkgVersion = (rsTemp.Fields("pkg_version"))
|
| 39 |
End If
|
97 |
End If
|
| 40 |
|
98 |
|
| - |
|
99 |
OraDatabase.Parameters.Remove "PKG_NAME"
|
| - |
|
100 |
OraDatabase.Parameters.Remove "PKG_ID"
|
| 41 |
OraDatabase.Parameters.Remove "PV_ID"
|
101 |
OraDatabase.Parameters.Remove "PV_ID"
|
| 42 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
102 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
| 43 |
|
103 |
|
| - |
|
104 |
' Determine output mode
|
| - |
|
105 |
' show or redirectuion
|
| - |
|
106 |
|
| - |
|
107 |
If parPage = "show" Then
|
| 44 |
url = parPage & "?rtag_id=" & DB_RTAG_ID & "&pv_id=" & pvId
|
108 |
Response.Write pkgVersion & vbCrLf
|
| - |
|
109 |
Response.End
|
| - |
|
110 |
End If
|
| 45 |
|
111 |
|
| - |
|
112 |
url = parPage & "?rtag_id=" & DB_RTAG_ID & "&pv_id=" & pvId
|
| 46 |
Response.Redirect url
|
113 |
Response.Redirect url
|
| 47 |
%>
|
114 |
%>
|