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.

119 lines
2.6 KiB

  1. <HTML>
  2. <HEAD>
  3. <!--
  4. Copyright (c) 2000 Microsoft Corporation
  5. -->
  6. <OBJECT ID=pchealth classid=CLSID:FC7D9E02-3F9E-11d3-93C0-00C04F72DAF7></OBJECT>
  7. </HEAD>
  8. <BODY>
  9. <TABLE cellspacing=0 cellpadding=0 width=100%>
  10. <TR>
  11. <TD WIDTH=100%>
  12. <INPUT id=idKEYWORD style="width:100%">
  13. </TD>
  14. <TD style="padding-left: .2em">
  15. <BUTTON id=idSEARCH accesskey="S" onClick="onClick_search();"><U>S</U>earch</BUTTON>
  16. </TD>
  17. </TR>
  18. </TABLE>
  19. <BR>
  20. <DIV id=idList></DIV>
  21. </BODY>
  22. <SCRIPT LANGUAGE=JavaScript>
  23. var g_semgr = null;
  24. var g_lookup = [];
  25. var ID_KEYWORD = "9488F2E9-47AF-46da-AE4A-86372DEBD56C";
  26. function onClick_search()
  27. {
  28. g_semgr = pchealth.CreateObject_SearchEngineMgr();
  29. for(var oEnumEngine = new Enumerator(g_semgr.EnumEngine()); !oEnumEngine.atEnd(); oEnumEngine.moveNext())
  30. {
  31. var oSearchEng = oEnumEngine.item();
  32. // Display the search engine only if it has been enabled
  33. oSearchEng.Enabled = (oSearchEng.ID == ID_KEYWORD);
  34. }
  35. g_semgr.NumResult = 500;
  36. g_semgr.QueryString = idKEYWORD.value;
  37. g_semgr.onComplete = onComplete;
  38. g_semgr.ExecuteAsynchQuery();
  39. }
  40. function onComplete()
  41. {
  42. var html = "";
  43. var i = 0;
  44. keywordsearch();
  45. for(var oEnumEngine = new Enumerator(g_semgr.EnumEngine()); !oEnumEngine.atEnd(); oEnumEngine.moveNext())
  46. {
  47. var oSearchEng = oEnumEngine.item();
  48. // Display the search engine only if it has been enabled
  49. if(oSearchEng.ID == ID_KEYWORD)
  50. {
  51. var coll = oSearchEng.Result( 0, g_semgr.NumResult );
  52. var iTotalResult = coll.Count;
  53. for(var e = new Enumerator( coll ); !e.atEnd(); e.moveNext())
  54. {
  55. var item = e.item();
  56. var obj = g_lookup[item.URI];
  57. var pri = 0;
  58. if(obj) pri = obj.Priority;
  59. html += "<DIV><TABLE>";
  60. html += "<TR><TD colspan=2><B>" + i++ + "</B></TD></TR>";
  61. html += "<TR><TD>ContentType</TD><TD>" + item.ContentType + "</TD></TR>";
  62. html += "<TR><TD>Priority</TD><TD>" + pri + "</TD></TR>";
  63. html += "<TR><TD>Title</TD><TD>" + item.Title + "</TD></TR>";
  64. html += "<TR><TD>URI</TD><TD>" + item.URI + "</TD></TR></TABLE><BR>";
  65. html += "</DIV>";
  66. }
  67. break;
  68. }
  69. }
  70. idList.innerHTML = html;
  71. }
  72. function keywordsearch()
  73. {
  74. var html = "";
  75. var i = 0;
  76. var lst = pchealth.Database.KeywordSearch( idKEYWORD.value );
  77. g_lookup = [];
  78. for(var e = new Enumerator( lst ); !e.atEnd(); e.moveNext())
  79. {
  80. var item = e.item();
  81. var obj;
  82. g_lookup[item.TopicURL] = item;
  83. }
  84. }
  85. </SCRIPT>
  86. </HTML>