Subversion Repositories DevTools

Rev

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

Rev Author Line No. Line
119 ghuddy 1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
3
'=====================================================
129 ghuddy 4
'            ADD NEW Runtime Dependency
119 ghuddy 5
'               --- PROCESS FORM ---
6
'=====================================================
7
%>
8
<%
9
Option explicit
10
' Good idea to set when using redirect
129 ghuddy 11
Response.Expires = 0   ' always load the page, dont store
119 ghuddy 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 )
129 ghuddy 41
   Dim i
121 hknight 42
 
129 ghuddy 43
   objEH.TryORA ( OraSession )
44
   On Error Resume Next
121 hknight 45
 
129 ghuddy 46
   For i = 0 To UBound( ARRrtd, 2 )
47
      If Err.Number = 0 Then
48
         OraDatabase.ExecuteSQL _
49
         "BEGIN Add_Runtime_Dependency ( "& NNpv_id &", "&_
50
                                         "'"& ARRrtd( COL_pkg_name, i ) &"', "&_
51
                                         "'"& ARRrtd( COL_pkg_version, i ) &"', "&_
52
                                         NNuser_id &" ); END;"
53
      End If
54
   Next
55
 
56
   objEH.CatchORA ( OraSession )
119 ghuddy 57
End Sub
58
 
121 hknight 59
Sub Populate_rtdArray ( NNpv_id_list, ARRrtd )
129 ghuddy 60
   Dim depList, lastItem, i, recCnt, pkg_name, pkg_version
61
   Dim rsTemp, Query_String
121 hknight 62
 
129 ghuddy 63
   Query_String = _
121 hknight 64
   " SELECT pkgs.pkg_id, pkgs.pkg_name, pv.pv_id, pv.pkg_version"&_
65
   "  FROM packages pkgs, package_versions pv"&_
66
   " WHERE pv.pv_id IN ("& NNpv_id_list &")"&_
67
   "   AND pv.pkg_id = pkgs.pkg_id"
129 ghuddy 68
   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
121 hknight 69
 
129 ghuddy 70
   recCnt = 0
71
   While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
72
      ReDim Preserve ARRrtd( 1, recCnt )
73
      ARRrtd( COL_pkg_name, recCnt ) = rsTemp("pkg_name")
121 hknight 74
      ARRrtd( COL_pkg_version, recCnt ) =  rsTemp("pkg_version")
75
 
129 ghuddy 76
      recCnt = recCnt + 1
77
      rsTemp.MoveNext
78
   WEnd
121 hknight 79
 
129 ghuddy 80
   rsTemp.Close
81
   Set rsTemp = nothing
119 ghuddy 82
End Sub
83
%>
84
<%
85
'-----------------------  MAIN LINE  ---------------------------
86
 
87
'--- Process submition ---
88
If (Request("pv_id") <> "") AND (Request("rtag_id") <> "") Then
1337 dpurdie 89
   ' All mandatory parameters FOUND
121 hknight 90
 
129 ghuddy 91
   'COMPLETE THE REQUEST...
121 hknight 92
   ' NOTE - Although the underlying search operation (see form_search_pkgs.asp and form_search_result_pkgs.asp)
93
   ' returns a list called "pkg_list", it actually contains a pv_id list when used to add runtime dependencies
129 ghuddy 94
   Call Populate_rtdArray ( Request("pkg_list"), rtdArray )
121 hknight 95
 
129 ghuddy 96
   Call Add_Runtime_Dependency ( rtdArray, Request("pv_id"), objAccessControl.UserId )
121 hknight 97
 
129 ghuddy 98
   Response.Redirect("runtime_dependencies.asp?pv_id="& Request("pv_id") &"&rtag_id="& Request("rtag_id"))
119 ghuddy 99
Else
1337 dpurdie 100
   Response.write "Some mandatory parameters are missing!" & "<br>" 'TODO
129 ghuddy 101
   Response.write QSTR_All
119 ghuddy 102
End If
103
%>
104
 
105
<!-- DESTRUCTOR ------->
121 hknight 106
<!--#include file="common/destructor.asp"-->