in 37 minutes<br />Episode 7<br />Extending XMetaL Author using the Resource Manager<br />Murray Smith, Technical Services...
Announcements<br />Latest Product Releases<br />XMetaL Author Enterprise for Documentum Webtop<br />XMetaL Reviewer 6.1<br...
System Overview<br />Implementation Details<br />Loading Internet Explorer in the Resource Manager.<br />Communicating fro...
System Overview<br />A key issue regarding script code is that script code in an HTML page in IE is running in IE’s script...
Loading Internet Explorer in the Resource Manager<br />Demo 1<br />
Loading Internet Explorer in the Resource Manager – XMetaL Script Code<br />1) Load IE in Resource Manager and call the ta...
Communication: HTML Page to External System<br />
Communication: HTML Page to External System<br />Demo 2<br />
Communication: HTML Page to External System – XMetaL Script code<br />The code is the same as the previous demo, except th...
Communication: HTML Page to External System – IE Script Code<br />Anything you can do from an HTML page in IE, you can do ...
Communication: HTML Page to XMetaL Author<br />The key issue is that script running in IE is running in IE’s script engine...
Communication: HTML Page to XMetaL Author<br />Demo 3<br />
Communication: HTML Page to XMetaL Author – IE Script Code<br />The key line is the first one. It shows how to get a refer...
Communication: XMetaL Author to the HTML Page<br />Same issue as before. Script running in IE is running in IE’s script en...
Communication: XMetaL Author to the HTML Page<br />Demo 4<br />
Communication: XMetaL Author to the HTML Page – IE Script Code<br />The page loaded in the Resource Manager has a JavaScri...
Communication: XMetaL Author to the HTML Page – XMetaL Script Code<br />Get a reference to the IE ActiveX control,<br />Ge...
Advanced Topic: Make Sure the HTML Page is Fully Loaded<br />The issue is that if you have script code running in XMetaL A...
Advanced Topic: Make Sure the HTML Page is Fully Loaded<br />Demo 5<br />
Advanced Topic: Make Sure the HTML Page is Fully Loaded – Overview<br />The solution is to have IE tell the script code ru...
Make Sure the HTML Page is Fully Loaded – Overview<br />We have an additional ActiveX control that is loaded in the Resour...
Make Sure the HTML Page is Fully Loaded – XMetaL Script Code<br />Callback code that is executed when IE finishes loading ...
Advanced Topic: Parameter Passing Between XMetaL and Your HTML Page<br />The key issue is that you generally can’t directl...
Parameter Passing Between XMetaL and Your HTML Page<br />Demo 6<br />
Parameter Passing Between XMetaL and Your HTML Page – IE Script Code<br />Use XMetaL’s CustomProperties API’s to pass para...
Summary<br />Loading HTML pages running in Internet Explorer in the Resource Manager is a highly flexible way to extend XM...
Additional Resources<br />Information on the Internet Explorer ActiveX control.<br />http://msdn.microsoft.com/en-us/libra...
Thank you for attending!<br />Q&A<br />
Upcoming SlideShare
Loading in...5
×

Extending XMetaL Author Using the Resource Manager

2,005

Published on

XML content is rarely authored in a vacuum. The Resource Manager in XMetaL Author provides a convenient piece of screen real-estate to connect the author to the rest of the world. Sitting right beside the editor pane in XMetaL Author, it’s the perfect place to present information needed by the author, collect ancillary information about the content while it’s fresh in the author’s mind, or display widgets for the author to initiate additional processing on the content.

For example, you can use the Resource Manager to:

* display a to-do list of changes that need to be made to a document
* embed a powerful third-party image editor, e.g. to display and interact with a 3D image of a machine part
* let the author search for relevant reusable content
* let the author record metadata while they author a document


Join us for a quick introduction to embedding Internet Explorer in the XMetaL Resource Manager and how to communicate between Internet Explorer and XMetaL Author and your back-end systems.

A recording of this presentation is available at http://tinyurl.com/276qoul . Code samples used in the presentation are available at http://na.justsystems.com/files/resource_manager-demofiles.zip .

This presentation is part of the free "XMetaL in 37 Minutes" webinar series. For upcoming webinars, see http://na.justsystems.com/webinars.php .

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,005
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
23
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Extending XMetaL Author Using the Resource Manager

  1. 1. in 37 minutes<br />Episode 7<br />Extending XMetaL Author using the Resource Manager<br />Murray Smith, Technical Services Manager<br />Brought to you by XMetaL Technical Services<br />
  2. 2. Announcements<br />Latest Product Releases<br />XMetaL Author Enterprise for Documentum Webtop<br />XMetaL Reviewer 6.1<br />Next time: June 17, Getting to Yes: Overcoming Barriers to XML Adoption in the Enterprise.<br />No 37 Minute webinar on the first Thursday of July (it’s a holiday in Canada).<br />
  3. 3. System Overview<br />Implementation Details<br />Loading Internet Explorer in the Resource Manager.<br />Communicating from the HTML page in IE to external systems.<br />Communicating from the HTML page in IE to XMetaL Author.<br />Communicating from XMetaL Author to your HTML page in IE.<br />Advanced Topic: Making sure the HTML page in IE is fully loaded.<br />Advanced Topic: Parameter passing between XMetaL Author and your HTML page in IE.<br />Agenda<br />
  4. 4. System Overview<br />A key issue regarding script code is that script code in an HTML page in IE is running in IE’s script engine, while script code in an XMetaL macro file is running in XMetaL Author’s script engine. <br />
  5. 5. Loading Internet Explorer in the Resource Manager<br />Demo 1<br />
  6. 6. Loading Internet Explorer in the Resource Manager – XMetaL Script Code<br />1) Load IE in Resource Manager and call the tab Demo_1.<br />2) Make this tab visible.<br />3) Get a reference to the IE control.<br />4) Tell the control to navigate to google.com.<br />ResourceManager.AddTab(“Demo_1","Shell.Explorer");<br />ResourceManager.SelectTab(“Demo_1");<br />Var msie = ResourceManager.ControlInTab( “Demo_1" );<br />msie.Navigate( “http://www.google.com" );<br />ResourceManager is a global object that is accessible from script code running in XMetaL Author.<br />XMetaL script code from ResManDemo1.mcr<br />
  7. 7. Communication: HTML Page to External System<br />
  8. 8. Communication: HTML Page to External System<br />Demo 2<br />
  9. 9. Communication: HTML Page to External System – XMetaL Script code<br />The code is the same as the previous demo, except this time we navigate to an html page on the file system.<br />XMetaL script code in ResManDemo2.mcr<br />
  10. 10. Communication: HTML Page to External System – IE Script Code<br />Anything you can do from an HTML page in IE, you can do from an HTML page in IE in the Resource Manager.<br />In this demo we use AJAX to call a server.<br />IE script code in ResManDemo2.html<br />
  11. 11. Communication: HTML Page to XMetaL Author<br />The key issue is that script running in IE is running in IE’s script engine and script running in XMetaL Author is running in XMetaL Author’s script engine.<br />
  12. 12. Communication: HTML Page to XMetaL Author<br />Demo 3<br />
  13. 13. Communication: HTML Page to XMetaL Author – IE Script Code<br />The key line is the first one. It shows how to get a reference to the XMetaL Application object from script code in IE. Once you have it you have access to the XMetaL Application API from within your HTML page.<br />var xmApp = new ActiveXObject("XMetaL.Application");<br />var doc = xmApp.ActiveDocument;<br />if( doc == null ){<br /> alert( "Please open a document first." );<br />}<br />else{<br /> doc.Range.Text = time;<br />}<br />IE script code in ResManDemo3.html<br />
  14. 14. Communication: XMetaL Author to the HTML Page<br />Same issue as before. Script running in IE is running in IE’s script engine and script running in XMetaL Author is running in XMetaL Author’s script engine.<br />
  15. 15. Communication: XMetaL Author to the HTML Page<br />Demo 4<br />
  16. 16. Communication: XMetaL Author to the HTML Page – IE Script Code<br />The page loaded in the Resource Manager has a JavaScript function [writeMsg(msg)] that writes a message into the HTML page.<br />We will invoke this function from script running in XMetaL Author.<br />IE script code in ResManDemo4.html<br />
  17. 17. Communication: XMetaL Author to the HTML Page – XMetaL Script Code<br />Get a reference to the IE ActiveX control,<br />Get a reference to the HTML Document object in IE,<br />Use the execScript() method of the Script object to invoke the JavaScript function in the HTML page.<br />var msie = ResourceManager.ControlInTab( "Demo_4" );<br />var doc = msie.document;<br />doc.Script.execScript( "writeMsg( '" + msg + "' )", "JSCRIPT" );<br />XMetaL script code in ResManDemo4.mcr<br />
  18. 18. Advanced Topic: Make Sure the HTML Page is Fully Loaded<br />The issue is that if you have script code running in XMetaL Author that will make calls to your HTML page running in IE in the Resource Manager, you need to make sure the HTML page is fully loaded before you make any calls to it.<br />
  19. 19. Advanced Topic: Make Sure the HTML Page is Fully Loaded<br />Demo 5<br />
  20. 20. Advanced Topic: Make Sure the HTML Page is Fully Loaded – Overview<br />The solution is to have IE tell the script code running in XMetaL Author when it has finished loading the HTML page.<br />
  21. 21. Make Sure the HTML Page is Fully Loaded – Overview<br />We have an additional ActiveX control that is loaded in the Resource Manager. (CritiqueUtils.WebBrowerContainer)<br />Internet Explorer will be loaded inside the CritiqueUtils container which is loaded in the Resource Manager.<br />The CritiqueUtils container will make a callback to your XMetaL JavaScript code once your page is fully loaded.<br />
  22. 22. Make Sure the HTML Page is Fully Loaded – XMetaL Script Code<br />Callback code that is executed when IE finishes loading the HTML page.<br />Use CritiqueUtils.WebBrowerContainer instead of Shell.Explorer<br />An instance of the callback handler is passed to the Navigate2() method.<br />XMetaL script code in ResManDemo5.mcr<br />
  23. 23. Advanced Topic: Parameter Passing Between XMetaL and Your HTML Page<br />The key issue is that you generally can’t directly pass parameters between the two because they are 2 separate script engines.<br />
  24. 24. Parameter Passing Between XMetaL and Your HTML Page<br />Demo 6<br />
  25. 25. Parameter Passing Between XMetaL and Your HTML Page – IE Script Code<br />Use XMetaL’s CustomProperties API’s to pass parameters back and forth between IE script code and XMetaL script code.<br />var xmApp = new ActiveXObject("XMetaL.Application");<br />xmApp.CustomProperties.Add( "msgFromHtmlPage", msg );<br />xmApp.Run( "displayMsgFromHtmlPage" );<br />IE script code in ResManDemo6.html<br />
  26. 26. Summary<br />Loading HTML pages running in Internet Explorer in the Resource Manager is a highly flexible way to extend XMetaL Author.<br />We’ve seen that script code in IE is running in IE’s script engine and script code in XMetaL Author is running in XMetaL Author’s script engine.<br />Therefore, we can’t directly invoke script methods or access script data.<br />Instead we need to get references to the ActiveX controls and use the XMetaL API and IE API.<br />
  27. 27. Additional Resources<br />Information on the Internet Explorer ActiveX control.<br />http://msdn.microsoft.com/en-us/library/aa752040(v=VS.85).aspx<br />Information on the XMetaL API<br />http://na.justsystems.com/webhelp/en/xmetaldeveloper/pg/6.0/pg.html<br />
  28. 28. Thank you for attending!<br />Q&A<br />
  1. A particular slide catching your eye?

    Clipping is a handy way to collect important slides you want to go back to later.

×