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.

555 lines
22 KiB

  1. <!-- ############################################################################ -->
  2. <!-- ## UDDI Services ## -->
  3. <!-- ## Copyright (c) Microsoft Corporation. All rights reserved. ## -->
  4. <!-- ############################################################################ -->
  5. <%@ Page Language='C#' %>
  6. <%@ Register TagPrefix='uddi' Namespace='UDDI.Web' Assembly='uddi.web' %>
  7. <%@ Import Namespace='UDDI.API' %>
  8. <%@ Import Namespace='UDDI.API.Binding' %>
  9. <%@ Import Namespace='UDDI.API.Business' %>
  10. <%@ Import Namespace='UDDI.API.Service' %>
  11. <%@ Import Namespace='UDDI.API.ServiceType' %>
  12. <%@ Import Namespace='UDDI' %>
  13. <%@ Import Namespace='UDDI.Web' %>
  14. <script language='C#' runat='server'>
  15. protected string key;
  16. protected string projectionparentkey;
  17. protected bool IsProjectionSelected = false;
  18. protected void Page_Init( object sender, EventArgs e )
  19. {
  20. //
  21. // Process service projections
  22. //
  23. string tmp = Request[ "key" ];
  24. if( null!=tmp && tmp.StartsWith( "sp:" ) )
  25. {
  26. IsProjectionSelected = true;
  27. string[] arr = tmp.Split( ":".ToCharArray() );
  28. projectionparentkey = arr[ 1 ];
  29. key = arr[ 2 ];
  30. }
  31. else
  32. {
  33. key = tmp;
  34. }
  35. //
  36. //commented: For Service Projections Fix
  37. //key = Request[ "key" ];
  38. //
  39. if( null == key )
  40. key = "_root";
  41. }
  42. protected void Page_Load( object sender, EventArgs e )
  43. {
  44. //
  45. // Build tree folders.
  46. //
  47. TreeNode nodeRoot = null;
  48. if( UDDI.Context.User.IsImpersonated )
  49. {
  50. cancelImpersonate.Visible = true;
  51. nodeRoot = tree.Nodes.Add(
  52. String.Format( Localization.GetString( "HEADING_ENTRIES" ), UDDI.Context.User.ID ),
  53. "_root",
  54. "../images/others_uddi.gif" );
  55. }
  56. else
  57. {
  58. nodeRoot = tree.Nodes.Add(
  59. Localization.GetString( "HEADING_MY_ENTRIES" ),
  60. "_root",
  61. "../images/my_uddi.gif" );
  62. }
  63. nodeRoot.OnClick = "TreeNode_OnSelect( [[node]], 'edit.aspx?frames=true&tab=0' )";
  64. nodeRoot.OnContextMenu = "TreeNode_OnContextMenu( [[node]], 'contextRoot', null )";
  65. nodeRoot.Tooltip = Localization.GetString( "TOOLTIP_MYUDDI" );
  66. TreeNode nodeBusinessList = nodeRoot.Nodes.Add(
  67. Localization.GetString( "HEADING_BUSINESSES" ),
  68. "_businessList",
  69. "../images/businesses.gif",
  70. "../images/businesses_open.gif" );
  71. nodeBusinessList.OnClick = "TreeNode_OnSelect( [[node]], 'edit.aspx?frames=true&tab=1' )";
  72. nodeBusinessList.OnContextMenu = "TreeNode_OnContextMenu( [[node]], 'contextBusinessList', null )";
  73. nodeBusinessList.Tooltip = Localization.GetString( "TOOLTIP_PUBLISH_PROVIDERS" );
  74. TreeNode nodeTModelList = nodeRoot.Nodes.Add(
  75. Localization.GetString( "HEADING_TMODELS" ),
  76. "_tModelList",
  77. "../images/tmodels.gif",
  78. "../images/tmodels_open.gif" );
  79. nodeTModelList.OnClick = "TreeNode_OnSelect( [[node]], 'edit.aspx?frames=true&tab=2' )";
  80. nodeTModelList.OnContextMenu = "TreeNode_OnContextMenu( [[node]], 'contextTModelList', null )";
  81. nodeTModelList.Tooltip = Localization.GetString( "TOOLTIP_PUBLISH_TMODELS" );
  82. nodeRoot.Expand();
  83. nodeBusinessList.Expand();
  84. nodeTModelList.Expand();
  85. if( '_' == key[ 0 ] )
  86. {
  87. switch( key )
  88. {
  89. case "_root":
  90. nodeRoot.Select();
  91. break;
  92. case "_businessList":
  93. nodeBusinessList.Select();
  94. break;
  95. case "_tModelList":
  96. nodeTModelList.Select();
  97. break;
  98. }
  99. }
  100. //
  101. // Build business list.
  102. //
  103. BusinessInfoCollection businessInfos = new BusinessInfoCollection();
  104. businessInfos.GetForCurrentPublisher();
  105. businessInfos.Sort();
  106. foreach( BusinessInfo businessInfo in businessInfos )
  107. {
  108. TreeNode nodeBusiness = nodeBusinessList.Nodes.Add(
  109. businessInfo.Names[ 0 ].Value,
  110. businessInfo.BusinessKey,
  111. "../images/business.gif" );
  112. nodeBusiness.OnClick = "TreeNode_OnSelect( [[node]], 'editbusiness.aspx?frames=true&key=" + businessInfo.BusinessKey + "' )";
  113. nodeBusiness.OnContextMenu = "TreeNode_OnContextMenu( [[node]], 'contextBusiness', 'key=" + businessInfo.BusinessKey + "' )";
  114. nodeBusiness.Tooltip = Localization.GetString( "TOOLTIP_PUBLISH_PROVIDER" );
  115. if( businessInfo.BusinessKey == key )
  116. nodeBusiness.Select();
  117. //
  118. // Build service list for this business.
  119. //
  120. ContactCollection contacts = new ContactCollection();
  121. int contactIndex = 0;
  122. contacts.Get( businessInfo.BusinessKey );
  123. foreach( Contact contact in contacts )
  124. {
  125. TreeNode nodeContact = nodeBusiness.Nodes.Add(
  126. Utility.StringEmpty( contact.PersonName ) ? Localization.GetString( "HEADING_NONE" ) : contact.PersonName,
  127. businessInfo.BusinessKey + ":" + contactIndex,
  128. "../images/contact.gif" );
  129. nodeContact.OnClick = "TreeNode_OnSelect( [[node]], 'editcontact.aspx?frames=true&key=" + businessInfo.BusinessKey + "&index=" + contactIndex + "' )";
  130. nodeContact.OnContextMenu = "TreeNode_OnContextMenu( [[node]], 'contextContact', 'key=" + businessInfo.BusinessKey + "&index=" + contactIndex + "' )";
  131. nodeContact.Tooltip = Localization.GetString( "TOOLTIP_PUBLISH_CONTACT" );
  132. if( businessInfo.BusinessKey + ":" + contactIndex == key )
  133. nodeContact.Select();
  134. contactIndex ++;
  135. }
  136. //
  137. // Build service list for this business.
  138. //
  139. businessInfo.ServiceInfos.Sort();
  140. foreach( ServiceInfo serviceInfo in businessInfo.ServiceInfos )
  141. {
  142. if( serviceInfo.BusinessKey.ToLower() != businessInfo.BusinessKey.ToLower() )
  143. {
  144. //
  145. // Added logic to catch errors on this.
  146. // if the refrenced service doesn't exist,
  147. // then we can't get the name, thus we get
  148. // an error.
  149. //
  150. TreeNode nodeService;
  151. //
  152. // if there are names, then the service projections still exists,
  153. // use the first name in teh collection.
  154. // otherwise leave name as the broken projection string.
  155. //
  156. if( serviceInfo.Names.Count>0 )
  157. {
  158. nodeService = nodeBusiness.Nodes.Add(
  159. serviceInfo.Names[ 0 ].Value,
  160. serviceInfo.ServiceKey,
  161. "../images/service_projection.gif" );
  162. nodeService.OnClick = "TreeNode_OnSelect( [[node]], '../details/servicedetail.aspx?projectionContext=edit&projectionKey="+businessInfo.BusinessKey+"&frames=true&key=" + serviceInfo.ServiceKey + "' )";
  163. nodeService.OnContextMenu = "TreeNode_OnContextMenu( [[node]], 'contextServiceProjection', 'key=" + serviceInfo.ServiceKey + "' )";
  164. nodeService.Tooltip = Localization.GetString( "TOOLTIP_SEARCH_SERVICEPROJECTION" );
  165. }
  166. else
  167. {
  168. nodeService = nodeBusiness.Nodes.Add(
  169. Localization.GetString( "BUTTON_PROJECTIONBROKEN" ),
  170. serviceInfo.ServiceKey,
  171. "../images/x.gif" );
  172. nodeService.OnClick = "javascript:alert('"+Localization.GetString( "TOOLTIP_PROJECTIONBROKEN" )+"');";
  173. nodeService.Tooltip = Localization.GetString( "TOOLTIP_PROJECTIONBROKEN" );
  174. }
  175. if( null!=projectionparentkey && projectionparentkey==serviceInfo.BusinessKey && key==serviceInfo.ServiceKey )
  176. nodeService.Select();
  177. }
  178. else
  179. {
  180. //
  181. // Business service
  182. //
  183. TreeNode nodeService = nodeBusiness.Nodes.Add(
  184. serviceInfo.Names[ 0 ].Value,
  185. serviceInfo.ServiceKey,
  186. "../images/service.gif" );
  187. nodeService.OnClick = "TreeNode_OnSelect( [[node]], 'editservice.aspx?frames=true&key=" + serviceInfo.ServiceKey + "' )";
  188. nodeService.OnContextMenu = "TreeNode_OnContextMenu( [[node]], 'contextService', 'key=" + serviceInfo.ServiceKey + "' )";
  189. nodeService.Tooltip = Localization.GetString( "TOOLTIP_PUBLISH_SERVICE" );
  190. if( serviceInfo.ServiceKey == key && null==projectionparentkey)
  191. nodeService.Select();
  192. //
  193. // Build binding list for this service.
  194. //
  195. BindingTemplateCollection bindingTemplates = new BindingTemplateCollection();
  196. bindingTemplates.Get( serviceInfo.ServiceKey );
  197. foreach( BindingTemplate binding in bindingTemplates )
  198. {
  199. TreeNode nodeBinding = nodeService.Nodes.Add(
  200. ( UDDI.Utility.StringEmpty( binding.AccessPoint.Value ) ? Localization.GetString( "HEADING_BINDING" ) : binding.AccessPoint.Value ),
  201. binding.BindingKey,
  202. "../images/binding.gif" );
  203. nodeBinding.OnClick = "TreeNode_OnSelect( [[node]], 'editbinding.aspx?frames=true&key=" + binding.BindingKey + "' )";
  204. nodeBinding.OnContextMenu = "TreeNode_OnContextMenu( [[node]], 'contextBinding', 'key=" + binding.BindingKey + "' )";
  205. nodeBinding.Tooltip = Localization.GetString( "TOOLTIP_PUBLISH_BINDING" );
  206. if( binding.BindingKey == key )
  207. nodeBinding.Select();
  208. //
  209. // Build instance info list for this service.
  210. //
  211. int instanceIndex = 0;
  212. foreach( TModelInstanceInfo instanceInfo in binding.TModelInstanceInfos )
  213. {
  214. TreeNode nodeInstanceInfo = nodeBinding.Nodes.Add(
  215. ( UDDI.Utility.StringEmpty( instanceInfo.TModelKey ) ? Localization.GetString( "HEADING_INSTANCE_INFO" ) : Lookup.TModelName( instanceInfo.TModelKey ) ),
  216. binding.BindingKey + ":" + instanceIndex,
  217. "../images/instance.gif" );
  218. nodeInstanceInfo.OnClick = "TreeNode_OnSelect( [[node]], 'editinstanceinfo.aspx?frames=true&key=" + binding.BindingKey + "&index=" + instanceIndex + "' )";
  219. nodeInstanceInfo.OnContextMenu = "TreeNode_OnContextMenu( [[node]], 'contextInstanceInfo', 'key=" + binding.BindingKey + "&index=" + instanceIndex + "' )";
  220. nodeInstanceInfo.Tooltip = Localization.GetString( "TOOLTIP_PUBLISH_INSTANCE_INFO" );
  221. if( binding.BindingKey + ":" + instanceIndex == key )
  222. nodeInstanceInfo.Select();
  223. instanceIndex ++;
  224. }
  225. }
  226. }
  227. }
  228. }
  229. //
  230. // Build tModel list.
  231. //
  232. TModelInfoCollection tModelInfos = new TModelInfoCollection();
  233. tModelInfos.GetForCurrentPublisher();
  234. tModelInfos.Sort();
  235. foreach( TModelInfo tModelInfo in tModelInfos )
  236. {
  237. if( !tModelInfo.IsHidden )
  238. {
  239. TreeNode nodeTModel = nodeTModelList.Nodes.Add(
  240. tModelInfo.Name,
  241. tModelInfo.TModelKey,
  242. "../images/tmodel.gif" );
  243. nodeTModel.OnClick = "TreeNode_OnSelect( [[node]], 'editmodel.aspx?frames=true&key=" + tModelInfo.TModelKey + "' )";
  244. nodeTModel.OnContextMenu = "TreeNode_OnContextMenu( [[node]], 'contextTModel', 'key=" + tModelInfo.TModelKey + "' )";
  245. nodeTModel.Tooltip = Localization.GetString( "TOOLTIP_PUBLISH_TMODEL" );
  246. if( tModelInfo.TModelKey == key )
  247. nodeTModel.Select();
  248. }
  249. }
  250. }
  251. </script>
  252. <uddi:SecurityControl PublisherRequired='true' Runat='server' />
  253. <html>
  254. <head>
  255. <link href='../stylesheets/uddi.css' rel='stylesheet' type='text/css'>
  256. </head>
  257. <body
  258. onload='Window_OnLoad()'
  259. onclick='Window_OnClick()'
  260. oncontextmenu='Window_OnContextMenu()'
  261. onkeypress='Window_OnKeyPress()'
  262. class='explorerFrame'
  263. style='padding: 5px'>
  264. <form runat='server'>
  265. <input type='hidden' id='key' name='key' value='<%=key%>'>
  266. <uddi:ContextMenu ID='contextRoot' Runat='Server'>
  267. <uddi:MenuItem Text='BUTTON_IMPERSONATE_USER' ImageUrl='../images/view_others_uddi.gif' RequiredRole='Coordinator' OnClick='ContextMenu_OnImpersonateUser()' Runat='Server' />
  268. <uddi:MenuItem ID='cancelImpersonate' Text='BUTTON_CANCEL_IMPERSONATE' Visible='false' RequiredRole='Coordinator' ImageUrl='../images/view_my_uddi.gif' OnClick='ContextMenu_OnCancelImpersonateUser()' Runat='Server' />
  269. <uddi:MenuSeparator RequiredRole='Coordinator' Runat='Server' />
  270. <uddi:MenuItem Text='BUTTON_REFRESH' ImageUrl='../images/refresh.gif' OnClick='ContextMenu_OnRefresh()' Runat='Server' />
  271. </uddi:ContextMenu>
  272. <uddi:ContextMenu ID='contextBusinessList' Runat='Server'>
  273. <uddi:MenuItem Text='BUTTON_ADD_BUSINESS' ImageUrl='../images/business_new.gif' OnClick='ContextMenu_OnAdd( "editbusiness.aspx?frames=true&mode=add" )' Runat='Server' />
  274. <uddi:MenuSeparator Runat='Server' />
  275. <uddi:MenuItem Text='BUTTON_REFRESH' ImageUrl='../images/refresh.gif' OnClick='ContextMenu_OnRefresh()' Runat='Server' />
  276. </uddi:ContextMenu>
  277. <uddi:ContextMenu ID='contextBusiness' Runat='Server'>
  278. <uddi:MenuItem Text='BUTTON_EDIT_BUSINESS' ImageUrl='../images/business.gif' OnClick='ContextMenu_OnEdit( "editbusiness.aspx?frames=true" )' Bold='true' Runat='Server' />
  279. <uddi:MenuSeparator Runat='Server' />
  280. <uddi:MenuItem Text='BUTTON_ADD_CONTACT' ImageUrl='../images/contact_new.gif' OnClick='ContextMenu_OnAdd( "editcontact.aspx?frames=true&mode=add" )' Runat='Server' />
  281. <uddi:MenuItem Text='BUTTON_ADD_SERVICE' ImageUrl='../images/service_new.gif' OnClick='ContextMenu_OnAdd( "editservice.aspx?frames=true&mode=add" )' Runat='Server' />
  282. <uddi:MenuSeparator Runat='Server' />
  283. <uddi:MenuItem Text='BUTTON_DELETE_BUSINESS' ImageUrl='../images/business_delete.gif' OnClick='ContextMenu_OnDelete( "editbusiness.aspx?frames=true&mode=delete" )' Runat='Server' />
  284. <uddi:MenuSeparator Runat='Server' RequiredRole='Coordinator' />
  285. <uddi:MenuItem Text='BUTTON_CHANGE_OWNER' ImageUrl='../images/changeowner.gif' RequiredRole='Coordinator' OnClick='ContextMenu_OnChangeOwner( "../admin/changeowner.aspx?frames=true&type=business" )' Runat='Server' />
  286. <uddi:MenuSeparator Runat='Server' />
  287. <uddi:MenuItem Text='BUTTON_REFRESH' ImageUrl='../images/refresh.gif' OnClick='ContextMenu_OnRefresh()' Runat='Server' />
  288. </uddi:ContextMenu>
  289. <uddi:ContextMenu ID='contextContact' Runat='Server'>
  290. <uddi:MenuItem Text='BUTTON_EDIT_CONTACT' ImageUrl='../images/contact.gif' OnClick='ContextMenu_OnEdit( "editcontact.aspx?frames=true" )' Bold='true' Runat='Server' />
  291. <uddi:MenuSeparator Runat='Server' />
  292. <uddi:MenuItem Text='BUTTON_DELETE_CONTACT' ImageUrl='../images/contact_delete.gif' OnClick='ContextMenu_OnDelete( "editcontact.aspx?frames=true&mode=delete" )' Runat='Server' />
  293. <uddi:MenuSeparator Runat='Server' />
  294. <uddi:MenuItem Text='BUTTON_REFRESH' ImageUrl='../images/refresh.gif' OnClick='ContextMenu_OnRefresh()' Runat='Server' />
  295. </uddi:ContextMenu>
  296. <uddi:ContextMenu ID='contextService' Runat='Server'>
  297. <uddi:MenuItem Text='BUTTON_EDIT_SERVICE' ImageUrl='../images/service.gif' OnClick='ContextMenu_OnEdit( "editservice.aspx?frames=true" )' Bold='true' Runat='Server' />
  298. <uddi:MenuSeparator Runat='Server' />
  299. <uddi:MenuItem Text='BUTTON_ADD_BINDING' ImageUrl='../images/binding_new.gif' OnClick='ContextMenu_OnAdd( "editbinding.aspx?frames=true&mode=add" )' Runat='Server' />
  300. <uddi:MenuSeparator Runat='Server' />
  301. <uddi:MenuItem Text='BUTTON_DELETE_SERVICE' ImageUrl='../images/service_delete.gif' OnClick='ContextMenu_OnDelete( "editservice.aspx?frames=true&mode=delete" )' Runat='Server' />
  302. <uddi:MenuSeparator Runat='Server' />
  303. <uddi:MenuItem Text='BUTTON_REFRESH' ImageUrl='../images/refresh.gif' OnClick='ContextMenu_OnRefresh()' Runat='Server' />
  304. </uddi:ContextMenu>
  305. <uddi:ContextMenu ID='contextServiceProjection' Runat='Server'>
  306. <uddi:MenuItem Text='BUTTON_VIEW_SERVICE_PROJECTION' ImageUrl='../images/service_projection.gif' OnClick='ContextMenu_OnView( "../details/servicedetail.aspx?frames=true" )' Bold='true' Runat='Server' />
  307. <uddi:MenuSeparator Runat='Server' />
  308. <!-- uddi:MenuItem Text='BUTTON_DELETE_SERVICE_PROJECTION' ImageUrl='../images/x.gif' OnClick='ContextMenu_OnDelete( "editserviceprojection.aspx?frames=true&mode=delete" )' Runas='Server' />
  309. <uddi:MenuSeparator Runas='Server' / -->
  310. <uddi:MenuItem Text='BUTTON_REFRESH' ImageUrl='../images/refresh.gif' OnClick='ContextMenu_OnRefresh()' Runat='Server' />
  311. </uddi:ContextMenu>
  312. <uddi:ContextMenu ID='contextBinding' Runat='Server'>
  313. <uddi:MenuItem Text='BUTTON_EDIT_BINDING' ImageUrl='../images/binding.gif' OnClick='ContextMenu_OnEdit( "editbinding.aspx?frames=true" )' Bold='true' Runat='Server' />
  314. <uddi:MenuSeparator Runat='Server' />
  315. <uddi:MenuItem Text='BUTTON_ADD_INSTANCE_INFO' ImageUrl='../images/instance_new.gif' OnClick='ContextMenu_OnAdd( "editinstanceinfo.aspx?frames=true&mode=add" )' Runat='Server' />
  316. <uddi:MenuSeparator Runat='Server' />
  317. <uddi:MenuItem Text='BUTTON_DELETE_BINDING' ImageUrl='../images/binding_delete.gif' OnClick='ContextMenu_OnDelete( "editbinding.aspx?frames=true&mode=delete" )' Runat='Server' />
  318. <uddi:MenuSeparator Runat='Server' />
  319. <uddi:MenuItem Text='BUTTON_REFRESH' ImageUrl='../images/refresh.gif' OnClick='ContextMenu_OnRefresh()' Runat='Server' />
  320. </uddi:ContextMenu>
  321. <uddi:ContextMenu ID='contextInstanceInfo' Runat='Server'>
  322. <uddi:MenuItem Text='BUTTON_EDIT_INSTANCE_INFO' ImageUrl='../images/instance.gif' OnClick='ContextMenu_OnEdit( "editinstanceinfo.aspx?frames=true" )' Bold='true' Runat='Server' />
  323. <uddi:MenuSeparator Runat='Server' />
  324. <uddi:MenuItem Text='BUTTON_DELETE_INSTANCE_INFO' ImageUrl='../images/instance_delete.gif' OnClick='ContextMenu_OnDelete( "editinstanceinfo.aspx?frames=true&mode=delete" )' Runat='Server' />
  325. <uddi:MenuSeparator Runat='Server' />
  326. <uddi:MenuItem Text='BUTTON_REFRESH' ImageUrl='../images/refresh.gif' OnClick='ContextMenu_OnRefresh()' Runat='Server' />
  327. </uddi:ContextMenu>
  328. <uddi:ContextMenu ID='contextTModelList' Runat='Server'>
  329. <uddi:MenuItem Text='BUTTON_ADD_TMODEL' ImageUrl='../images/tmodel_new.gif' OnClick='ContextMenu_OnAdd( "editmodel.aspx?frames=true&mode=add" )' Runat='Server' />
  330. <uddi:MenuSeparator Runat='Server' />
  331. <uddi:MenuItem Text='BUTTON_REFRESH' ImageUrl='../images/refresh.gif' OnClick='ContextMenu_OnRefresh()' Runat='Server' />
  332. </uddi:ContextMenu>
  333. <uddi:ContextMenu ID='contextTModel' Runat='Server'>
  334. <uddi:MenuItem Text='BUTTON_EDIT_TMODEL' ImageUrl='../images/tmodel.gif' OnClick='ContextMenu_OnEdit( "editmodel.aspx?frames=true" )' Bold='true' Runat='Server' />
  335. <uddi:MenuSeparator Runat='Server' />
  336. <uddi:MenuItem Text='BUTTON_DELETE_TMODEL' ImageUrl='../images/tmodel_delete.gif' OnClick='ContextMenu_OnDelete( "editmodel.aspx?frames=true&mode=delete" )' Runat='Server' />
  337. <uddi:MenuSeparator Runat='Server' RequiredRole='Coordinator' />
  338. <uddi:MenuItem Text='BUTTON_CHANGE_OWNER' ImageUrl='../images/changeowner.gif' RequiredRole='Coordinator' OnClick='ContextMenu_OnChangeOwner( "../admin/changeowner.aspx?frames=true&type=tmodel" )' Runat='Server' />
  339. <uddi:MenuSeparator Runat='Server' />
  340. <uddi:MenuItem Text='BUTTON_REFRESH' ImageUrl='../images/refresh.gif' OnClick='ContextMenu_OnRefresh()' Runat='Server' />
  341. </uddi:ContextMenu>
  342. <uddi:TreeView ID='tree' Runat='Server' />
  343. </form>
  344. <script language='javascript'>
  345. var markedNode = null;
  346. function Window_OnClick()
  347. {
  348. HideAnyPopups();
  349. SelectNode( selectedNode );
  350. }
  351. function Window_OnContextMenu()
  352. {
  353. var e = window.event;
  354. HideAnyPopups();
  355. SelectNode( selectedNode );
  356. e.cancelBubble = true;
  357. e.returnValue = false;
  358. }
  359. function Window_OnKeyPress()
  360. {
  361. var e = window.event;
  362. if( 27 == e.keyCode )
  363. {
  364. HideAnyPopups();
  365. SelectNode( selectedNode );
  366. }
  367. }
  368. function Window_OnLoad()
  369. {
  370. var url = window.location.toString();
  371. if( url.indexOf( "#top" ) < 0 )
  372. window.location = url + "#top";
  373. }
  374. function MarkNode( node )
  375. {
  376. if( null != selectedNode )
  377. selectedNode.className = "node";
  378. if( null != markedNode )
  379. markedNode.className = "node";
  380. if( null != node )
  381. node.className = "selected";
  382. markedNode = node;
  383. }
  384. function SelectNode( node )
  385. {
  386. var keyField = window.document.getElementById( "key" );
  387. if( null != keyField )
  388. keyField.value = node.key;
  389. MarkNode( node );
  390. selectedNode = node;
  391. }
  392. function ConcatUrl( url, args )
  393. {
  394. if( null != args )
  395. {
  396. if( url.indexOf( "?" ) < 0 )
  397. return url + "?" + args;
  398. else
  399. return url + "&" + args;
  400. }
  401. return url;
  402. }
  403. function ViewGoto( url, args )
  404. {
  405. window.parent.frames[ "view" ].location = ConcatUrl( url, args );
  406. }
  407. function ContextMenu_OnAdd( url )
  408. {
  409. SelectNode( popupNode );
  410. ViewGoto( url, popupArgs );
  411. }
  412. function ContextMenu_OnDelete( url )
  413. {
  414. SelectNode( popupNode );
  415. ViewGoto( url, popupArgs );
  416. }
  417. function ContextMenu_OnEdit( url )
  418. {
  419. SelectNode( popupNode );
  420. ViewGoto( url, popupArgs );
  421. }
  422. function ContextMenu_OnView( url )
  423. {
  424. SelectNode( popupNode );
  425. ViewGoto( url, popupArgs );
  426. }
  427. function ContextMenu_OnChangeOwner( url )
  428. {
  429. SelectNode( popupNode );
  430. ViewGoto( url, popupArgs )
  431. }
  432. function ContextMenu_OnRefresh()
  433. {
  434. document.forms[ 0 ].submit();
  435. }
  436. function ContextMenu_OnImpersonateUser()
  437. {
  438. SelectNode( popupNode );
  439. ViewGoto( "../admin/impersonate.aspx?frames=true", null );
  440. }
  441. function ContextMenu_OnCancelImpersonateUser()
  442. {
  443. SelectNode( popupNode );
  444. ViewGoto( "../admin/impersonate.aspx?frames=true&cancel=true", null );
  445. }
  446. function TreeNode_OnContextMenu( node, menu, args )
  447. {
  448. MarkNode( node );
  449. ShowContextMenu( node, menu, args );
  450. }
  451. function TreeNode_OnSelect( node, url )
  452. {
  453. SelectNode( node );
  454. ViewGoto( url, null );
  455. }
  456. </script>
  457. </body>
  458. </html>