DLESE Tools
v1.6.0

org.dlese.dpc.xml
Class ADNToNSDLDCFormatConverter

java.lang.Object
  extended by org.dlese.dpc.xml.ADNToNSDLDCFormatConverter
All Implemented Interfaces:
XMLDocumentFormatConverter

public class ADNToNSDLDCFormatConverter
extends Object
implements XMLDocumentFormatConverter

Converts from ADN format to the NSDL DC format. Converts DLESE-specific IDs to URLs.

Author:
John Weatherley
See Also:
XMLConversionService

Constructor Summary
ADNToNSDLDCFormatConverter()
           
 
Method Summary
 String convertXML(String xml, XMLDocReader docReader, ServletContext context)
          Performs XML conversion from ADN to nsdl_dc format.
 String getFromFormat()
          Converts from the ADN format.
 String getToFormat()
          Converts to the nsdl_dc format.
 long lastModified(ServletContext context)
          Gets the time this converter code was last modified.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ADNToNSDLDCFormatConverter

public ADNToNSDLDCFormatConverter()
Method Detail

getFromFormat

public String getFromFormat()
Converts from the ADN format.

Specified by:
getFromFormat in interface XMLDocumentFormatConverter
Returns:
The String "adn".

getToFormat

public String getToFormat()
Converts to the nsdl_dc format.

Specified by:
getToFormat in interface XMLDocumentFormatConverter
Returns:
The String "nsdl_dc".

lastModified

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

Specified by:
lastModified in interface XMLDocumentFormatConverter
Parameters:
context - The context in which this is running.
Returns:
The time this converter code was last modified.

convertXML

public String convertXML(String xml,
                         XMLDocReader docReader,
                         ServletContext context)
Performs XML conversion from ADN to nsdl_dc format. Characters are encoded as UTF-8.

Specified by:
convertXML in interface XMLDocumentFormatConverter
Parameters:
xml - XML input in the 'adn' format.
context - The context in which this is running.
docReader - Lucene DocReader for the item.
Returns:
XML in the converted 'nsdl_dc' format.

DLESE Tools
v1.6.0