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.

389 lines
12 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' Namespace='UDDI.Web' Assembly='uddi.web' %>
  7. <%@ Register Tagprefix='uddi' Tagname='Header' Src='../controls/header.ascx' %>
  8. <%@ Register Tagprefix='uddi' Tagname='Footer' Src='../controls/footer.ascx' %>
  9. <%@ Register Tagprefix='uddi' Tagname='BreadCrumb' Src='../controls/breadcrumb.ascx' %>
  10. <%@ Register Tagprefix='uddi' Tagname='Descriptions' Src='../controls/descriptions.ascx' %>
  11. <%@ Register Tagprefix='uddi' Tagname='Names' Src='../controls/names.ascx' %>
  12. <%@ Register Tagprefix='uddi' Tagname='CategoryBag' Src='../controls/categorybag.ascx' %>
  13. <%@ Register Tagprefix='uddi' Tagname='Contacts' Src='../controls/contacts.ascx' %>
  14. <%@ Register Tagprefix='uddi' Tagname='Services' Src='../controls/services.ascx' %>
  15. <%@ Register Tagprefix='uddi' Tagname='IdentifierBag' Src='../controls/identifierbag.ascx' %>
  16. <%@ Register Tagprefix='uddi' Tagname='DiscoveryUrls' Src='../controls/discoveryurls.ascx' %>
  17. <%@ Register Tagprefix='uddi' Tagname='PublisherAssertions' Src='../controls/publisherassertions.ascx' %>
  18. <%@ Import Namespace='UDDI' %>
  19. <%@ Import Namespace='UDDI.API' %>
  20. <%@ Import Namespace='UDDI.API.Business' %>
  21. <%@ Import Namespace='UDDI.API.Service' %>
  22. <%@ Import Namespace='System.Data' %>
  23. <script language='C#' runat='server'>
  24. protected BusinessEntity business = new BusinessEntity();
  25. protected BusinessServiceCollection businessServices = new BusinessServiceCollection();
  26. protected bool frames = false;
  27. protected string key;
  28. protected string mode;
  29. public string tabItems = "";
  30. protected void Page_Init( object sender, EventArgs e )
  31. {
  32. frames = ( "true" == Request[ "frames" ] );
  33. key = Request[ "key" ];
  34. mode = Request[ "mode" ];
  35. if( null == key && "add" != mode )
  36. {
  37. #if never
  38. throw new UDDIException(
  39. ErrorType.E_fatalError,
  40. "Missing required parameter 'key'." );
  41. #endif
  42. throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_MISSING_REQUIRED_KEY_PARAMETER" );
  43. }
  44. switch( mode )
  45. {
  46. case "add":
  47. //
  48. // BUG: 728086
  49. // We need to use the Current UI Culture to decide the default language.
  50. //
  51. //business.Names.Add( UDDI.Context.User.IsoLangCode, Localization.GetString( "DEFAULT_BUSINESS_NAME" ) );
  52. business.Names.Add( UDDI.Localization.GetCultureWithFallback().Name, Localization.GetString( "DEFAULT_BUSINESS_NAME" ) );
  53. business.Save();
  54. if( frames )
  55. {
  56. //
  57. // Reload explorer and view panes.
  58. //
  59. Response.Write(
  60. ClientScripts.ReloadExplorerAndViewPanes(
  61. "editbusiness.aspx?key=" + business.BusinessKey + ( frames ? "&frames=true" : "" ),
  62. business.BusinessKey ) );
  63. Response.End();
  64. }
  65. else
  66. {
  67. Response.Redirect( "editbusiness.aspx?key=" + business.BusinessKey );
  68. Response.End();
  69. }
  70. break;
  71. case "delete":
  72. if( null == Request[ "confirm" ] )
  73. {
  74. //
  75. // The user has not yet confirmed the delete operation, so display
  76. // a confirmation dialog.
  77. //
  78. business.BusinessKey = key;
  79. business.Get();
  80. string message = String.Format( Localization.GetString( "TEXT_DELETE_CONFIRMATION" ), business.Names[ 0 ].Value );
  81. Page.RegisterStartupScript(
  82. "Confirm",
  83. ClientScripts.Confirm(
  84. message,
  85. "editbusiness.aspx?key=" + key + ( frames ? "&frames=true" : "" ) + "&mode=delete&confirm=true",
  86. "editbusiness.aspx?key=" + key + ( frames ? "&frames=true" : "" ) ) );
  87. break;
  88. }
  89. //
  90. // The user has confirmed the delete, so go ahead and delete
  91. // the entity. Then reload the tree view.
  92. //
  93. business.BusinessKey = key;
  94. business.Delete();
  95. if( frames )
  96. {
  97. Response.Write(
  98. ClientScripts.ReloadExplorerAndViewPanes(
  99. "edit.aspx?frames=true&tab=1",
  100. "_businessList" ) );
  101. Response.End();
  102. }
  103. else
  104. {
  105. Response.Redirect( "edit.aspx?frames=false&tab=1" );
  106. Response.End();
  107. }
  108. break;
  109. default:
  110. business.BusinessKey = key;
  111. business.Get();
  112. businessServices.Get( key );
  113. businessServices.Sort();
  114. break;
  115. }
  116. }
  117. protected void Page_Load( object sender, EventArgs e )
  118. {
  119. names.Initialize( business.Names, business, business.BusinessKey );
  120. descriptions.Initialize( business.Descriptions, business );
  121. contacts.Initialize( business.Contacts, business, true );
  122. services.Initialize( businessServices, business );
  123. identifierBag.Initialize( business.IdentifierBag, business );
  124. categoryBag.Initialize( business.CategoryBag, business );
  125. discoveryUrls.Initialize( business.DiscoveryUrls, business );
  126. assertions.Initialize( business.BusinessKey, true );
  127. if( UDDI.Context.User.IsCoordinator )
  128. {
  129. changeOwner.Text = Localization.GetString( "BUTTON_CHANGE_OWNER" );
  130. changeOwner.Visible = true;
  131. }
  132. authorizedName.Text = business.AuthorizedName;
  133. businessKey.Text = business.BusinessKey;
  134. if( !Page.IsPostBack && null != Request[ "tab" ] )
  135. tabs.SelectedIndex = Convert.ToInt32( Request[ "tab" ] );
  136. if( null!=Request[ "refreshExplorer" ] && frames )
  137. {
  138. Response.Write(
  139. ClientScripts.ReloadExplorerPane( business.BusinessKey )
  140. );
  141. }
  142. }
  143. protected void ChangeOwner_OnClick( object sender, EventArgs e )
  144. {
  145. Response.Redirect( "../admin/changeowner.aspx?frames=" + ( frames ? "true" : "false" ) + "&type=business&key=" + key );
  146. }
  147. protected void Page_PreRender( object sender, EventArgs e )
  148. {
  149. assertions.Initialize( business.BusinessKey, true );
  150. breadcrumb.Initialize( BreadCrumbType.Edit, EntityType.BusinessEntity, key );
  151. changeOwner.Enabled = !EditMode;
  152. }
  153. protected void TabControl_TabChange( object sender, int oldIndex, int newIndex )
  154. {
  155. //
  156. // if the publisher assertions tab is selected
  157. // refresh the DataGrids. This makes sure that all data
  158. // that has been saved since the first request to the page
  159. // have been included in the publisherassertions.ascx control.
  160. //
  161. if( 6==newIndex )
  162. {
  163. assertions.RefreshDataGrids();
  164. }
  165. }
  166. </script>
  167. <uddi:StyleSheetControl
  168. Runat='server'
  169. Default='../stylesheets/uddi.css'
  170. Downlevel='../stylesheets/uddidl.css'
  171. />
  172. <uddi:PageStyleControl
  173. Runat='server'
  174. OnClientContextMenu='Document_OnContextMenu()'
  175. Title="TITLE"
  176. AltTitle="TITLE_ALT"
  177. />
  178. <uddi:ClientScriptRegister
  179. Runat='server'
  180. Source='../client.js'
  181. Language='javascript'
  182. />
  183. <uddi:SecurityControl
  184. PublisherRequired='true'
  185. Runat='server'
  186. />
  187. <form runat='server'>
  188. <table width='100%' border='0' height='100%' cellpadding='0' cellspacing='0'>
  189. <asp:PlaceHolder
  190. Id='HeaderBag'
  191. Runat='server'
  192. >
  193. <tr height='95'>
  194. <td>
  195. <!-- Header Control Here -->
  196. <uddi:Header
  197. Runat='server'
  198. />
  199. </td>
  200. </tr>
  201. </asp:PlaceHolder>
  202. <tr height='100%' valign='top'>
  203. <td>
  204. <uddi:BreadCrumb
  205. Id='breadcrumb'
  206. Runat='server'
  207. />
  208. <table cellpadding='10' cellspacing='0' border='0' width='100%'>
  209. <tr>
  210. <td>
  211. <uddi:UddiLabel Text='[[HELP_BLOCK_PUBLISH_PROVIDER]]' CssClass='helpBlock' Runat='server' /><br>
  212. <br>
  213. <uddi:TabControl ID='tabs' Runat='server' OnTabChange='TabControl_TabChange'>
  214. <uddi:TabPage Name='TAB_DETAILS' Runat='server'>
  215. <uddi:ContextualHelpControl
  216. Runat='Server'
  217. Text='[[HELP_BLOCK_PUBLISH_PROVIDER_DETAILS]]'
  218. HelpFile='publish.context.publishproviderdetails'
  219. CssClass='tabHelpBlock'
  220. BorderWidth='0'
  221. />
  222. <br>
  223. <uddi:UddiLabel Text='[[TAG_OWNER]]' CssClass='header' Runat='server' /><br>
  224. <asp:Label id='authorizedName' Runat='server' />
  225. <asp:Button
  226. ID='changeOwner'
  227. Visible='false'
  228. OnClick='ChangeOwner_OnClick'
  229. Runat='server' /><br>
  230. <br>
  231. <uddi:UddiLabel Text='[[TAG_BUSINESS_KEY]]' CssClass='header' Runat='server' /><br>
  232. <asp:Label id='businessKey' Runat='server' /><br>
  233. <br>
  234. <uddi:Names ID='names' Runat='server' /><br>
  235. <br>
  236. <uddi:Descriptions
  237. ID='descriptions'
  238. Runat='server' />
  239. </uddi:TabPage>
  240. <uddi:TabPage Name='TAB_SERVICES' Runat='server'>
  241. <uddi:ContextualHelpControl
  242. Runat='Server'
  243. Text='[[HELP_BLOCK_PUBLISH_PROVIDER_SERVICES]]'
  244. HelpFile='publish.context.providerservices'
  245. CssClass='tabHelpBlock'
  246. BorderWidth='0'
  247. />
  248. <br>
  249. <uddi:Services
  250. Id='services'
  251. Runat='server' />
  252. </uddi:TabPage>
  253. <uddi:TabPage Name='TAB_CONTACTS' Runat='server'>
  254. <uddi:ContextualHelpControl
  255. Runat='Server'
  256. Text='[[HELP_BLOCK_PUBLISH_PROVIDER_CONTACTS]]'
  257. HelpFile='publish.context.providercontacts'
  258. CssClass='tabHelpBlock'
  259. BorderWidth='0'
  260. />
  261. <br>
  262. <uddi:Contacts
  263. Id='contacts'
  264. Runat='server' />
  265. </uddi:TabPage>
  266. <uddi:TabPage Name='TAB_IDENTIFIERS' Runat='server'>
  267. <uddi:ContextualHelpControl
  268. Runat='Server'
  269. Text='[[HELP_BLOCK_PUBLISH_PROVIDER_IDENTIFIERS]]'
  270. HelpFile='publish.context.publishprovideridentifiers'
  271. CssClass='tabHelpBlock'
  272. BorderWidth='0'
  273. />
  274. <br>
  275. <uddi:IdentifierBag
  276. ID='identifierBag'
  277. Runat='Server' />
  278. </uddi:TabPage>
  279. <uddi:TabPage Name='TAB_CATEGORIES' Runat='server'>
  280. <uddi:ContextualHelpControl
  281. Runat='Server'
  282. Text='[[HELP_BLOCK_PUBLISH_PROVIDER_CATEGORIES]]'
  283. HelpFile='publish.context.publishprovidercategories'
  284. CssClass='tabHelpBlock'
  285. BorderWidth='0'
  286. />
  287. <br>
  288. <uddi:CategoryBag
  289. ID='categoryBag'
  290. Runat='server' />
  291. </uddi:TabPage>
  292. <uddi:TabPage Name='TAB_DISCOVERYURLS' Runat='server'>
  293. <uddi:ContextualHelpControl
  294. Runat='Server'
  295. Text='[[HELP_BLOCK_PUBLISH_PROVIDER_OVERVIEWDOCS]]'
  296. HelpFile='publish.context.publishproviderdiscoveryurls'
  297. CssClass='tabHelpBlock'
  298. BorderWidth='0'
  299. />
  300. <br>
  301. <uddi:DiscoveryUrls
  302. ID='discoveryUrls'
  303. Runat='server' />
  304. </uddi:TabPage>
  305. <uddi:TabPage Name='TAB_PUBLISHER_ASSERTIONS' Runat='server'>
  306. <uddi:ContextualHelpControl
  307. Runat='Server'
  308. Text='[[HELP_BLOCK_PUBLISH_PROVIDER_RELATIONSHIPS]]'
  309. HelpFile='publish.context.publishproviderrelationships'
  310. CssClass='tabHelpBlock'
  311. BorderWidth='0'
  312. />
  313. <br>
  314. <uddi:PublisherAssertions
  315. ID='assertions'
  316. Runat='server' />
  317. </uddi:TabPage>
  318. </uddi:TabControl>
  319. </td>
  320. </tr>
  321. </table>
  322. </td>
  323. </tr>
  324. <asp:PlaceHolder
  325. Id='FooterBag'
  326. Runat='server'
  327. >
  328. <tr height='95'>
  329. <td>
  330. <!-- Footer Control Here -->
  331. <uddi:Footer
  332. Runat='server'
  333. />
  334. </td>
  335. </tr>
  336. </asp:PlaceHolder>
  337. </table>
  338. </form>