% '==================================================
' Microsoft Server Appliance
' Alert Viewer page
' Copyright (c) Microsoft Corporation. All rights reserved.
'==================================================%>
<%
Dim L_ALERT_DETAILS_MESSAGE
Dim L_NOALERTS_MESSAGE
Dim L_PAGETITLE
L_PAGETITLE = Request.QueryString("Title")
If ( Len(L_PAGETITLE) <= 0 ) Then
L_PAGETITLE = GetLocString("sakitmsg.dll", "4001000F", "")
End If
L_ALERT_DETAILS_MESSAGE = GetLocString("sakitmsg.dll", "40010011", "")
L_NOALERTS_MESSAGE = GetLocString("sakitmsg.dll", "40010010", "")
%>
<%
Set objElementCol = GetElements("SA_Alerts")
If objElementCol.Count=0 or Err.Number <> 0 Then
If ( Err.Number <> 0 ) Then
Call SA_TraceOut("SH_ALERTVIEWER", "GetElements(SA_Alerts) failed: " + CStr(Hex(Err.Number)) + " " + Err.Description)
End If
Err.Clear
%>
|
|
<%=Server.HtmlEncode(L_NOALERTS_MESSAGE)%> |
<%
Else
Set objAlertElementCol = GetElements(sAlertDefContainer)
If ( Err.Number <> 0 ) Then
Call SA_TraceOut("SH_ALERTVIEWER", "GetElements(AlertDefinitions) failed: " + CStr(Hex(Err.Number)) + " " + Err.Description)
End If
i = 0
blnSameType = True
ReDim arrAlerts(objElementCol.Count, 3)
For Each objElement in objElementCol
Err.Clear
strAlertSrc = objElement.GetProperty("AlertLog")
strElementID = strAlertSrc & Hex(objElement.GetProperty("AlertID"))
strMsg = ""
Err.Clear
Set objAlertElement = objAlertElementCol.Item(sAlertDefContainer+strElementID)
If ( Err.Number <> 0 ) Then
Err.Clear
Set objAlertElement = objAlertElementCol.Item(strElementID)
If (Err.Number <> 0) Then
Set objAlertElement = Nothing
End If
Else
strAlertSrc = objAlertElement.GetProperty("Source")
End If
If ( objAlertElement <> Nothing ) Then
varReplacementStrings = objElement.GetProperty("ReplacementStrings")
strMsg = GetLocString(strAlertSrc, objAlertElement.GetProperty("CaptionRID"), varReplacementStrings)
arrAlerts(i, 0) = strMsg
arrAlerts(i, 1) = objElement.GetProperty("Cookie")
arrAlerts(i, 2) = objElement.GetProperty("AlertType")
arrAlerts(i, 3) = Trim(objAlertElement.GetProperty("URL"))
' adjust alert types for the current display sort order
Select Case arrAlerts(i, 2)
Case 0
arrAlerts(i, 2) = 2
Case 1
arrAlerts(i, 2) = 1
Case 2
arrAlerts(i, 2) = 3
Case Else
Call SA_TraceOut(SA_GetScriptFileName(), "Unexpected AlertType: " + CStr(arrAlerts(i, 2)))
arrAlerts(i, 2) = 3
End Select
If i > 0 Then
If arrAlerts(i, 2) <> arrAlerts(i-1, 2) Then
blnSameType = False
End If
End If
i = i + 1
End If
Next
ReDim Preserve arrAlerts(i,3)
' sort by Type if needed
If Not blnSameType Then
QuickSort arrAlerts, LBound(arrAlerts,1), UBound(arrAlerts,1)-1, 2
End If
strDefaultViewer = m_VirtualRoot & "sh_alertdetails.asp"
Call SA_MungeURL( strDefaultViewer, "AlertDefinitions", sAlertDefContainer)
'strReturnURL = GetScriptPath()
'strReturnURL = ""
For i = 0 To UBound(arrAlerts,1)
strMsg = arrAlerts(i, 0)
If strMsg <> "" Then
If arrAlerts(i, 3) <> "" Then
strViewer = arrAlerts(i, 3)
Else
strViewer = strDefaultViewer
End If
strAlertURL = strViewer
Call SA_MungeURL( strAlertURL, "Tab1", GetTab1())
Call SA_MungeURL( strAlertURL, "Tab2", GetTab2())
Call SA_MungeURL( strAlertURL, "Cookie", CStr(arrAlerts(i, 1)) )
Call SA_MungeURL( strAlertURL, "ReturnURL", strReturnURL)
Call SA_MungeURL( strAlertURL, "R", CStr(Rnd))
Call SA_MungeURL( strAlertURL, SAI_FLD_PAGEKEY, SAI_GetPageKey())
%>
">
|
href=<%=oEncoder.EncodeAttribute(strAlertURL)%>
title=<%=oEncoder.EncodeAttribute(L_ALERT_DETAILS_MESSAGE)%>
onMouseOver="window.status='<%=Server.HTMLEncode(EscapeQuotes(L_ALERTDETAILS_MESSAGE))%>';return true;">
<%=oEncoder.EncodeElement(arrAlerts(i,0))%>
|
<% End If
Next
End If
Response.Write "
"
Set oEncoder = Nothing
Set oValidator = Nothing
Set objElement = Nothing
Set objElementCol = Nothing
Set objAlertElement = Nothing
Set objAlertElementCol = Nothing
End Function
%>