General XMetaL Discussion
XMetaL Community Forum › General XMetaL Discussion › Open document from browser with specific parameters
-
kris3842 May 22, 2013 at 10:08 am
Open document from browser with specific parameters
May 22, 2013 at 10:08 amParticipants 0Replies 1Last Activity 9 years, 8 months agoHi,
I need to open a specific document from a link in a browser in XMetal Author Essential 7.0… A database is browserbased…
We have different custom setups(ctm-files) for different users, and the document is supposed to open with these setups…
I have received first draft to how we are going to open excel-files from the browser from the developer, and need something similar for xmetal
function runApp () {
var excApp = new ActiveXObject("Excel.Application");
excApp.visible = true;
var excBook = excApp.Workbooks.open("c:\test\test.xls");
idTmr = window.setInterval("Cleanup();",1000);
}Derek Read May 22, 2013 at 5:13 pm
Reply to: Open document from browser with specific parameters
May 22, 2013 at 5:13 pmXMetaL Author is also a COM server, so instead of “Excel.Application” substitute “XMetaL.Application” and then call appropriate APIs from there. Refer to the XMetaL Developer Programmers Guide for details on the various APIs available. There are several APIs for opening a file:
Application.Documents.Open() — opens a file in a way that is probably closest to what you are doing with Excel.
Application.Documents.OpenTemplate() — opens a file and treats it as a template.
Application.Documents.OpenString() — creates a new file based on a string you provide.Keeping with your naming scheme you would probably call Open() like this:
var xmApp = new ActiveXObject(“XMetaL.Application”);
var xmDoc = xmApp.Documents.open(“c:\test\test.xml”);In the case of XMetaL Author you do not need to worry about visibility as that is the default. If your script needs to known when XMetaL Author has finished starting up you can use the Application.InitComplete property.
If this will be an integration with a content management system (CMS) that will be used by more than one of our clients please consider creating a “connector” using the XMetaL Connector SDK (our partner manager can provide details). A connector is the preferred method for integrating with any CMS as it allows the software to function seamlessly with most document-level customizations.
-
AuthorPosts
- You must be logged in to reply to this topic.