Open SiteSearch 4.1.1
Final

ORG.oclc.webz
Class ImageInfo

java.lang.Object
  |
  +--ORG.oclc.webz.ImageInfo

public class ImageInfo
extends Object

The ImageInfo class is a utility class to maintain page navigation information for retrival of binary images from a newton database. It provides methods to save and retrieve the data. It is used by the ImageFETCH Verb.


Field Summary
 int count
          integer data type containing the number of images in the record.
protected  ORG.oclc.webz.ImageEntry[] entries
          ImageEntry array of objects for a record describing the type of image, the key for database retrieval, and the item number within the record.
protected  String imageRootPath
          String data type containing the http address of the web server handling the delivery of the images.
protected  DataPairs info
          DataPairs object containing information about the record containing the image, such as dbname= and recno=.
 
Constructor Summary
ImageInfo(DataDir dir, String path, DataPairs info)
          Constructs an ImageInfo object for the input DataDir record object by creating retrieval keys to all the nodes matching the input path.
ImageInfo(DataDir dir, String path, String httpImagesRootLocation, DataPairs info)
          Constructs an ImageInfo object for the input DataDir record object by creating retrieval keys to all the nodes matching the input path.
 
Method Summary
 String cookie(int whichImage)
          Retrieves a String containing the magic-cookie string to use in the Z39.50 present request to retrieve the image.
 String dbKey(int whichImage)
          Retrieves a String containing the key for retrieving a particular image from the database.
 String dbname()
          Retrieves a String containing the database name for the image.
 String filename(int whichImage)
          Retrieves a String containing the relative filename of the image when the data is NOT stored in a newton database.
 String getGifFile(int whichImage, int scale)
          Retrieves a String containing the name of the file that contains the gif image already converted to tiff.
 DataPairs getInfo()
          Retrieves a DataPairs object containing information about the image.
 int recno()
          Retrieves an integer containing the database record number.
 void setGifFile(String filename, int whichImage, int scale)
          Sets the name of file that contains the gif image if available for the input image item number and scale.
 String thumbnailFilename(int whichImage)
          Retrieves a String containing the relative filename for the thumbnail of the image when the data is NOT stored in a newton database.
 String toString()
          Generates a String representation of the object.
 String type(int whichImage)
          Retrieves a String containing the type of image for the image entry (GIF, JPEG for example).
 void updateInfo(DataDir dir, String path, DataPairs info)
          Updates the ImageInfo object for the input DataDir record object by creating retrieval keys to all the nodes matching the input path.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

entries

protected ORG.oclc.webz.ImageEntry[] entries
ImageEntry array of objects for a record describing the type of image, the key for database retrieval, and the item number within the record.

count

public int count
integer data type containing the number of images in the record.

info

protected DataPairs info
DataPairs object containing information about the record containing the image, such as dbname= and recno=.

imageRootPath

protected String imageRootPath
String data type containing the http address of the web server handling the delivery of the images.
Constructor Detail

ImageInfo

public ImageInfo(DataDir dir,
                 String path,
                 DataPairs info)
Constructs an ImageInfo object for the input DataDir record object by creating retrieval keys to all the nodes matching the input path.
Parameters:
DataDir - the DataDir object for the database record
path - the path to the images in the record

ImageInfo

public ImageInfo(DataDir dir,
                 String path,
                 String httpImagesRootLocation,
                 DataPairs info)
Constructs an ImageInfo object for the input DataDir record object by creating retrieval keys to all the nodes matching the input path.
Parameters:
DataDir - the DataDir object for the database record
path - the path to the images in the record
httpImagesRootLocation - the root directory for the images when accessing them via http://
Method Detail

updateInfo

public void updateInfo(DataDir dir,
                       String path,
                       DataPairs info)
Updates the ImageInfo object for the input DataDir record object by creating retrieval keys to all the nodes matching the input path.
Parameters:
DataDir - the DataDir object for the database record
path - the path to the images in the record

getInfo

public DataPairs getInfo()
Retrieves a DataPairs object containing information about the image.
Returns:
DataPairs

dbname

public String dbname()
Retrieves a String containing the database name for the image.
Returns:
String

recno

public int recno()
Retrieves an integer containing the database record number.
Returns:
int

dbKey

public String dbKey(int whichImage)
Retrieves a String containing the key for retrieving a particular image from the database.
Parameters:
whichImage - the image item number from the record
Returns:
String or null indicating that the data is not stored in a newton database.

filename

public String filename(int whichImage)
Retrieves a String containing the relative filename of the image when the data is NOT stored in a newton database.
Parameters:
whichImage - the image item number from the record
Returns:
String or null indicating that the data is not stored in a newton database.

thumbnailFilename

public String thumbnailFilename(int whichImage)
Retrieves a String containing the relative filename for the thumbnail of the image when the data is NOT stored in a newton database.
Parameters:
whichImage - the image item number from the record
Returns:
String or null indicating that the data is not stored in a newton database.

type

public String type(int whichImage)
Retrieves a String containing the type of image for the image entry (GIF, JPEG for example).
Parameters:
whichImage - the image item number from the record
Returns:
String

cookie

public String cookie(int whichImage)
Retrieves a String containing the magic-cookie string to use in the Z39.50 present request to retrieve the image.
Parameters:
whichImage - the image item number from the record
Returns:
String

getGifFile

public String getGifFile(int whichImage,
                         int scale)
Retrieves a String containing the name of the file that contains the gif image already converted to tiff.
Parameters:
whichImage - the image item number from the record
scale - the scale of the converted image
Returns:
String

setGifFile

public void setGifFile(String filename,
                       int whichImage,
                       int scale)
Sets the name of file that contains the gif image if available for the input image item number and scale.
Parameters:
filename - the name of the file
whichImage - the image item number from the record
scale - the scale of the converted image

toString

public String toString()
Generates a String representation of the object.
Returns:
String
Overrides:
toString in class Object

Open SiteSearch 4.1.1
Final