MediaRich® provides APIs that enable integration within heterogeneous production environments:
These APIs include clients that communicate with the MediaRich server to generate and return cached or streamed data. These entry points expose similar functionality while extending the flexibility of the MediaRich Server.
URL Based
MediaRich uses a fully-qualified URL, known as a MediaRich Locator (MRL). The MRL refers to a MediaRich server, a MediaScript file, and the function and parameters that will be used to create a dynamic image. The MRL is read by either an ISAPI Filter or an Apache Mod, based on the operating system being used.
In HTML web pages, the <img> tag is used to insert a graphic or photographic image directly into the flow of text and other images. The src attribute of the <img> tag is the URL of the location of the image file. Traditionally, the URL includes the file name and can include a relative or absolute path. With MediaRich, the static URL is replaced with a dynamic MRL.
Although the two images below look identical, the first is defined by a URL, while the second is defined by an MRL.

This image uses a URL, http://mgen2.equilibrium.com/mgen/demos/website/colorize/blackshoes.jpg, to refer to a single static image. If you wanted to display this shoe in a different color, you would need to create an entirely new image and a new URL referring to that static image.

This image uses an MRL, http://mgen2.equilibrium.com/mgen/demos/website/colorize/color.ms?img=shoes.psd&width=100&height=100&color=0x252525.
The MRL lists all the elements required to generate the image, including the MediaScript (color.ms) and MediaRich server (mgen2.equilibrium.com).
Parameters are appended to the MRL in the form of a query string. The query string is delimited using a question mark (?). Each parameter in the query is delimited by an ampersand (&) and is written in the form of name=value. The MRL above includes parameters for the source image filename, output height and width, and color.
To see how this works, visit our interactive demonstrations.
Using ASP or JSP (for example) you can programmatically generate MRLs based on information in a content management system or database. When that information changes, a new MRL is created, and thus a new image is generated.
.NET Web Service
The MediaRich server can be integrated into any stand-alone or web application through the MediaRich Web Service. Examples of languages that support a Web Service include VB.NET, C#, and managed C++.
The MediaRich .NET Web Service includes a MediaGenWebService client that contains methods used to create and execute requests.
This allows a request to be formed and forwarded to the MediaRich server via a Web Method providing the framework for building transaction-based services for various media types. In addition, it enables data interaction and the ability for data to be pulled from heterogeneous production environments.
.NET and Java APIs
The MediaRich .NET and Java APIs provides classes and methods for communicating with MediaRich from within a .NET or Java application. Clients can specify a MediaScript the server is to execute, pass arguments to the MediaScript, include file contents to be processed by the script, and read the response from the MediaGenerator.
The MediaRich .NET and Java APIs also fully supports batch processing of images through the MediaGenerator. With the batch processing API, clients can specify any number of associated batch jobs, synchronize the jobs, and determine the status of the jobs.
Additionally, the MediaRich .NET and Java APIs provides a mechanism for managing connections to multiple MediaGenerators. This connection manager distributes the generation load across the specified MediaGenerators and provides for automatic fail-over if a MediaGenerator becomes available.
COM API
The host application can use the MediaRich COM interface to make a request for an image. The request consists of the name of the MediaScript and parameters. When the request is made MediaRich will either stream the image back to the application or create the image and return a filepath or a URL to the resulting image.
The MediaRich server can be integrated into any stand-alone or web application through this MediaRich COM client. Examples of languages that support a COM binding include JavaScript, VB, VBScript, C, C#, and Perl.
The MediaRich COM API includes a MediaGenClient that contains methods and properties used to create and execute requests.
|