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.

274 lines
10 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' Namespace='UDDI.Web' Assembly='uddi.web' %>
  10. <%@ Import Namespace='System.Data' %>
  11. <%@ Import Namespace='System.Data.SqlClient' %>
  12. <%@ Import Namespace='System.Xml.Serialization' %>
  13. <%@ Import Namespace="System.Web" %>
  14. <%@ Import Namespace="System.Web.UI" %>
  15. <%@ Import Namespace='UDDI' %>
  16. <%@ Import Namespace='UDDI.API' %>
  17. <%@ Import Namespace='UDDI.API.ServiceType' %>
  18. <%@ Import Namespace='UDDI.API.Extensions' %>
  19. <script language='C#' runat='server'>
  20. protected bool frames;
  21. protected void Page_Init( object sender, EventArgs e )
  22. {
  23. frames = ( "true" == Request[ "frames" ] );
  24. breadcrumb.AddBlurb( Localization.GetString( "HEADING_CATEGORIZATION" ), null, null, null, false );
  25. breadcrumb.AddBlurb( Localization.GetString( "HEADING_ADMINISTER" ), "../admin/admin.aspx?refreshExplorer=&frames=" + ( frames ? "true" : "false" ), null, null, true );
  26. taxonomyList.Columns[ 1 ].HeaderText = Localization.GetString( "HEADING_TAXONOMY_NAME" );
  27. taxonomyList.Columns[ 2 ].HeaderText = Localization.GetString( "HEADING_CHECKED" );
  28. taxonomyList.Columns[ 3 ].HeaderText = Localization.GetString( "HEADING_TAXONOMY_ISBROWSABLE" );
  29. taxonomyList.Columns[ 4 ].HeaderText = Localization.GetString( "HEADING_ACTIONS" );
  30. }
  31. protected void Page_Load( object sender, EventArgs e )
  32. {
  33. if( !Page.IsPostBack )
  34. {
  35. switch( Request[ "mode" ] )
  36. {
  37. case "delete":
  38. CategorizationScheme taxonomy = new CategorizationScheme();
  39. taxonomy.TModelKey = Request[ "key" ];
  40. taxonomy.Delete();
  41. break;
  42. case "toggle":
  43. toggleBrowsing( Request[ "key" ] );
  44. break;
  45. default:
  46. break;
  47. }
  48. DataView view = UDDI.Web.Taxonomy.GetTaxonomies();
  49. taxonomyList.DataSource = view;
  50. taxonomyList.DataBind();
  51. }
  52. if( null!=Request[ "refreshExplorer" ] && frames )
  53. {
  54. Response.Write(
  55. ClientScripts.ReloadExplorerPane( "_categorization" )
  56. );
  57. }
  58. }
  59. protected void Taxonomy_OnCommand( object sender, DataGridCommandEventArgs e )
  60. {
  61. //
  62. // The user has not yet confirmed the operation, so display
  63. // a confirmation dialog.
  64. //
  65. string message="";
  66. string mode ="none";
  67. int i = ( (string)e.CommandArgument ).IndexOf( ":" );
  68. string key = "uuid:" + e.Item.Cells[ 0 ].Text;
  69. string name = ((Label)e.Item.Cells[ 1 ].FindControl( "name" )).Text;
  70. //set the messsage to display.
  71. switch( ((string)e.CommandName).ToLower() )
  72. {
  73. case "delete":
  74. message=String.Format( Localization.GetString( "TEXT_DELETE_CONFIRMATION" ).Replace( "\"", "\\\"" ), name );
  75. mode="delete";
  76. Page.RegisterStartupScript(
  77. "Confirm",
  78. ClientScripts.Confirm(
  79. message,
  80. "categorization.aspx?key=" + key + "&frames=" + ( frames ? "true" : "false" ) + "&mode="+mode+"&confirm=true",
  81. "categorization.aspx?frames=" + ( frames ? "true" : "false" ) ) );
  82. break;
  83. case "update":
  84. mode="toggle";
  85. Response.Redirect( "categorization.aspx?key=" + key + "&frames=" + ( frames ? "true" : "false" ) + "&mode="+mode+"&confirm=true" );
  86. break;
  87. }
  88. }
  89. protected string FlagToString( int flag )
  90. {
  91. if( 0!=( flag & 0x0001 ) )
  92. {
  93. return Localization.GetString( "HEADING_YES" );
  94. }
  95. else
  96. {
  97. return Localization.GetString( "HEADING_NO" );
  98. }
  99. }
  100. protected bool IsUddiTypesTaxonomy( object tModelKey )
  101. {
  102. return 0 == String.Compare(
  103. "C1ACF26D-9672-4404-9D70-39B756E62AB4",
  104. tModelKey.ToString(),
  105. true );
  106. }
  107. private void toggleBrowsing( string TModelKey )
  108. {
  109. Taxonomy.SetTaxonomyBrowsable( TModelKey, !Taxonomy.IsValidForBrowsing( TModelKey ) );
  110. }
  111. </script>
  112. <uddi:StyleSheetControl
  113. Runat='server'
  114. Default='../stylesheets/uddi.css'
  115. Downlevel='../stylesheets/uddidl.css'
  116. />
  117. <uddi:PageStyleControl
  118. Runat='server'
  119. OnClientContextMenu='Document_OnContextMenu()'
  120. Title="TITLE"
  121. AltTitle="TITLE_ALT"
  122. />
  123. <uddi:ClientScriptRegister
  124. Runat='server'
  125. Source='../client.js'
  126. Language='javascript'
  127. />
  128. <uddi:SecurityControl
  129. CoordinatorRequired='true'
  130. Runat='server'
  131. />
  132. <form enctype='multipart/form-data' Runat='server'>
  133. <table width='100%' border='0' height='100%' cellpadding='0' cellspacing='0'>
  134. <asp:PlaceHolder
  135. Id='HeaderBag'
  136. Runat='server'
  137. >
  138. <tr height='95'>
  139. <td>
  140. <!-- Header Control Here -->
  141. <uddi:Header
  142. Runat='server'
  143. />
  144. </td>
  145. </tr>
  146. </asp:PlaceHolder>
  147. <tr height='100%' valign='top'>
  148. <td>
  149. <uddi:BreadCrumb
  150. Id='breadcrumb'
  151. Runat='server'
  152. />
  153. <table cellpadding='10' cellspacing='0' border='0' width='100%'>
  154. <tr>
  155. <td>
  156. <uddi:UddiLabel Text='[[HELP_BLOCK_ADMIN]]' CssClass='helpBlock' Runat='server' /><br>
  157. <br>
  158. <uddi:TabControl ID='tabs' Runat='server'>
  159. <uddi:TabPage Name='HEADING_CATEGORIZATION' Runat='server'>
  160. <table cellpadding='0' cellspacing='0' border='0' bordercolor='green' width='100%' class='folder'>
  161. <tr>
  162. <td class='normal'>
  163. <uddi:UddiLabel Text='[[TEXT_TAXONOMY_HOSTED]]' CssClass='tabHelpBlock' Runat='Server' />
  164. </td>
  165. <td align='right' valign='top'>
  166. <uddi:HelpControl HelpFile='coordinate.context.categorizationschemes' Runat='server'/></td>
  167. </tr>
  168. <tr>
  169. <td class='normal' colspan='2'>
  170. <br>
  171. <asp:DataGrid
  172. CellPadding='4'
  173. CellSpacing='0'
  174. ID='taxonomyList'
  175. GridLines='None'
  176. AutoGenerateColumns='false'
  177. HeaderStyle-CssClass='tableHeader'
  178. ItemStyle-CssClass='tableItem'
  179. OnDeleteCommand='Taxonomy_OnCommand'
  180. OnUpdateCommand='Taxonomy_OnCommand'
  181. Runat='server'>
  182. <Columns>
  183. <asp:BoundColumn DataField='tModelKey' Visible='false' />
  184. <asp:TemplateColumn HeaderStyle-Width='400' HeaderText='Taxonomy Name' HeaderStyle-CssClass='tableHeader' ItemStyle-CssClass='tableItem' FooterStyle-CssClass='tableItem'>
  185. <ItemTemplate>
  186. <asp:Label ID='name' Text='<%# HttpUtility.HtmlEncode( (string)((DataRowView)Container.DataItem)[ "description" ] ) %>' CssClass='rowItem' Runat='Server' />
  187. </ItemTemplate>
  188. </asp:TemplateColumn>
  189. <asp:TemplateColumn HeaderStyle-Width='75' HeaderText='Checked' HeaderStyle-CssClass='tableHeader' ItemStyle-CssClass='tableItem' FooterStyle-CssClass='tableItem'>
  190. <ItemTemplate>
  191. <asp:Label Text='<%# FlagToString( (int)((DataRowView)Container.DataItem)[ "flag" ] ) %>' CssClass='rowItem' Runat='Server' />
  192. </ItemTemplate>
  193. </asp:TemplateColumn>
  194. <asp:TemplateColumn HeaderStyle-Width='75' HeaderText='Available for Browsing' HeaderStyle-CssClass='tableHeader' ItemStyle-CssClass='tableItem' FooterStyle-CssClass='tableItem'>
  195. <ItemTemplate>
  196. <uddi:UddiLabel
  197. Text='<%# ( ( Taxonomy.IsValidForBrowsing( "UUID:"+( ( (DataRowView)Container.DataItem )[ "tModelKey" ]).ToString() ) )
  198. ? Localization.GetString( "HEADING_YES" ) : Localization.GetString( "HEADING_NO" ) )%>'
  199. CssClass='button'
  200. Width='60px'
  201. Runat='Server' />
  202. </ItemTemplate>
  203. </asp:TemplateColumn>
  204. <asp:TemplateColumn HeaderStyle-Width='125' HeaderText='Actions' HeaderStyle-CssClass='tableHeader' ItemStyle-CssClass='tableItem' FooterStyle-CssClass='tableItem'>
  205. <ItemTemplate>
  206. <nobr><uddi:UddiButton
  207. CommandName='Update'
  208. CommandArguments='<%# ( ( (DataRowView)Container.DataItem )[ "tModelKey" ] ).ToString() + ":" + ( (string)((DataRowView)Container.DataItem)[ "description" ] )%>'
  209. Text='<%# ( ( Taxonomy.IsValidForBrowsing( "UUID:"+( ( (DataRowView)Container.DataItem )[ "tModelKey" ]).ToString() ) )
  210. ? Localization.GetString( "BUTTON_HIDE" ) : Localization.GetString( "BUTTON_SHOW" ) )%>'
  211. CssClass='button'
  212. Width='60px'
  213. Runat='Server' />
  214. <uddi:UddiButton
  215. CommandName='Delete'
  216. Text='[[BUTTON_DELETE]]'
  217. Enabled='<%# !IsUddiTypesTaxonomy( ((DataRowView)Container.DataItem)[ "tModelKey" ] ) %>'
  218. Width='60px'
  219. CssClass='button'
  220. Runat='server'
  221. CommandArguments='<%# ( ( (DataRowView)Container.DataItem )[ "tModelKey" ].ToString() ) + ":"+ ( (string)((DataRowView)Container.DataItem)[ "description" ] )%>'
  222. /></nobr>
  223. </ItemTemplate>
  224. </asp:TemplateColumn>
  225. </Columns>
  226. </asp:DataGrid>
  227. </td>
  228. </tr>
  229. </table>
  230. </uddi:TabPage>
  231. </uddi:TabControl>
  232. </td>
  233. </tr>
  234. </table>
  235. </td>
  236. </tr>
  237. <asp:PlaceHolder
  238. Id='FooterBag'
  239. Runat='server'
  240. >
  241. <tr height='95'>
  242. <td>
  243. <!-- Footer Control Here -->
  244. <uddi:Footer
  245. Runat='server'
  246. />
  247. </td>
  248. </tr>
  249. </asp:PlaceHolder>
  250. </table>
  251. </form>