Pages: 1
Print
Author Topic: XMetaL customizing: How to support new image types?  (Read 3345 times)
t3programmer
Member

Posts: 2


« on: March 01, 2012, 03:33:10 AM »

Hello,

I am a programmer for an XML authoring system that uses XMetaL as XML editor.

We use the authoring system to produce Web-based trainings that make extensive use of video films.

Currently, we are only using video files that have the file type "swf".

For displaying them in XMetaL, we insert them as images and use the same IE Active X control that is used by the macro "SVG_OnInitialize" of the XMetal standard. For this, the only change we did was to change the function "isSVG" such that it returns "true" in the "swf" case, too. That is, we essentially use the code:

Code:
var ipc = Application.ActiveInPlaceControl;
if ( ipc != null )
{
  //...
  if( isSVG( src ) )
  {
//...
ipc.Control.Navigate2(  "file:///" + ActiveDocument.Path + "\\" + src + fileExt );

Now we want to support additional video types ("flv", "f4v"). These video formats cannot be displayed by the Flash Plugin for IE. However, they can be referenced and displayed by a Flash application ("flvplayer.swf").

Principal approaches that we could think of were:

  • Use a different Active X control than IE, or
  • Open the "flvplayer.swf" instead of the image file, passing the image file as parameter, or
  • Create an HTML page on-the-fly and display it with the IE control (see code below, replace **vid location** by the image file).

Code:
    <object type="application/x-shockwave-flash" width="400" height="350"
    wmode="transparent" data="flvplayer.swf?file=**vid location**&autoStart=true">
    <param name="movie" value="flvplayer.swf?file=**vid location**&autoStart=true" />
    <param name="wmode" value="transparent" />
    </object>

How can this be done in XMetaL? Which approach would you recommend?

I am using XMetaL Author Enterprise 6.0. My XMetaL version is 6.0.0.079. I use it on the operating system Windows XP Professional, Service Pack 3.
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #1 on: March 01, 2012, 11:34:03 AM »

You will need to add new settings into the CTM file to identify which ActiveX control and which events to fire. The settings are in a section called:
<OCXReplacements>...</OCXReplacements>

You will need to create a new section, or change the section currently set up for IE (Shell.Explorer.1).

It looks like you are already modifying the scripts that come with the DITA functionality. Keep in mind that officially we are not supporting customization of the DITA authoring functionality at this level (yet).

If this is for another DTD/XSD (your own customization) then the XMetaL Developer Customization Guide has a section on using ActiveX controls called: "In-Place Control" which is a subtopic within "Display As" (these terms will have little meaning if you are not using XMetaL Developer).
Logged
t3programmer
Member

Posts: 2


« Reply #2 on: March 05, 2012, 02:11:00 AM »

Hello,

I got one step further: I replaced the OCXReplacement entry for "Shell.Explorer.2" by

Code:
<OCXReplacement>
<SelectorName ns="">img</SelectorName>
<MacroPrefix>SVG</MacroPrefix>
<ClassID>{D27CDB6E-AE6D-11cf-96B8-444553540000}</ClassID>
<ProgID>ShockwaveFlash.ShockwaveFlash.10</ProgID>
</OCXReplacement>

By inserting

Code:
ipc.Control.LoadMovie( 0,  "file:///" + ActiveDocument.Path + "\\" + src + fileExt );

I can use the Flash player for displaying "swf" files. "flv" files are not yet displayed. How to do this, I'll try to figure out myself.

However, I have now lost the SVG functionality since the new ActiveX control replaces the old one.

  • How can I define that both "Shell.Explorer.2" and "ShockwaveFlash.ShockwaveFlash.10" are available as in-place-controls in XMetaL? I would like to use "Shell.Explorer.2" for images with extension "svg" and "ShockwaveFlash.ShockwaveFlash.10" for images with extension "swf".

Still, I have another question:

  • Within my debugging environment "XMetal Developer 6.0" the in-place-controls are no longer working. That means:

    • When debugging the code of "SVG_OnShouldCreate.js", in the 'Debug Variables Window' it says 'undefined' for 'ipc.Control' and 'Server exception error' for 'ipc.NextEventParam'.
    • After opening in XMetaL, the "swf" images are displayed like missing graphics.

    In contrast, without debugging, XMetaL displays the "swf" images correctly. What can be reasons why the in-place-controls do not work in the VisualStudio 2008 debugging session?
Logged
Derek Read
Program Manager (XMetaL)
Administrator
Member

Posts: 2621



WWW
« Reply #3 on: March 06, 2012, 06:55:19 PM »

Please see this part of my answer: "It looks like you are already modifying the scripts that come with the DITA functionality. Keep in mind that officially we are not supporting customization of the DITA authoring functionality at this level (yet)."

I'm afraid this means that you are really on your own here. The documentation for embedding ActiveX controls in the XMetaL Developer Customization Guide and the Programmers Guide may help you, as well as the Journalist sample (which also embeds IE unfortunately), but since you are making changes to a portion of the DITA functionality that is unsupported. Other clients might be able to help if they have tried to do this (that is what the forum is for) but keep in mind that if you do alter the code in this area it will be difficult for XMetaL Support to help you in other areas if those changes break other features. Support would need to answer any questions about other broken functionality based on the assumption that you have not made these changes and that you have a "clean" installation (so you'd need to back them out and reproduce the issue without these changes in place).
« Last Edit: March 07, 2012, 05:32:39 PM by Derek Read » Logged
Pages: 1
Print
Jump to: