Subversion Repositories DevTools

Rev

Rev 6077 | Rev 6080 | 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
'|                                                   |
5
'|         View Release Licencing Details            |
6
'|                                                   |
7
'=====================================================
8
Option explicit
9
' Good idea to set when using redirect
10
Response.Expires = 0  ' always load the page, dont store
11
%>
12
<!--#include file="common/conf.asp"-->
13
<!--#include file="common/globals.asp"-->
14
<!--#include file="common/formating.asp"-->
15
<!--#include file="common/qstr.asp"-->
16
<!--#include file="common/common_subs.asp"-->
17
<!--#include file="common/_form_window_common.asp"-->
18
<%
19
' Make sure rtag_id is always present
20
If Request("rtag_id") = "" Then
5957 dpurdie 21
    Call Destroy_All_Objects
5357 dpurdie 22
	Response.Redirect("index.asp")
23
End If
24
 
25
' Set rfile parameter. This is a return page after Login
26
Call objPMod.StoreParameter ( "rfile", "dependencies.asp" )
27
'------------ ACCESS CONTROL ------------------
28
%>
29
<!--#include file="_access_control_login.asp"-->
30
<!--#include file="_access_control_general.asp"-->
31
<!--#include file="_access_control_project.asp"-->
32
<%
33
'------------ Variable Definition -------------
6077 dpurdie 34
Dim bShowAll
6078 dpurdie 35
Dim bShowAny
36
Dim bShowNone
6077 dpurdie 37
Dim sPrevPage
5357 dpurdie 38
'------------ Constants Declaration -----------
39
 
40
'------------ Variable Init -------------------
6077 dpurdie 41
bShowAll = Request("ShowAll")
6078 dpurdie 42
bShowAny = Request("ShowAny")
43
bShowNone = Request("ShowNone")
6077 dpurdie 44
sPrevPage = QStrParDefault("prevPage", Request.ServerVariables("HTTP_REFERER"))
5357 dpurdie 45
 
6078 dpurdie 46
 
5357 dpurdie 47
'--------------------------------------------------------------------------------------------------------------------------
48
'  release_licencing_query_string
49
'
50
'  DESCRIPTION
51
'     Constructs a query string using the provided release tag, designed to elicit
52
'     a list of PV_ID's, thier package names, versions and extensions, and licencing
53
'     associations from the release. Only those PV_IDs with one or more licencing
54
'     associations are returned.
55
'
56
'  INPUTS
57
'     NNrtag_id : The release tag to be used in the query string
58
'
59
Function release_licencing_query_string(NNrtag_id)
60
 
6077 dpurdie 61
   release_licencing_query_string = _
62
                    "WITH AllPkgLic AS " &_
63
                    "  (SELECT pkg_id, " &_
64
                    "    listagg(name, ',') within GROUP ( " &_
65
                    "  ORDER BY name) AS Name " &_
66
                    "  FROM " &_
67
                    "    (SELECT pv.pkg_id, " &_
68
                    "      ld.name, " &_
69
                    "      row_number() over (partition BY pv.pkg_id, ld.name order by pv.pkg_id) AS rn " &_
70
                    "    FROM LICENCING lg, " &_
71
                    "      LICENCES ld , " &_
72
                    "      package_versions pv " &_
73
                    "    WHERE lg.pv_id = pv.pv_id " &_
74
                    "    AND lg.LICENCE = ld.LICENCE " &_
75
                    "    ) " &_
76
                    "  WHERE rn = 1 " &_
77
                    "  GROUP BY pkg_id " &_
78
                    "  ), " &_
79
                    "  AllPvIDs AS " &_
80
                    "  ( SELECT DISTINCT * " &_
81
                    "  FROM " &_
82
                    "    ( SELECT pv_id FROM RELEASE_CONTENT rc WHERE rc.rtag_id = :rtag_id " &_
83
                    "    UNION " &_
84
                    "    SELECT pv_id FROM work_in_progress wip WHERE wip.rtag_id = :rtag_id " &_
85
                    "    UNION " &_
86
                    "    SELECT pv_id " &_
87
                    "    FROM planned pl " &_
88
                    "    WHERE pl.rtag_id   = :rtag_id " &_
89
                    "    AND (pl.operation IS NULL " &_
90
                    "    OR pl.operation    = 'R') " &_
91
                    "    ) " &_
92
                    "  ) " &_
93
                    "SELECT DISTINCT pv.pv_id, " &_
94
                    "  pkg.pkg_name, " &_
95
                    "  pv.pkg_version, " &_
96
                    "  pv.v_ext, " &_
97
                    "  pv.pv_description, " &_
98
                    "  lcs.name AS licenceName , " &_
99
                    "  CASE " &_
100
                    "    WHEN al.NAME  IS NOT NULL " &_
101
                    "    AND lcs.name  IS NOT NULL " &_
102
                    "    AND ( lcs.name = al.NAME ) " &_
103
                    "    THEN NULL " &_
104
                    "    ELSE al.NAME " &_
105
                    "  END AS OTHERLICENSES " &_
106
                    "FROM AllPvIDs rc, " &_
107
                    "  package_versions pv, " &_
108
                    "  packages pkg, " &_
109
                    "  licencing lcng, " &_
110
                    "  licences lcs, " &_
111
                    "  AllPkgLic al " &_
112
                    "WHERE pv.pv_id   = rc.pv_id " &_
113
                    "AND pkg.pkg_id   = pv.pkg_id " &_
114
                    "AND pv.pv_id     = lcng.pv_id (+) " &_
115
                    "AND lcng.licence = lcs.licence (+) " &_
116
                    "AND pv.pkg_id    = al.pkg_id(+) " &_
6078 dpurdie 117
                    "AND ((lcng.licence is not null) OR ('" & bShowAll & "' is not null) OR ( (al.name is not null) AND ('" & bShowAny & "' is not null) )) " &_
6077 dpurdie 118
                    "ORDER BY Upper( pkg.pkg_name), " &_
119
                    "  Upper(pv.pkg_version) "
120
 
5357 dpurdie 121
End Function
122
 
123
 
124
'--------------------------------------------------------------------------------------------------------------------------
125
'  PV_ID_ListHTML
126
'
127
'  DESCRIPTION
128
'     Constructs the HTML to render the rows of package names, versions and extensions, and licences
129
'
130
Function PV_ID_ListHTML
131
   Dim rsQry
132
   Dim html_string
133
 
6077 dpurdie 134
 
135
   OraDatabase.Parameters.Add "RTAG_ID", parRtag_Id, ORAPARM_INPUT, ORATYPE_NUMBER
5357 dpurdie 136
   Set rsQry = OraDatabase.DbCreateDynaset( release_licencing_query_string(parRtag_Id), cint(0) )
6077 dpurdie 137
   OraDatabase.Parameters.Remove "PV_ID"
5357 dpurdie 138
 
139
   '--- Render rows ---
140
   Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
141
 
142
      ' BEGIN ROW
143
      html_string = html_string & "<tr>"
144
 
145
      ' PACKAGE NAME
6077 dpurdie 146
      html_string = html_string & "<td nowrap class='body_rowg'>"
147
      html_string = html_string & "<a href=dependencies.asp?pv_id=" & rsQry("pv_id") & "&rtag_id=" & parRtag_Id & ">" & rsQry("pkg_name") & "</a>"
148
      html_string = html_string & "</td>"
5357 dpurdie 149
 
150
      ' PACKAGE VERSION
151
      If IsNull(rsQry("v_ext")) Then
152
         html_string = html_string & "<td nowrap class='body_rowg'>" & rsQry("pkg_version") & "</td>"
153
      Else
154
         html_string = html_string & "<td nowrap class='body_rowg'>" & Left(rsQry("pkg_version"), Len(rsQry("pkg_version")) - Len(rsQry("v_ext")) ) & "</td>"
155
      End If
156
 
157
      ' PACKAGE EXTENSION
158
      html_string = html_string & "<td nowrap class='body_rowg'>" & rsQry("v_ext") & "</td>"
159
 
6077 dpurdie 160
      ' PACKAGE Short Description
161
      html_string = html_string & "<td class='body_rowg'>" & rsQry("pv_description") & "</td>"
162
 
5357 dpurdie 163
      ' LICENCE NAME
164
      html_string = html_string & "<td nowrap class='body_rowg'>" & rsQry("licenceName") & "</td>"
165
 
6077 dpurdie 166
      ' Other Licenses
167
      html_string = html_string & "<td nowrap class='body_rowg'>" & rsQry("otherlicenses") & "</td>"
168
 
169
      ' Edit License
170
      Dim sonclick
171
      sonclick="""MM_openVixIFrame('_wform_change_licence.asp?pv_id="& rsQry("pv_id") &"&rtag_id="& parRtag_id &"','Change License')"""
172
      Dim data
173
 
174
      If canActionControlInProject ("EditPackageLicence") OR canActionControl("MSMaintainer") Then
175
        data = "<a href='javascript:;' onClick=" & sonclick & " class='body_txt'>" &_
176
               "<img src='images/i_edit.gif' width='12' height='12' border='0'>" &_
177
               "</a>"
178
     Else
179
        data = "<img src='images/i_edit_disable.gif' width='12' height='12' border='0'>"
180
     End If
181
 
182
      html_string = html_string & "<td nowrap class='body_rowg'>" & data & "</td>"
183
 
5357 dpurdie 184
      ' END ROW
185
      html_string = html_string & "</tr>"
186
 
187
      rsQry.MoveNext
188
 
189
      ' ROW SEPERATOR
190
      If (NOT rsQry.BOF) AND (NOT rsQry.EOF) Then
191
         html_string = html_string & "<tr><td colspan='8' background='images/bg_table_border.gif'><img src='images/spacer.gif' width='1' height='1'></td></tr>"
192
      End If
193
   Loop
194
 
195
   ' destroy objects
196
   rsQry.Close()
197
   Set rsQry = nothing
198
 
199
   ' return result
200
   PV_ID_ListHTML = html_string
201
End Function
202
 
203
'--------------------------------------------------------------------------------------------------------------------------
204
'--------------------------------------------------------------------------------------------------------------------------
205
'------------ RUN BEFORE PAGE RENDER ----------
206
 
207
 
208
 
209
'----------------------------------------------
210
%>
211
 
212
<html>
213
<head>
214
<title>Release Manager</title>
215
<link rel="shortcut icon" href="<%=FavIcon%>"/>
216
<meta HTTP-EQUIV="Pragma" CONTENT="no-cache">
217
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
218
<link rel="stylesheet" href="images/release_manager_style.css" type="text/css">
219
<link rel="stylesheet" href="images/navigation.css" type="text/css">
220
<script language="JavaScript" src="images/common.js"></script>
221
<script language="JavaScript" src="scripts/remote_scripting.js"></script>
222
<!-- DROPDOWN MENUS -->
5983 dpurdie 223
<!--#include file="_jquery_includes.asp"-->
5357 dpurdie 224
<!--#include file="_menu_def.asp"-->
225
<script language="JavaScript1.2" src="images/popup_menu.js"></script>
6077 dpurdie 226
<!-- TIPS -->
227
<script language="JavaScript" src="images/tipster.js"></script>
228
<script language="JavaScript" src="images/_help_tips.js"></script>
229
<script language="JavaScript" type="text/javascript">
230
<!--
231
formTips.tips.h_licenses       = stdTip(300, 'License', 'A list of licenses found on this version of this package' +
232
                                                          '<p>Licenses are specified for a specific version of a package.' + 
233
                                                          '<p>A package may have several licenses and the packages licenses may chnage over time.' 
234
                                                          );
235
formTips.tips.h_other       = stdTip(300, 'Other License', 'A list of licenses found in others versions of this package, if they differ from the one specified' +
236
                                                          'for this package.' +
237
                                                          '<p>Licenses are specified for a specific version of a package.' + 
238
                                                          '<p>A package may have several licenses and the packages licenses may chnage over time.' 
239
                                                          );
240
</script>
5357 dpurdie 241
</head>
242
<!-- HEADER -->
243
<!--#include file="_header.asp"-->
244
<!-- BODY ---->
245
 
246
<table width="100%" border="0" cellspacing="0" cellpadding="0">
247
   <%
248
   '-- FROM START ---------------------------------------------------------------------------------------------------------
249
 
250
   objFormComponent.FormName = "FormName"
251
   objFormComponent.Method = "post"
252
   objFormComponent.Action = ScriptName & "?rtag_id=" & parRtag_Id
253
   Call objFormComponent.FormStart()
254
   %>
255
   <tr>
256
      <td width="1" background="images/bg_home_orange.gif" valign="top"></td>
257
      <td width="100%" rowspan="2" align="center" valign="top" bgcolor="#EEEFEF">
6077 dpurdie 258
         <table width="95%" border="0" cellspacing="0" cellpadding="0">
5357 dpurdie 259
            <tr>
260
               <td width="1%"></td>
261
               <td width="100%">
262
                  <table width="100%"  border="0" cellspacing="0" cellpadding="0">
263
                     <tr>
264
                        <td nowrap class="body_txt"></td>
265
                     </tr>
266
                  </table>
267
                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
268
                     <tr>
269
                        <td nowrap class="form_ttl"><p>&nbsp;</p>
270
                           <p>VIEW RELEASE LICENCING DETAILS</p>
271
                        </td>
272
                        <td align="right" valign="bottom"></td>
273
                     </tr>
274
                  </table>
275
               </td>
276
               <td width="1%"></td>
277
            </tr>
278
            <tr>
279
               <td align="left" valign="top" background="images/lbox_bg_blue.gif"><img src="images/lbox_tl_cnr_b.gif" width="13" height="13"></td>
280
               <td background="images/lbox_bg_blue.gif" class="lbox_ttl_w"><img src="images/h_trsp_dot.gif" width="600" height="15"></td>
281
               <td align="right" valign="top"  background="images/lbox_bg_blue.gif"><img src="images/lbox_tr_cnr_b.gif" width="13" height="13"></td>
282
            </tr>
283
            <tr>
284
               <td bgcolor="#FFFFFF"><img src="images/h_trsp_dot.gif" width="10" height="100"></td>
285
               <td bgcolor="#FFFFFF" valign="top">
286
                  <%
287
                  %>
288
                  <!-- MESSAGE +++++++++++++++++++++++++++++++++++++++++++++++++++ -->
289
                  <!--#include file="messages/_msg_inline.asp"-->
290
                  <!-- +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ -->
291
                  <br>
292
                  <table width="100%"  border="0" cellspacing="2" cellpadding="0">
293
                     <tr>
6077 dpurdie 294
                        <td valign="top"></td>
5357 dpurdie 295
                        <tr>
296
                           <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Package Name</td>
297
                           <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Package Version</td>
298
                           <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Package Extension</td>
6077 dpurdie 299
                           <td valign="top" background="images/bg_table_col.gif" class="body_col">Short Description</td>
300
                           <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Licences<%=Quick_Help("h_licenses")%></td>
301
                           <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Other Licenses<%=Quick_Help("h_other")%></td>
302
                           <td valign="top" nowrap background="images/bg_table_col.gif" class="body_col">Edit</td>
5357 dpurdie 303
                           <td valign="top">
304
                        </tr>
305
                        <%=PV_ID_ListHTML()%>
306
                        <tr>
307
                           <td class="form_iname">&nbsp;</td>
308
                           <td>&nbsp;</td>
309
                           <td class="val_err"></td>
310
                        </tr>
311
                     </tr>
312
                  </table>
313
               </td>
314
               <td background="images/lbox_bgside_white.gif">&nbsp;</td>
315
            </tr>
316
            <tr>
317
               <td background="images/bg_action_norm.gif" ></td>
318
               <td align="right" background="images/bg_action_norm.gif" >
6077 dpurdie 319
                  <input name="btn_submit" type="reset" class="form_btn" value="OK", onClick="location.href='<%=sPrevPage%>';">
6078 dpurdie 320
                  <%If NOT IsEmpty(bShowNone)Then%>
321
                  <input name="showAny" type="submit" class="form_btn" value="Show Any">
322
                  <%ElseIf NOT IsEmpty(bShowAny) Then%>
6077 dpurdie 323
                  <input name="showAll" type="submit" class="form_btn" value="Show All">
324
                  <%Else%>
325
                  <input name="showNone" type="submit" class="form_btn" value="Hide Unspecified">
326
                  <%End If%>
5357 dpurdie 327
               </td>
6077 dpurdie 328
                  <input name="prevPage" type="hidden" value="<%=sPrevPage%>">
5357 dpurdie 329
               <td background="images/bg_action_norm.gif" ><img src="images/h_trsp_dot.gif" width="5" height="30"></td>
330
            </tr>
331
            <tr>
332
               <td background="images/lbox_bg_blue.gif" valign="bottom"><img src="images/lbox_bl_cnr_b.gif" width="13" height="13"></td>
333
               <td background="images/lbox_bg_blue.gif"></td>
334
               <td background="images/lbox_bg_blue.gif" valign="bottom" align="right"><img src="images/lbox_br_cnr_b.gif" width="13" height="13"></td>
335
            </tr>
336
         </table>
337
      </td>
338
      <td width="1" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="1"></td>
339
   </tr>
340
   <tr>
341
      <td valign="bottom" align="center" background="images/bg_home_orange.gif"><img src="images/img_vtree.gif" width="86" height="99" vspace="20" hspace="30"></td>
342
      <td background="images/bg_lght_gray.gif" valign="top"><img src="images/h_trsp_dot.gif" width="1" height="500"></td>
343
   </tr>
344
   <%
345
   Call objFormComponent.FormEnd()
346
   '-- FROM END ----------------------------------------------------------------------------------------------------------------
347
   %>
348
</table>
349
<!-- FOOTER -->
350
<!--#include file="_footer.asp"-->
351
</body>
352
</html>