Subversion Repositories DevTools

Rev

Rev 5506 | Rev 5957 | Go to most recent revision | 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"-->
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
110
      Response.Redirect( "dependencies.asp?rtag_id="& Request("rtag_id") )
111
   End If
112
 
113
Else
114
 
115
   Err.Raise 8, "This page requires more paramaters to run.<br>"& objPMod.ComposeURL()
116
 
117
End If
118
 
119
'-------------------------------------------------
120
' Function:     GetPackageInfo
121
' Description:  Build up a hash of the required package information for  the display
122
'               Start with the results of one query that is a list of pv_ids
123
Sub GetPackageInfo
124
   Dim listPvid : listPvid = ""
125
   Dim joiner : joiner = ""
126
   Dim rsTemp, sqlStr
127
   Dim nRtagId : nRtagId = Request("rtag_id")
128
 
129
   '    Build up a list of pv_id's to process
130
 
131
    While ((NOT rsView.BOF) AND (NOT rsView.EOF))
132
        listPvid = listPvid & joiner & rsView(0)
133
        joiner = ", "
134
    rsView.MoveNext
135
    WEnd
136
 
137
    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" &_
138
             " FROM RELEASE_CONTENT rc, PACKAGE_VERSIONS pv, PACKAGES p, SDK_TAGS st, SDK_NAMES sn" &_
139
             " WHERE rc.pv_id = pv.pv_id" &_
140
             " AND st.SDKTAG_ID(+) = rc.SDKTAG_ID" &_
141
             " AND st.SDK_ID = sn.SDK_ID(+)" &_
142
             " AND pv.PKG_ID = p.PKG_ID" &_
143
             " AND rc.rtag_id = :RTAG_ID " &_
144
             " AND pv.pv_id in ("&listPvid&")" &_
145
             " ORDER BY UPPER(p.pkg_name)"
146
 
147
    OraDatabase.Parameters.Add "RTAG_ID",        nRtagId,       ORAPARM_INPUT, ORATYPE_NUMBER
148
 
149
    Set rsTemp = OraDatabase.DbCreateDynaset( sqlStr, 0 )
150
      Do Until ((rsTemp.BOF) OR (rsTemp.EOF))
151
         Response.Write "<tr>"
152
         Response.Write "<td>"        
153
         If rsTemp("sdktag_id") <> 0 Then Response.Write enum_imgSdkImport        
154
         Response.Write "<td nowrap>" & rsTemp("pkg_name")         
155
         Response.Write "<td nowrap>" & rsTemp("pkg_version")         
156
         Response.Write "<td>"         
157
         If rsTemp("sdktag_id") <> 0 Then Response.Write rsTemp("sdk_name")         
158
         Response.Write "<td>"         
159
         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'>"         
160
         Response.Write "</tr>"          
161
         rsTemp.MoveNext
162
      Loop
163
    rsTemp.Close
164
    Set rsTemp = nothing
165
 
166
    OraDatabase.Parameters.Remove "RTAG_ID"
167
End Sub
168
'----------------------------------------------------------------
169
'
170
'   The body of this page will be displayed only if an error in the insertion process
171
'   occured. Not packages will have been inserted as the transaction will have been
172
'   rolled back. We have a list if PV_ID's that conflicted
173
'
174
'   Generate a display showing:
175
'       Conflicting package name and version
176
'       If the package is imported via an SDK - then highlight this
177
'       If the package is not, then allow the user to delete the package-version from the release
178
%>
179
<html>
180
<head>
181
<title><%=Title(Request("rtag_id"))%></title>
182
<link rel="shortcut icon" href="<%=FavIcon%>"/>
183
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
184
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
185
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
186
<link rel="stylesheet" href="images/navigation.css" type="text/css">
187
<script language="JavaScript" src="images/common.js"></script>
188
<script language="JavaScript" src="scripts/remote_scripting.js"></script>
189
<!--#include file="_jquery_includes.asp"-->
190
<!-- TIPS -->
191
<script language="JavaScript" src="images/tipster.js"></script>
192
<script language="JavaScript" src="images/_help_tips.js"></script>
193
 
194
<!-- DROPDOWN MENUS -->
195
<!--#include file="_menu_def.asp"-->
196
<script language="JavaScript1.2" src="images/popup_menu.js"></script>
197
</head>
198
<body bgcolor="White" text="Black" leftmargin=0 topmargin=0>
199
<!-- MENU LAYERS -------------------------------------->
200
<div id="popmenu" class="menuskin" onMouseover="clearhidemenu();highlightmenu(event,'on')" onMouseout="highlightmenu(event,'off');dynamichide(event)"></div>
201
<!-- TIPS LAYERS -------------------------------------->
202
<div id="formTipsLayer" style="position: absolute; z-index: 1000; visibility: hidden; left:0; top: 0; width: 10">&nbsp;</div>
203
<!----------------------------------------------------->
204
<!-- HEADER -->
205
<!--#include file="_header.asp"-->
206
<!-- BODY ---->
207
<table width="100%" border="0" cellspacing="0" cellpadding="0">
208
	<tr>
209
		<td valign="top" width="1" background="images/bg_bage.gif">
210
		<!-- LEFT -->
211
		<!--#include file="_environment.asp"-->
212
		</td>
213
		<td width="1" bgcolor="#999999"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
214
		<td valign="top" width="100%" class="form_item_grey">
215
		<!-- MIDDLE -->
216
            <table width="100%" height="98%"  border="0" cellpadding="0" cellspacing="0">
217
               <tr>
218
                  <td align="center" valign="middle" class="form_item_grey">
219
                     <table width="70%" border="0" cellspacing="0" cellpadding="0">
220
                        <tr>
221
                           <td>
222
                              <table class="full_table rounded_box" bgcolor="#FFFFFF" style="margin-top: 30px;">
223
                                 <tr>
224
                                    <td width="10px"></td>
225
                                    <td valign="top">
226
                                       <!-- Body -->
227
                                       <table class="full_table">
228
                                             <tr>
229
                                                <td width="10px" height=10"px"></td>
230
                                             </tr>
231
                                             <tr>
232
                                                <td nowrap class="form_field">
233
                                                   <table class="full_table form_item_grey" style="border-spacing: 1px 1px;">
234
                                                      <tr>
235
                                                         <td colspan=5 class="form_field_bg"><p class="err_ttl">Import SDK. Conflicting Packages</p></td>
236
                                                      </tr>
237
                                                      <tr class="form_field form_field_bg">
238
                                                          <td width="15px"></td>
239
                                                          <td width="1%">Name</td>
240
                                                          <td>Version</td>
241
                                                          <td>SDK</td>
242
                                                          <td width="1%"></td>
243
                                                      </tr>
244
                                                      <tr>
245
                                                        <% Call GetPackageInfo %>
246
                                                      </tr>
247
                                                      <tr>
248
                                                         <td colspan=5>&nbsp;</td>
249
                                                      </tr>
250
                                                      <tr>
251
                                                         <td colspan=5 class="form_field_hdr">
252
                                                            The SDK was not imported
253
                                                          </td>
254
                                                      </tr>
255
                                                   </table>
256
                                                </td>
257
                                             </tr>
258
                                             <tr>
259
                                                <td height="10px"></td>
260
                                       </table>
261
                                       <!-- END Body-->
262
                                    </td>
263
                                    <td width="10px"></td>
264
                                 </tr>
265
                              </table>
266
                           </td>
267
                        </tr>
268
                     </table>
269
                  </td>
270
               </tr>
271
            </table>
272
        <!-- End MIDDLE -->
273
		</td>
274
	</tr>
275
</table>
276
 
277
<!-- FOOTER -->
278
<!--#include file="_footer.asp"-->
279
</body>
280
</html>
281
<%
282
Call Destroy_All_Objects
283
%>