|
DLESE Tools v1.2 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.dlese.dpc.index.writer.FileIndexingServiceWriter org.dlese.dpc.index.writer.XMLFileIndexingWriter org.dlese.dpc.index.writer.SimpleXMLFileIndexingWriter
Creates a Lucene Document
from any XML
file by stripping the XML tags to extract and index the content. The reader
for this type of Document is XMLDocReader.
FileIndexingService
,
XMLDocReader
Field Summary |
---|
Fields inherited from class org.dlese.dpc.index.writer.XMLFileIndexingWriter |
---|
recordDataService, vocab |
Constructor Summary | |
---|---|
SimpleXMLFileIndexingWriter(String collection,
String doctype,
RecordDataService recordDataService)
Constructor for the XMLFileIndexingWriter. |
Method Summary | |
---|---|
protected void |
addFields(Document newDoc,
Document existingDoc,
File sourceFile)
Adds the full content of the XML to the default search field. |
protected void |
destroy()
Does nothing. |
String |
getCollection()
Returns unique collection keys for the item being indexed, separated by spaces. |
String |
getDocType()
Gets the docType associated with this file. |
protected String |
getId()
Returns an ID for this record derived from the file name. |
String |
getReaderClass()
Gets the name of the concrete DocReader
class that is used to read this type of Document , which is
"org.dlese.dpc.index.reader.XMLDocReader". |
protected String |
getValidationReport()
Gets a report detailing any errors found in the validation of the data, or null if no error was found. |
void |
init(File sourceFile,
Document existingDoc)
Caputres the sourc file. |
Methods inherited from class org.dlese.dpc.index.writer.XMLFileIndexingWriter |
---|
addCustomFields, getFieldContent, getFieldContent, getFieldName, getOaiModtime |
Methods inherited from class org.dlese.dpc.index.writer.FileIndexingServiceWriter |
---|
abortIndexing, addToAdminDefaultField, addToDefaultField, create, getDeletedDoc, getExistingDoc, getFileIndexingService, getSourceDir, getSourceFile, isValidationEnabled, prtln, prtlnErr, setDebug, setDefaultFieldName, setFileIndexingService, setValidationEnabled |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public SimpleXMLFileIndexingWriter(String collection, String doctype, RecordDataService recordDataService)
collection
- The collection associated with this file.doctype
- A document type for this type of file, such as
'oai_dc' or 'adn.'recordDataService
- Used to get data about the file.Method Detail |
public String getDocType() throws Exception
getDocType
in interface DocWriter
getDocType
in class FileIndexingServiceWriter
Exception
- DESCRIPTIONpublic String getCollection()
XMLFileIndexingWriter
getCollection
in class XMLFileIndexingWriter
public String getReaderClass()
DocReader
class that is used to read this type of Document
, which is
"org.dlese.dpc.index.reader.XMLDocReader".
getReaderClass
in interface DocWriter
getReaderClass
in class FileIndexingServiceWriter
public void init(File sourceFile, Document existingDoc) throws Exception
init
in class FileIndexingServiceWriter
sourceFile
- The sourceFile being indexed.existingDoc
- An existing Document that exists for this in the
index.
Exception
- DESCRIPTIONprotected void destroy()
destroy
in class FileIndexingServiceWriter
protected String getValidationReport() throws Exception
getValidationReport
in class FileIndexingServiceWriter
Exception
- If error in performing the validation.protected String getId() throws Exception
getId
in class XMLFileIndexingWriter
Exception
- If error.protected void addFields(Document newDoc, Document existingDoc, File sourceFile) throws Exception
addFields
in class XMLFileIndexingWriter
newDoc
- The new Document
that is being created for this resourceexistingDoc
- An existing Document
that currently resides in the
index for the given resource, or null if none was previously presentsourceFile
- The feature to be added to the CustomFields attribute
Exception
- This method should throw and Exception with
appropriate error message if an error occurs.
|
DLESE Tools v1.2 |
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |