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.

568 lines
17 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='CategoryBag' Src='../controls/categorybag.ascx' %>
  12. <%@ Register Tagprefix='uddi' Tagname='IdentifierBag' Src='../controls/identifierbag.ascx' %>
  13. <%@ Import Namespace='UDDI' %>
  14. <%@ Import Namespace='UDDI.API' %>
  15. <%@ Import Namespace='UDDI.API.ServiceType' %>
  16. <%@ Import Namespace='System.Data' %>
  17. <script language='C#' runat='server'>
  18. protected TModel tModel = new TModel();
  19. protected bool frames = false;
  20. protected string key;
  21. protected string mode;
  22. protected void Page_Init( object sender, EventArgs e )
  23. {
  24. frames = ( "true" == Request[ "frames" ] );
  25. key = Request[ "key" ];
  26. mode = Request[ "mode" ];
  27. if( null == key && "add" != mode )
  28. {
  29. #if never
  30. throw new UDDIException(
  31. ErrorType.E_fatalError,
  32. "Missing required parameter 'key'." );
  33. #endif
  34. throw new UDDIException( ErrorType.E_fatalError, "UDDI_ERROR_MISSING_REQUIRED_KEY_PARAMETER" );
  35. }
  36. switch( mode )
  37. {
  38. case "add":
  39. tModel.Name = Localization.GetString( "DEFAULT_TMODEL_NAME" );
  40. tModel.Save();
  41. if( frames )
  42. {
  43. //
  44. // Reload explorer and view panes.
  45. //
  46. Response.Write(
  47. ClientScripts.ReloadExplorerAndViewPanes(
  48. "editmodel.aspx?key=" + tModel.TModelKey + ( frames ? "&frames=true" : "" ),
  49. tModel.TModelKey ) );
  50. Response.End();
  51. }
  52. else
  53. {
  54. Response.Redirect( "editmodel.aspx?key=" + tModel.TModelKey + ( frames ? "&frames=true" : "" ) );
  55. Response.End();
  56. }
  57. break;
  58. case "delete":
  59. if( null == Request[ "confirm" ] )
  60. {
  61. //
  62. // The user has not yet confirmed the delete operation, so display
  63. // a confirmation dialog.
  64. //
  65. tModel.TModelKey = key;
  66. tModel.Get();
  67. string message = String.Format( Localization.GetString( "TEXT_DELETE_CONFIRMATION" ), tModel.Name );
  68. Page.RegisterStartupScript(
  69. "Confirm",
  70. ClientScripts.Confirm(
  71. message,
  72. "editmodel.aspx?key=" + key + ( frames ? "&frames=true" : "" ) + "&mode=delete&confirm=true",
  73. "editmodel.aspx?key=" + key + ( frames ? "&frames=true" : "" ) ) );
  74. break;
  75. }
  76. //
  77. // The user has confirmed the delete, so go ahead and delete
  78. // the entity. Then reload the tree view.
  79. //
  80. tModel.TModelKey = key;
  81. tModel.Delete();
  82. if( frames )
  83. {
  84. Response.Write(
  85. ClientScripts.ReloadExplorerAndViewPanes(
  86. "edit.aspx?frames=true&tab=2",
  87. "_tModelList" ) );
  88. Response.End();
  89. }
  90. else
  91. {
  92. Response.Redirect( "edit.aspx?frames=false&tab=2" );
  93. Response.End();
  94. }
  95. break;
  96. default:
  97. tModel.TModelKey = key;
  98. tModel.Get();
  99. break;
  100. }
  101. }
  102. protected void Page_Load( object sender, EventArgs e )
  103. {
  104. descriptions.Initialize( tModel.Descriptions, tModel );
  105. overviewDocDescriptions.Initialize( tModel.OverviewDoc.Descriptions, tModel );
  106. identifierBag.Initialize( tModel.IdentifierBag, tModel );
  107. categoryBag.Initialize( tModel.CategoryBag, tModel );
  108. authorizedName.Text = tModel.AuthorizedName;
  109. if( UDDI.Context.User.IsCoordinator )
  110. {
  111. changeOwner.Text = Localization.GetString( "BUTTON_CHANGE_OWNER" );
  112. changeOwner.Visible = true;
  113. }
  114. tModelKey.Text = tModel.TModelKey;
  115. }
  116. protected void ChangeOwner_OnClick( object sender, EventArgs e )
  117. {
  118. Response.Redirect( "../admin/changeowner.aspx?frames=" + ( frames ? "true" : "false" ) + "&type=tmodel&key=" + key );
  119. }
  120. protected void Details_OnEdit( object sender, CommandEventArgs e )
  121. {
  122. tModelDetail.SetEditMode();
  123. SetEditMode();
  124. TextBox textBox = (TextBox)tModelDetail.ActiveControl.FindControl( "editName" );
  125. textBox.Text = tModel.Name;
  126. RequiredFieldValidator requiredName = (RequiredFieldValidator)tModelDetail.ActiveControl.FindControl( "requiredName" );
  127. requiredName.ErrorMessage = Localization.GetString( "ERROR_FIELD_REQUIRED" );
  128. }
  129. protected void Details_OnUpdate( object sender, EventArgs e )
  130. {
  131. Details_OnUpdate( sender, null );
  132. }
  133. protected void Details_OnUpdate( object sender, CommandEventArgs e )
  134. {
  135. Page.Validate();
  136. if( Page.IsValid )
  137. {
  138. TextBox textBox = (TextBox)tModelDetail.ActiveControl.FindControl( "editName" );
  139. tModel.Name = textBox.Text;
  140. tModel.Save();
  141. tModelDetail.CancelEditMode();
  142. CancelEditMode();
  143. UddiLabel label = (UddiLabel)tModelDetail.ActiveControl.FindControl( "displayName" );
  144. label.Text = tModel.Name;
  145. Page.RegisterStartupScript(
  146. "Reload",
  147. ClientScripts.ReloadExplorerPane(
  148. tModel.TModelKey ) );
  149. }
  150. }
  151. protected void Details_OnCancel( object sender, CommandEventArgs e )
  152. {
  153. CancelEditMode();
  154. tModelDetail.CancelEditMode();
  155. }
  156. protected void OverviewUrl_OnEdit( object sender, CommandEventArgs e )
  157. {
  158. overviewUrlDetail.SetEditMode();
  159. SetEditMode();
  160. TextBox textBox = (TextBox)overviewUrlDetail.ActiveControl.FindControl( "editOverviewUrl" );
  161. textBox.Text = tModel.OverviewDoc.OverviewURL;
  162. }
  163. protected void OverviewUrl_OnUpdate( object sender, EventArgs e )
  164. {
  165. OverviewUrl_OnUpdate( sender, null );
  166. }
  167. protected void OverviewUrl_OnUpdate( object sender, CommandEventArgs e )
  168. {
  169. Page.Validate();
  170. if( Page.IsValid )
  171. {
  172. TextBox textBox = (TextBox)overviewUrlDetail.ActiveControl.FindControl( "editOverviewUrl" );
  173. tModel.OverviewDoc.OverviewURL = textBox.Text;
  174. tModel.Save();
  175. overviewUrlDetail.CancelEditMode();
  176. CancelEditMode();
  177. HyperLink link = (HyperLink)overviewUrlDetail.ActiveControl.FindControl( "displayOverviewUrl" );
  178. string url = tModel.OverviewDoc.OverviewURL;
  179. link.NavigateUrl = "";
  180. if( Utility.StringEmpty( url ) )
  181. link.Text = Localization.GetString( "HEADING_NONE" );
  182. else
  183. {
  184. link.Text = url;
  185. link.NavigateUrl = url;
  186. }
  187. }
  188. }
  189. protected void OverviewUrl_OnCancel( object sender, CommandEventArgs e )
  190. {
  191. overviewUrlDetail.CancelEditMode();
  192. CancelEditMode();
  193. }
  194. protected void Page_PreRender( object sender, EventArgs e )
  195. {
  196. breadcrumb.Initialize( BreadCrumbType.Edit, EntityType.TModel, key );
  197. changeOwner.Enabled = !EditMode;
  198. }
  199. </script>
  200. <uddi:StyleSheetControl
  201. Runat='server'
  202. Default='../stylesheets/uddi.css'
  203. Downlevel='../stylesheets/uddidl.css'
  204. />
  205. <uddi:PageStyleControl
  206. Runat='server'
  207. OnClientContextMenu='Document_OnContextMenu()'
  208. Title="TITLE"
  209. AltTitle="TITLE_ALT"
  210. />
  211. <uddi:ClientScriptRegister
  212. Runat='server'
  213. Source='../client.js'
  214. Language='javascript'
  215. />
  216. <uddi:SecurityControl
  217. PublisherRequired='true'
  218. Runat='server'
  219. />
  220. <form runat='server'>
  221. <table width='100%' border='0' height='100%' cellpadding='0' cellspacing='0'>
  222. <asp:PlaceHolder
  223. Id='HeaderBag'
  224. Runat='server'
  225. >
  226. <tr height='95'>
  227. <td>
  228. <!-- Header Control Here -->
  229. <uddi:Header
  230. Runat='server'
  231. />
  232. </td>
  233. </tr>
  234. </asp:PlaceHolder>
  235. <tr height='100%' valign='top'>
  236. <td>
  237. <uddi:BreadCrumb
  238. Id='breadcrumb'
  239. Runat='server'
  240. />
  241. <table cellpadding='10' cellspacing='0' border='0' width='100%'>
  242. <tr>
  243. <td>
  244. <uddi:UddiLabel Text='[[HELP_BLOCK_PUBLISH_TMODEL]]' CssClass='helpBlock' Runat='server' /><br>
  245. <br>
  246. <uddi:TabControl ID='tabs' Runat='server'>
  247. <uddi:TabPage Name='TAB_DETAILS' Runat='server'>
  248. <uddi:ContextualHelpControl
  249. Runat='Server'
  250. Text='[[HELP_BLOCK_PUBLISH_TMODEL_DETAILS]]'
  251. HelpFile='publish.context.publishtmodeldetails'
  252. CssClass='tabHelpBlock'
  253. BorderWidth='0'
  254. />
  255. <br>
  256. <uddi:UddiLabel Text='[[TAG_OWNER]]' CssClass='header' Runat='server' /><br>
  257. <asp:Label id='authorizedName' Runat='server' />
  258. <asp:Button
  259. ID='changeOwner'
  260. Visible='false'
  261. OnClick='ChangeOwner_OnClick'
  262. Runat='server' /><br>
  263. <br>
  264. <uddi:UddiLabel Text='[[TAG_TMODEL_KEY]]' CssClass='header' Runat='server' /><br>
  265. <asp:Label id='tModelKey' Runat='server' /><br>
  266. <br>
  267. <uddi:EditControl
  268. ID='tModelDetail'
  269. OnEditCommand='Details_OnEdit'
  270. OnUpdateCommand='Details_OnUpdate'
  271. OnCancelCommand='Details_OnCancel'
  272. Runat='server'>
  273. <EditItemTemplate>
  274. <table width='100%' cellpadding='4' cellspacing='0' border='0'>
  275. <colgroup>
  276. <col width='0*'>
  277. <col width='154'>
  278. </colgroup>
  279. <tr>
  280. <td class='tableHeader'>
  281. <uddi:StringResource
  282. Name='HEADING_NAME'
  283. Runat='Server' /></td>
  284. <td class='tableHeader'>
  285. <uddi:StringResource
  286. Name='HEADING_ACTIONS'
  287. Runat='Server' /></td>
  288. </tr>
  289. <tr valign='top'>
  290. <td class='tableEditItem'>
  291. <uddi:UddiTextBox
  292. ID='editName'
  293. Width='200px'
  294. Columns='40'
  295. Selected='true'
  296. OnEnterKeyPressed='Details_OnUpdate'
  297. MaxLength='255'
  298. Runat='server' /><br>
  299. <asp:RequiredFieldValidator
  300. id='requiredName'
  301. ControlToValidate='editName'
  302. Display='Dynamic'
  303. Runat='server'/></td>
  304. <td class='tableEditItem'>
  305. <uddi:UddiButton
  306. Text='[[BUTTON_UPDATE]]'
  307. CommandName='update'
  308. Width='70px'
  309. CssClass='button'
  310. Runat='server' />
  311. &nbsp;
  312. <uddi:UddiButton
  313. Text='<%# Localization.GetString( "BUTTON_CANCEL" )%>'
  314. CommandName='cancel'
  315. Width='70px'
  316. CssClass='button'
  317. CausesValidation='false'
  318. Runat='server' /></td>
  319. </tr>
  320. </table>
  321. </EditItemTemplate>
  322. <ItemTemplate>
  323. <table width='100%' cellpadding='4' cellspacing='0' border='0'>
  324. <colgroup>
  325. <col width='0*'>
  326. <col width='154'>
  327. </colgroup>
  328. <tr>
  329. <td class='tableHeader'>
  330. <uddi:StringResource
  331. Name='HEADING_NAME'
  332. Runat='Server' /></td>
  333. <td class='tableHeader'>
  334. <uddi:StringResource
  335. Name='HEADING_ACTIONS'
  336. Runat='Server' /></td>
  337. </tr>
  338. <tr valign='top'>
  339. <td class='tableItem'>
  340. <uddi:UddiLabel
  341. ID='displayName'
  342. Text='<%# tModel.Name %>'
  343. Runat='server' /></td>
  344. <td class='tableItem'>
  345. <uddi:UddiButton
  346. Text='[[BUTTON_EDIT]]'
  347. EditModeDisable='true'
  348. CommandName='edit'
  349. Width='70px'
  350. CssClass='button'
  351. Runat='server' /></td>
  352. </tr>
  353. </table>
  354. </ItemTemplate>
  355. </uddi:EditControl><br>
  356. <br>
  357. <uddi:Descriptions
  358. ID='descriptions'
  359. Runat='server' />
  360. </uddi:TabPage>
  361. <uddi:TabPage Name='TAB_IDENTIFIERS' Runat='server'>
  362. <uddi:ContextualHelpControl
  363. Runat='Server'
  364. Text='[[HELP_BLOCK_PUBLISH_TMODEL_IDENTIFIERS]]'
  365. HelpFile='publish.context.publishtmodelidentifiers'
  366. CssClass='tabHelpBlock'
  367. BorderWidth='0'
  368. />
  369. <br>
  370. <uddi:IdentifierBag ID='identifierBag' Runat='Server' />
  371. </uddi:TabPage>
  372. <uddi:TabPage Name='TAB_CATEGORIES' Runat='server'>
  373. <uddi:ContextualHelpControl
  374. Runat='Server'
  375. Text='[[HELP_BLOCK_PUBLISH_TMODEL_CATEGORIES]]'
  376. HelpFile='publish.context.publishtmodelcategories'
  377. CssClass='tabHelpBlock'
  378. BorderWidth='0'
  379. />
  380. <br>
  381. <uddi:CategoryBag ID='categoryBag' Runat='server' />
  382. </uddi:TabPage>
  383. <uddi:TabPage Name='TAB_OVERVIEWDOC' Runat='server'>
  384. <uddi:ContextualHelpControl
  385. Runat='Server'
  386. Text='[[HELP_BLOCK_PUBLISH_TMODEL_OVERVIEWDOCS]]'
  387. HelpFile='publish.context.publishtmodeloverviewdocument'
  388. CssClass='tabHelpBlock'
  389. BorderWidth='0'
  390. />
  391. <br>
  392. <uddi:EditControl
  393. id="overviewUrlDetail"
  394. OnEditCommand='OverviewUrl_OnEdit'
  395. OnUpdateCommand='OverviewUrl_OnUpdate'
  396. OnCancelCommand='OverviewUrl_OnCancel'
  397. Runat='server' >
  398. <EditItemTemplate>
  399. <table width='100%' cellpadding='4' cellspacing='0' border='0'>
  400. <colgroup>
  401. <col width='0*'>
  402. <col width='154'>
  403. </colgroup>
  404. <tr>
  405. <td class='tableHeader'>
  406. <uddi:StringResource Name='HEADING_OVERVIEW_URL' Runat='Server' /></td>
  407. <td class='tableHeader'>
  408. <uddi:StringResource Name='HEADING_ACTIONS' Runat='Server' /></td>
  409. </tr>
  410. <tr valign='top'>
  411. <td class='tableEditItem'>
  412. <uddi:UddiTextBox
  413. id='editOverviewUrl'
  414. Columns='40'
  415. Width='200px'
  416. Selected='true'
  417. OnEnterKeyPressed='OverviewUrl_OnUpdate'
  418. CssClass='textBox'
  419. MaxLength='255'
  420. Runat='server'/></td>
  421. <td class='tableEditItem'>
  422. <uddi:UddiButton
  423. Text='[[BUTTON_UPDATE]]'
  424. CommandName='update'
  425. Width='70px'
  426. CssClass='button'
  427. Runat='server' />&nbsp;
  428. <uddi:UddiButton
  429. Text='[[BUTTON_CANCEL]]'
  430. CommandName='cancel'
  431. Width='70px'
  432. CssClass='button'
  433. CausesValidation='false'
  434. Runat='server' /></td>
  435. </tr>
  436. </table>
  437. </EditItemTemplate>
  438. <ItemTemplate>
  439. <table width='100%' cellpadding='4' cellspacing='0' border='0'>
  440. <colgroup>
  441. <col width='0*'>
  442. <col width='154'>
  443. </colgroup>
  444. <tr>
  445. <td class='tableHeader'>
  446. <uddi:StringResource
  447. Name='HEADING_OVERVIEW_URL'
  448. Runat='Server' /></td>
  449. <td class='tableHeader'>
  450. <uddi:StringResource
  451. Name='HEADING_ACTIONS'
  452. Runat='Server' /></td>
  453. </tr>
  454. <tr valign='top'>
  455. <td class='tableItem'>
  456. <asp:HyperLink
  457. ID='displayOverviewUrl'
  458. Text='<%# Utility.StringEmpty( tModel.OverviewDoc.OverviewURL ) ? Localization.GetString( "HEADING_NONE" ) : tModel.OverviewDoc.OverviewURL %>'
  459. NavigateUrl='<%# Utility.StringEmpty( tModel.OverviewDoc.OverviewURL ) ? Localization.GetString( "HEADING_NONE" ) : tModel.OverviewDoc.OverviewURL %>'
  460. Target="_new"
  461. Runat='server'/>
  462. <td class='tableItem'>
  463. <uddi:UddiButton
  464. Text='[[BUTTON_EDIT]]'
  465. CommandName='edit'
  466. Width='70px'
  467. EditModeDisable='true'
  468. CssClass='button'
  469. Runat='server' />
  470. </td>
  471. </tr>
  472. </table>
  473. </ItemTemplate>
  474. </uddi:EditControl>
  475. <br>
  476. <uddi:Descriptions ID='overviewDocDescriptions' Runat='server' />
  477. </uddi:TabPage>
  478. </uddi:TabControl>
  479. </td>
  480. </tr>
  481. </table>
  482. </td>
  483. </tr>
  484. <asp:PlaceHolder
  485. Id='FooterBag'
  486. Runat='server'
  487. >
  488. <tr height='95'>
  489. <td>
  490. <!-- Footer Control Here -->
  491. <uddi:Footer
  492. Runat='server'
  493. />
  494. </td>
  495. </tr>
  496. </asp:PlaceHolder>
  497. </table>
  498. </form>