DLESE Tools
v1.2

org.dlese.dpc.xml
Interface XMLDocumentFormatConverter

All Known Implementing Classes:
ADNToNSDLDCFormatConverter, ADNToOAIDCFormatConverter

public interface XMLDocumentFormatConverter

Implementations of this interface are used by the XMLConversionService to convert content from one format to another. The input content may be in the form of a String or a Lucene Document or both.

Author:
John Weatherley
See Also:
XMLConversionService

Method Summary
 String convertXML(String xml, XMLDocReader docReader, ServletContext context)
          Performs XML conversion from the input format to the output format and may use content available in the given Lucene Document.
 String getFromFormat()
          The metadataPrefix of the format from which this XMLFormatConverter converts, for example "dlese_ims," "adn" or "oai_dc".
 String getToFormat()
          The metadataPrefix of the format to which this XMLFormatConverter converts, for example "dlese_ims," "adn" or "oai_dc".
 long lastModified(ServletContext context)
          Gets the time this converter code was last modified.
 

Method Detail

getFromFormat

public String getFromFormat()
The metadataPrefix of the format from which this XMLFormatConverter converts, for example "dlese_ims," "adn" or "oai_dc".

Returns:
The metadataPrefix of the format being converted.

getToFormat

public String getToFormat()
The metadataPrefix of the format to which this XMLFormatConverter converts, for example "dlese_ims," "adn" or "oai_dc".

Returns:
The metadataPrefix of the format being output.

convertXML

public String convertXML(String xml,
                         XMLDocReader docReader,
                         ServletContext context)
Performs XML conversion from the input format to the output format and may use content available in the given Lucene Document. This method should retrun null if the conversion fails for any reason.

Parameters:
xml - XML input in the 'from' format.
docReader - A lucene doc reader for this record.
context - The servlet context where this is running.
Returns:
XML in the converted 'to' format.

lastModified

public long lastModified(ServletContext context)
Gets the time this converter code was last modified. If unknown, this method should return -1.

Parameters:
context - The context in which this is running.
Returns:
The time this converter code was last modified.

DLESE Tools
v1.2