Subversion Repositories DevTools

Rev

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