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.

281 lines
8.4 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='Descriptions' Src='../controls/descriptions.ascx' %>
  10. <%@ Register Tagprefix='uddi' Tagname='Names' Src='../controls/names.ascx' %>
  11. <%@ Register Tagprefix='uddi' Tagname='CategoryBag' Src='../controls/categorybag.ascx' %>
  12. <%@ Register Tagprefix='uddi' Tagname='IdentifierBag' Src='../controls/identifierbag.ascx' %>
  13. <%@ Register Tagprefix='uddi' Tagname='DiscoveryUrls' Src='../controls/discoveryurls.ascx' %>
  14. <%@ Register Tagprefix='uddi' Tagname='Bindings' Src='../controls/bindings.ascx' %>
  15. <%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %>
  16. <%@ Import Namespace='UDDI' %>
  17. <%@ Import Namespace='UDDI.API' %>
  18. <%@ Import Namespace='UDDI.API.Business' %>
  19. <%@ Import Namespace='UDDI.API.Service' %>
  20. <%@ Import Namespace='UDDI.API.Binding' %>
  21. <%@ Import Namespace='System.Data' %>
  22. <script language='C#' runat='server'>
  23. protected BusinessService service = new BusinessService();
  24. protected BindingTemplateCollection serviceBindings = new BindingTemplateCollection();
  25. protected string projectionKey;
  26. protected bool frames = false;
  27. protected string key;
  28. protected string mode;
  29. protected void Page_Init( object sender, EventArgs e )
  30. {
  31. frames = ( "true" == Request[ "frames" ] );
  32. key = Request[ "key" ];
  33. mode = Request[ "mode" ];
  34. projectionKey = Request[ "projectionKey" ];
  35. if( null == key )
  36. {
  37. throw new UDDIException(
  38. ErrorType.E_fatalError,
  39. Localization.GetString( "ERROR_MISSINGPARAM" )
  40. );
  41. }
  42. switch( mode )
  43. {
  44. case "add":
  45. //
  46. // BUG: 728086
  47. // We need to use the Current UI Culture to decide the default language.
  48. //
  49. //service.Names.Add( UDDI.Context.User.IsoLangCode, Localization.GetString( "DEFAULT_SERVICE_NAME" ) );
  50. service.Names.Add( UDDI.Localization.GetCultureWithFallback().Name, Localization.GetString( "DEFAULT_SERVICE_NAME" ) );
  51. service.BusinessKey = key;
  52. service.Save();
  53. if( frames )
  54. {
  55. //
  56. // Reload explorer and view panes.
  57. //
  58. Response.Write(
  59. ClientScripts.ReloadExplorerAndViewPanes(
  60. "editservice.aspx?key=" + service.ServiceKey + ( frames ? "&frames=true" : "" ),
  61. service.ServiceKey ) );
  62. Response.End();
  63. }
  64. else
  65. {
  66. Response.Redirect( "editservice.aspx?key=" + service.ServiceKey + ( frames ? "&frames=true" : "" ) );
  67. Response.End();
  68. }
  69. break;
  70. case "delete":
  71. service.ServiceKey = key;
  72. service.Get();
  73. if( null == Request[ "confirm" ] )
  74. {
  75. //
  76. // The user has not yet confirmed the delete operation, so display
  77. // a confirmation dialog.
  78. //
  79. string message = String.Format( Localization.GetString( "TEXT_DELETE_CONFIRMATION" ), service.Names[ 0 ].Value );
  80. Page.RegisterStartupScript(
  81. "Confirm",
  82. ClientScripts.Confirm(
  83. message,
  84. "editservice.aspx?key=" + key + ( frames ? "&frames=true" : "" ) + "&mode=delete&confirm=true",
  85. "editservice.aspx?key=" + key + ( frames ? "&frames=true" : "" ) ) );
  86. break;
  87. }
  88. //
  89. // The user has confirmed the delete, so go ahead and delete
  90. // the entity. Then reload the tree view.
  91. //
  92. if( !frames )
  93. {
  94. service.Delete();
  95. Response.Redirect( "editbusiness.aspx?frames=false&key=" + service.BusinessKey + ( null != Request[ "tab" ] ? "&tab=" + Request[ "tab" ] : "" ) );
  96. }
  97. else
  98. {
  99. Response.Write(
  100. ClientScripts.ReloadExplorerAndViewPanes(
  101. "editbusiness.aspx?frames=true&key=" + service.BusinessKey + ( null != Request[ "tab" ] ? "&tab=" + Request[ "tab" ] : "" ),
  102. service.BusinessKey ) );
  103. service.Delete();
  104. }
  105. Response.End();
  106. break;
  107. default:
  108. service.ServiceKey = key;
  109. service.Get();
  110. serviceBindings.Get( key );
  111. break;
  112. }
  113. }
  114. protected void Page_Load( object sender, EventArgs e )
  115. {
  116. names.Initialize( service.Names, service, service.ServiceKey );
  117. descriptions.Initialize( service.Descriptions, service );
  118. bindings.Initialize( serviceBindings, service );
  119. categoryBag.Initialize( service.CategoryBag, service );
  120. serviceKey.Text = service.ServiceKey;
  121. if( !Page.IsPostBack && null != Request[ "tab" ] )
  122. tabs.SelectedIndex = Convert.ToInt32( Request[ "tab" ] );
  123. if( null!=Request[ "refreshExplorer" ] && frames )
  124. {
  125. Response.Write(
  126. ClientScripts.ReloadExplorerPane( service.ServiceKey )
  127. );
  128. }
  129. }
  130. protected void Page_PreRender( object sender, EventArgs e )
  131. {
  132. breadcrumb.Initialize( BreadCrumbType.Edit, EntityType.BusinessService, key );
  133. }
  134. </script>
  135. <uddi:StyleSheetControl
  136. Runat='server'
  137. Default='../stylesheets/uddi.css'
  138. Downlevel='../stylesheets/uddidl.css'
  139. />
  140. <uddi:PageStyleControl
  141. Runat='server'
  142. OnClientContextMenu='Document_OnContextMenu()'
  143. Title="TITLE"
  144. AltTitle="TITLE_ALT"
  145. />
  146. <uddi:ClientScriptRegister
  147. Runat='server'
  148. Source='../client.js'
  149. Language='javascript'
  150. />
  151. <uddi:SecurityControl
  152. PublisherRequired='true'
  153. Runat='server'
  154. />
  155. <form runat='server'>
  156. <table width='100%' border='0' height='100%' cellpadding='0' cellspacing='0'>
  157. <asp:PlaceHolder
  158. Id='HeaderBag'
  159. Runat='server'
  160. >
  161. <tr height='95'>
  162. <td>
  163. <!-- Header Control Here -->
  164. <uddi:Header
  165. Runat='server'
  166. />
  167. </td>
  168. </tr>
  169. </asp:PlaceHolder>
  170. <tr height='100%' valign='top'>
  171. <td>
  172. <uddi:BreadCrumb
  173. Id='breadcrumb'
  174. Runat='server'
  175. />
  176. <table cellpadding='10' cellspacing='0' border='0' width='100%'>
  177. <tr>
  178. <td>
  179. <uddi:UddiLabel Text='[[HELP_BLOCK_PUBLISH_SERVICE]]' CssClass='helpBlock' Runat='server' /><br>
  180. <br>
  181. <uddi:TabControl ID='tabs' Runat='server'>
  182. <uddi:TabPage Name='TAB_DETAILS' Runat='server'>
  183. <uddi:ContextualHelpControl
  184. Runat='Server'
  185. Text='[[HELP_BLOCK_PUBLISH_SERVICE_DETAILS]]'
  186. HelpFile='publish.context.publishservicedetails'
  187. CssClass='tabHelpBlock'
  188. BorderWidth='0'
  189. />
  190. <br>
  191. <uddi:UddiLabel Text='[[TAG_SERVICE_KEY]]' CssClass='header' Runat='server' />
  192. <br>
  193. <asp:Label id='serviceKey' Runat='server' /><br>
  194. <br>
  195. <uddi:Names ID='names' Runat='server' /><br>
  196. <br>
  197. <uddi:Descriptions ID='descriptions' Runat='server' />
  198. </uddi:TabPage>
  199. <uddi:TabPage Name='TAB_BINDINGS' Runat='server'>
  200. <uddi:ContextualHelpControl
  201. Runat='Server'
  202. Text='[[HELP_BLOCK_PUBLISH_SERVICE_BINDINGS]]'
  203. HelpFile='publish.context.serviceeditbinding'
  204. CssClass='tabHelpBlock'
  205. BorderWidth='0'
  206. />
  207. <br>
  208. <uddi:Bindings Id='bindings' Runat='server' />
  209. </uddi:TabPage>
  210. <uddi:TabPage Name='TAB_CATEGORIES' Runat='server'>
  211. <uddi:ContextualHelpControl
  212. Runat='Server'
  213. Text='[[HELP_BLOCK_PUBLISH_SERVICE_CATEGORIES]]'
  214. HelpFile='publish.context.publishservicecategories'
  215. CssClass='tabHelpBlock'
  216. BorderWidth='0'
  217. />
  218. <br>
  219. <uddi:CategoryBag ID='categoryBag' Runat='server' />
  220. </uddi:TabPage>
  221. </uddi:TabControl>
  222. </td>
  223. </tr>
  224. </table>
  225. </td>
  226. </tr>
  227. <asp:PlaceHolder
  228. Id='FooterBag'
  229. Runat='server'
  230. >
  231. <tr height='95'>
  232. <td>
  233. <!-- Footer Control Here -->
  234. <uddi:Footer
  235. Runat='server'
  236. />
  237. </td>
  238. </tr>
  239. </asp:PlaceHolder>
  240. </table>
  241. </form>