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.

436 lines
16 KiB

  1. <!-- ############################################################################ -->
  2. <!-- ## UDDI Services ## -->
  3. <!-- ## Copyright (c) Microsoft Corporation. All rights reserved. ## -->
  4. <!-- ############################################################################ -->
  5. <%@ Page Language='C#' Inherits='UDDI.Web.UddiPage' %>
  6. <%@ Register Tagprefix='uddi' Tagname='Header' Src='../controls/header.ascx' %>
  7. <%@ Register Tagprefix='uddi' Tagname='Footer' Src='../controls/footer.ascx' %>
  8. <%@ Register Tagprefix='uddi' Tagname='BreadCrumb' Src='../controls/breadcrumb.ascx' %>
  9. <%@ Register Tagprefix='uddi' Tagname='BusyWait' Src='../controls/busywait.ascx' %>
  10. <%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %>
  11. <%@ Import Namespace='System.Data' %>
  12. <%@ Import Namespace='System.Data.SqlClient' %>
  13. <%@ Import Namespace='System.IO' %>
  14. <%@ Import Namespace='System.Text' %>
  15. <%@ Import Namespace='UDDI' %>
  16. <%@ Import Namespace='UDDI.Web' %>
  17. <script language='C#' runat='server'>
  18. protected bool frames;
  19. private string mode;
  20. private DateTime time;
  21. protected void Page_Init( object sender, EventArgs e )
  22. {
  23. frames = ( "true" == Request[ "frames" ] );
  24. mode = (null==Request.Form[ "mode" ]) ? Request.QueryString[ "mode" ] : Request.Form[ "mode" ];
  25. breadcrumb.AddBlurb( Localization.GetString( "HEADING_STATISTICS" ), null, null, null, false );
  26. breadcrumb.AddBlurb( Localization.GetString( "HEADING_ADMINISTER" ), "../admin/admin.aspx?refreshExplorer=&frames=" + ( frames ? "true" : "false" ), null, null, true );
  27. entityCountStatsList.Columns[ 1 ].HeaderText = Localization.GetString( "HEADING_STATISTICS_ENTITYTYPE" );
  28. entityCountStatsList.Columns[ 2 ].HeaderText = Localization.GetString( "HEADING_STATISTICS_COUNT" );
  29. pubStatsList.Columns[ 1 ].HeaderText = Localization.GetString( "HEADING_STATISTICS_STATISTIC" );
  30. pubStatsList.Columns[ 2 ].HeaderText = Localization.GetString( "HEADING_STATISTICS_VALUE" );
  31. topPubsList.Columns[ 0 ].HeaderText = Localization.GetString( "HEADING_STATISTICS_ENTITYTYPE" );
  32. topPubsList.Columns[ 1 ].HeaderText = Localization.GetString( "HEADING_STATISTICS_PUBNAME" );
  33. topPubsList.Columns[ 2 ].HeaderText = Localization.GetString( "HEADING_STATISTICS_COUNT" );
  34. taxStatsList.Columns[ 0 ].HeaderText = Localization.GetString( "HEADING_STATISTICS_TAXANDVAL" );
  35. taxStatsList.Columns[ 1 ].HeaderText = Localization.GetString( "HEADING_STATISTICS_STATISTIC" );
  36. taxStatsList.Columns[ 2 ].HeaderText = Localization.GetString( "HEADING_STATISTICS_VALUE" );
  37. }
  38. protected void Page_Load( object sender, EventArgs e )
  39. {
  40. if( !Page.IsPostBack )
  41. {
  42. //
  43. //Set the selected tab.
  44. //
  45. if( null!=Request[ "tab" ] )
  46. tabs.SelectedIndex = Convert.ToInt32( Request[ "tab" ] );
  47. }
  48. //
  49. //set the current time for the report
  50. //
  51. time = DateTime.Now;
  52. //
  53. // Make sure the 'Statistics' node in the tree is selected
  54. //
  55. if( null!=Request[ "refreshExplorer" ] && frames )
  56. {
  57. Response.Write(
  58. ClientScripts.ReloadExplorerPane( "_statistics" )
  59. );
  60. }
  61. }
  62. protected void Page_PreRender( object sender, EventArgs e )
  63. {
  64. switch( tabs.SelectedIndex )
  65. {
  66. case 0:
  67. PopulateEntityStats();
  68. break;
  69. case 1:
  70. PopulatePublisherStats();
  71. break;
  72. case 2:
  73. PopulateTaxonomyStats();
  74. break;
  75. }
  76. LastChange.Text = time.ToString();
  77. }
  78. protected void Recalculate_OnCommand( object sender, CommandEventArgs e )
  79. {
  80. switch( e.CommandName.ToLower() )
  81. {
  82. case "refresh":
  83. Statistics.RecalculateStatistics();
  84. mode = "refresh";
  85. break;
  86. }
  87. }
  88. protected void PopulateTaxonomyStats()
  89. {
  90. if( mode!="refresh" && ReportStatus.Available== Statistics.GetReportStatus( ReportType.GetTaxonomyStats ) )
  91. {
  92. TaxonomyStatsBusyPanel.Visible = false;
  93. TaxonomyStatsAvailablePanel.Visible = true;
  94. taxStatsList.DataSource = Statistics.GetStatistics( ReportType.GetTaxonomyStats, ref time );
  95. taxStatsList.DataBind();
  96. RecalcButton.Enabled = true;
  97. }
  98. else
  99. {
  100. TaxonomyStatsBusyPanel.Visible = true;
  101. TaxonomyStatsAvailablePanel.Visible = false;
  102. RecalcButton.Enabled = false;
  103. }
  104. }
  105. protected void PopulatePublisherStats( )
  106. {
  107. if( mode!="refresh" && ( ReportStatus.Available==Statistics.GetReportStatus( ReportType.GetPublisherStats ) ||
  108. ReportStatus.Available== Statistics.GetReportStatus( ReportType.GetTopPublishers ) ) )
  109. {
  110. PublisherStatsAvailablePanel.Visible = true;
  111. PublisherStatsBusyPanel.Visible = false;
  112. topPubsList.DataSource = Statistics.GetStatistics( ReportType.GetTopPublishers, ref time );
  113. topPubsList.DataBind();
  114. pubStatsList.DataSource = Statistics.GetStatistics( ReportType.GetPublisherStats, ref time );
  115. pubStatsList.DataBind();
  116. RecalcButton.Enabled = true;
  117. }
  118. else
  119. {
  120. PublisherStatsBusyPanel.Visible = true;
  121. PublisherStatsAvailablePanel.Visible = false;
  122. RecalcButton.Enabled = false;
  123. }
  124. }
  125. protected void PopulateEntityStats( )
  126. {
  127. if( mode!="refresh" && ReportStatus.Available==Statistics.GetReportStatus( ReportType.GetEntityCounts ) )
  128. {
  129. EntityStatsAvailablePanel.Visible = true;
  130. EntityStatsBusyPanel.Visible = false;
  131. entityCountStatsList.DataSource = Statistics.GetStatistics( ReportType.GetEntityCounts, ref time );
  132. entityCountStatsList.DataBind();
  133. RecalcButton.Enabled = true;
  134. }
  135. else
  136. {
  137. EntityStatsBusyPanel.Visible = true;
  138. EntityStatsAvailablePanel.Visible = false;
  139. RecalcButton.Enabled = false;
  140. }
  141. }
  142. </script>
  143. <uddi:StyleSheetControl
  144. Runat='server'
  145. Default='../stylesheets/uddi.css'
  146. Downlevel='../stylesheets/uddidl.css'
  147. />
  148. <uddi:PageStyleControl
  149. Runat='server'
  150. OnClientContextMenu='Document_OnContextMenu()'
  151. Title="TITLE"
  152. AltTitle="TITLE_ALT"
  153. />
  154. <uddi:ClientScriptRegister
  155. Runat='server'
  156. Source='../client.js'
  157. Language='javascript'
  158. />
  159. <uddi:SecurityControl
  160. CoordinatorRequired='true'
  161. Runat='server'
  162. />
  163. <form enctype='multipart/form-data' Runat='server'>
  164. <table width='100%' border='0' height='100%' cellpadding='0' cellspacing='0'>
  165. <asp:PlaceHolder
  166. Id='HeaderBag'
  167. Runat='server'
  168. >
  169. <tr height='95'>
  170. <td>
  171. <!-- Header Control Here -->
  172. <uddi:Header
  173. Runat='server'
  174. />
  175. </td>
  176. </tr>
  177. </asp:PlaceHolder>
  178. <tr height='100%' valign='top'>
  179. <td>
  180. <uddi:BreadCrumb
  181. Id='breadcrumb'
  182. Runat='server'
  183. />
  184. <table cellpadding='10' cellspacing='0' border='0' width='100%'>
  185. <tr>
  186. <td colspan='2'>
  187. <uddi:UddiLabel Text='[[HELP_BLOCK_ADMIN]]' CssClass='helpBlock' Runat='server' /><br>
  188. <br>
  189. <uddi:TabControl ID='tabs' Runat='server'>
  190. <uddi:TabPage Name='TAB_STATISTICS_ENTITYCOUNTS' Runat='server'>
  191. <uddi:ContextualHelpControl
  192. Runat='Server'
  193. Text='[[HELP_BLOCK_ADMIN_STATISTICS_ENTITIES]]'
  194. HelpFile='coordinate.context.statisticsentity'
  195. CssClass='tabHelpBlock'
  196. />
  197. <br>
  198. <asp:Panel id='EntityStatsAvailablePanel' runat='server' Visible='true' >
  199. <asp:DataGrid
  200. CellPadding='4'
  201. CellSpacing='0'
  202. ID='entityCountStatsList'
  203. GridLines='None'
  204. AutoGenerateColumns='false'
  205. HeaderStyle-CssClass='tableHeader'
  206. ItemStyle-CssClass='tableItem'
  207. Runat='server'>
  208. <Columns>
  209. <asp:BoundColumn DataField='section' Visible='false' />
  210. <asp:TemplateColumn HeaderStyle-Width='400' HeaderText='label' HeaderStyle-CssClass='tableHeader' ItemStyle-CssClass='tableItem' FooterStyle-CssClass='tableItem'>
  211. <ItemTemplate>
  212. <asp:Label Text='<%# Localization.GetString( HttpUtility.HtmlEncode( (string)((DataRowView)Container.DataItem)[ "label" ] ) ) %>' CssClass='rowItem' Runat='Server' />
  213. </ItemTemplate>
  214. </asp:TemplateColumn>
  215. <asp:TemplateColumn HeaderStyle-Width='75' HeaderText='value' HeaderStyle-CssClass='tableHeader' ItemStyle-CssClass='tableItem' FooterStyle-CssClass='tableItem'>
  216. <ItemTemplate>
  217. <asp:Label Text='<%# HttpUtility.HtmlEncode( (string)((DataRowView)Container.DataItem)[ "value" ] ) %>' CssClass='rowItem' Runat='Server' />
  218. </ItemTemplate>
  219. </asp:TemplateColumn>
  220. </Columns>
  221. </asp:DataGrid>
  222. </asp:Panel>
  223. <asp:Panel id='EntityStatsBusyPanel' runat='server' Visible='false' >
  224. <uddi:BusyWait TabID='0' Runat='server' />
  225. </asp:Panel>
  226. </uddi:TabPage>
  227. <uddi:TabPage Name='TAB_STATISTICS_PUBLISHERSTATS' Runat='server'>
  228. <uddi:ContextualHelpControl
  229. Runat='Server'
  230. Text='[[HELP_BLOCK_ADMIN_STATISTICS_PUBLISHERS]]'
  231. HelpFile='coordinate.context.statisticspublisher'
  232. CssClass='tabHelpBlock'
  233. />
  234. <br>
  235. <asp:Panel id='PublisherStatsAvailablePanel' runat='server' Visible='true' >
  236. <asp:DataGrid
  237. CellPadding='4'
  238. CellSpacing='0'
  239. ID='pubStatsList'
  240. GridLines='None'
  241. AutoGenerateColumns='false'
  242. HeaderStyle-CssClass='tableHeader'
  243. ItemStyle-CssClass='tableItem'
  244. Runat='server'>
  245. <Columns>
  246. <asp:BoundColumn DataField='section' Visible='false' />
  247. <asp:TemplateColumn HeaderStyle-Width='400' HeaderText='label' HeaderStyle-CssClass='tableHeader' ItemStyle-CssClass='tableItem' FooterStyle-CssClass='tableItem'>
  248. <ItemTemplate>
  249. <asp:Label Text='<%# Localization.GetString( HttpUtility.HtmlEncode( (string)((DataRowView)Container.DataItem)[ "label" ] ) ) %>' CssClass='rowItem' Runat='Server' />
  250. </ItemTemplate>
  251. </asp:TemplateColumn>
  252. <asp:TemplateColumn HeaderStyle-Width='75' HeaderText='value' HeaderStyle-CssClass='tableHeader' ItemStyle-CssClass='tableItem' FooterStyle-CssClass='tableItem'>
  253. <ItemTemplate>
  254. <asp:Label Text='<%# HttpUtility.HtmlEncode( (string)((DataRowView)Container.DataItem)[ "value" ] ) %>' CssClass='rowItem' Runat='Server' />
  255. </ItemTemplate>
  256. </asp:TemplateColumn>
  257. </Columns>
  258. </asp:DataGrid>
  259. <br>
  260. <br>
  261. <uddi:UddiLabel Text='[[TEXT_STATISTICS_TOPPUBS]]' Runat='Server' /><br>
  262. <br>
  263. <asp:DataGrid
  264. CellPadding='4'
  265. CellSpacing='0'
  266. ID='topPubsList'
  267. GridLines='None'
  268. AutoGenerateColumns='false'
  269. HeaderStyle-CssClass='tableHeader'
  270. ItemStyle-CssClass='tableItem'
  271. Runat='server'>
  272. <Columns>
  273. <asp:TemplateColumn HeaderStyle-Width='400' HeaderText='label' HeaderStyle-CssClass='tableHeader' ItemStyle-CssClass='tableItem' FooterStyle-CssClass='tableItem'>
  274. <ItemTemplate>
  275. <asp:Label Text='<%# Localization.GetString( HttpUtility.HtmlEncode( (string)((DataRowView)Container.DataItem)[ "section" ] ) ) %>' CssClass='rowItem' Runat='Server' />
  276. </ItemTemplate>
  277. </asp:TemplateColumn>
  278. <asp:TemplateColumn HeaderStyle-Width='400' HeaderText='label' HeaderStyle-CssClass='tableHeader' ItemStyle-CssClass='tableItem' FooterStyle-CssClass='tableItem'>
  279. <ItemTemplate>
  280. <asp:Label Text='<%# HttpUtility.HtmlEncode( (string)((DataRowView)Container.DataItem)[ "label" ] ) %>' CssClass='rowItem' Runat='Server' />
  281. </ItemTemplate>
  282. </asp:TemplateColumn>
  283. <asp:TemplateColumn HeaderStyle-Width='75' HeaderText='value' HeaderStyle-CssClass='tableHeader' ItemStyle-CssClass='tableItem' FooterStyle-CssClass='tableItem'>
  284. <ItemTemplate>
  285. <asp:Label Text='<%# HttpUtility.HtmlEncode( (string)((DataRowView)Container.DataItem)[ "value" ] ) %>' CssClass='rowItem' Runat='Server' />
  286. </ItemTemplate>
  287. </asp:TemplateColumn>
  288. </Columns>
  289. </asp:DataGrid>
  290. </asp:Panel>
  291. <asp:Panel id='PublisherStatsBusyPanel' runat='server' Visible='false' >
  292. <uddi:BusyWait TabID='1' Runat='server' />
  293. </asp:Panel>
  294. </uddi:TabPage>
  295. <uddi:TabPage Name='TAB_STATISTICS_TAXSTATS' Runat='server'>
  296. <uddi:ContextualHelpControl
  297. Runat='Server'
  298. Text='[[HELP_BLOCK_ADMIN_STATISTICS_CATEGORIES]]'
  299. HelpFile='coordinate.context.statisticscategorization'
  300. CssClass='tabHelpBlock'
  301. />
  302. <br>
  303. <asp:Panel id='TaxonomyStatsAvailablePanel' runat='server' Visible='true' >
  304. <asp:DataGrid
  305. CellPadding='4'
  306. CellSpacing='0'
  307. ID='taxStatsList'
  308. GridLines='None'
  309. AutoGenerateColumns='false'
  310. HeaderStyle-CssClass='tableHeader'
  311. ItemStyle-CssClass='tableItem'
  312. Runat='server'>
  313. <Columns>
  314. <asp:TemplateColumn HeaderStyle-Width='400' HeaderText='label' HeaderStyle-CssClass='tableHeader' ItemStyle-CssClass='tableItem' FooterStyle-CssClass='tableItem'>
  315. <ItemTemplate>
  316. <asp:Label Text='<%# HttpUtility.HtmlEncode( (string)((DataRowView)Container.DataItem)[ "section" ] ) %>' CssClass='rowItem' Runat='Server' />
  317. </ItemTemplate>
  318. </asp:TemplateColumn>
  319. <asp:TemplateColumn HeaderStyle-Width='400' HeaderText='label' HeaderStyle-CssClass='tableHeader' ItemStyle-CssClass='tableItem' FooterStyle-CssClass='tableItem'>
  320. <ItemTemplate>
  321. <asp:Label Text='<%# Localization.GetString( HttpUtility.HtmlEncode( (string)((DataRowView)Container.DataItem)[ "label" ] ) ) %>' CssClass='rowItem' Runat='Server' />
  322. </ItemTemplate>
  323. </asp:TemplateColumn>
  324. <asp:TemplateColumn HeaderStyle-Width='75' HeaderText='value' HeaderStyle-CssClass='tableHeader' ItemStyle-CssClass='tableItem' FooterStyle-CssClass='tableItem'>
  325. <ItemTemplate>
  326. <asp:Label Text='<%# HttpUtility.HtmlEncode( (string)((DataRowView)Container.DataItem)[ "value" ] ) %>' CssClass='rowItem' Runat='Server' />
  327. </ItemTemplate>
  328. </asp:TemplateColumn>
  329. </Columns>
  330. </asp:DataGrid>
  331. </asp:Panel>
  332. <asp:Panel id='TaxonomyStatsBusyPanel' runat='server' Visible='false' >
  333. <uddi:BusyWait TabID='2' Runat='server' />
  334. </asp:Panel>
  335. </uddi:TabPage>
  336. </uddi:TabControl>
  337. </td>
  338. </tr>
  339. <tr>
  340. <td valign='top'>
  341. <uddi:UddiLabel CssClass='HelpBlock' Text='[[HEADING_STATISTICS_TIMESTAMP]]' Runat='Server' />
  342. <uddi:UddiLabel CssClass='HelpBlock' id='LastChange' Runat='server'/>
  343. </td>
  344. <td align='right' valign='top'>
  345. <uddi:UddiButton
  346. id='RecalcButton'
  347. Text='[[BUTTON_RECALCULATE]]'
  348. OnCommand='Recalculate_OnCommand'
  349. CommandName='refresh'
  350. Width='125px'
  351. CssClass='button'
  352. Runat='server'
  353. enabled='false'/>
  354. </td>
  355. </tr>
  356. </table>
  357. </td>
  358. </tr>
  359. <asp:PlaceHolder
  360. Id='FooterBag'
  361. Runat='server'
  362. >
  363. <tr height='95'>
  364. <td>
  365. <!-- Footer Control Here -->
  366. <uddi:Footer
  367. Runat='server'
  368. />
  369. </td>
  370. </tr>
  371. </asp:PlaceHolder>
  372. </table>
  373. </form>