Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

160 lines
4.2 KiB

  1. <html>
  2. <body>
  3. <h2>This is unit test page of SAF Channel object</h2>
  4. <div>
  5. <table>
  6. <tr>
  7. <td>Vendor Name:</td>
  8. <td><Input id="VendorName" Value="Microsoft" size=30></input></td>
  9. <tr>
  10. <td>VendorID:</td>
  11. <td><Input id="VendorID" Value="CN=Microsoft Corporation,L=Redmond,S=Washington,C=US" size=50></Input></td>
  12. <tr>
  13. <td>Config file location:</td>
  14. <td><Input id="ConfigFile" value="d:\mpc\helpctr\saf\test\config.xml" size=80 type=file></input><input type=button value="view xml" Onclick=ViewXML()></td>
  15. <tr>
  16. <td align=right><Input type=button value="Register Support Channel" OnClick=Register()></Input></td>
  17. <td align=right><Input type=button value="Remove Support Channel" OnClick=RemoveChannel()></Input></td>
  18. </table>
  19. </div>
  20. <br>
  21. <hr>
  22. <div>
  23. <table>
  24. <tr>
  25. <td>ProductID:</td>
  26. <td><Input id="ProductID" Value="Microsoft Millennium Beta" size=50></Input></td>
  27. <tr>
  28. <td>Display String:</td>
  29. <td><Input id="Display" Value="This is the Microsoft Word bug #1" size=50></Input></td>
  30. <tr>
  31. <td>URL:</td>
  32. <td><Input id="URL" Value="http://support.microsoft.com/word?ASP=1" size=50></Input></td>
  33. <tr>
  34. <td>Progress:</td>
  35. <td><Input id="Progress" Value="Building..." size=50></Input></td>
  36. <tr>
  37. <td>XML Data File:</td>
  38. <td><Input id="XMLDataFile" value="d:\mpc\helpctr\saf\test\config.xml" size=80 type=file></td>
  39. <tr>
  40. <td align=right><Input type=button value="Add Incident" OnClick=AddIncident()></Input></td>
  41. <td align=right><input type=button value="Close Incident" OnClick=CloseIncident()></td>
  42. <td align=right><Input type=button value="Remove Incident" OnClick=RemoveIncident()></td>
  43. </table>
  44. </div>
  45. <br>
  46. <hr>
  47. <div>
  48. <table>
  49. <tr>
  50. <td>Use above VendorID and ProductID as the channel ID.
  51. <tr>
  52. <td><input type=button value="Show Channel Open-incidents" OnClick=ShowOpenedInc()></td>
  53. <td><input type=button value="Show Channel Closed-incidents" OnClick=ShowClosedInc()></td>
  54. </table>
  55. </div>
  56. <br>
  57. <hr>
  58. <table>
  59. <tr>
  60. <td><input type=button value="Show All Channels" OnClick=ShowAllChannel()></td>
  61. <tr>
  62. <td><hr></td>
  63. <tr>
  64. <td><input type=button value="Show me vendor directory" OnClick=ShowVendorDirectory()></td>
  65. </table>
  66. </body>
  67. <Script Language=VBScript>
  68. Sub ViewXML()
  69. if Len(ConfigFile.Value) = 0 Then
  70. MsgBox "Please select file first"
  71. else
  72. Dim x
  73. set x = Window.open(ConfigFile.Value)
  74. x.focus
  75. end if
  76. End Sub
  77. Sub ShowOpenedInc()
  78. Dim x
  79. set x = Window.open("status_test.htm")
  80. x.focus
  81. End Sub
  82. Sub ShowClosedInc()
  83. Dim x
  84. set x = Window.Open("status_h_test.htm")
  85. x.focus
  86. End Sub
  87. Sub ShowAllChannel()
  88. Dim x
  89. set x = Window.Open("Vendor_test.htm")
  90. x.focus
  91. End Sub
  92. Sub RemoveChannel()
  93. Dim x
  94. Set x = CreateObject("SAF.SAFAPI")
  95. call x.RemoveSupportChannel(VendorID.Value, VendorName.Value, ConfigFile.Value)
  96. Set x = Nothing
  97. End Sub
  98. Sub Register()
  99. Dim x
  100. Set x = CreateObject("SAF.SAFAPI")
  101. call x.RegisterSupportChannel(VendorID.Value, VendorName.Value, ConfigFile.Value)
  102. Set x = Nothing
  103. End Sub
  104. Sub AddIncident()
  105. 'MsgBox VendorID.value
  106. Dim x, y
  107. set x = CreateObject("SAF.SAFAPI")
  108. set y = x.GetChannel(VendorID.Value, ProductID.Value)
  109. y.RecordIncident Display.Value, URL.Value, Progress.Value, XMLDataFile.Value
  110. set y = Nothing
  111. set x = Nothing
  112. End Sub
  113. Sub ShowVendorDirectory()
  114. Dim x, y
  115. set x = CreateObject("SAF.SAFAPI")
  116. set y = x.GetChannel(VendorID.Value, ProductID.Value)
  117. MsgBox "Path: " & y.VendorDirectory
  118. set y = Nothing
  119. set x = Nothing
  120. End Sub
  121. Sub CloseIncident()
  122. Dim x
  123. Dim y
  124. Dim z
  125. Set x = CreateObject("SAF.SAFAPI")
  126. Set y = x.GetChannel(VendorID.Value, ProductID.Value)
  127. Set z = y.Incidents(2)
  128. For Each oItem In z
  129. If oItem.URL = URL.Value Then
  130. oItem.CloseIncidentItem
  131. Exit For
  132. End if
  133. next
  134. End Sub
  135. Sub RemoveIncident()
  136. Dim x
  137. Dim y
  138. Dim z
  139. Set x = CreateObject("SAF.SAFAPI")
  140. Set y = x.GetChannel(VendorID.Value, ProductID.Value)
  141. Set z = y.Incidents(1)
  142. For Each oItem In z
  143. If oItem.URL = URL.Value Then
  144. oItem.DeleteIncidentItem
  145. Exit For
  146. End if
  147. next
  148. End Sub
  149. </Script>
  150. </html>