Subversion Repositories DevTools

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
119 ghuddy 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
4
' 			  ADD NEW Runtime Dependency
5
'               --- PROCESS FORM ---
6
'=====================================================
7
%>
8
<%
9
Option explicit
10
' Good idea to set when using redirect
11
Response.Expires = 0	' always load the page, dont store
12
%>
13
<%
14
' Page Access Condition
15
%>
16
<!--#include file="common/conf.asp"-->
17
<!--#include file="common/globals.asp"-->
18
<!--#include file="common/formating.asp"-->
19
<!--#include file="common/qstr.asp"-->
20
<!--#include file="common/common_subs.asp"-->
21
<!--#include file="common/common_dbedit.asp"-->
22
<%
23
' Set rfile parameter. This is a return page after Login
24
Call objPMod.StoreParameter ( "rfile", "runtime_dependencies.asp" )
25
'------------ ACCESS CONTROL ------------------
26
%>
27
<!--#include file="_access_control_login.asp"-->
28
<!--#include file="_access_control_general.asp"-->
29
<!--#include file="_access_control_project.asp"-->
30
<%
31
'------------ Variable Definition -------------
32
Dim rtdArray()
33
'------------ Constants Declaration -----------
34
Const COL_pkg_name = 0
35
Const COL_pkg_version = 1
36
'------------ Variable Init -------------------
37
'----------------------------------------------
38
%>
39
<%
40
Sub Add_Runtime_Dependency ( ARRrtd, NNpv_id, NNuser_id )
41
	Dim i
121 hknight 42
 
119 ghuddy 43
	For i = 0 To UBound( ARRrtd, 2 )
44
		OraDatabase.ExecuteSQL "BEGIN Add_Runtime_Dependency ( "& NNpv_id &", "&_
45
		                                                          "'"& ARRrtd( COL_pkg_name, i ) &"', "&_
46
																  "'"& ARRrtd( COL_pkg_version, i ) &"', "&_
47
																  NNuser_id &" ); END;"
48
	Next
121 hknight 49
 
119 ghuddy 50
End Sub
51
 
121 hknight 52
Sub Populate_rtdArray ( NNpv_id_list, ARRrtd )
119 ghuddy 53
	Dim depList, lastItem, i, recCnt, pkg_name, pkg_version
54
	Dim rsTemp, Query_String
121 hknight 55
 
119 ghuddy 56
	Query_String = _
121 hknight 57
   " SELECT pkgs.pkg_id, pkgs.pkg_name, pv.pv_id, pv.pkg_version"&_
58
   "  FROM packages pkgs, package_versions pv"&_
59
   " WHERE pv.pv_id IN ("& NNpv_id_list &")"&_
60
   "   AND pv.pkg_id = pkgs.pkg_id"
119 ghuddy 61
	Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
121 hknight 62
 
119 ghuddy 63
	recCnt = 0
64
	While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
65
		ReDim Preserve ARRrtd( 1, recCnt )
66
		ARRrtd( COL_pkg_name, recCnt ) = rsTemp("pkg_name")
121 hknight 67
      ARRrtd( COL_pkg_version, recCnt ) =  rsTemp("pkg_version")
68
 
119 ghuddy 69
		recCnt = recCnt + 1
70
		rsTemp.MoveNext
71
	WEnd
121 hknight 72
 
119 ghuddy 73
	rsTemp.Close
74
	Set rsTemp = nothing
75
End Sub
76
%>
77
<%
78
'-----------------------  MAIN LINE  ---------------------------
79
 
80
'--- Process submition ---
81
If (Request("pv_id") <> "") AND (Request("rtag_id") <> "") Then
82
	' All mendatory parameters FOUND
121 hknight 83
 
119 ghuddy 84
	'COMPLETE THE REQUEST...
121 hknight 85
   ' NOTE - Although the underlying search operation (see form_search_pkgs.asp and form_search_result_pkgs.asp)
86
   ' returns a list called "pkg_list", it actually contains a pv_id list when used to add runtime dependencies
119 ghuddy 87
	Call Populate_rtdArray ( Request("pkg_list"), rtdArray )
121 hknight 88
 
119 ghuddy 89
	Call Add_Runtime_Dependency ( rtdArray, Request("pv_id"), objAccessControl.UserId )
121 hknight 90
 
119 ghuddy 91
	Response.Redirect("runtime_dependencies.asp?pv_id="& Request("pv_id") &"&rtag_id="& Request("rtag_id"))
92
Else
93
	Response.write "Some mendatory parameters are missing!" & "<br>" 'TODO
121 hknight 94
	Response.write QSTR_All
119 ghuddy 95
End If
96
%>
97
 
98
<!-- DESTRUCTOR ------->
121 hknight 99
<!--#include file="common/destructor.asp"-->