| 5357 |
dpurdie |
1 |
<%@LANGUAGE="VBSCRIPT"%>
|
|
|
2 |
<%
|
|
|
3 |
'=====================================================
|
|
|
4 |
' sdk_add_release
|
|
|
5 |
' Add and SDK to a given Release
|
|
|
6 |
' Called with two parameters
|
|
|
7 |
' The page will either:
|
|
|
8 |
' add the SDKTAG to the Release - and then redirect to the dependencies tab
|
|
|
9 |
' or
|
|
|
10 |
' Fail in adding the SDK to the Release - and display a page of conflicting package-versions
|
|
|
11 |
'
|
|
|
12 |
'=====================================================
|
|
|
13 |
%>
|
|
|
14 |
<%
|
|
|
15 |
Option explicit
|
|
|
16 |
' Good idea to set when using redirect
|
|
|
17 |
Response.Expires = 0 ' always load the page, dont store
|
|
|
18 |
Const allowNoPackage = TRUE ' Allow page display without pvid being present
|
|
|
19 |
Const showReleaseSdk = TRUE ' Show the Release SDK div
|
|
|
20 |
%>
|
|
|
21 |
|
|
|
22 |
<!--#include file="common/conf.asp"-->
|
|
|
23 |
<!--#include file="common/globals.asp"-->
|
|
|
24 |
<!--#include file="common/formating.asp"-->
|
|
|
25 |
<!--#include file="common/qstr.asp"-->
|
|
|
26 |
<!--#include file="common/common_subs.asp"-->
|
|
|
27 |
<!--#include file="common/common_dbedit.asp"-->
|
|
|
28 |
<!--#include file="common/_package_common.asp"-->
|
|
|
29 |
<%
|
|
|
30 |
'------------ ACCESS CONTROL ------------------
|
|
|
31 |
%>
|
|
|
32 |
<!--#include file="_access_control_login.asp"-->
|
|
|
33 |
<!--#include file="_access_control_general.asp"-->
|
|
|
34 |
<!--#include file="_access_control_project.asp"-->
|
|
|
35 |
<%
|
|
|
36 |
'------------ Variable Definition -------------
|
|
|
37 |
Dim sdkAdded
|
|
|
38 |
Dim rsQry
|
|
|
39 |
Dim rsView
|
|
|
40 |
'------------ Constants Declaration -----------
|
|
|
41 |
'------------ Variable Init -------------------
|
|
|
42 |
sdkAdded = FALSE
|
|
|
43 |
Set pkgInfoHash = CreateObject("Scripting.Dictionary")
|
|
|
44 |
'----------------------------------------------
|
|
|
45 |
%>
|
|
|
46 |
<%
|
|
|
47 |
'-------------------------------------------------
|
|
|
48 |
' Function: AddReleaseSDK
|
|
|
49 |
' Description: Add the nominated sdktag to the release
|
|
|
50 |
' Args: dMode. 0: No Delete, 1:Delete non-sdk packages
|
|
|
51 |
' Returns: Number of Packages Inserted
|
|
|
52 |
' < 0 - Error. Conflict list populated
|
|
|
53 |
' rsView is set to a list of PV_ID that cause the conflict
|
|
|
54 |
' = 0 - No packages inserted
|
|
|
55 |
' > 0 - Number of packages inserted
|
|
|
56 |
|
|
|
57 |
Function AddReleaseSDK ( nRtagId, nSdktagId, dMode )
|
|
|
58 |
OraDatabase.Parameters.Add "RTAG_ID", nRtagId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
59 |
OraDatabase.Parameters.Add "SDKTAG_ID", nSdktagId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
60 |
OraDatabase.Parameters.Add "USER_ID", objAccessControl.UserId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
61 |
OraDatabase.Parameters.Add "DMODE", dMode, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
62 |
OraDatabase.Parameters.Add "INSERT_COUNT", NULL, ORAPARM_OUTPUT, ORATYPE_NUMBER
|
|
|
63 |
OraDatabase.Parameters.Add "CONFLICT_LIST", NULL, ORAPARM_OUTPUT, ORATYPE_CURSOR
|
|
|
64 |
|
|
|
65 |
objEH.TryORA ( OraSession )
|
|
|
66 |
On Error Resume Next
|
|
|
67 |
|
|
|
68 |
OraDatabase.ExecuteSQL _
|
|
|
69 |
" BEGIN "&_
|
|
|
70 |
" PK_RELEASE.ADD_RELEASE_SDK ( :RTAG_ID, :SDKTAG_ID, :USER_ID, :DMODE, :INSERT_COUNT, :CONFLICT_LIST ); "&_
|
|
|
71 |
" END; "
|
|
|
72 |
|
|
|
73 |
objEH.CatchORA ( OraSession )
|
|
|
74 |
|
|
|
75 |
' INSERT_COUNT < 0 - Error. Conflict list populated
|
|
|
76 |
' INSERT_COUNT = 0 - No packages inserted
|
|
|
77 |
' INSERT_COUNT > 0 - Number of packages inserted
|
|
|
78 |
AddReleaseSDK = OraDatabase.Parameters("INSERT_COUNT").Value
|
|
|
79 |
|
|
|
80 |
' NULL Conflict list indicates that the operation did not fail
|
|
|
81 |
' There may have been no items to insert
|
|
|
82 |
If NOT isNull(OraDatabase.Parameters("CONFLICT_LIST").Value) Then
|
|
|
83 |
Set rsView = OraDatabase.Parameters("CONFLICT_LIST").Value
|
|
|
84 |
AddReleaseSDK = -1
|
|
|
85 |
End If
|
|
|
86 |
|
|
|
87 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
| 5952 |
dpurdie |
88 |
OraDatabase.Parameters.Remove "SDKTAG_ID"
|
| 5357 |
dpurdie |
89 |
OraDatabase.Parameters.Remove "USER_ID"
|
|
|
90 |
OraDatabase.Parameters.Remove "DMODE"
|
|
|
91 |
OraDatabase.Parameters.Remove "INSERT_COUNT"
|
|
|
92 |
OraDatabase.Parameters.Remove "CONFLICT_LIST"
|
|
|
93 |
End Function
|
|
|
94 |
%>
|
|
|
95 |
<%
|
|
|
96 |
'----------------------- MAIN LINE ---------------------------
|
|
|
97 |
|
|
|
98 |
'------ ACCESS CONTROL ----------
|
|
|
99 |
If NOT canShowControlInProject("AddSdk") Then
|
|
|
100 |
Call RaiseMsg(enum_MSG_ERROR, "User not authorized to add an SDK.<br>User login may have expired.")
|
|
|
101 |
End If
|
|
|
102 |
'--------------------------------
|
|
|
103 |
|
|
|
104 |
If (Request("rtag_id") <> "") AND (Request("sdktag_id") <> "") AND (Request("dmode") <> "") Then
|
|
|
105 |
|
|
|
106 |
'--- Process submition ---
|
|
|
107 |
sdkAdded = AddReleaseSDK ( Request("rtag_id"), Request("sdktag_id"), Request("dmode") )
|
|
|
108 |
|
|
|
109 |
If sdkAdded >= 0 Then
|
| 5957 |
dpurdie |
110 |
Call Destroy_All_Objects
|
| 5357 |
dpurdie |
111 |
Response.Redirect( "dependencies.asp?rtag_id="& Request("rtag_id") )
|
|
|
112 |
End If
|
|
|
113 |
|
|
|
114 |
Else
|
|
|
115 |
|
|
|
116 |
Err.Raise 8, "This page requires more paramaters to run.<br>"& objPMod.ComposeURL()
|
|
|
117 |
|
|
|
118 |
End If
|
|
|
119 |
|
|
|
120 |
'-------------------------------------------------
|
|
|
121 |
' Function: GetPackageInfo
|
|
|
122 |
' Description: Build up a hash of the required package information for the display
|
|
|
123 |
' Start with the results of one query that is a list of pv_ids
|
|
|
124 |
Sub GetPackageInfo
|
|
|
125 |
Dim listPvid : listPvid = ""
|
|
|
126 |
Dim joiner : joiner = ""
|
|
|
127 |
Dim rsTemp, sqlStr
|
|
|
128 |
Dim nRtagId : nRtagId = Request("rtag_id")
|
|
|
129 |
|
|
|
130 |
' Build up a list of pv_id's to process
|
|
|
131 |
|
|
|
132 |
While ((NOT rsView.BOF) AND (NOT rsView.EOF))
|
|
|
133 |
listPvid = listPvid & joiner & rsView(0)
|
|
|
134 |
joiner = ", "
|
|
|
135 |
rsView.MoveNext
|
|
|
136 |
WEnd
|
|
|
137 |
|
|
|
138 |
sqlStr = "Select pv.pv_id, pv.pkg_version, p.pkg_name, NVL(rc.sdktag_id,0) as sdktag_id, sn.sdk_name || '::' || st.sdktag_name as sdk_name" &_
|
|
|
139 |
" FROM RELEASE_CONTENT rc, PACKAGE_VERSIONS pv, PACKAGES p, SDK_TAGS st, SDK_NAMES sn" &_
|
|
|
140 |
" WHERE rc.pv_id = pv.pv_id" &_
|
|
|
141 |
" AND st.SDKTAG_ID(+) = rc.SDKTAG_ID" &_
|
|
|
142 |
" AND st.SDK_ID = sn.SDK_ID(+)" &_
|
|
|
143 |
" AND pv.PKG_ID = p.PKG_ID" &_
|
|
|
144 |
" AND rc.rtag_id = :RTAG_ID " &_
|
|
|
145 |
" AND pv.pv_id in ("&listPvid&")" &_
|
|
|
146 |
" ORDER BY UPPER(p.pkg_name)"
|
|
|
147 |
|
|
|
148 |
OraDatabase.Parameters.Add "RTAG_ID", nRtagId, ORAPARM_INPUT, ORATYPE_NUMBER
|
|
|
149 |
|
|
|
150 |
Set rsTemp = OraDatabase.DbCreateDynaset( sqlStr, 0 )
|
|
|
151 |
Do Until ((rsTemp.BOF) OR (rsTemp.EOF))
|
|
|
152 |
Response.Write "<tr>"
|
|
|
153 |
Response.Write "<td>"
|
|
|
154 |
If rsTemp("sdktag_id") <> 0 Then Response.Write enum_imgSdkImport
|
|
|
155 |
Response.Write "<td nowrap>" & rsTemp("pkg_name")
|
|
|
156 |
Response.Write "<td nowrap>" & rsTemp("pkg_version")
|
|
|
157 |
Response.Write "<td>"
|
|
|
158 |
If rsTemp("sdktag_id") <> 0 Then Response.Write rsTemp("sdk_name")
|
|
|
159 |
Response.Write "<td>"
|
|
|
160 |
If rsTemp("sdktag_id") = 0 Then Response.Write "<img src='images/i_delete_disable.gif' width='13' height='12' hspace='2' border='0' title='Delete this package from the Release'>"
|
|
|
161 |
Response.Write "</tr>"
|
|
|
162 |
rsTemp.MoveNext
|
|
|
163 |
Loop
|
|
|
164 |
rsTemp.Close
|
|
|
165 |
Set rsTemp = nothing
|
|
|
166 |
|
|
|
167 |
OraDatabase.Parameters.Remove "RTAG_ID"
|
|
|
168 |
End Sub
|
|
|
169 |
'----------------------------------------------------------------
|
|
|
170 |
'
|
|
|
171 |
' The body of this page will be displayed only if an error in the insertion process
|
|
|
172 |
' occured. Not packages will have been inserted as the transaction will have been
|
|
|
173 |
' rolled back. We have a list if PV_ID's that conflicted
|
|
|
174 |
'
|
|
|
175 |
' Generate a display showing:
|
|
|
176 |
' Conflicting package name and version
|
|
|
177 |
' If the package is imported via an SDK - then highlight this
|
|
|
178 |
' If the package is not, then allow the user to delete the package-version from the release
|
|
|
179 |
%>
|
|
|
180 |
<html>
|
|
|
181 |
<head>
|
|
|
182 |
<title><%=Title(Request("rtag_id"))%></title>
|
|
|
183 |
<link rel="shortcut icon" href="<%=FavIcon%>"/>
|
|
|
184 |
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
|
|
|
185 |
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
| 6579 |
dpurdie |
186 |
<link rel="stylesheet" href="images/release_manager_style.css?ver=<%=VixVerNum%>" type="text/css">
|
|
|
187 |
<link rel="stylesheet" href="images/navigation.css?ver=<%=VixVerNum%>" type="text/css">
|
|
|
188 |
<script language="JavaScript" src="images/common.js?ver=<%=VixVerNum%>"></script>
|
|
|
189 |
<script language="JavaScript" src="scripts/remote_scripting.js?ver=<%=VixVerNum%>"></script>
|
| 5357 |
dpurdie |
190 |
<!--#include file="_jquery_includes.asp"-->
|
|
|
191 |
<!-- TIPS -->
|
| 6579 |
dpurdie |
192 |
<script language="JavaScript" src="images/tipster.js?ver=<%=VixVerNum%>"></script>
|
|
|
193 |
<script language="JavaScript" src="images/_help_tips.js?ver=<%=VixVerNum%>"></script>
|
| 5357 |
dpurdie |
194 |
<!-- DROPDOWN MENUS -->
|
|
|
195 |
<!--#include file="_menu_def.asp"-->
|
| 6579 |
dpurdie |
196 |
<script language="JavaScript1.2" src="images/popup_menu.js?ver=<%=VixVerNum%>"></script>
|
| 5357 |
dpurdie |
197 |
</head>
|
|
|
198 |
<body bgcolor="White" text="Black" leftmargin=0 topmargin=0>
|
|
|
199 |
<!-- HEADER -->
|
|
|
200 |
<!--#include file="_header.asp"-->
|
|
|
201 |
<!-- BODY ---->
|
|
|
202 |
<table width="100%" border="0" cellspacing="0" cellpadding="0">
|
|
|
203 |
<tr>
|
| 6876 |
dpurdie |
204 |
<td class='bg_bage'>
|
| 5357 |
dpurdie |
205 |
<!-- LEFT -->
|
|
|
206 |
<!--#include file="_environment.asp"-->
|
|
|
207 |
</td>
|
|
|
208 |
<td width="1" bgcolor="#999999"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
|
|
|
209 |
<td valign="top" width="100%" class="form_item_grey">
|
|
|
210 |
<!-- MIDDLE -->
|
|
|
211 |
<table width="100%" height="98%" border="0" cellpadding="0" cellspacing="0">
|
|
|
212 |
<tr>
|
|
|
213 |
<td align="center" valign="middle" class="form_item_grey">
|
|
|
214 |
<table width="70%" border="0" cellspacing="0" cellpadding="0">
|
|
|
215 |
<tr>
|
|
|
216 |
<td>
|
|
|
217 |
<table class="full_table rounded_box" bgcolor="#FFFFFF" style="margin-top: 30px;">
|
|
|
218 |
<tr>
|
|
|
219 |
<td width="10px"></td>
|
|
|
220 |
<td valign="top">
|
|
|
221 |
<!-- Body -->
|
|
|
222 |
<table class="full_table">
|
|
|
223 |
<tr>
|
|
|
224 |
<td width="10px" height=10"px"></td>
|
|
|
225 |
</tr>
|
|
|
226 |
<tr>
|
|
|
227 |
<td nowrap class="form_field">
|
|
|
228 |
<table class="full_table form_item_grey" style="border-spacing: 1px 1px;">
|
|
|
229 |
<tr>
|
|
|
230 |
<td colspan=5 class="form_field_bg"><p class="err_ttl">Import SDK. Conflicting Packages</p></td>
|
|
|
231 |
</tr>
|
|
|
232 |
<tr class="form_field form_field_bg">
|
|
|
233 |
<td width="15px"></td>
|
|
|
234 |
<td width="1%">Name</td>
|
|
|
235 |
<td>Version</td>
|
|
|
236 |
<td>SDK</td>
|
|
|
237 |
<td width="1%"></td>
|
|
|
238 |
</tr>
|
|
|
239 |
<tr>
|
|
|
240 |
<% Call GetPackageInfo %>
|
|
|
241 |
</tr>
|
|
|
242 |
<tr>
|
|
|
243 |
<td colspan=5> </td>
|
|
|
244 |
</tr>
|
|
|
245 |
<tr>
|
|
|
246 |
<td colspan=5 class="form_field_hdr">
|
|
|
247 |
The SDK was not imported
|
|
|
248 |
</td>
|
|
|
249 |
</tr>
|
|
|
250 |
</table>
|
|
|
251 |
</td>
|
|
|
252 |
</tr>
|
|
|
253 |
<tr>
|
|
|
254 |
<td height="10px"></td>
|
|
|
255 |
</table>
|
|
|
256 |
<!-- END Body-->
|
|
|
257 |
</td>
|
|
|
258 |
<td width="10px"></td>
|
|
|
259 |
</tr>
|
|
|
260 |
</table>
|
|
|
261 |
</td>
|
|
|
262 |
</tr>
|
|
|
263 |
</table>
|
|
|
264 |
</td>
|
|
|
265 |
</tr>
|
|
|
266 |
</table>
|
|
|
267 |
<!-- End MIDDLE -->
|
|
|
268 |
</td>
|
|
|
269 |
</tr>
|
|
|
270 |
</table>
|
|
|
271 |
<!-- FOOTER -->
|
|
|
272 |
<!--#include file="_footer.asp"-->
|
|
|
273 |
</body>
|
|
|
274 |
</html>
|