Main Page
<%
Dim objElement
Dim objElementCol
Dim objAlertElementCol
Dim objAlertElement
Dim objResourceElementCol
Dim objResourceElement
Dim objLocMgr
Dim strElementID
Dim strText
Dim strAlertLog
Dim varReplacementStrings
Dim objRetriever
Dim objSaHelper
Dim strCurrentIp
Dim strHostName
Dim strCaptions
Dim strDescriptions
Dim strLongDescriptions
Dim intCaptionID
Dim intDescriptionID
Dim intLongDescriptionID
Dim intResourceWidth
Dim strSourceDll
On Error Resume Next
'Reset tasks page settings
Session("Task_CurrentPage") = ""
Session("Task_CurrentTask") = ""
Session("Task_FocusItem") = ""
'Get the hostname and ip address
Set objSaHelper = Server.CreateObject("ServerAppliance.SAHelper")
If Err.Number <> 0 Then
strCurrentIp = "UNKNOWN"
strHostName = "UNKNOWN"
Else
strCurrentIp = objSaHelper.IpAddress
If Err.Number <> 0 Then
strCurrentIp = "UNKNOWN"
End If
strHostName = objSaHelper.HostName
If Err.Number <> 0 Then
strHostName = "UNKNOWN"
End If
End If
Set objSaHelper = Nothing
Err.Clear
'Create elementmgr and get current alerts
Set objRetriever = Server.CreateObject("Elementmgr.ElementRetriever")
If Err.Number = 0 Then
Set objResourceElementCol = objRetriever.GetElements(1, "LOCAL_UI_RESOURCE")
intResourceWidth = 0
If Err.Number = 0 Then
intResourceWidth = objResourceElementCol.Count * 16
End If
Set objElementCol = objRetriever.GetElements(1, "SA_Alerts")
If objElementCol.Count=0 or Err.Number <> 0 Then
Err.Clear
strCaptions = ""
strDescriptions = ""
strLongDescriptions = ""
Else
'get alert definitions
Set objAlertElementCol = objRetriever.GetElements(1,"LocalUIAlertDefinitions")
'create localization manager to get alert strings
Set objLocMgr = Server.CreateObject("ServerAppliance.LocalizationManager")
If (Err.Number <> 0) Then
Err.Clear
strCaptions = ""
strDescriptions = ""
strLongDescriptions = ""
Else
For Each objElement in objElementCol
strAlertLog = objElement.GetProperty("AlertLog")
strElementID = "LocalUIAlertDefinitions" & strAlertLog & Hex(objElement.GetProperty("AlertID"))
strText = ""
Err.Clear
Set objAlertElement = objAlertElementCol.Item(strElementID)
If Err <> 0 Then
Set objAlertElement = Nothing
Else
strSourceDll = objAlertElement.GetProperty("Source")
intCaptionID = "&H" & objAlertElement.GetProperty("CaptionRID")
intDescriptionID = "&H" & objAlertElement.GetProperty("DescriptionRID")
intLongDescriptionID = "&H" & objAlertElement.GetProperty("LongDetailRID")
varReplacementStrings = objElement.GetProperty("ReplacementStrings")
strText = ""
strText = objLocMgr.GetString(strSourceDll, intCaptionID, varReplacementStrings)
If strText<> "" Then
strCaptions = strCaptions & "