%@LANGUAGE="VBSCRIPT"%>
<%
'=====================================================
' View Project 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 proj_id is always present
If Request("proj_id") = "" Then
Call Destroy_All_Objects
Response.Redirect("index.asp")
End If
'------------ ACCESS CONTROL ------------------
%>
<%
'------------ Variable Definition -------------
Dim parProjId
Dim canModify
'------------ Constants Declaration -----------
'------------ Variable Init -------------------
canModify = canActionControl("ConfigureReplication")
parProjId = Request("proj_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 = _
"SELECT" &_
" bs.*,bp.bp_enabled," &_
" nvl2(bp.BLAT_ID, 1, 0) AS inuse" &_
" FROM" &_
" blat_servers bs," &_
" blat_projects bp" &_
" WHERE" &_
" bs.BLAT_ID = bp.BLAT_ID (+)" &_
" AND bp.proj_id(+) = :PROJ_ID" &_
" AND (bp.BLAT_ID is NOT NULL OR bs.blat_mode in ('P', 'E'))" &_
" ORDER BY" &_
" upper(blat_display_name) ASC"
OraDatabase.Parameters.Add "PROJ_ID", parProjId, ORAPARM_INPUT, ORATYPE_NUMBER
Set rsQry = OraDatabase.DbCreateDynaset( sQry, cint(0) )
OraDatabase.Parameters.Remove "PROJ_ID"
'--- Render rows ---
Do While (NOT rsQry.BOF) AND (NOT rsQry.EOF)
Dim btnText, btnClass, btnDisable, inUse, replicationMode
inUse = rsQry("INUSE") > 0
replicationMode = "Unknown"
If rsQry("blat_mode") = "P" Then
replicationMode = "All Projects"
ElseIf rsQry("blat_mode") = "E" Then
replicationMode = "Entire Archive"
ElseIf rsQry("inUse") > 0 Then
replicationMode = "Project"
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("BP_ENABLED") = "Y", "checked", "" )
btnText = "Operation not available"
btnClass = ""
btnDisable = "disabled"
If canModify AND inUse 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 inUse 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
%>