Subversion Repositories DevTools

Rev

Rev 121 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 121 Rev 129
Line 1... Line 1...
1
<%@LANGUAGE="VBSCRIPT"%>
1
<%@LANGUAGE="VBSCRIPT"%>
2
<%
2
<%
3
'=====================================================
3
'=====================================================
4
' 				 UPDATE dependencies
4
'              UPDATE dependencies
5
'               --- PROCESS FORM ---
5
'               --- PROCESS FORM ---
6
'=====================================================
6
'=====================================================
7
%>
7
%>
8
<%
8
<%
9
Option explicit
9
Option explicit
10
' Good idea to set when using redirect
10
' Good idea to set when using redirect
11
Response.Expires = 0	' always load the page, dont store
11
Response.Expires = 0   ' always load the page, dont store
12
%>
12
%>
13
 
13
 
14
<!--#include file="common/conf.asp"-->
14
<!--#include file="common/conf.asp"-->
15
<!--#include file="common/globals.asp"-->
15
<!--#include file="common/globals.asp"-->
16
<!--#include file="common/formating.asp"-->
16
<!--#include file="common/formating.asp"-->
Line 38... Line 38...
38
'------------ Variable Init -------------------
38
'------------ Variable Init -------------------
39
'----------------------------------------------
39
'----------------------------------------------
40
%>
40
%>
41
<%
41
<%
42
Sub Populate_depArray_from_Import ( SSdep_import, ARRdep, BBarray_is_empty )
42
Sub Populate_depArray_from_Import ( SSdep_import, ARRdep, BBarray_is_empty )
43
	Dim depList, lastItem, i, recCnt, pkg_name, pkg_version
43
   Dim depList, lastItem, i, recCnt, pkg_name, pkg_version
44
 
44
 
45
	If (SSdep_import = "") Then Exit Sub		' exit if no dependencies are submited
45
   If (SSdep_import = "") Then Exit Sub      ' exit if no dependencies are submited
46
 
46
 
47
	' Decode Server.URLEncode if present
47
   ' Decode Server.URLEncode if present
48
	SSdep_import = URLDecode( SSdep_import )
48
   SSdep_import = URLDecode( SSdep_import )
49
 
49
 
50
	SSdep_import = Replace(SSdep_import, " ", "")		' remove spaces
50
   SSdep_import = Replace(SSdep_import, " ", "")            ' remove spaces
51
	SSdep_import = Replace(SSdep_import, VBTab, "")	' remove horizontal tabs
51
   SSdep_import = Replace(SSdep_import, VBTab, "")          ' remove horizontal tabs
52
	SSdep_import = Replace(SSdep_import, VBVerticalTab, "")	' remove vertical tabs
52
   SSdep_import = Replace(SSdep_import, VBVerticalTab, "")  ' remove vertical tabs
53
	SSdep_import = Replace(SSdep_import, """", "'")	' replace " with '
53
   SSdep_import = Replace(SSdep_import, """", "'")          ' replace " with '
54
 
54
 
55
	depList = Split( SSdep_import, "'")
55
   depList = Split( SSdep_import, "'")
56
 
56
 
57
	recCnt = 0
57
   recCnt = 0
58
	lastItem = UBound(depList)
58
   lastItem = UBound(depList)
59
	For i = 1 To lastItem Step 4
59
   For i = 1 To lastItem Step 4
60
		pkg_name = depList(i)
60
      pkg_name = depList(i)
61
		pkg_version = depList(i+2)
61
      pkg_version = depList(i+2)
62
 
62
 
63
		' Proceed only if:
63
      ' Proceed only if:
64
		' 	pkg name is not empty,
64
      '    pkg name is not empty,
65
		' 	pkg version is not empty,
65
      '    pkg version is not empty,
66
		' 	line is not commented out with #
66
      '    line is not commented out with #
67
 
67
 
68
		If ( pkg_name <> "" )  AND  ( pkg_version <> "" )  AND  (InStr(depList(i-1), "#") = 0) Then
68
      If ( pkg_name <> "" )  AND  ( pkg_version <> "" )  AND  (InStr(depList(i-1), "#") = 0) Then
69
			ReDim Preserve ARRdep( 2, recCnt )
69
         ReDim Preserve ARRdep( 2, recCnt )
70
			ARRdep( COL_pkg_name, recCnt ) = pkg_name
70
         ARRdep( COL_pkg_name, recCnt ) = pkg_name
71
			ARRdep( COL_pkg_version, recCnt ) = pkg_version
71
         ARRdep( COL_pkg_version, recCnt ) = pkg_version
72
 
72
 
73
			' Define build type
73
         ' Define build type
74
			If InStr(depList(i-1), "BuildPkgArchive") > 0 Then
74
         If InStr(depList(i-1), "BuildPkgArchive") > 0 Then
75
				ARRdep( COL_build_type, recCnt ) = enum_BUILD_PKG_ARCHIVE
75
            ARRdep( COL_build_type, recCnt ) = enum_BUILD_PKG_ARCHIVE
76
 
76
 
77
			ElseIf InStr(depList(i-1), "LinkPkgArchive") > 0 Then
77
         ElseIf InStr(depList(i-1), "LinkPkgArchive") > 0 Then
78
				ARRdep( COL_build_type, recCnt ) = enum_LINK_PKG_ARCHIVE
78
            ARRdep( COL_build_type, recCnt ) = enum_LINK_PKG_ARCHIVE
79
 
79
 
80
			Else
80
         Else
81
				ARRdep( COL_build_type, recCnt ) = enum_BUILD_PKG_ARCHIVE	'neither build_package or link_package is found, hence set to...
81
            ARRdep( COL_build_type, recCnt ) = enum_BUILD_PKG_ARCHIVE   'neither build_package or link_package is found, hence set to...
82
 
82
 
83
			End If
83
         End If
84
 
84
 
85
			recCnt = recCnt + 1
85
         recCnt = recCnt + 1
86
			BBarray_is_empty = FALSE
86
         BBarray_is_empty = FALSE
87
		End If
87
      End If
88
 
88
 
89
	Next
89
   Next
90
 
90
 
91
End Sub
91
End Sub
92
 
92
 
93
' This function is called when update_type is "add_custom". This is only the case when adding dependencies
93
' This function is called when update_type is "add_custom". This is only the case when adding dependencies
94
' The list given via the actual parameter pkg_list is in fact a list of pv_id's supplied from the form_search_result_pkgs.asp
94
' The list given via the actual parameter pkg_list is in fact a list of pv_id's supplied from the form_search_result_pkgs.asp
95
' and form_add_pkg_versions.asp files. In the past, it only ever used to be a list of package IDs, but this has now been
95
' and form_add_pkg_versions.asp files. In the past, it only ever used to be a list of package IDs, but this has now been
96
' changed so that users can only add package versions from the relevant release as dependencies to a packge also in that
96
' changed so that users can only add package versions from the relevant release as dependencies to a packge also in that
97
' release, and to do this, the list has to hold pv_id's instead of pkg_id's, to cater for situations where a release
97
' release, and to do this, the list has to hold pv_id's instead of pkg_id's, to cater for situations where a release
98
' contains 2 instances of a package, each one having different extensions (eg .mas, .sea).
98
' contains 2 instances of a package, each one having different extensions (eg .mas, .sea).
99
Sub Populate_depArray_from_ADD_Custom ( NNpv_id_list, ARRdep, BBarray_is_empty )
99
Sub Populate_depArray_from_ADD_Custom ( NNpv_id_list, ARRdep, BBarray_is_empty )
100
	Dim depList, lastItem, i, recCnt, pkg_name, pkg_version, V_EXT
100
   Dim depList, lastItem, i, recCnt, pkg_name, pkg_version, V_EXT
101
	Dim rsTemp, Query_String, PkgBaseView
101
   Dim rsTemp, Query_String, PkgBaseView
102
 
102
 
103
	PkgBaseView = Get_Pkg_Base_View_ID ( Request("pv_id"), Request("rtag_id") )
103
   PkgBaseView = Get_Pkg_Base_View_ID ( Request("pv_id"), Request("rtag_id") )
104
 
104
 
105
	Query_String = _
105
   Query_String = _
106
   " SELECT pkgs.pkg_id, pkgs.pkg_name, pv.pv_id, pv.pkg_version"&_
106
   " SELECT pkgs.pkg_id, pkgs.pkg_name, pv.pv_id, pv.pkg_version"&_
107
   "  FROM packages pkgs, package_versions pv"&_
107
   "  FROM packages pkgs, package_versions pv"&_
108
   " WHERE pv.pv_id IN ("& NNpv_id_list &")"&_
108
   " WHERE pv.pv_id IN ("& NNpv_id_list &")"&_
109
   "   AND pv.pkg_id = pkgs.pkg_id"
109
   "   AND pv.pkg_id = pkgs.pkg_id"
110
	Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
110
   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
111
 
111
 
112
	recCnt = 0
112
   recCnt = 0
113
	While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
113
   While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
114
		ReDim Preserve ARRdep( 2, recCnt )
114
      ReDim Preserve ARRdep( 2, recCnt )
115
		ARRdep( COL_pkg_name, recCnt ) = rsTemp("pkg_name")
115
      ARRdep( COL_pkg_name, recCnt ) = rsTemp("pkg_name")
116
      ARRdep( COL_pkg_version, recCnt ) = rsTemp("pkg_version")
116
      ARRdep( COL_pkg_version, recCnt ) = rsTemp("pkg_version")
117
 
117
 
118
		'// Dependencies comming from custom dependency add are set to LinkPkgArchive by default, unless it is a product
118
      '// Dependencies comming from custom dependency add are set to LinkPkgArchive by default, unless it is a product
119
		If PkgBaseView = enumBASE_VIEW_PRODUCTS Then
119
      If PkgBaseView = enumBASE_VIEW_PRODUCTS Then
120
			ARRdep( COL_build_type, recCnt ) = enum_BUILD_PKG_ARCHIVE
120
         ARRdep( COL_build_type, recCnt ) = enum_BUILD_PKG_ARCHIVE
121
		Else
121
      Else
122
			ARRdep( COL_build_type, recCnt ) = enum_LINK_PKG_ARCHIVE
122
         ARRdep( COL_build_type, recCnt ) = enum_LINK_PKG_ARCHIVE
123
		End If
123
      End If
124
 
124
 
125
		recCnt = recCnt + 1
125
      recCnt = recCnt + 1
126
		BBarray_is_empty = FALSE
126
      BBarray_is_empty = FALSE
127
		rsTemp.MoveNext
127
      rsTemp.MoveNext
128
	WEnd
128
   WEnd
129
 
129
 
130
	rsTemp.Close
130
   rsTemp.Close
131
	Set rsTemp = nothing
131
   Set rsTemp = nothing
132
End Sub
132
End Sub
133
 
133
 
134
 
134
 
135
Sub Populate_depArray_from_EDIT_Custom ( NNpv_id, ARRdep, BBarray_is_empty, sDependBlock )
135
Sub Populate_depArray_from_EDIT_Custom ( NNpv_id, ARRdep, BBarray_is_empty, sDependBlock )
136
	Dim depList, lastItem, i, recCnt, pkg_name, pkg_version, V_EXT
136
   Dim depList, lastItem, i, recCnt, pkg_name, pkg_version, V_EXT
137
	Dim rsTemp, rsCurrent, Query_String
137
   Dim rsTemp, rsCurrent, Query_String
138
 
138
 
139
	Query_String = _
139
   Query_String = _
140
	" SELECT dpkg.pkg_name, dpv.pkg_version, dpv.pv_id"&_
140
   " SELECT dpkg.pkg_name, dpv.pkg_version, dpv.pv_id"&_
141
	"  FROM package_dependencies dep,"&_
141
   "  FROM package_dependencies dep,"&_
142
	"       package_versions dpv,"&_
142
   "       package_versions dpv,"&_
143
	"       packages dpkg"&_
143
   "       packages dpkg"&_
144
	" WHERE dep.dpv_id = dpv.pv_id"&_
144
   " WHERE dep.dpv_id = dpv.pv_id"&_
145
	"   AND dpv.pkg_id = dpkg.pkg_id"&_
145
   "   AND dpv.pkg_id = dpkg.pkg_id"&_
146
	"   AND dep.pv_id = "& NNpv_id
146
   "   AND dep.pv_id = "& NNpv_id
147
 
147
 
148
	Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
148
   Set rsTemp = OraDatabase.DbCreateDynaset( Query_String, cint(0))
149
 
149
 
150
	recCnt = 0
150
   recCnt = 0
151
	While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
151
   While ((NOT rsTemp.BOF) AND (NOT rsTemp.EOF))
152
		ReDim Preserve ARRdep( 2, recCnt )
152
      ReDim Preserve ARRdep( 2, recCnt )
153
		ARRdep( COL_pkg_name, recCnt ) = rsTemp("pkg_name")
153
      ARRdep( COL_pkg_name, recCnt )    = rsTemp("pkg_name")
154
		ARRdep( COL_pkg_version, recCnt ) =  Request( "pkgn"& rsTemp("pv_id") )
154
      ARRdep( COL_pkg_version, recCnt ) = Request( "pkgn"& rsTemp("pv_id") )
155
		ARRdep( COL_build_type, recCnt ) = Request( "bt"& rsTemp("pv_id") )
155
      ARRdep( COL_build_type, recCnt )  = Request( "bt"& rsTemp("pv_id") )
156
 
156
 
157
		If not rsTemp("pkg_version") =  Request( "pkgn"& rsTemp("pv_id") ) Then
157
      If not rsTemp("pkg_version") =  Request( "pkgn"& rsTemp("pv_id") ) Then
158
			sDependBlock = rsTemp("pkg_name") & " " & Request( "pkgn"& rsTemp("pv_id") )
158
         sDependBlock = rsTemp("pkg_name") & " " & Request( "pkgn"& rsTemp("pv_id") )
159
		End If
159
      End If
160
 
160
 
161
		recCnt = recCnt + 1
161
      recCnt = recCnt + 1
162
		BBarray_is_empty = FALSE
162
      BBarray_is_empty = FALSE
163
		rsTemp.MoveNext
163
      rsTemp.MoveNext
164
	WEnd
164
   WEnd
165
 
165
 
166
	rsTemp.Close
166
   rsTemp.Close
167
	Set rsTemp = nothing
167
   Set rsTemp = nothing
168
End Sub
168
End Sub
169
 
169
 
170
Sub Update_Package_Dependencies ( ARRdep, NNpv_id, NNuser_id, NNdelete_old_dependency, sAction_type, sDependBlock )
170
Sub Update_Package_Dependencies ( ARRdep, NNpv_id, NNuser_id, NNdelete_old_dependency, sAction_type, sDependBlock )
171
	Dim i, OraParameter, sComments
171
   Dim i, OraParameter, sComments
172
 
172
 
173
	OraDatabase.Parameters.Add "PV_ID", 			NNpv_id, 	ORAPARM_INPUT, ORATYPE_NUMBER
173
   OraDatabase.Parameters.Add "PV_ID",            NNpv_id,                 ORAPARM_INPUT, ORATYPE_NUMBER
174
	OraDatabase.Parameters.Add "PKG_NAME", 			"", 	ORAPARM_INPUT, ORATYPE_VARCHAR2
174
   OraDatabase.Parameters.Add "PKG_NAME",         "",                      ORAPARM_INPUT, ORATYPE_VARCHAR2
175
	OraDatabase.Parameters.Add "PKG_VERSION", 		"", 	ORAPARM_INPUT, ORATYPE_VARCHAR2
175
   OraDatabase.Parameters.Add "PKG_VERSION",      "",                      ORAPARM_INPUT, ORATYPE_VARCHAR2
176
	OraDatabase.Parameters.Add "BUILD_TYPE", 		"", 	ORAPARM_INPUT, ORATYPE_VARCHAR2
176
   OraDatabase.Parameters.Add "BUILD_TYPE",       "",                      ORAPARM_INPUT, ORATYPE_VARCHAR2
177
	OraDatabase.Parameters.Add "USER_ID", 			NNuser_id, 	ORAPARM_INPUT, ORATYPE_NUMBER
177
   OraDatabase.Parameters.Add "USER_ID",          NNuser_id,               ORAPARM_INPUT, ORATYPE_NUMBER
178
	OraDatabase.Parameters.Add "DELETE_PV_ID", 		NNdelete_old_dependency, 	ORAPARM_INPUT, ORATYPE_NUMBER
178
   OraDatabase.Parameters.Add "DELETE_PV_ID",     NNdelete_old_dependency, ORAPARM_INPUT, ORATYPE_NUMBER
179
	OraDatabase.Parameters.Add "ACTION_TYPE_NAME",  sAction_type, ORAPARM_INPUT, ORATYPE_VARCHAR2
179
   OraDatabase.Parameters.Add "ACTION_TYPE_NAME", sAction_type,            ORAPARM_INPUT, ORATYPE_VARCHAR2
180
 
180
 
181
	Set OraParameter = OraDatabase.Parameters
181
   Set OraParameter = OraDatabase.Parameters
182
 
182
 
183
	For i = 0 To UBound( ARRdep, 2 )
183
   For i = 0 To UBound( ARRdep, 2 )
184
		If not i = 0 Then
184
      If not i = 0 Then
185
			sComments = sComments & ", "
185
         sComments = sComments & ", "
186
		End If
186
      End If
187
		sComments = sComments & depArray(COL_pkg_name, i) & " " & ARRdep( COL_pkg_version, i )
187
      sComments = sComments & depArray(COL_pkg_name, i) & " " & ARRdep( COL_pkg_version, i )
188
 
188
 
189
		OraParameter("PKG_NAME").Value = ARRdep( COL_pkg_name, i )
189
      OraParameter("PKG_NAME").Value    = ARRdep( COL_pkg_name, i )
190
		OraParameter("PKG_VERSION").Value = ARRdep( COL_pkg_version, i )
190
      OraParameter("PKG_VERSION").Value = ARRdep( COL_pkg_version, i )
191
		OraParameter("BUILD_TYPE").Value = ARRdep( COL_build_type, i )
191
      OraParameter("BUILD_TYPE").Value  = ARRdep( COL_build_type, i )
192
 
192
 
193
		OraDatabase.ExecuteSQL "BEGIN  Update_Package_Dependency ( :PV_ID, :PKG_NAME, :PKG_VERSION, :BUILD_TYPE, :USER_ID, :DELETE_PV_ID );  END;"
193
      OraDatabase.ExecuteSQL "BEGIN  Update_Package_Dependency ( :PV_ID, :PKG_NAME, :PKG_VERSION, :BUILD_TYPE, :USER_ID, :DELETE_PV_ID );  END;"
194
 
194
 
195
	Next
195
   Next
196
 
196
 
197
	Set OraParameter = Nothing
197
   Set OraParameter = Nothing
198
 
198
 
199
	If sAction_type = "depend_add" Then
199
   If sAction_type = "depend_add" Then
200
		OraDatabase.Parameters.Add "COMMENTS", 	sComments, ORAPARM_INPUT, ORATYPE_VARCHAR2
200
      OraDatabase.Parameters.Add "COMMENTS",    sComments, ORAPARM_INPUT, ORATYPE_VARCHAR2
201
	Else
201
   Else
202
		If Len(sDependBlock) <= 4000 Then
202
      If Len(sDependBlock) <= 4000 Then
203
			OraDatabase.Parameters.Add "COMMENTS", 	sDependBlock, ORAPARM_INPUT, ORATYPE_VARCHAR2
203
         OraDatabase.Parameters.Add "COMMENTS",    sDependBlock, ORAPARM_INPUT, ORATYPE_VARCHAR2
204
		Else
204
      Else
205
			OraDatabase.Parameters.Add "COMMENTS", 	"Description too long to be inserted!", ORAPARM_INPUT, ORATYPE_VARCHAR2
205
         OraDatabase.Parameters.Add "COMMENTS",    "Description too long to be inserted!", ORAPARM_INPUT, ORATYPE_VARCHAR2
206
		End If
206
      End If
207
	End If
207
   End If
208
 
208
 
209
	OraDatabase.ExecuteSQL _
209
   OraDatabase.ExecuteSQL _
210
	"BEGIN  Log_Action ( :PV_ID, :ACTION_TYPE_NAME, :USER_ID, :COMMENTS );  END;"
210
   "BEGIN  Log_Action ( :PV_ID, :ACTION_TYPE_NAME, :USER_ID, :COMMENTS );  END;"
211
 
211
 
212
 
212
 
213
 
213
 
214
	OraDatabase.Parameters.Remove "PV_ID"
214
   OraDatabase.Parameters.Remove "PV_ID"
215
	OraDatabase.Parameters.Remove "PKG_NAME"
215
   OraDatabase.Parameters.Remove "PKG_NAME"
216
	OraDatabase.Parameters.Remove "PKG_VERSION"
216
   OraDatabase.Parameters.Remove "PKG_VERSION"
217
	OraDatabase.Parameters.Remove "BUILD_TYPE"
217
   OraDatabase.Parameters.Remove "BUILD_TYPE"
218
	OraDatabase.Parameters.Remove "USER_ID"
218
   OraDatabase.Parameters.Remove "USER_ID"
219
	OraDatabase.Parameters.Remove "DELETE_PV_ID"
219
   OraDatabase.Parameters.Remove "DELETE_PV_ID"
220
	OraDatabase.Parameters.Remove "ACTION_TYPE_NAME"
220
   OraDatabase.Parameters.Remove "ACTION_TYPE_NAME"
221
	OraDatabase.Parameters.Remove "COMMENTS"
221
   OraDatabase.Parameters.Remove "COMMENTS"
222
End Sub
222
End Sub
223
 
223
 
224
 
224
 
225
Sub Remove_Old_Dependencies ( SSpv_id )
225
Sub Remove_Old_Dependencies ( SSpv_id )
226
	OraDatabase.Parameters.Add "PV_ID", SSpv_id, 	ORAPARM_INPUT, ORATYPE_NUMBER
226
   OraDatabase.Parameters.Add "PV_ID", SSpv_id,    ORAPARM_INPUT, ORATYPE_NUMBER
227
 
227
 
228
	OraDatabase.ExecuteSQL "DELETE FROM package_dependencies WHERE pv_id = :PV_ID"
228
   OraDatabase.ExecuteSQL "DELETE FROM package_dependencies WHERE pv_id = :PV_ID"
229
 
229
 
230
	OraDatabase.Parameters.Remove "PV_ID"
230
   OraDatabase.Parameters.Remove "PV_ID"
231
End Sub
231
End Sub
232
 
232
 
233
 
233
 
234
Sub Update_Mod_Details ( SSpv_id )
234
Sub Update_Mod_Details ( SSpv_id )
235
	OraDatabase.Parameters.Add "PV_ID", SSpv_id, 	ORAPARM_INPUT, ORATYPE_NUMBER
235
   OraDatabase.Parameters.Add "PV_ID",   SSpv_id,                 ORAPARM_INPUT, ORATYPE_NUMBER
236
	OraDatabase.Parameters.Add "RTAG_ID", Request("rtag_id"), 	ORAPARM_INPUT, ORATYPE_NUMBER
236
   OraDatabase.Parameters.Add "RTAG_ID", Request("rtag_id"),      ORAPARM_INPUT, ORATYPE_NUMBER
237
	OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, 	ORAPARM_INPUT, ORATYPE_NUMBER
237
   OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
238
 
238
 
239
	OraDatabase.ExecuteSQL _
239
   OraDatabase.ExecuteSQL _
240
		" UPDATE package_versions "&_
240
      " UPDATE package_versions "&_
241
    	" SET modified_stamp = "& ORA_SYSDATETIME &", modifier_id = :USER_ID"&_
241
       " SET modified_stamp = "& ORA_SYSDATETIME &", modifier_id = :USER_ID"&_
242
    	" WHERE pv_id = :PV_ID"
242
       " WHERE pv_id = :PV_ID"
243
 
243
 
244
	If Request("rtag_id") <> "" Then
244
   If Request("rtag_id") <> "" Then
245
		' Package in release view
245
      ' Package in release view
246
		OraDatabase.ExecuteSQL _
246
      OraDatabase.ExecuteSQL _
247
	  	"BEGIN "&_
247
        "BEGIN "&_
248
		" Touch_Release ( :RTAG_ID ); "&_
248
      " Touch_Release ( :RTAG_ID ); "&_
249
		"END; "
249
      "END; "
250
 
250
 
251
	Else
251
   Else
252
		' Package view
252
      ' Package view
253
		OraDatabase.ExecuteSQL _
253
      OraDatabase.ExecuteSQL _
254
	  	"BEGIN "&_
254
        "BEGIN "&_
255
		" PK_RELEASE.RUN_POST_ACTIONS_BULK ( :PV_ID ); "&_
255
      " PK_RELEASE.RUN_POST_ACTIONS_BULK ( :PV_ID ); "&_
256
		"END; "
256
      "END; "
257
 
257
 
258
	End If
258
   End If
259
 
259
 
260
	OraDatabase.Parameters.Remove "PV_ID"
260
   OraDatabase.Parameters.Remove "PV_ID"
261
	OraDatabase.Parameters.Remove "RTAG_ID"
261
   OraDatabase.Parameters.Remove "RTAG_ID"
262
	OraDatabase.Parameters.Remove "USER_ID"
262
   OraDatabase.Parameters.Remove "USER_ID"
263
End Sub
263
End Sub
264
 
264
 
265
%>
265
%>
266
<%
266
<%
267
'-----------------------  MAIN LINE  ---------------------------
267
'-----------------------  MAIN LINE  ---------------------------
268
 
268
 
269
Dim sDependBlock
269
Dim sDependBlock
270
 
270
 
271
'--- Process submition ---
271
'--- Process submition ---
272
If (QStrPar("pv_id") <> "")  Then
272
If (QStrPar("pv_id") <> "")  Then
273
	' All mendatory parameters FOUND
273
   ' All mendatory parameters FOUND
274
 
274
 
275
 
275
   Err.Clear
276
	On Error Resume Next
276
   On Error Resume Next
277
	OraSession.BeginTrans
277
   OraSession.BeginTrans
278
 
-
 
279
 
-
 
-
 
278
   ' The called subroutines beneath here do not use "on error resume next", but this calling code does, so if any error
-
 
279
   ' occurs in the called functions, control will resume within this code somewhere. On the assumption that an error might
-
 
280
   ' be the result of some problem in the database, further database commands are not performed, achieved by making them
-
 
281
   ' conditional upon Err.Number being zero. Ultimately, this should result in a rollback
280
 
282
 
281
	array_is_empty = TRUE
283
   array_is_empty = TRUE
282
	If Request("update_type") = "add_custom" Then
284
   If Request("update_type") = "add_custom" Then
283
		'---- ADD CUSTOM dependency ----
285
      '---- ADD CUSTOM dependency ----
284
      ' NOTE - this happens when user clicks the Add action button on the dependencies/runtime tabs. Although the underlying search operation
286
      ' NOTE - this happens when user clicks the Add action button on the dependencies/runtime tabs. Although the underlying search operation
285
      ' (see form_search_pkgs.asp and form_search_result_pkgs.asp) returns a list called "pkg_list", it actually contains a pv_id list in these
287
      ' (see form_search_pkgs.asp and form_search_result_pkgs.asp) returns a list called "pkg_list", it actually contains a pv_id list in these
286
      ' special cases.
288
      ' special cases.
287
		Call Populate_depArray_from_ADD_Custom ( Request("pkg_list"), depArray, array_is_empty )
289
      Call Populate_depArray_from_ADD_Custom ( Request("pkg_list"), depArray, array_is_empty )
288
 
-
 
289
		If NOT array_is_empty Then
-
 
290
			Call Update_Package_Dependencies ( depArray, Request("pv_id"), objAccessControl.UserId, enumlocal_DELETE_OLD_DEPENDENCIES, "depend_add", null )
-
 
291
		End If
-
 
292
 
-
 
293
 
-
 
294
	ElseIf Request("update_type") = "edit_custom" Then
-
 
295
		'---- EDIT CUSTOM dependency ----
-
 
296
		Call Populate_depArray_from_EDIT_Custom ( Request("pv_id"), depArray, array_is_empty, sDependBlock )
-
 
297
		Call Remove_Old_Dependencies ( Request("pv_id") )
-
 
298
 
-
 
299
		If NOT array_is_empty Then
-
 
300
			Call Update_Package_Dependencies ( depArray, Request("pv_id"), objAccessControl.UserId, enumlocal_DONOT_DELETE_OLD_DEPENDENCIES, "depend_update", sDependBlock )
-
 
301
		End If
-
 
302
 
-
 
303
 
290
 
304
	Else
-
 
305
		'---- JATS, ANT dependency import ----
291
      If ((NOT array_is_empty) AND (Err.number = 0)) Then
306
		Call Populate_depArray_from_Import ( Request("FRdeps"), depArray, array_is_empty )
292
         Call Update_Package_Dependencies ( depArray, Request("pv_id"), objAccessControl.UserId, enumlocal_DELETE_OLD_DEPENDENCIES, "depend_add", null )
307
		Call Remove_Old_Dependencies ( Request("pv_id") )
293
      End If
308
 
294
 
309
		If NOT array_is_empty Then
-
 
310
			Call Update_Package_Dependencies ( depArray, Request("pv_id"), objAccessControl.UserId, enumlocal_DONOT_DELETE_OLD_DEPENDENCIES, "depend_import", Request("FRdeps") )
-
 
311
		End If
-
 
312
 
295
 
-
 
296
   ElseIf Request("update_type") = "edit_custom" Then
313
	End If
297
      '---- EDIT CUSTOM dependency ----
-
 
298
      Call Populate_depArray_from_EDIT_Custom ( Request("pv_id"), depArray, array_is_empty, sDependBlock )
-
 
299
      Call Remove_Old_Dependencies ( Request("pv_id") )
314
 
300
 
-
 
301
      If ((NOT array_is_empty) AND (Err.number = 0)) Then
-
 
302
         Call Update_Package_Dependencies ( depArray, Request("pv_id"), objAccessControl.UserId, enumlocal_DONOT_DELETE_OLD_DEPENDENCIES, "depend_update", sDependBlock )
-
 
303
      End If
315
 
304
 
316
 
305
 
-
 
306
   Else
-
 
307
      '---- JATS, ANT dependency import ----
-
 
308
      Call Populate_depArray_from_Import ( Request("FRdeps"), depArray, array_is_empty )
317
	Call Update_Mod_Details ( Request("pv_id") )
309
      Call Remove_Old_Dependencies ( Request("pv_id") )
318
 
310
 
-
 
311
      If ((NOT array_is_empty) AND (Err.number = 0)) Then
-
 
312
         Call Update_Package_Dependencies ( depArray, Request("pv_id"), objAccessControl.UserId, enumlocal_DONOT_DELETE_OLD_DEPENDENCIES, "depend_import", Request("FRdeps") )
-
 
313
      End If
319
 
314
 
-
 
315
   End If
320
 
316
 
321
	If Err.number <> 0 Then
-
 
322
		OraSession.RollBack
-
 
323
		Call RaiseMsg ( enum_MSG_ERROR, Err.description &"<br>"& Err.Source )
-
 
324
	Else
-
 
325
		OraSession.CommitTrans
-
 
326
	End If
-
 
327
 
317
 
-
 
318
   If Err.number = 0 Then
-
 
319
      Call Update_Mod_Details ( Request("pv_id") )
-
 
320
   End If
328
 
321
 
329
	Response.Redirect("dependencies.asp?pv_id="& Request("pv_id") &"&rtag_id="& Request("rtag_id"))
-
 
330
 
322
 
-
 
323
   If Err.number <> 0 Then
-
 
324
      OraSession.RollBack
-
 
325
      Call RaiseMsg ( enum_MSG_ERROR, Err.description &"<br>"& Err.Source )
-
 
326
   Else
-
 
327
      OraSession.CommitTrans
-
 
328
   End If
331
 
329
 
-
 
330
   Response.Redirect("dependencies.asp?pv_id="& Request("pv_id") &"&rtag_id="& Request("rtag_id"))
332
Else
331
Else
333
	Response.write "Some mendatory parameters are missing!" & "<br>" 'TODO
332
   Response.write "Some mendatory parameters are missing!" & "<br>" 'TODO
334
	Response.write QSTR_All
333
   Response.write QSTR_All
335
End If
334
End If
336
%>
335
%>
337
 
336
 
338
<!-- DESTRUCTOR ------->
337
<!-- DESTRUCTOR ------->
339
<!--#include file="common/destructor.asp"-->
338
<!--#include file="common/destructor.asp"-->