Subversion Repositories DevTools

Rev

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

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