skip the i-GuideIllinois State UniversityAdmissions at ISUAcademics at ISUEvents at ISUMap of ISUISU A to Z ListingISU AccessibilityISU 150th Anniversary

 

 

 

 

 

 

 

 

 

 

 

 

<% ' ###################################################################### ' EVENTS XML SERVICE - Version 1.3 - 4/14/2003 ' ###################################################################### ' Caching not enabled ' ' 1.3 - Added Location Lookup ' ###################################################################### ' Get the remote XML file ' ###################################################################### FUNCTION getHttpFile(strURL, sHTTPType) Dim objXmlHttp Dim strHTML Dim errAction Set objXmlHttp = Server.CreateObject("Msxml2.ServerXMLHTTP") objXmlHttp.open sHTTPType, strURL, False objXmlHttp.send ' Print out the request status: ' Response.Write "Status: " & objXmlHttp.status & " " & objXmlHttp.statusText & "
" ' ### CHECK FOR SERVER DOWN ### If objXmlHttp.status <> 200 Then errAction = objXmlHttp.statusText ElseIf objXmlHttp.responseXML.parseError.errorCode <> 0 Then errAction = objXmlHttp.responseXML.parseError.reason Else End If getHttpFile = objXmlHttp.responseText 'response.write getHttpFile Set objXmlHttp = nothing END FUNCTION FUNCTION transform (xmlDoc, xslDoc, bIsXml, objArgs) ' ###################################################################### ' Perform the transformation on the XML / XSL Documents ' ###################################################################### set xml = Server.CreateObject("Msxml2.DOMDocument.3.0") xml.validateOnParse = True xml.async = false IF bIsXml THEN xml.loadXML(xmlDoc) ELSE xml.load(Server.MapPath(xmlDoc)) END IF set xsl = Server.CreateObject("Msxml2.FreeThreadedDOMDocument.3.0") xsl.validateOnParse = True xsl.async = false IF bIsXml THEN xsl.loadXML(xslDoc) ELSE xsl.load(Server.MapPath(xslDoc)) END IF Set oTemplate = Server.CreateObject("Msxml2.XSLTemplate.3.0") Set oTemplate.stylesheet = xsl Set oProcessor = oTemplate.createProcessor() FOR EACH param IN objArgs oProcessor.addParameter param, objArgs.item(param) NEXT oProcessor.input = xml on error resume next oProcessor.Transform() 'if xml.parseError.errorCode <> 0 then ' Response.write "xml Error : " & xml.parseError.errorCode & " , " & xml.parseError.reason & "
" 'end if 'if xsl.parseError.errorCode <> 0 then 'Response.write "xsl Error : " & xsl.parseError.errorCode & " , " & xsl.parseError.reason & "
" 'Response.write "(xsl) Line Number : " & xsl.parseError.line & " , " & xsl.parseError.linepos & "
" 'Response.write "(xsl) xml Text : " & xsl.parseError.srctext & "
" 'end if transform = oProcessor.output set xml=nothing set xsl=nothing END FUNCTION ' ###################################################################### ' RSS Specific Function ' ###################################################################### FUNCTION readRSS(calendarType, displayDate, calendarSize, intStart, intID, objArgs) dim dateStart, dateEnd dim sRemoteXML, sRemoteXSL dim cacheFilePath cacheFilePath = Server.MapPath("/calendar/calendarRSS.rss") IF Lcase(calendarType) = "location" THEN ELSE IF ((isNULL (intID)) OR intID < 0) THEN intID = 1 END IF END IF ' ###################################################################### ' Month specified - format intStart = 'xx' ' ###################################################################### IF (displayDate = "month") THEN IF (isNull(intStart)) THEN ' # USE THE CURRENT MONTH OF THIS YEAR dateStart = DATE dateEnd = DATEADD("M", 1, Date)-1 ELSE IF (intStart > 12 OR intStart < 1) THEN intStart = 1 END IF ' # USE THE SPECIFIED MONTH OF THIS YEAR dateStart = cDate(intStart & "/01/" & DatePart("YYYY", DATE)) dateEnd = DATEADD("M", 1, cDate(intStart & "/01/" & DatePart("YYYY", DATE)))-1 END IF ELSE ' ###################################################################### ' Day specified - format intStart = 'xx/xx/xxxx' ' ###################################################################### IF (displayDate = "day") THEN dateStart = cDate(intStart) dateEnd = cDate(intStart) ELSE dateStart = DATE dateEnd = DATE END IF END IF sRemoteXML = "http://dacweb.sys.ilstu.edu/isucal/template/" select case Lcase(calendarType) case "all" sRemoteXML = sRemoteXML & ("Calendar-RSS-Range.xml?startDate=" & dateStart & "&endDate=" & dateEnd) case "category" IF (displayDate = "top") THEN sRemoteXML = sRemoteXML &("Calendar-RSS-Top-Category.xml?startDate="& dateStart & "&catID=" & intID) ELSE sRemoteXML = sRemoteXML &("Calendar-RSS-Category.xml?startDate="& dateStart & "&endDate=" & dateEnd & "&catID=" & intID) END IF case "topic" IF (displayDate= "top") THEN sRemoteXML = sRemoteXML &("Calendar-RSS-Top-Topic.xml?startDate=" & dateStart & "&topicID=" & intID) ELSE sRemoteXML = sRemoteXML &("Calendar-RSS-Topic.xml?startDate="& dateStart & "&endDate=" & dateEnd & "&topicID=" & intID) END IF case "group" IF (displayDate= "top") THEN sRemoteXML = sRemoteXML &("Calendar-RSS-Top-Group.xml?startDate=" & dateStart & "&groupID=" & intID) ELSE sRemoteXML = sRemoteXML &("Calendar-RSS-Group.xml?startDate="& dateStart & "&endDate=" & dateEnd & "&groupID=" & intID) END IF case "location" IF (displayDate= "top") THEN sRemoteXML = sRemoteXML &("Calendar-RSS-Top-Location.xml?startDate=" & dateStart & "&buildingID=" & intID) ELSE sRemoteXML = sRemoteXML &("Calendar-RSS-Location.xml?startDate="& dateStart & "&endDate=" & dateEnd & "&buildingID=" & intID) END IF case default sRemoteXML = sRemoteXML &("Calendar-RSS-Range.xml?startDate=" & dateStart & "&endDate=" & dateEnd) end select sRemoteXSL = "http://" & Request.ServerVariables("SERVER_NAME") select case Lcase(calendarSize) case "wide" sRemoteXSL = sRemoteXSL & ("/calendar/RSStoHTML-Wide.xsl") case "narrow" sRemoteXSL = sRemoteXSL & ("/calendar/RSStoHTML-Narrow.xsl") case default sRemoteXSL = sRemoteXSL & ("/calendar/RSStoHTML-Narrow.xsl") end select 'response.write ("


" & sRemoteXML & "
" & sRemoteXSL & "
") gRemoteXML = getHttpFile(sRemoteXML,"GET") gRemoteXSL = getHttpFile(sRemoteXSL,"GET") response.write transform(gRemoteXML,gRemoteXSL, true, objArgs) ' ### CLEAN UP set sRemoteXML = nothing set sRemoteXSL = nothing set gRemoteXML = nothing set gRemoteXSL = nothing END FUNCTION %> <% DIM objArgs SET objArgs = CreateObject("Scripting.Dictionary") objArgs.Add "_showEventImage", "true" objArgs.Add "_showEventDescription", "true" CALL readRSS("category","top","wide",NULL,20,objArgs) %>