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.

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