%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
' form_view_release_licencing.asp
'| |
'=====================================================
%>
<%
Option explicit
' Good idea to set when using redirect
Response.Expires = 0 ' always load the page, dont store
%>
<%
' Make sure rtag_id is always present
If Request("rtag_id") = "" Then
Call Destroy_All_Objects
Response.Redirect("index.asp")
End If
' Set rfile parameter. This is a return page after Login
Call objPMod.StoreParameter ( "rfile", "form_view_release_licencing.asp" )
'------------ ACCESS CONTROL ------------------
%>
<%
'------------ Variable Definition -------------
Dim bShowAll
Dim bShowAny
Dim bAllCots
Dim sAllCheck
Dim sAnyCheck
Dim sAllCots
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
bShowAll = Request("ShowAll")
bShowAny = Request("ShowAny")
bAllCots = Request("allCots")
If bAllCots <> "" Then sAllCots = " Checked "
If bShowAny <> "" Then sAnyCheck = " Checked "
If bShowAll <> "" Then sAllCheck = " Checked "
'--------------------------------------------------------------------------------------------------------------------------
' release_licencing_query_string
'
' DESCRIPTION
' Constructs a query string using the provided release tag, designed to elicit
' a list of PV_ID's, thier package names, versions and extensions, and licencing
' associations from the release. Only those PV_IDs with one or more licencing
' associations are returned.
'
' INPUTS
' NNrtag_id : The release tag to be used in the query string
'
Function release_licencing_query_string(NNrtag_id)
release_licencing_query_string = _
"WITH AllPkgLic AS " &_
" (SELECT pkg_id, " &_
" listagg(name, ',') within GROUP ( " &_
" ORDER BY name) AS Name " &_
" FROM " &_
" (SELECT pv.pkg_id, " &_
" ld.name, " &_
" row_number() over (partition BY pv.pkg_id, ld.name order by pv.pkg_id) AS rn " &_
" FROM LICENCING lg, " &_
" LICENCES ld , " &_
" package_versions pv " &_
" WHERE lg.pv_id = pv.pv_id " &_
" AND lg.LICENCE = ld.LICENCE " &_
" ) " &_
" WHERE rn = 1 " &_
" GROUP BY pkg_id " &_
" ), " &_
" AllPvIDs AS " &_
" ( SELECT DISTINCT * " &_
" FROM " &_
" ( SELECT pv_id FROM RELEASE_CONTENT rc WHERE rc.rtag_id = :rtag_id " &_
" UNION " &_
" SELECT pv_id FROM work_in_progress wip WHERE wip.rtag_id = :rtag_id " &_
" UNION " &_
" SELECT pv_id " &_
" FROM planned pl " &_
" WHERE pl.rtag_id = :rtag_id " &_
" AND (pl.operation IS NULL " &_
" OR pl.operation = 'R') " &_
" ) " &_
" ) " &_
"SELECT DISTINCT pv.pv_id, " &_
" pv.pkg_id, " &_
" pkg.pkg_name, " &_
" pv.pkg_version, " &_
" pv.v_ext, " &_
" pv.pv_description, " &_
" lcs.name AS licenceName , " &_
" CASE " &_
" WHEN al.NAME IS NOT NULL " &_
" AND lcs.name IS NOT NULL " &_
" AND ( lcs.name = al.NAME ) " &_
" THEN NULL " &_
" ELSE al.NAME " &_
" END AS OTHERLICENSES " &_
"FROM AllPvIDs rc, " &_
" package_versions pv, " &_
" packages pkg, " &_
" licencing lcng, " &_
" licences lcs, " &_
" AllPkgLic al " &_
"WHERE pv.pv_id = rc.pv_id " &_
"AND pkg.pkg_id = pv.pkg_id " &_
"AND pv.pv_id = lcng.pv_id (+) " &_
"AND lcng.licence = lcs.licence (+) " &_
"AND pv.pkg_id = al.pkg_id(+) " &_
"AND ( " &_
"(lcng.licence is not null) OR ('" & bShowAll & "' is not null)" &_
" OR ( (al.name is not null) AND ('" & bShowAny & "' is not null) )" &_
" OR ((UPPER(pv.v_ext) = '.COTS') AND ('" & bAllCots & "' is not null))" &_
") " &_
"ORDER BY Upper( pkg.pkg_name), " &_
" Upper(pv.pkg_version) "
End Function
'--------------------------------------------------------------------------------------------------------------------------
' PV_ID_ListHTML
'
' DESCRIPTION
' Constructs the HTML to render the rows of package names, versions and extensions, and licences
'
Sub PV_ID_ListHTML
Dim rsQry
Dim hRef
Dim pkgVer
OraDatabase.Parameters.Add "RTAG_ID", parRtag_Id, ORAPARM_INPUT, ORATYPE_NUMBER
Set rsQry = OraDatabase.DbCreateDynaset( release_licencing_query_string(parRtag_Id), cint(0) )
OraDatabase.Parameters.Remove "PV_ID"
'--- Render rows ---
Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
' BEGIN ROW
Response.Write "
"
rsQry.MoveNext
Loop
' destroy objects
rsQry.Close()
Set rsQry = nothing
End Sub
'--------------------------------------------------------------------------------------------------------------------------
Sub LeftPanelContent
objFormComponent.FormName = "FormName"
objFormComponent.Method = "get"
objFormComponent.Action = ScriptName
Call objFormComponent.FormStart()
%>
<%
Call objFormComponent.FormEnd()
'-- FROM END ----------------------------------------------------------------------------------------------------------------
%>
<%
End Sub
'----------------------------------------------
Sub MainPanelContent
%>
VIEW RELEASE LICENCING DETAILS
Package Name
Package Version
Package Extension
Short Description
Licences<%=Quick_Help("h_licences")%>
Other Licences<%=Quick_Help("h_other")%>
Edit
<%Call PV_ID_ListHTML%>
<%
End Sub
'------------------------------------------------------------------------------
%>
Release Manager
<%bJqueryDataTables = TRUE%>
<%bCsvExport = True%>