Each Image Template file contains one Main object. This object controls formatting options for the entire Corda® image.
The Main object has the following methods:
|
method |
|
addITXML |
|
|---|---|---|---|
|
Syntax |
|
main.addITXML(itxml) |
|
|
Description
|
|
Inserts the specified ITXML object into an Image Template file. If an object has already been defined, 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 main.addITXML statement is useful for accessing features of Corda Server™ not available through the PCScript API. It allows you to add to or modify the actual Image Template file. For example, PCScript does not let you dynamically add a textbox to an image. However, you can use addITXML to insert a textbox object in the Image Template file. The example below illustrates how to do this. Note that this applies only to properties contained by the <cit:image-template> tag. |
|
|
Parameters |
|
main.addITXML accepts the following parameters: |
|
|
|
|
itxml |
String |
|
|
|
A string of ITXML. This ITXML should contain valid objects of the <cit:image-template> tag. For more information, see ITXML. |
|
|
Example |
|
main.addITXML Method Call main.addITXML(<cit:textbox name="textbox" cversion="0" positioned-in-builder="true" common="top:25;left:162;width:180;height:31"> <cit:text content="Sample Text"/></cit:textbox>)
|
|
|
method |
|
description |
|
|---|---|---|---|
|
Syntax |
|
main.description(description) |
|
|
Description
|
|
Specifies a description for the Corda image. This description is displayed immediately under the Corda image's title in its text description. For more information, see Descriptive Text in the Corda Builder™ User Guide. |
|
|
Parameters |
|
main.description accepts the following parameters: |
|
|
|
|
description |
String |
|
|
|
The description of the Corda image. |
|
|
method |
|
itemDelimiter |
|
|---|---|---|---|
|
Syntax |
|
main.itemDelimiter(delimiter) |
|
|
Description
|
|
Sets the item delimiter to the specified character. This method affects PCScript commands for the current Corda image only. The item delimiter divides data items from each other in the graph.setSeries method. Because a data series can have any number of data items, it uses two types of delimiters. The parameter delimiter delimits data values in each data item, while the item delimiter divides data items from each other. (For more information, see graph.setSeries.) Similarly, the item delimiter is used to divide multiple hover text or drilldown settings from each other in the graph.addHoverText and graph.ddEnable commands, respectively. By default, the item delimiter for PCScript is a semi-colon (;). This can cause problems when you are trying to pass strings containing semi-colons. The main.itemDelimiter method lets you change the delimiter to something else. For example, a series named "Fred; not Wilma" causes Corda Server to think that the series name is Fred and that the first data item in the series is not Wilma. Changing the delimiter to a carat (^), for example, properly passes the data series. Separate each parameter from the others by a carat (see the example below). Unless you change the parameter delimiter using the main.paramDelimiter method, do not change the series delimiter to a comma (,). This character is reserved for delimiting parameters. |
|
|
Parameters |
|
main.itemDelimiter accepts the following parameters: |
|
|
|
|
delimiter |
char |
|
|
|
The character that delimits items in this PCScript command string. |
|
|
Example |
|
Changing the Item Delimiter main.itemDelimiter(^) graph.setSeries(Fred; not Wilma ^ 23,34 ^ 54,29) graph.addHoverText(1,1, Flintstones ^ 1,2, Vitamins) |
|
|
method |
|
message |
|
|---|---|---|---|
|
Syntax |
|
main.message(TextMessage) |
|
|
Description |
|
Tells Corda Server to generate a Corda image that displays the specified message. All server commands, PCScript commands, and data are ignored. |
|
|
Parameters |
|
main.message accepts the following parameters: |
|
|
|
|
TextMessage |
String |
|
|
|
The message that should be displayed in the Corda image. As with all strings in PCScript, it should not be surrounded by quotation marks. |
|
|
method |
|
paramDelimiter |
|
|---|---|---|---|
|
Syntax |
|
main.paramDelimiter(delimiter) |
|
|
Description
|
|
Sets PCScript's parameter delimiter to the specified character. This method affects PCScript commands for the current Corda image only. By default, the item delimiter for PCScript is a comma (,). This can cause problems when using strings containing commas. The main.paramDelimiter method lets you change the delimiter to something else. For example, a category named Fred, Barney, and Wilma works fine until using it to create a drilldown. In this case, the category name causes Corda Server to identify three different parameters—Fred, Barney, and and Wilma—instead of a single category title. Changing the delimiter to an asterisk (*), for example, properly passes the category name. Delimit each parameter from the others with an asterisk (see Example 1 below). This method is also useful when adding hover text to a map data item named Portland, OR (see Example 2 below). In this case, the data item name causes Corda Server to attempt to add the hover text to a data item named Portland, and identifies the hover text as OR * Corporate Headquarters, instead of Corporate Headquarters. Changing paramDelimiter to an asterisk (*) lets Corda Server interpret the data item's name correctly. Unless you change the item delimiter using the main.itemDelimiter method, do not change the parameter delimiter to a semi-colon (;). This character is reserved for delimiting data items. |
|
|
Parameters |
|
main.paramDelimiter accepts the following parameters: |
|
|
|
|
delimiter |
char |
|
|
|
The character that delimits parameters for this PCScript command string. |
|
|
Examples |
|
Example 1: Changing the Parameter Delimiter main.itemDelimiter(*) graph.categories(Fred, Barney, and Wilma * Gus * Matilda) graph.series(Apples, Oranges, and Pears * 67 * 89 * 93) graph.ddEnable(Fred, Barney, and Wilma * 1-3 * http://fruitstocks.com) Example 2: Changing the Parameter Delimiter main.paramDelimiter(*) map.setHover(Cities;Portland,OR * Corporate Headquarters) |
|
|
method |
|
suppressAutoDescription |
|---|---|---|
|
Syntax |
|
main.suppressAutoDescription() |
|
Description |
|
Suppresses automatic descriptive text generation for the entire Corda image. Only explicitly specified descriptions (via main.description, graph.description, or textbox.description) appear in the text description. |
|
method |
|
title |
|
|---|---|---|---|
|
Syntax |
|
main.title(title) |
|
|
Description |
|
Specifies the title of the Corda image. This is used only in the image's text description. For more information, see Descriptive Text in the Corda Builder User Guide. |
|
|
Parameters |
|
main.title accepts the following parameters: |
|
|
|
|
title |
String |
|
|
|
The title of the Corda image. |
|