Subversion Repositories DevTools

Rev

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