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.

542 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='CategoryBagChooser' Src='../controls/categorybag.ascx' %>
  11. <%@ Register Tagprefix='uddi' Tagname='CategoryBrowser' Src='../controls/categorybrowser.ascx' %>
  12. <%@ Register Tagprefix='uddi' Tagname='IdentifierBagChooser' Src='../controls/identifierbag.ascx' %>
  13. <%@ Register Tagprefix='uddi' Tagname='TModelBagChooser' Src='../controls/tmodelbag.ascx' %>
  14. <%@ Import Namespace='System.Collections.Specialized' %>
  15. <%@ Import Namespace='System.Data' %>
  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.ServiceType' %>
  21. <%@ Import Namespace='UDDI.Web' %>
  22. <script language='c#' runat='server'>
  23. protected CacheObject cache;
  24. protected string searchID;
  25. protected bool frames = false;
  26. protected FindService findService;
  27. protected FindBusiness findBusiness;
  28. protected FindTModel findTModel;
  29. protected string reloadResults = @"
  30. <script language='javascript'>
  31. var results = window.parent.frames[ ""explorer"" ];
  32. if( null != results )
  33. {
  34. results.location = ""results.aspx?frames=true&search={searchID}"";
  35. }
  36. <" + "/script" + ">";
  37. protected void Page_Init( object sender, EventArgs e )
  38. {
  39. frames = ( 0 == String.Compare( "true", Request[ "frames" ], true ) );
  40. searchID = Request[ "search" ];
  41. if( null == searchID )
  42. Response.Redirect( "default.aspx" );
  43. reloadResults = reloadResults.Replace( "{searchID}", searchID );
  44. breadcrumb.AddBlurb( Localization.GetString( "HEADING_SEARCH_CRITERIA" ), null, null, null, false );
  45. }
  46. protected void Page_Load( object sender, EventArgs e )
  47. {
  48. DataView taxonomies = Taxonomy.GetTaxonomies();
  49. cache = SessionCache.Get( searchID );
  50. if( null == cache )
  51. {
  52. findService = new FindService();
  53. findService.CategoryBag = new KeyedReferenceCollection();
  54. findService.TModelBag = new StringCollection();
  55. findBusiness = new FindBusiness();
  56. findBusiness.CategoryBag = new KeyedReferenceCollection();
  57. findBusiness.IdentifierBag = new KeyedReferenceCollection();
  58. findBusiness.TModelBag = new StringCollection();
  59. findTModel = new FindTModel();
  60. findTModel.CategoryBag = new KeyedReferenceCollection();
  61. findTModel.IdentifierBag = new KeyedReferenceCollection();
  62. cache = new CacheObject();
  63. cache.FindService = findService;
  64. cache.FindBusiness = findBusiness;
  65. cache.FindTModel = findTModel;
  66. SessionCache.Save( searchID, cache );
  67. }
  68. else
  69. {
  70. findService = cache.FindService;
  71. findBusiness = cache.FindBusiness;
  72. findTModel = cache.FindTModel;
  73. }
  74. serviceCategoryBag.Initialize( findService.CategoryBag, cache );
  75. serviceTModelBag.Initialize( findService.TModelBag, cache );
  76. businessCategoryBag.Initialize( findBusiness.CategoryBag, cache );
  77. businessIdentifierBag.Initialize( findBusiness.IdentifierBag, cache );
  78. businessTModelBag.Initialize( findBusiness.TModelBag, cache );
  79. tModelCategoryBag.Initialize( findTModel.CategoryBag, cache );
  80. tModelIdentifierBag.Initialize( findTModel.IdentifierBag, cache );
  81. categoryBrowser.Initialize( null,cache );
  82. }
  83. protected override void OnPreRender( EventArgs e )
  84. {
  85. string key = categoryBrowser.TModelKey ;
  86. string id = categoryBrowser.TaxonomyID ;
  87. string val = categoryBrowser.KeyValue;
  88. bool searchEnabled = ( null!=id && ""!=id &&
  89. null!=val && ""!=val &&
  90. Taxonomy.IsValidForClassification( Convert.ToInt32( id ), val ) );
  91. bool canelable = ( null!=key && ""!=key );
  92. searchtModel.Enabled = searchEnabled;
  93. searchProvider.Enabled = searchEnabled;
  94. searchService.Enabled = searchEnabled;
  95. cancelSearch.Enabled = canelable;
  96. base.OnPreRender( e );
  97. }
  98. public void FindService_OnFind( object sender, EventArgs e )
  99. {
  100. Page.Validate();
  101. if( Page.IsValid )
  102. {
  103. //
  104. // Clear previous find criteria.
  105. //
  106. findService.BusinessKey = string.Empty;
  107. Clear( findService.Names );
  108. if( !Utility.StringEmpty( serviceName.Text ) )
  109. {
  110. findService.Names = new NameCollection();
  111. findService.Names.Add( null,serviceName.Text );
  112. }
  113. cache.FindType = "find_service";
  114. SessionCache.Save( searchID, cache );
  115. if( frames )
  116. Page.RegisterClientScriptBlock( "ReloadResults", reloadResults );
  117. else
  118. Response.Redirect( "results.aspx?search=" + searchID );
  119. }
  120. }
  121. public void FindBusiness_OnFind( object sender, EventArgs e )
  122. {
  123. Page.Validate();
  124. if( Page.IsValid )
  125. {
  126. //
  127. // Clear previous find criteria.
  128. //
  129. Clear( findBusiness.Names );
  130. if( !Utility.StringEmpty( businessName.Text ) )
  131. {
  132. findBusiness.Names = new NameCollection();
  133. findBusiness.Names.Add( null, businessName.Text );
  134. }
  135. cache.FindType = "find_business";
  136. SessionCache.Save( searchID, cache );
  137. if( frames )
  138. Page.RegisterClientScriptBlock( "ReloadResults", reloadResults );
  139. else
  140. Response.Redirect( "results.aspx?search=" + searchID );
  141. }
  142. }
  143. public void FindTModel_OnFind( object sender, EventArgs e )
  144. {
  145. Page.Validate();
  146. if( Page.IsValid )
  147. {
  148. //
  149. // Clear previous find criteria.
  150. //
  151. findTModel.Name = string.Empty;
  152. if( !Utility.StringEmpty( tModelName.Text ) )
  153. findTModel.Name = tModelName.Text;
  154. cache.FindType = "find_tModel";
  155. SessionCache.Save( searchID, cache );
  156. if( frames )
  157. Page.RegisterClientScriptBlock( "ReloadResults", reloadResults );
  158. else
  159. Response.Redirect( "results.aspx?search=" + searchID );
  160. }
  161. }
  162. protected void cancelSearch_Click( object sender, EventArgs e )
  163. {
  164. if( frames )
  165. Response.Write(
  166. ClientScripts.ReloadViewPane( Root + "/search/search.aspx?frames=true&search="+searchID) );
  167. else
  168. Response.Redirect( Page.Request.Url.AbsoluteUri );
  169. }
  170. protected void TabControl_TabChange( object sender, int oldindex, int newindex )
  171. {
  172. switch( newindex )
  173. {
  174. case 0:
  175. categoryBrowser.Reset();
  176. break;
  177. case 1:
  178. findService.CategoryBag.Clear();
  179. serviceCategoryBag.Initialize( findService.CategoryBag, cache, true );
  180. break;
  181. case 2:
  182. findBusiness.CategoryBag.Clear();
  183. businessCategoryBag.Initialize( findBusiness.CategoryBag, cache, true );
  184. break;
  185. case 3:
  186. findTModel.CategoryBag.Clear();
  187. tModelCategoryBag.Initialize( findTModel.CategoryBag, cache,true );
  188. break;
  189. }
  190. SessionCache.Save( searchID, cache );
  191. }
  192. private void Clear( IList list )
  193. {
  194. if( null != list )
  195. {
  196. list.Clear();
  197. }
  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. UserRequired='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:ContentController
  245. Mode = 'Public'
  246. Runat='server'
  247. >
  248. <uddi:UddiLabel Text='[[HELP_BLOCK_SEARCH_ALT]]' CssClass='helpBlock' Runat='server' />
  249. </uddi:ContentController>
  250. <uddi:ContentController
  251. Mode = 'Private'
  252. Runat='server'
  253. >
  254. <uddi:UddiLabel Text='[[HELP_BLOCK_SEARCH]]' CssClass='helpBlock' Runat='server' />
  255. </uddi:ContentController>
  256. <br>
  257. <br>
  258. <uddi:TabControl ID='tabs' Runat='server' OnTabChange='TabControl_TabChange'>
  259. <uddi:TabPage runat='server' name="TAB_FIND_BROWSE" >
  260. <uddi:ContextualHelpControl
  261. Runat='Server'
  262. Text='[[HELP_BLOCK_SEARCH_BROWSE]]'
  263. HelpFile='search.context.searchbrowsecategory'
  264. CssClass='tabHelpBlock'
  265. />
  266. <br>
  267. <asp:Table CellPadding='0' CellSpacing='0' Border='0' Runat='server' width='100%'>
  268. <asp:TableRow CssClass='tableHeader' height='20'>
  269. <asp:TableCell>&nbsp;&nbsp;<uddi:UddiLabel Text='[[HEADING_SEARCH_BROWSECATEGORYTITLE]]' CssClass='tableHeader' Runat='server' />
  270. </asp:TableCell>
  271. <asp:TableCell align='center'><uddi:UddiLabel Text='[[HEADING_SEARCH_BROWSEACTIONTITLE]]' CssClass='tableHeader' Runat='server' />&nbsp;&nbsp;
  272. </asp:TableCell>
  273. </asp:TableRow>
  274. <asp:TableRow>
  275. <asp:TableCell Valign='top'>
  276. <uddi:CategoryBrowser runat='server' ID='categoryBrowser' name="categoryBrowser"/>
  277. </asp:TableCell>
  278. <asp:TableCell align='right' valign='top' width='150px'>
  279. <uddi:UddiButton
  280. ID='searchProvider'
  281. Text='[[BUTTON_FIND_PROVIDERS]]'
  282. Width='146'
  283. CssClass='button'
  284. OnClick='FindBusiness_OnFind'
  285. Enabled='false'
  286. Runat='server' /><br>
  287. <uddi:UddiButton
  288. ID='searchService'
  289. Text='[[BUTTON_FIND_SERVICES]]'
  290. Width='146'
  291. CssClass='button'
  292. OnClick='FindService_OnFind'
  293. Enabled='false'
  294. Runat='server' /><br>
  295. <uddi:UddiButton
  296. ID='searchtModel'
  297. Text='[[BUTTON_FIND_TMODELS]]'
  298. Width='146'
  299. CssClass='button'
  300. CausesValidation='false'
  301. OnClick='FindTModel_OnFind'
  302. Enabled='false'
  303. Runat='Server' /><br>
  304. <uddi:UddiButton
  305. ID='cancelSearch'
  306. Text='[[BUTTON_CANCEL]]'
  307. Width='146px'
  308. CssClass='button'
  309. CausesValidation='false'
  310. OnClick='cancelSearch_Click'
  311. Enabled='false'
  312. Runat='Server' />
  313. </asp:TableCell>
  314. </asp:TableRow>
  315. </asp:Table>
  316. </uddi:TabPage>
  317. <uddi:TabPage Name='TAB_FIND_SERVICE' Runat='server'>
  318. <uddi:ContextualHelpControl
  319. Runat='Server'
  320. Text='[[HELP_BLOCK_SEARCH_SERVICE]]'
  321. HelpFile='search.context.searchservices'
  322. CssClass='tabHelpBlock'
  323. />
  324. <br>
  325. <img src='../images/service.gif' border='0' align='absmiddle'>
  326. <b><uddi:UddiLabel Text='[[TAG_SERVICE_NAME]]' CssClass='lightHeader' Runat='server' /></b><br>
  327. <asp:Table CellPadding='0' CellSpacing='0' Border='0' Width='100%' Runat='server'>
  328. <asp:TableRow>
  329. <asp:TableCell>
  330. <uddi:UddiTextBox
  331. ID='serviceName'
  332. MaxLength='255'
  333. Width='300px'
  334. Columns='40'
  335. CssClass='textBox'
  336. Focus='true'
  337. EditModeDisable='true'
  338. OnEnterKeyPressed='FindService_OnFind'
  339. Runat='server'/>
  340. </asp:TableCell>
  341. <asp:TableCell Width='170px'>
  342. <uddi:UddiButton
  343. Text='[[BUTTON_SEARCH]]'
  344. Width='70px'
  345. OnClick='FindService_OnFind'
  346. CssClass='button'
  347. EditModeDisable='true'
  348. Runat='server' />
  349. </asp:TableCell>
  350. </asp:TableRow>
  351. </asp:Table>
  352. <br>
  353. <uddi:Box Runat='server'>
  354. <uddi:CategoryBagChooser ID='serviceCategoryBag' FindMode='true' Runat='Server' /><br>
  355. <br>
  356. <uddi:TModelBagChooser ID='serviceTModelBag' FindMode='true' Runat='server'/><br>
  357. </uddi:Box>
  358. </uddi:TabPage>
  359. <uddi:TabPage Name='TAB_FIND_BUSINESS' Runat='server'>
  360. <uddi:ContextualHelpControl
  361. Runat='Server'
  362. Text='[[HELP_BLOCK_SEARCH_PROVIDER]]'
  363. HelpFile='search.context.searchproviders'
  364. CssClass='tabHelpBlock'
  365. />
  366. <br>
  367. <img src='../images/business.gif' border='0' align='absmiddle'>
  368. <b><uddi:UddiLabel Text='[[TAG_BUSINESS_NAME]]' CssClass='lightHeader' Runat='server' /></b><br>
  369. <asp:Table CellPadding='0' CellSpacing='0' Border='0' Width='100%' Runat='server'>
  370. <asp:TableRow>
  371. <asp:TableCell>
  372. <uddi:UddiTextBox
  373. ID='businessName'
  374. MaxLength='255'
  375. Width='300px'
  376. Columns='40'
  377. CssClass='textBox'
  378. Focus='true'
  379. EditModeDisable='true'
  380. OnEnterKeyPressed='FindBusiness_OnFind'
  381. Runat='server'/>
  382. </asp:TableCell>
  383. <asp:TableCell Width='170px'>
  384. <uddi:UddiButton
  385. Text='[[BUTTON_SEARCH]]'
  386. Width='70px'
  387. OnClick='FindBusiness_OnFind'
  388. CssClass='button'
  389. EditModeDisable='true'
  390. Runat='server' />
  391. </asp:TableCell>
  392. </asp:TableRow>
  393. </asp:Table>
  394. <br>
  395. <uddi:Box Runat='server'>
  396. <uddi:CategoryBagChooser ID='businessCategoryBag' FindMode='true' Runat='Server' /><br>
  397. <br>
  398. <uddi:IdentifierBagChooser ID='businessIdentifierBag' FindMode='true' Runat='Server' /><br>
  399. <br>
  400. <uddi:TModelBagChooser ID='businessTModelBag' FindMode='true' Runat='server'/>
  401. </uddi:Box>
  402. </uddi:TabPage>
  403. <uddi:TabPage Name='TAB_FIND_TMODEL' Runat='server'>
  404. <uddi:ContextualHelpControl
  405. Runat='Server'
  406. Text='[[HELP_BLOCK_SEARCH_TMODEL]]'
  407. HelpFile='search.context.searchtmodels'
  408. CssClass='tabHelpBlock'
  409. />
  410. <br>
  411. <img src='../images/tmodel.gif' border='0' align='absmiddle'>
  412. <b><uddi:UddiLabel Text='[[TAG_TMODEL_NAME]]' CssClass='lightHeader' Runat='server' /></b><br>
  413. <asp:Table CellPadding='0' CellSpacing='0' Border='0' Width='100%' Runat='server'>
  414. <asp:TableRow>
  415. <asp:TableCell>
  416. <uddi:UddiTextBox
  417. ID='tModelName'
  418. MaxLength='255'
  419. Width='300px'
  420. Columns='40'
  421. CssClass='textBox'
  422. Focus='true'
  423. EditModeDisable='true'
  424. OnEnterKeyPressed='FindTModel_OnFind'
  425. Runat='server'/>
  426. </asp:TableCell>
  427. <asp:TableCell Width='170px'>
  428. <uddi:UddiButton
  429. Text='[[BUTTON_SEARCH]]'
  430. Width='70px'
  431. OnClick='FindTModel_OnFind'
  432. CssClass='button'
  433. EditModeDisable='true'
  434. Runat='server' />
  435. </asp:TableCell>
  436. </asp:TableRow>
  437. </asp:Table>
  438. <br>
  439. <uddi:Box Runat='server'>
  440. <uddi:CategoryBagChooser ID='tModelCategoryBag' FindMode='true' Runat='Server' /><br>
  441. <br>
  442. <uddi:IdentifierBagChooser ID='tModelIdentifierBag' FindMode='true' Runat='Server' /><br>
  443. </uddi:Box>
  444. </uddi:TabPage>
  445. </uddi:TabControl>
  446. </td>
  447. </tr>
  448. </table>
  449. </td>
  450. </tr>
  451. <asp:PlaceHolder
  452. Id='FooterBag'
  453. Runat='server'
  454. >
  455. <tr height='95'>
  456. <td>
  457. <!-- Footer Control Here -->
  458. <uddi:Footer
  459. Runat='server'
  460. />
  461. </td>
  462. </tr>
  463. </asp:PlaceHolder>
  464. </table>
  465. </form>