|
DLESE Tools v1.2 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.dlese.dpc.index.reader.DocReader
org.dlese.dpc.index.reader.FileIndexingServiceDocReader
org.dlese.dpc.index.reader.XMLDocReader
Provides getter methods to read data from an XML-based Lucene Document that was created by a XMLFileIndexingWriter. The getter methods can then be
accessed from (Struts) beans that need the data. This class may be extended for each
document type that might be returned in a search. For example: DLESE-IMS, ADN-i, ADN-c
or DC. Instances of this class and sublcasses are created by ResultDoc. After implemeting a new XMLDocReader, a new switch to
access it should be added to class ResultDoc. In general,
one XMLDocReader may be created for each document type that is defined in package
org.dlese.dpc.index.writer.
XMLFileIndexingWriter,
Serialized Form| Field Summary | |
|---|---|
protected RecordDataService |
recordDataService
DESCRIPTION |
protected MetadataVocab |
vocab
DESCRIPTION |
| Fields inherited from class org.dlese.dpc.index.reader.DocReader |
|---|
conf, doc, score |
| Constructor Summary | |
|---|---|
XMLDocReader(Document doc)
Constructor that may be used programatically to wrap a reader around a Lucene Document created by a FileIndexingServiceWriter. |
|
XMLDocReader(Document doc,
float score,
ResultDocConfig conf)
Constructor that is used by ResultDoc at search time to
create a new instance. |
|
| Method Summary | |
|---|---|
ArrayList |
getAvailableFormats()
Gets the XML formats that are available for this item. |
String |
getCollectionKey()
Gets the collection key associated with this record, for example 01. |
String[] |
getCollectionKeys()
Gets the collection keys associated with this record, for example {01,02}. |
String[] |
getCollections()
Gets the sets associated with this record as an array of Strings, for example dcc. |
String |
getDocsource()
Gets the absolute path of the file that was used to index the Document. |
protected String |
getFieldName(String fieldString)
Gets the fieldName attribute of the XMLDocReader object |
String |
getId()
Gets the id attribute of the object |
String |
getIndexedContent()
Gets the full text of the content that was indexed. |
String |
getMetadataPrefix()
Gets the metadata previx (format) of the file associated with this reader, for example 'dlese_ims' or 'adn'. |
String |
getNativeFormat()
Gets the nativeFormat of the file associated with this reader, for example 'dlese_ims' or 'adn'. |
String |
getOaiDatestamp()
Gets the oaiDatestamp in UTC format for the given record. |
String |
getOaiLastModifiedString()
Gets a String representataion of the oai datestamp in readable format. |
String |
getReaderType()
Gets the String 'XmlDocReader,' which is the key that describes this reader type. |
String[] |
getSets()
Gets the sets associated with this record as an array of Strings, for example dcc. |
String |
getSetString()
Gets the collections associated with this record as a single String. |
String |
getValidationReport()
Gets the validationReport for this document, or null if no validationReport was found. |
String |
getXml()
Gets XML in the format native to the underlying docType. |
String |
getXmlFormat(String format,
boolean filter)
Gets XML in the given format. |
String |
getXmlStripped()
Gets XML with no XML or DTD declaration in the format native to the underlying docType. |
boolean |
isValid()
Determines whether the XML for this record is valid. |
static void |
setXMLConversionService(XMLConversionService cs)
Sets the XMLConversionService used by this DocReader. |
| Methods inherited from class org.dlese.dpc.index.reader.FileIndexingServiceDocReader |
|---|
fileExists, getDateStamp, getDeleted, getDocDir, getDocsourceEncoded, getDoctype, getFileExists, getFileName, getFullContent, getLastModified, getLastModifiedString, getSourceFile, isDeleted, prtln, prtlnErr, setDebug |
| Methods inherited from class org.dlese.dpc.index.reader.DocReader |
|---|
getDocument, getIndex, getQuery, getScore, setDoc |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected MetadataVocab vocab
protected RecordDataService recordDataService
| Constructor Detail |
public XMLDocReader(Document doc,
float score,
ResultDocConfig conf)
ResultDoc at search time to
create a new instance.
doc - The Lucene Document that is read.score - The rank of the Document in a set of results.conf - Config object.public XMLDocReader(Document doc)
Document created by a FileIndexingServiceWriter.
doc - A Lucene Document created by a ItemFileIndexingWriter.| Method Detail |
public String getReaderType()
getReaderType in class DocReaderpublic String getIndexedContent()
public String getId()
public String getMetadataPrefix()
public String getNativeFormat()
getMetadataPrefix().
public String getSetString()
public String[] getSets()
public String[] getCollections()
public String getCollectionKey()
public String[] getCollectionKeys()
public final String getXml()
public final String getXmlStripped()
public String getXmlFormat(String format,
boolean filter)
filter is set to true then
the output will have the XML declaration stripped out and the DTD declaration will be
commented out, in the case of DLESE IMS. Use filter=true to get XML
suitable for insertion into an OAI container. Use filter=true to get the
full XML including XML and DTD declaration, if present.
format - The format desired.filter - Indicates whether to filter out the XML and DTD declaration.
public ArrayList getAvailableFormats()
public String getOaiDatestamp()
public String getOaiLastModifiedString()
public static void setXMLConversionService(XMLConversionService cs)
cs - The new XMLConversionService.public String getValidationReport()
isValid()public String getDocsource()
FileIndexingServiceDocReaderDocument.
getDocsource in class FileIndexingServiceDocReaderpublic boolean isValid()
getValidationReport()protected String getFieldName(String fieldString)
fieldString - DESCRIPTION
|
DLESE Tools v1.2 |
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||