Previous ION Script User's Guide: ION Script Tag Reference Next

ION_OBJECT

The ION_OBJECT tag pair is used to insert content such as VRML, MPEG, and WAV files into an ION Script application. IDL is capable of creating output in a variety of file formats other than the image formats handled by ION_IMAGE and text handled by ION_DATA_OUT. The ION_IMAGE tag allows the ION Script developer to insert any IDL-generated data that can be inserted into a Web page with either the <OBJECT> tag or <EMBED> tag.

Implementation of the <OBJECT> and <EMBED> tags differs significantly from browser to browser. Therefore, it is usually necessary to write ION_OBJECT code differently for each browser supported by your application. It is important to understand how each browser you intend to support handles the MIME types you are including in your ION Script application. In addition, plug-ins are often used to render data contained in <OBJECT> and <EMBED> tags. Each plug-in has its own coding requirements, so make sure you know which information is required by the plug-ins you are supporting.

The <OBJECT> tag was originally implemented by Microsoft to support their ActiveX applets. In a similar manner, Netscape initially supported the alternative <EMBED> and <APPLET> tags for inclusion objects and later provided support for the <OBJECT> tag.

HTML 4.0 standard supports the <OBJECT> tag, and this is expected to be the standard. If you want your code to be supported in the future, it is recommended you use the <OBJECT> tag before the <EMBED> tag.

Syntax

<ION_OBJECT
FILE="filename"
MIME="mime-type"
[DEBUG={"TRUE" | "FALSE"}]
[DELETE_FILE={"TRUE" | "FALSE"}]
[HEIGHT="height"]
[OBJTYPE={"EMBED | OBJECT"}]
[SERVER="server name"]
[WIDTH="width"]
[Any attribute of the HTML <EMBED> or <OBJECT> tags]>

[ION_PARAM tags]

<IDL>
IDL code used to write a file named filename
</IDL>

</ION_OBJECT>

Attributes

In addition to the attributes listed below, it is usually necessary when using the HTML <OBJECT> or <EMBED> tag to specify an attribute that tells the plug-in where to retrieve the data that will be displayed by the plug-in. For the <OBJECT> tag, the DATA attribute is used for this purpose. For the <EMBED> tag, the SRC attribute is used. Some plug-ins ignore the DATA or SRC attribute and instead require a <PARAM> tag to provide this information. The method used to provide this information to the plug-in depends on the plug-in that is used to render the data. The $ION.IDLURL system variable defines the URL used to access the ION Script image engine, ion-i.exe. Set either the DATA attribute or SRC attribute to the value of the $ION.IDLURL system variable. See Examples for examples that illustrate the use of the $ION.IDLURL system variable.

DEBUG

Setting this attribute to TRUE causes ION Script to generate a text file that can be used to help debug your ION Script application. This debugging file contains the exact code sent to IDL, as well as any errors reported by IDL. The file is given the name specified by the "Log Filename" setting on the "Debug" tab of the ION Script Configuration utility (Windows) or by the "ION Debug Filename" in the "Debug" section of the .ionsrc file (UNIX). For example, if the setting is "ion-out%d.txt", then a file called ion-out<PID>.txt is created, where <PID> is the unique process ID for the instance of ion-i that generated the output. The file is written to the directory specified by the "Log Location" setting on the "Debug" tab of the ION Script Configuration utility (Windows) or by the "ION Debug Location" in the "Debug" section of the .ionsrc file (UNIX). In order for this to work, the directory specified by the "ION Debug Location" must be writable. See Debug for more information. The default value for DEBUG is FALSE.

DELETE_FILE

Specifies whether to delete the file created in the <IDL> block. If TRUE, this file is deleted after it is streamed to the browser. If FALSE, the file is not deleted. The default value is TRUE.

HEIGHT

Specifies the height of the object. Although this attribute is optional, it is usually required by a plug-in.

FILE

Set this attribute to the name of the file written by IDL in the <IDL>...</IDL> block. Specify only the filename, not the path. The application assumes that this file is written to the directory specified by the $ION.temp system variable (see temp). The IDL code in the <IDL>...</IDL> block must create a file with the name specified by this attribute, and must write it to the path specified by the $ION.temp system variable.

MIME

Specifies the MIME type of the object.

OBJTYPE

Specifies whether to create the HTML <OBJECT> tag or <EMBED> tag. The default value is OBJECT.

SERVER

The full path to the image engine, ion-i. This must be a valid, absolute URL using the HTTP protocol. This attribute, which is also an attribute of <ION_DATA_OUT> and <ION_IMAGE>, can be used for load control by specifying different servers for different tasks (provided you have a copy of ion-i on each server, and that you have the proper license). Because the streaming of some types of data can be a resource-intensive process, it may be beneficial to performance in some cases to use a separate server to stream data inserted with the ION_OBJECT tag. If this attribute is not specified, ION Script will use the server specified during installation. The default value for this attribute can be changed using the configuration utility. This attribute can contain a variable.

WIDTH

Specifies the width of the object. Although this attribute is optional, it is usually required by a plug-in.

HTML Mapping

The ION_OBJECT tag is converted to either the HTML <OBJECT> tag (if the OBJTYPE attribute is set to OBJECT or if OBJTYPE is not specified), or the HTML <EMBED> tag (if the OBJTYPE attribute is set to EMBED).

Examples

This example illustrates the fact that the same MIME type is handled differently for Internet Explorer than for Netscape. When using the ION_OBJECT tag, it is usually necessary to code a different ION Script page for each browser that your application supports. In this example, wav_ns.ion is the Netscape version, which uses the Apple Quicktime plug in, and wav_ie.ion is the Internet Explorer version, which uses the Microsoft ActiveMovie plug- in.

wav_ns.ion:

<ION_SCRIPT>  
<ION_HEADER>   
   <VARIABLES>   
      <VARIABLE_DECL NAME="file" TYPE="STR" VALUE="'test.wav'"/>   
      <VARIABLE_DECL NAME="fullPath" TYPE="STR"   
         VALUE="$ION.Temp+$file"/>   
      <VARIABLE_DECL NAME="HTMLPath" TYPE="STR"   
         VALUE="'http://'+$BROWSER.SERVER_NAME+'/'+$file" />   
</VARIABLES>   
</ION_HEADER>   
  
<ION_BODY>  
<ION_DATA_OUT>  
   <IDL>  
      x=findgen(5000)  
      y=sin(x/5)*6000  
      wave=fix(y)  
      print,'$fullPath'  
      write_wav,'$fullPath',y,10000  
  
      print,'finished writing'  
   </IDL>  
</ION_DATA_OUT>  
<ION_OBJECT HEIGHT="80" WIDTH="2500" FILE="$file" MIME="audio/wav"  
   DATA="$ION.IDLURL">  
   Wav file test  
</ION_OBJECT>  
</ION_BODY>  
</ION_SCRIPT>  

wav_ie.ion:

<ION_SCRIPT>  
<ION_HEADER>   
   <VARIABLES>   
      <VARIABLE_DECL NAME="file" TYPE="STR" VALUE="'test.wav'"/>   
      <VARIABLE_DECL NAME="fullPath" TYPE="STR"  
         VALUE="$ION.temp+'\'+$file" />   
</VARIABLES>   
</ION_HEADER>   
  
<ION_BODY>  
<ION_DATA_OUT>  
   <IDL>  
      x=findgen(5000)  
      y=sin(x/5)*6000  
      wave=fix(y)  
      print,'$fullPath'  
      write_wav,'$fullPath',y,10000  
  
      print,'finished writing'  
   </IDL>  
</ION_DATA_OUT>  
<br>  
<ION_OBJECT DEBUG="true" FILE="$file" MIME="audio/wav"  
   ID="snd1" 			CLASSID="CLSID:05589FA1-C356-11CE-BF01-00AA0055595A">  
      <ION_PARAM NAME="FileName" VALUE="$ION.IDLURL" />  
</ION_OBJECT>  
</ION_BODY>  
</ION_SCRIPT>  

  IDL Online Help (March 06, 2007)