Corda Server™ can embed Corda® images into a Web page using HTML—a technology so simple that pretty much any graphical Web browser can display Corda images. No special plug-ins or applets are required.
The sample code below demonstrates how to embed a Corda image with HTML.
HTML Code for Embedding a Corda image
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,0,0" border="0" width="600" height="400" >
<param name="MOVIE" value="http://<server_address>:2001/?@_FILEexamples/bar.itxml@_HEIGHT400@_WIDTH600@_PCSCRIPTtitle.setText(Hello%20World)@_FLASH">
<img width="600" height="400" src="http://<server_address>:2001/?@_FILEexamples/bar.itxml@_HEIGHT400@_WIDTH600@_PCSCRIPTtitle.setText(Hello%20World)@_JPEG">
</object>
Writing and maintaining HTML-based code for generating Corda images can be very tedious and confusing. Fortunately, Corda Embedder can generate this code for you. To do so, create a Corda Embedder object, set a few attributes, and then call the getEmbeddingHTML method. The getEmbeddingHTML method then "compiles" the Corda image and returns the code necessary to request the image from Corda Server.
Corda Embedder is available in the following formats: Java*, PHP, PERL, and .NET. It can be used in a variety of environments, including Java Server Pages, Active Server Pages, PHP, Java Servlets, and ColdFusion*.
By providing a native interface for embedding Corda images, Corda Embedder helps separate content from presentation. Corda Embedder generates the HTML code, and provides additional flexibility, such as importing from a database and adding HTML Tables.
The example below illustrates how Corda Server typically works with a Web application server and database to produce a Corda image and return it to a Web client.
This process can be broken down into the following steps:
A client (Web browser) requests a Web page containing graphs or maps from a Web application.
The Web application can run on the same machine as the Corda Server, or on a different machine.
The Web application fetches data for the graph or map from a data source.
Alternatively, the Corda Embedder or Corda Server can request the data.
Using the Corda Embedder, the Web application sends instructions (such as the location of the Image Template file) and data to Corda Server. Corda Server stores the data and instructions. It returns to the Corda Embedder any HTML necessary to embed the requested graph or map within a Web page.
This HTML consists of an <object>, <embed>, or <img> tag whose URL source instructs the Web browser to get an image from Corda Server. This URL contains a "key" in its query string that references the information Corda Server has stored.
The Web Application Server builds an HTML page that integrates the HTML returned to the Corda Embedder to embed the graph or map. It then serves this page to the client.
Seeing the appropriate tag in the HTML page, the Web browser requests a graph or map image from Corda Server.
Corda Server uses the reference (key) from the Web browser's request to look up the stored data and instructions. It then fetches the appropriate Image Template file and merges the data into this Image Template file to create a Corda image.
Image Template files can be created by designers using Corda Builder™. They can then be uploaded to Corda Server, or stored on another machine from which Corda Server can read. Or, the Image Template file can be generated dynamically by another Web application.
This image is returned to the Web browser, which then displays the graph or map in the Web page it originally requested.