%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
' View Release Level replication
' form_project_replication.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
'------------ ACCESS CONTROL ------------------
%>
<%
'------------ Variable Definition -------------
Dim parRtagId
Dim canModify
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
canModify = canActionControl("ConfigureReplication")
parRtagId = Request("rtag_id")
'--------------------------------------------------------------------------------------------------------------------------
' GenerateTableBody
'
' DESCRIPTION
' Constructs the HTML to render the rows of package names, and other information
'
Function GenerateTableBody
Dim rsQry
Dim html_string
Dim sQry
sQry = _
"WITH aa as (" &_
" SELECT * from blat_projects where proj_id = (select PROJ_ID from RELEASE_TAGS where rtag_id = :RTAG_ID)" &_
" )" &_
" SELECT" &_
" bs.*," &_
" br.rtag_id, br.br_enabled, br.br_exclude," &_
" nvl2(br.BLAT_ID, 1, 0) AS inRelease," &_
" nvl2(aa.BLAT_ID, 1, 0) AS inProject" &_
" FROM" &_
" blat_servers bs," &_
" blat_releases br," &_
" aa" &_
" WHERE" &_
" bs.BLAT_ID = br.BLAT_ID (+)" &_
" AND br.rtag_id(+) = :RTAG_ID" &_
" AND bs.BLAT_ID = aa.BLAT_ID (+)" &_
" AND (aa.BLAT_ID is NOT NULL OR br.BLAT_ID is NOT NULL OR bs.BLAT_MODE IN( 'P', 'E'))" &_
" ORDER BY" &_
" upper(blat_display_name) ASC"
OraDatabase.Parameters.Add "RTAG_ID", DB_RTAG_ID, ORAPARM_INPUT, ORATYPE_NUMBER
Set rsQry = OraDatabase.DbCreateDynaset( sQry, cint(0) )
OraDatabase.Parameters.Remove "RTAG_ID"
'--- Render rows ---
Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
Dim btnText, btnClass, btnDisable, isaRelease, replicationMode
isaRelease = rsQry("inRelease") > 0
replicationMode = "Unknown"
If rsQry("blat_mode") = "E" Then
replicationMode = "Entire Archive"
ElseIf rsQry("blat_mode") = "P" Then
replicationMode = "All Projects"
Else
If rsQry("inProject") > 0 Then
replicationMode = "Project"
ElseIf rsQry("inRelease") > 0 Then
replicationMode = "Release"
End If
End If
' BEGIN ROW
html_string = html_string & "
"
' Server Active
Dim activeChecked
activeChecked = IIF(rsQry("BLAT_ENABLE") = "Y", "checked", "" )
html_string = html_string & "
"
' Server Name
html_string = html_string & "
" & rsQry("BLAT_DISPLAY_NAME") & "
"
' Project Active
activeChecked = IIF(rsQry("BR_ENABLED") = "Y", "checked", "" )
btnText = "Operation not available"
btnClass = ""
btnDisable = "disabled"
If canModify AND isaRelease Then
btnText = "Toggle Replication State"
btnClass = "class=btn_enable"
btnDisable = ""
End If
html_string = html_string & "
"
' Delete Operation
Dim DelUserImage : DelUserImage = LIMG_NDEL_DISABLED
btnText = "Operation not available"
btnClass = ""
If canModify AND isaRelease Then
DelUserImage = LIMG_NDEL
btnText = "Remove this replica"
btnClass = "class=btn_delete"
End If
html_string = html_string & "
" & DelUserImage & "
"
' END ROW
html_string = html_string & "
"
rsQry.MoveNext
' ROW SEPERATOR
'If (NOT rsQry.BOF) AND (NOT rsQry.EOF) Then
html_string = html_string & "
"
'End If
Loop
' destroy objects
rsQry.Close()
Set rsQry = nothing
' return result
GenerateTableBody = html_string
End Function
'----------------------------------------------------
' Insert Includes and scripts associated with TIPS
Sub InsertTips
%>
<%
End Sub
'----------------------------------------------------
' Insert scripts into the header section of the generated document
Sub InsertUserScripts
%>
<%
End Sub
'--------------------------------------------------------------------------------------------------------------------------
'--------------------------------------------------------------------------------------------------------------------------
'------------ RUN BEFORE PAGE RENDER ----------
'
'----------------------------------------------------
Sub LeftPanelContent
End Sub
'----------------------------------------------------
Sub MainPanelContent
%>