|
pari_garapati -> calendar on web page (14.Dec.2005 1:02:27 AM)
|
i am putting calendar on the web page using webdav it is working fine. i am using XSLT but i'm not able to put starting time and ending time of an appointment. please anyone give me advise how to put appointment starting and end time onthe web page.here is my code . i would be apperciate.... <html> <head> <style> body { margin: 0px; } table { border-collapse: collapse; } td { color: #333333; font-family: Tahoma; font-size: 11px; line-height: 14px; vertical-align: top; } tr.bgcolor1 { background-color: #EFEFF7; } tr.bgcolor2 { background-color: #D6DFEF; } </style> <script language='VBScript'> Dim objXMLHTTP, objXMLDoc ' Define your protocol; http or https strProtocol = "http" ' Define your server name strServername = "server name" ' Define your local name for 'Inbox' strInbox = "Calendar" Sub getMessages_OnClick() strUsername = document.all.mailbox.value If strUsername <> "" Then strInboxURL = strProtocol & "://" & strServername & "/Exchange/" strInboxURL = strInboxURL & strUsername & "/" & strInbox Set objXMLHTTP = CreateObject("Microsoft.XMLHTTP") objXMLHTTP.Open "SEARCH", strInboxURL, True objXMLHTTP.setRequestHeader "Content-type:", "text/xml" objXMLHTTP.setRequestHeader "Depth", "1" objXMLHTTP.onReadyStateChange = getRef("checkXMLHTTPState") strXML = "<?xml version='1.0' ?>" & _ "<a:searchrequest xmlns:a='DAV:'><a:sql>" & _ "SELECT ""urn:schemas:calendar:location"", ""urn:schemas:httpmail:subject"", " & _ """urn:schemas:calendar:dtstart"", ""urn:schemas:calendar:EndTime"", " & _ """urn:schemas:calendar:duration"", ""urn:schemas:calendar:instancetype"" " & _ "FROM Scope('SHALLOW TRAVERSAL OF """ & strURL & """') " & _ "WHERE NOT ""urn:schemas:calendar:instancetype"" = 1 " & _ "AND ""DAV:contentclass"" = 'urn:content-classes:appointment' " & _ "AND ""urn:schemas:calendar:dtstart"">=CAST(""2000-01-01T08:00:00Z"" as 'dateTime')" & _ "ORDER BY ""urn:schemas:calendar:dtstart"" DESC" & _ "</a:sql></a:searchrequest>" objXMLHTTP.SetRequestHeader "Range", "rows=0-4" objXMLHTTP.Send(strXML) End If End Sub Sub checkXMLHTTPState 'Dim objStartTimeNodeList As Xml.XmlNodeList If objXMLHTTP.readyState = 4 Then responseStatus.innerHTML = objXMLHTTP.Status & " - " & objXMLHTTP.StatusText Set objXMLDoc = objXMLHTTP.ResponseXML XSLDiv.innerHTML = objXMLDoc.TransformNode(responseXSL.documentElement) 'Set objStartTimeNodeList = objXMLDoc.getElementsByTagName("urn:schemas:calendar:dtstart") 'Set objNode = objStartTimeNodeList.nextNode 'If objStartTimeNodeList.length > 0 Then 'Dim s_StartDate 'For i = 0 To (objStartTimeNodeList.length -1) 'objNode = objStartTimeNodeList.Item(i) 's_StartDate = objNode.InnerText 'msgbox "Start Time:" &s_StartDate 'Next 'End If 'wscript.echo " Start time: " & objNode.Text Set objXMLHTTP = Nothing Set objXMLDoc = Nothing End If End Sub </script> <xml id='responseXSL'> <xsl:template xmlns:xsl='uri:xsl' xmlns:a='DAV:' xmlns:d='urn:schemas:httpmail:' xmlns:p='urn:schemas:calendar:'> <table border="8" frame="hsides" align="left" rules="all"> <!-- Add a row for each element in the 207 Multistatus response to the SEARCH request. --> <xsl:for-each select='a:multistatus/a:response'> <tr bgcolor="#ccffcc"> <!-- Build a hyperlink using the resource href and subject --> <td> <a> <xsl:attribute name='href'> <xsl:value-of select='a:propstat/a:prop/a:href' />/?Cmd=open </xsl:attribute> <xsl:attribute name='target'>_blank</xsl:attribute> <xsl:value-of select='a:propstat/a:prop/d:subject' /><br/> <xsl:value-of select='a:propstat/a:prop/p:location' /><br/> <xsl:value-of select='a:propstat/a:prop/p:duration' /> <xsl:value-of select='a:propstat/a:prop/p:dtstart.starttime' /> </a> </td> </tr> </xsl:for-each> </table> </xsl:template> </xml> </head> <body> <font face='Verdana' size='2'> Mailbox name:<br> <input type='text' name='mailbox'><br> <input type='button' name='getMessages' value=' GO '><br> <div id='responseStatus'></div> <div id='XSLDiv'></div> </body> </html> thank you in advance....
|
|
|
|