This section describes the attributes of Corda® Embedder. These attributes specify data and formatting settings for the Corda image.
Note: The sample code in this section is written for a Corda Embedder object named myImage.
For a list of Corda Embedder attributes, see Class Summary.
|
boolean |
|
appendServerInfoSlash |
|
Syntax |
|
myImage.appendServerInfoSlash = false; |
|
Alternate Syntax |
|
|
|
Description |
|
Specifies whether or not Corda Embedder should automatically add a slash if there is not one at the end of the Web address. By default, this is set to true. Important: Do not set this attribute to false unless you are having problems with the Corda Redirector. |
|
boolean |
|
autoSwitchToPNG |
|
Syntax |
|
myImage.autoSwitchToPNG = false; |
|
Alternate Syntax |
|
|
|
Description |
|
If the client supports PNG (as determined by the userAgent string), and Automatic PNG Detection has been enabled, setting this value to false prevents Corda Server from returning a PNG image when a JPEG image has been requested. Since the default value of this attribute is true, setting this value to true has no effect. This attribute is also meaningless when Automatic PNG Detection has been disabled. For more information, see Automatic PNG Detection in the Corda 7 Install and Administration manual. |
|
String |
|
bgColor |
|
Syntax |
|
myImage.bgColor = "FFFFFF"; |
|
Alternate Syntax |
|
|
|
Description |
|
Specifies the background color of the Corda image. The value of this string is a six-digit HTML color code. For example, "FFFFFF" represents white, while "000000" represents black. Note: Do NOT prefix the color value with a pound sign (#), as is often done on Web pages. |
|
String |
|
clusterMonitorAddress Available only with Corda 7 Enterprise. |
|
Syntax |
|
myImage.clusterMonitorAddress = "localhost/clusterMonitor" ; |
|
Alternate Syntax |
|
|
|
Description |
|
Specifies the address and port of the Corda Cluster Monitor. The value of this string should be the location of the cluster monitor. Usually, the cluster monitor runs on the Web application server as a servlet or Web module. This attribute has meaning only when clustering is enabled on Corda Server (see Clustering in the Corda 7 Install and Administration manual). Note: When using a cluster monitor, do not set the internalCommPortAddress attribute. |
|
String |
|
externalServerAddress |
|
Syntax |
|
myImage.externalServerAddress = "http://is.mycompany.com:2001" ; |
|
Alternate Syntax |
|
|
|
Description |
|
Specifies the external address and port of Corda Server. The value of this string should be an IP address or domain name, followed by the server port number (e.g., http://10.0.0.1:2001 or http://imageserver.mycompany.com:2001). By default, the server port is 2001. Clients retrieve the generated image from this address, which must be accessible to the client. When serving images to external clients, configure the firewall to open this address or port. If you don't want to open another port on the firewall, use the Corda Redirector module to access Corda Server's external port (see HTTP Redirection in the Corda 7 Install and Administration manual). In this case, set this attribute to the location of the Corda Redirector (e.g., www.mycompany.com/ctredirector). Note that you do not have to specify a port in this case, as port 80 is assumed. The external server address is different from the internal comm port address, which is the address that the Web application server uses to communicate with the Corda Server (see internalCommPortAddress). Both the external and internal addresses must be specified when generating a Corda image (except when setting clusterMonitorAddress while clustering). For more information about configuring Corda Server ports and addresses, see Server Address and Port Settings in the Corda 7 Install and Administration manual. |
|
String |
|
extraCTSCommands |
|
Syntax |
|
myImage.extraCTSCommands = commandstring; |
|
Alternate Syntax |
|
|
|
Description |
|
Specifies additional server commands to send to Corda Server. The value of this string should be a server command string. For more information, see Server Command Strings. This attribute is useful for sending server commands to Corda Server that the Corda Embedder does not support. Although there were more such commands in the past, the only documented command that is currently inaccessible in the Corda Embedder API is @_FLUSH. The example below shows how you would set this command with extraCTSCommands: Setting Extra Server Commands myImage.extraCTSCommands = "@_FLUSH@_PWpassword"; |
|
String |
|
extraHTMLAttributes |
|
Syntax |
|
myImage.extraHTMLAttributes = attributes; |
|
Alternate Syntax |
|
|
|
Description |
|
Specifies additional attributes to place within the <object>, <embed>, or <img> tag that embeds the generated Corda image. The value of this string should be a list of attributes and styles, in the exact same format as the would appear within an HTML tag on a Web page (i.e., "attribute1='value1' attribute2='value2'"). To use the double quotes character inside of this string, escape it using the appropriate escape character for the language or scripting environment. In most languages, a backslash (\) is the escape character. (e.g., attribute1=\"value1\"), but some environments require you to repeat the character twice instead (e.g., attribute1=""value1""). This attribute is useful when formatting the Corda image with HTML attributes that don't have an equivalent Corda Embedder attribute. Some of the more common attributes that fall into this category are style, align, name, vspace, and hspace. The example below shows how you would set these attributes with extraHTMLAttributes: Setting Extra HTML Attributes myImage.extraHTMLAttributes = "style='position:absolute; top:120' align='center' vspace='2' hspace='2'"; |
|
String |
|
fallback |
|
Syntax |
|
myImage.fallback = {"NONE" | "LOOSE" | "STRICT"} ; |
|
Alternate Syntax |
|
|
|
Description |
|
Specifies the fallback method for the generated Corda image. The value of this string should be one of the following three strings: "NONE", "LOOSE", or "STRICT". These strings represent the different fallback methods: none, loose, and strict. For an explanation of Corda Server's best-image fallback feature and the various fallback methods, see Best Image Fallback. |
|
int |
|
height |
|
Syntax |
|
myImage.height = 400; |
|
Alternate Syntax |
|
|
|
Description |
|
Specifies the height of the generated Corda image. This value should be set to an integer, which represents the height (in pixels) of the generated image. This attribute sets the height of the image that is returned to the browser, but not necessarily the height at which the browser displays the image. This is because the htmlHeight attribute, if it is set, overrides the height attribute within the browser. For more information on how Corda Server handles the sizing of an image, see Changing Image Size. |
|
String |
|
htmlHeight |
|
Syntax |
|
myImage.htmlHeight = "75%"; |
|
Alternate Syntax |
|
|
|
Description |
|
Specifies the height at which a client displays a Corda image. This value should be set to a string which contains either the height of the image in pixels (number only), or the height of the image as a percentage of the Web page (number followed by a percent sign [%]). This attribute does not set the actual height of the image (which is determined by either the Image Template file or the Corda Embedder height attribute). Rather, the htmlHeight attribute sets the value of the height attribute within the <object>, <embed>, or <img> tag that embeds the Corda image into the Web page. This is similar to using <img height="75%"> in HTML. If htmlHeight is not set, the value of height is used instead. For more information on how Corda Server handles the sizing of an image, see Changing Image Size. |
|
String |
|
htmlWidth |
|
Syntax |
|
myImage.htmlWidth = "100%"; |
|
Alternate Syntax |
|
|
|
Description |
|
Specifies the width at which a client displays a Corda image. This value should be set to a string which contains either the width of the image in pixels (number only), or the width of the image as a percentage of the Web page (number followed by a percent sign [%]). This attribute does not set the actual width of the image (which is determined by either the Image Template file or the Corda Embedder width attribute). Rather, the htmlWidth attribute sets the value of the width attribute within the <object>, <embed>, or <img> tag that embeds the Corda image into the Web page. This is similar to using <img width="100%"> in HTML. If htmlWidth is not set, the value of width is used instead. For more information on how Corda Server handles the sizing of an image, see Changing Image Size. |
|
String |
|
imageTemplate |
|
Syntax |
|
myImage.imageTemplate = "examples\bar.itxml"; |
|
Alternate Syntax |
|
|
|
Description |
|
Specifies the location of the Image Template file for the Corda image. The Image Template file should have a .itxml extension. The file location should be relative to Corda Server's document root. It can also be an absolute path or a URL. Make sure that path.xml gives Corda Server" permission to read Image Template files from the location where the Image Template file resides. For more information, see Setting Path Permissions in the Corda 7 Install and Administration manual For more information, see About Image Template Files in the Corda Builder" User Guide. Note: Corda Server still supports legacy .pcxml files from Corda Tools versions 4.x - 6.x. |
|
String |
|
internalCommPortAddress |
|
Syntax |
|
myImage.internalCommPortAddress = "10.0.0.1:2002"; |
|
Alternate Syntax |
|
|
|
Description |
|
Specifies the internal address and comm port for Corda Server. The value of this string should be an IP address or domain name, followed by the comm port number (e.g., 10.0.0.1:2002 or imageserver.myintranet.com:2002). By default, the comm port is 2002. This is the address that the Web application uses to communicate with Corda Server. The address needs to be accessible only from the Web application server. Often times, Corda Server runs on the same machine as the Web application server. In such cases, set internalCommPortAddress to localhost:2002. The internal comm port address is different from the external server address, which is the address that clients use to communicate with Corda Server (see externalServerAddress). Both the external and internal addresses must be specified when generating a Corda image (except when setting clusterMonitorAddress while clustering). For more information about configuring Corda Server ports and addresses, see Server Address and Port Settings in the Corda 7 Install and Administration manual. |
|
boolean |
|
isPostRequest |
|
Syntax |
|
myImage.isPostRequest = true; |
|
Alternate Syntax |
|
|
|
Description |
|
Tells the Corda Embedder to POST data and formatting options to Corda Server instead of using a GET request. When using the Corda Server Servlet, you must set this attribute to true. This command may also be useful when sending large data sets with the .NET version of Corda Embedder. |
|
String |
|
language |
|
Syntax |
|
myImage.language = CordaEmbedder.EN; |
|
Alternate Syntax |
|
|
|
Description |
|
Specifies language settings for the generated Corda image and descriptive text. This attribute should be set to the two-letter language code for the language type you are outputting (e.g., EN for English). For OptiMap" and PopChart®, this attribute only applies if the DLink or table template defines a separate language output for the language code you specify (see Adding Support for Additional Languages). |
|
boolean |
|
makeFullRequest This is a deprecated command that is disabled by default. Enable it in <product_root>\server\config\server_config.txt by adding the following line: server.enable.deprecated.commands=true |
|
Syntax |
|
myImage.makeFullRequest = true|false; |
|
Alternate Syntax |
|
|
|
Description |
|
Specifies whether the Corda Embedder should embed an image within a Web page using its full URL request, or just its embedder session ID. The default value is false. Set this attribute to disable the embedder session cache. For more information about this attribute, see Embedder Session Cache in the Corda 7 Install and Administration manual. |
|
int |
|
maxRequestLength |
|
Syntax |
|
myImage.maxRequestLength = int; |
|
Alternate Syntax |
|
|
|
Description |
|
Specifies the maximum length for full URL requests embedded by Corda Embedder within a Web page. If an image's full URL request is longer than this length, Corda Embedder embeds it using an embedder session ID instead of a full request. If this value is set to 0 (the default setting), there is no maximum length. Set this attribute to disable the embedder session cache. For more information about this attribute, see Embedder Session Cache in the Corda 7 Install and Administration manual. Note: This attribute has no effect unless you set makeFullRequest to true. |
|
String |
|
outputType |
|
|
Syntax |
|
myImage.outputType = {"AUTO" | "EMF" |"EPS" | "FLASH" | "JPEG" | "PDF" | "PNG" | "SVG*" | "SVGFOP" | "TABLE" | "TEXTDESC" | "TIFF" | "URL"}; |
|
|
Alternate Syntax |
|
||
|
Description |
|
Specifies the format for the generated Corda image. The value of this string should be a string containing the name of one of Corda Server's supported image formats, such as "JPEG", "FLASH", or "SVG". A complete list of these formats is found under the topic Output Types. You need to set this attribute only when requesting an image format other than the default format, which can be specified on the Server Settings > Image Type page of the Corda Server Administration console, or using the <Server.defaultOutputType> configuration setting. This format is not necessarily the same format that is returned to the client. If you have enabled best image fallback or automatic PNG detection, Corda Server might return a different format, depending on which formats a browser can display. For an explanation of the image formats that Corda Server supports, see Image Formats in the Corda Builder User Guide. This attribute supports several valid values, which are described below: |
|
|
|
|
AUTO |
If you set the image type to AUTO, Corda Server uses automatic PNG detection to determine which image type to return (PNG or JPEG). For more information, see Automatic PNG Detection in the Corda 7 Install and Administration manual. |
|
|
|
TABLE |
If you set the image type to TABLE, Corda Server returns an HTML table of the data instead of an image. This is the same HTML table as the one produced using the addHTMLTable method. |
|
|
|
TEXTDESC |
If you set the image type to TEXTDESC, Corda Server returns a text description of the data instead of an image. This is the same description as the one produced when a user clicks the d-link at the bottom right corner of an image whose returnDescriptiveLink attribute has been enabled. |
|
|
|
URL
|
Another option is to set the outputType to URL. When you do this, getEmbeddingHTML returns the URL for the image (e.g., http://server.mycompany.com:2001/@_FILEbar.itxml), but nothing else. This lets you add additional server commands (such as @_PDF) and set it as the source of an image tag or as the destination of a link, which is useful when you want better control over how an image is embedded in a Web page. For example, use it when you want a link to a PDF version of the image to appear right below the regular image in the Web page. For more information, see Server Commands. |
|
String |
|
password |
|
Syntax |
|
myImage.password = "password"; |
|
Alternate Syntax |
|
|
|
Description |
|
Specifies the Corda Server password. You must use a password when using saveToCordaServer and useLogData. |
|
String |
|
pcScript |
|
Syntax |
|
myImage.pcScript = pcscript; |
|
Alternate Syntax |
|
|
|
Description |
|
Specifies the PCScript command string. PCScript is a language used to send data and graph formatting options to Corda Server. The example below shows how to give PCScript commands with the PCScript attribute. To learn more about PCScript commands and the PCScript command string, see PCScript. Setting PCScript String pcscript = "title.setText(2001 Statistics)"; pcscript += "graph.setSeries(January; 45,11,45,16; 90,13,34,56)"; pcscript += "graph.description(Sales Stats)"; pcscript += "map.setValues(Background;WI,90;IL,21;WA,27;FL,86)"; pcscript += "map.setHover(Background;OH,Not Available;MI,Not Available)"; myImage.pcScript = pcscript; |
|
boolean |
|
returnDescriptiveLink |
|
Syntax |
|
myImage.returnDescriptiveLink = true; |
|
Alternate Syntax |
|
|
|
Description |
|
If set to true, this attribute instructs Corda Server to return a link to a text description of the Corda image in addition to the image. The text description link is a blue underlined letter d (d). It appears at the bottom-right corner of the image. When a user clicks it, the browser jumps to a separate page containing a description of the image for the visually impaired. Corda Server does not generate a descriptive text link unless you set this attribute to true. For more information about descriptive text, see Descriptive Text Settings. |
|
String |
|
svgTemplate |
|
Syntax |
|
myImage.svgTemplate = "examples\svg_templates\grow.svg"; |
|
Alternate Syntax |
|
|
|
Description |
|
Specifies the location of an SVG template that should be applied to the Corda image. By default, this location is <document_root>\examples\svg_templates. It can also be an absolute path or URL. Corda Server allows you to insert dynamically generated SVG Corda images into SVG documents. Use a tool such as Adobe* Illustrator* to create an SVG file to use as a template. Then, simply insert a <!--corda--> tag where you want Corda Server to insert the dynamically generated SVG. Several popular templates are located in <document_root>\examples\svg_templates. They include special effects like fading, rotation, and animation. For consistency, we recommend that you also put any other SVG templates in this directory. Important: Make sure that the path.xml file gives Corda Server permission to read from the location where the SVG Template is located. Otherwise, Corda Server cannot read the file. For more information, see Setting Path Permissions in the Corda 7 Install and Administration manual. |
|
boolean |
|
useCache |
|
Syntax |
|
myImage.useCache = true; |
|
Alternate Syntax |
|
|
|
Description |
|
Specifies whether or not the generated Corda image should be cached. This attribute has two effects. First, it tells the client's Web browser whether to cache the image. Second, if running Corda 7 Enterprise with caching enabled, it tells Corda Server whether to cache the image. By default, this value is set to true . For more information, see Caching in the Corda 7 Install and Administration manual. |
|
boolean |
|
useLogData |
|
Syntax |
|
myImage.useLogData = true; |
|
Alternate Syntax |
|
|
|
Description |
|
Instructs Corda Server to import its data from the Corda Server log files. This command is useful only when generating customized usage reports for Corda Server. See @_LOGGRAPH for advice on how to use the log data. |
|
String |
|
userAgent |
|
Syntax |
|
myImage.userAgent = userAgentString; |
|
Alternate Syntax |
|
|
|
Description |
|
Tells Corda Server information about the client's user agent. Set this attribute to the value of the user agent string that is passed to the Web application server—for example, "Mozilla/4.0 (compatible; MSIE 4.01; Windows* NT)" or "Mozilla/4.7 (Macintosh; I; PPC)". Each environment has its own method for looking up the user agent string. For information on setting the user agent for each of the environments Corda Server supports, see Setting the User Agent. Note: It is not necessary to set this attribute, but doing so helps Corda Server optimize its code for embedding Corda images. The example below shows how to set the user agent in Java: Specifying the User Agent in Java myImage.userAgent = request.getHeader("user-agent"); |
|
int |
|
width |
|
Syntax |
|
myImage.width = 600; |
|
Alternate Syntax |
|
|
|
Description |
|
Specifies the width of the generated Corda image. This value should be set to an integer, which represents the width (in pixels) of the generated image. This attribute sets the width of the image that is returned to the browser, but not necessarily the width at which the browser displays the image. This is because the htmlWidth attribute overrides the width attribute within the browser. For more information on how Corda Server handles the sizing of an image, see Changing Image Size. |