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

More Related Content

Recently uploaded

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...gurkirankumar98700
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 

Recently uploaded (20)

[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
Kalyanpur ) Call Girls in Lucknow Finest Escorts Service 🍸 8923113531 🎰 Avail...
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Extending XMetaL Author Using the Resource Manager

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