This document describes the Web API of the Content Server. Since the Content
Server runs as an extension of a supported Web Server, this API is expressed
as URLs conforming to the CGI convention - that is,
This will extract a portion of the specified image which exactly
corresponds to the region between the center of the image and the lower
right corner, at a resolution which most closely fits a 200x300 pixel area.
Description
The getimage function locates the image specified by the cat
and img parameters. It extracts a portion of the image, specified
by the rgn parameter, at a resolution which closely fits
the target dimensions as specified by the parameters width and height.
The resultant pixel data is returned in the output format specified by
the oif parameter.
Arguments
cat
This is the catalog of which the image is a member.
img [optional]
This identifies the image within the catalog. Most often it will be a "/"
delimited hierarchical path to the image.
If img is not specified, getimage will return the default
image for the catalog, which is chosen from among the images in the root
folder. If the root folder contains no images, a 404 (HTTP status: Not
Found) will be returned.
oif [optional, default=jpeg]
This is the output-format: May be one of jpeg, tiff, bmp, wbmp,
or
mrsid.
rgn [optional,default=0,0,1,1]
region (in resolution independant coordinates)
format:
comma separated list of numbers
first two specify upper-left point of the region
last two specify the lower-left point of the region
e.g. rgn=0,0,1,1 specifies the entire image
e.g. rgn=0,0,1,.5 specifies the upper half of the image
e.g. rgn=.25,.25,.75,.75 specifies the middle 50% of the image
georgn [optional][3.1]
specifies the region to extract in terms of geospacial coordinates
this may be used instead of rgn. If both are present, then georgn
is used.
format: same as rgn
width [optional, default=300]
target width (in pixels)
height [optional, default=300]
target height (in pixels)
cs [optional] [*3.1]
specifies colorspace of output image
may be one of the following
rgb - this is the default for all non-grayscale source images
gs - default for grayscale images
srcdrwin [optional] [*3.1]
specifies dynamic range window
acceptible values are positive integers between 2 and the full dynamic
range extent of the source image (which is 256 for 8 bit images, 4096 for
11 bit images)
this parameter is used in conjunction with srcdrlev to adjust the
dynamic range of the output image
srcdrlev [optional] [*3.1]
specifies dynamic range level (i.e. center)
acceptible values are positive integers between 2 and the full dynamic
range extent of the source image (which is 256 for 8 bit images, 4096 for
11 bit images)
his parameter is used in conjunction with srcdrwin to adjust the
dynamic range of the output image
transpose [optional][*3.1]
specifies transposition of image in degrees
may be one of
0 [no transposition]
90 [transpose 90 degrees]
180 [transpose 180 degrees]
270 [transpose 270 degrees]
txn [optional]
This is an image format specific sequence of bytes which identify certain
data within the image.
Given the current region of an image and the width and height in which
is is displayed, this function will interpret a command (zoomin, zoomout,
or pan), and an offset, and will calculate the next region.
Arguments
cat
This is the catalog of which the image is a member.
img
This identifies the image within the catalog. Most often it will be a "/"
delimited hierarchical path to the image.
rgn [optional,default=0,0,1,1]
The current region (in resolution independant coordinates). This follows
the same conventions as are described in the getImage command
georgn [optional][3.1]
The current region (in geospacial coordinates)
This follows the same conventions as are described in the getImage command
cmd [optional,default=pan]
The action to perform. May be one of the following
zoomin
zoomout
pan
x and y [optional, default x=wid/2, default y=hei/2]
These represent an offset, in pixels, from the upper left hand corner
of the portion of the image specified by rgn and width and
height.
The cmd parameter is interpreted relative to this offset.
width
width (in pixels) of area in which the region is to be placed
height
height (in pixels)o f area in which the region is to be placed
props [optional]
Same as for browse command
Response
The response is an XML document conforoming to the Content
Server API DTD, or an HTTP error.
Notes on usage
Use this command in conjunction with getimage and an to allow clients
to zoom in and zoom out of images within a browser, requiring no plugin.
returns a thumbnail for the specified image which is generated according
to the rules defined in the thumbspec "medium"
Description
Returns a jpeg thumbnail of image specified by the cat and img
parameters, generated according the the rules defined in the thumbnail
specification specified by the thumbspec parameter.
Arguments
cat
catalog
img [optional]
image identifier
If img is not specified, getimage will return the default
thumbnail for the catalog, which is generated from among the images in
the root folder. If the root folder contains no images, a 404 (HTTP status:
Not Found) will be returned.
thumbspec [optional, default="default"]
specifies which thumbnail specification to use
Thumbnails specifications are defined in the catalog configuration file.
They define the rules for generating a thumbnail (e.g. width, height )
transpose [optional][*3.1]
specifies transposition of thumbnail in degrees
functions same as for getimage command
Response
Returns the specified thumbnail image, or an HTTP error
(a) the catalogs on the content server
(b) the contents of a catalog
(c) the contents of a folder within a catalog
(d) detailed information about an item (i.e. image
or document) on the content server
The response list is generated according to the following rules
If catalog is not specified, then (a) is returned
If a catalog is specified, and a folder is not specified, then (b) is returned.
If a catalog and a folder are both specified, then (c) is returned.
If an image or document is specified, then (d) is returned
The description is returned as an XML document/stream conforming to the
Content
Server API DTD..
Arguments
cat [optional]
the catalog to browse
folder [optional]
the folder to browse
img [optional]
the image to browse
if this parameter is present, then an image node, corresponding to the
value of this parameter, will be returned in the XML response
style [optional, default="default.xsl"]
specifies an XSL style sheet, stored in the server "styles" directory,
which can be used to transform the output into HTML.
An XML processing instruction will be inserted into the response which
specifies the URL of the stylesheet to use when displaying this document.
For example
<?xml-stylesheet type="text/xsl"
href="getstyle?style=default"?>
However, if the value of this parameter is set to "none" (i.e. "style=none"),
then no XML processing instruction will be issued
props [optional]
list of properties to show for catalogs and items(i.e. images and documents)
returned as a result of the query.
Specified thus: props=item(<prop-name>,<prop-name>,.),cat(<prop-name>,<prop-name>,.)
according to these rules:
catalog prop names correspond to the properties defined by the Administrator
in cat-cfg.xml
item prop names correspond to image and document properties. Which properties
are available depends on the catalog back-end used (i.e. the catalog provider).
the item property "text" denotes the first 100 words of text found in a
DjVu document
This will perform a search in catalogs MyImages and YourImages for all
documents and images containing the words Clinton, Hillary, and Chelsea)
Description
Returns list of images and documents which match the specified criteria
The results are returned as an XML document/stream conforming to the Content
Server API DTD.
Arguments
cat
A catalog in which to search.
There may be 1 or more "cat" parameters in the URL (e.g. cat=MyCat&cat=YourCat
) which specify the catalogs to perform the search in.
criteria
The criteria to use for the search.
Acceptible values
contains
The contains criteria specifies a list of words. All documents and images
whcih contain these words are returned.
The words are expressed as a "," or "+" delimited list of words within
parentheses - thus
contains(word1, word2,...)
contains(word1+word2...)
style [optional]
same as for browse command, except that if not present then the
style "default.xsl" is assumed.
props [optional]
same as for browse command
lang [optional]
same as for browse command
Response
The response to the "search" command is an XML document conforming
to the Content Server API DTD, or an HTTP
error.
2.3 Administrative
Administrative commands are defined in another
document TBD.
2.4 Other
2.4.1 getStyle
Examples
getstyle?style=dumbek.xsl
will return the stylesheet entitled "dumbek.xsl" stored on the Image Server
in the <server-root>/docs/styles/ directory.
getstyle?style=French
will return the stylesheet entitled "default.xsl" stored on the Image Server
in the <server-root>/docs/styles/French/ directory.
Description
returns named style sheet stored in the server's "styles" directory, preceeded
by the appropriate HTTP headers
This function is used by the StyleServer to retrieve the appropriate style
sheet with which it can format its output.
Parameters
style
If the value of this parameter ends in ".xsl", then this parameter is interpreted
as a path to a stylesheet stored on the server (relative to the styles
directory). If the stylesheet exists, then the server returns it in its
response.
If the value does not end in ".xsl", then this parameter is interpreted
as a path to a folder in the styles directory on the server. The server
looks in the folder for a stylesheet called "default.xsl" and returns this
document in its response.
Response
Returns the specified XSL style sheet, or an HTTP error if not found.
2.4.2 getWatermark
Examples
getwatermark?cat=MyImages
will return the watermark image for the catalog MyImages
Description
Returns the watermark image associated with a catalog via the cat-cfg.xml
file. If the catalog has no watermark, then an HTTP error is returned.
Parameters
cat
The catalog whose watermark is desired.
Response
Retutns the specified watermark image, or an HTTP error if none exists.