Dynamic Objects

Dynamic objects are essentially placeholder objects—an empty container that is replaced with another object dynamically when you send an Image Template file to Corda Server™. For more information about dynamic objects, see Dynamic Objects.

Putting dynamic objects in an Image Template file lets you access the object in PCScript. Each dynamic object has its own name, data, and formatting options.

Note: The examples in this section assume that the dynamic object has the default name of dynamic. However, dynamic objects are not usually named dynamic. In such cases, use the object name in place of dynamic.

Dynamic objects have the following methods:

method

 

addITXML

Syntax

 

dynamic.addITXML(itxml)

Description

 

Inserts the specified ITXML properties into this dynamic object. If a property has already been defined (e.g., in the Image Template file), this statement overrides it. If no Image Template file is currently open, this command creates a new Image Template file and inserts the specified object into the empty Image Template file. The ITXML in this file is appended to the ITXML from the Image Template file and from any previous addITXML commands.

Adding an image object that has the same name as an existing image object in the Image Template file replaces the existing image object with the new image object.

The dynamic.addITXML statement allows you to insert ITXML into the object you import. For example, if you want to dynamically import a graph or map with an inserted legend, send the appropriate ITXML to Corda Server via dynamic.addITXML (see the example below).

Note that this only applies to properties of the <cit:dynamic-object> object. To modify attributes of the <cit:dynamic-object> tag (e.g., common="top:20;"), use the dynamic.setITXMLAttributes method.

Parameters

 

dynamic.addITXML accepts the following parameters:

 

 

itxml

String

 

 

A string of ITXML that contains valid properties for the object you are importing. For more information, see ITXML.

Example

 

dynamic.addITXML Method Call

dynamic.AddITXML(<cit:dynamic-object name="dynamic" preserve-proportions="false"/>)

 

 

method

 

hide

Syntax

 

dynamic.hide()

Description

 

Hides this dynamic object.

Use the dynamic.show command to make the dynamic object visible again after using this command.

 

method

 

setITXMLAttributes

Syntax

 

dynamic.setITXMLAttributes(attributes)

Description

 

Inserts the specified attribute assignments into this dynamic object's ITXML tag. If an attribute has already been assigned (e.g., in the Image Template file), this statement overrides its assignment.

The dynamic.setITXMLAttributes statement is most commonly used to specify the object that you want to dynamically import. For example, to import a shape named shape1 from a file generated by a Web application server at http://myserver.mycompany.com/flowcharts?code=1, set the Filename attribute to http://myserver.mycompany.com/flowcharts?code=1 and the object-name attribute to shape1 (see the example below).

Important: The path.xml file must grant Corda Server permission to read files from the location that you specify. Otherwise, it is unable to load the data. For more information, see Setting Path Permissions in the Corda® 7 Install and Administration manual.

Use this strategy to import any object defined in another Image Template file, including graphs and maps.

Note that this only applies to attributes listed in this object's <cit:dynamic-object> tag. To modify properties of the dynamic object tag, use the dynamic.addITXML method.

Parameters

 

dynamic.setITXMLAttributes accepts the following parameters:

 

 

attributes

String

 

 

A string of ITXML attribute assignments, each separated by a blank space. This string is essentially what follows dynamic-object in a <cit:dynamic-object> tag.

For example, to set the top attribute to 100, this string reads common="top:20;". This string can contain any number of attribute assignments.

For more information about ITXML, see ITXML.

Example

 

dynamic.setITXMLAttributes Method Call

dynamic1.setITXMLAttributes(Filename='logo.itxml' object-name='logosmall')

dynamic2.setITXMLAttributes(Filename='http://myserver.mycompany.com/flowcharts?code=1' object-name='step1')

 

 

method

 

show

Syntax

 

dynamic.show()

Description

 

Makes this dynamic object visible.

By default, all objects are visible. Use this command to make the dynamic object visible again after using the dynamic.hide command.