|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectfr.gouv.culture.sdx.utils.AbstractSdxObject
fr.gouv.culture.sdx.document.AbstractDocument
fr.gouv.culture.sdx.document.AbstractIndexableDocument
An abstract class for indexable documents. TODO: THIS SHOULD BE BETTER, IN MORE DETAILS OF THE BASIC INDEXATION ELEMENT CREATION, should refer to some schema and it works from the permuatations of the schema.
| Nested Class Summary | |
class |
AbstractIndexableDocument.StoreHandler
|
| Nested classes inherited from class fr.gouv.culture.sdx.utils.SdxObject |
SdxObject.ConfigurationNode |
| Field Summary | |
protected float |
_boost
|
protected float |
_currentFieldBoost
|
protected org.xml.sax.ContentHandler |
_msgHandler
|
protected java.util.HashMap |
_xmlFieldList
list of fields with a a XML type |
protected java.io.ByteArrayOutputStream |
_xmlFieldOutput
The output of the parsed xml field |
protected javax.xml.transform.sax.TransformerHandler |
_xmlFieldTransformer
The transfomer used to parse the xml fields |
protected java.util.Vector |
attachedDocuments
A list of attached documents |
protected java.lang.StringBuffer |
characterBuffer
A character buffer for element content. |
protected org.xml.sax.ContentHandler |
contentHandler
The ContentHandler receiving SAX events. |
protected java.lang.String |
currentFieldName
The current field name |
protected java.lang.String |
DOC_ATTACHEDOC_ELEMENT_NAME
|
protected java.lang.String |
DOC_FIELD_ELEMENT_NAME
|
protected java.lang.String |
DOC_MSG_ELEMENT_NAME
|
protected java.lang.String |
DOC_NAMESPACE
|
protected java.lang.String |
DOC_ROOT_ELEMENT_NAME
|
protected org.xml.sax.ext.LexicalHandler |
lexicalHandler
The LexicalHandler receiving SAX events. |
protected org.apache.avalon.framework.parameters.Parameters |
nsTable
|
protected int |
openSdxDocElems
|
protected java.util.Vector |
properties
List of fields for indexing. |
protected AbstractIndexableDocument.StoreHandler |
storeHandler
|
protected IndexableDocument |
subDoc
|
protected java.io.ByteArrayOutputStream |
subDocBytes
|
protected java.util.Vector |
subDocuments
A list of sub(Indexable) documents |
protected IndexableDocument |
transformedDoc
A document resulting from a transformation |
protected boolean |
withinSdxElement
|
protected boolean |
withinXmlField
|
protected org.apache.cocoon.xml.XMLConsumer |
xmlConsumer
The XMLConsumer receiving SAX events. |
| Fields inherited from class fr.gouv.culture.sdx.document.AbstractDocument |
idGenerator, idPrefix, idSuffix, mimeType, storeRepo |
| Fields inherited from class fr.gouv.culture.sdx.utils.AbstractSdxObject |
_configuration, _context, _description, _encoding, _id, _locale, _logger, _manager, _xmlizable_objects, _xmlLang, isToSaxInitialized |
| Fields inherited from interface fr.gouv.culture.sdx.document.Document |
CLASS_NAME_SUFFIX, DOCTYPE_BINARY, DOCTYPE_GROUP, DOCTYPE_HTML, DOCTYPE_USER, DOCTYPE_XML |
| Fields inherited from interface fr.gouv.culture.sdx.utils.Encodable |
DEFAULT_ENCODING |
| Constructor Summary | |
AbstractIndexableDocument()
|
|
| Method Summary | |
void |
addAttachedDocument(java.lang.String id,
java.net.URL baseURL,
java.lang.String url,
java.lang.String mimetype,
java.lang.String repoId)
Add an attached document to the list for this document. |
void |
characters(char[] ch,
int start,
int length)
|
void |
comment(char[] chars,
int i,
int i1)
Currently has no function |
void |
endCDATA()
Currently has no function |
void |
endDocument()
Currently has no function |
void |
endDTD()
Currently has no function |
void |
endElement(java.lang.String nsURI,
java.lang.String name,
java.lang.String qName)
|
void |
endEntity(java.lang.String s)
Currently has no function |
void |
endPrefixMapping(java.lang.String s)
Currently has no function |
protected java.lang.String |
generateId()
|
java.util.Enumeration |
getAttachedDocuments()
Retrieves an Enumeration of attached documents |
float |
getBoost()
Gets a boost factor for scoring (currently Lucene specific) |
java.util.Enumeration |
getFieldValues()
Returns field values. |
AbstractIndexableDocument.StoreHandler |
getStoreHandler()
|
java.util.Enumeration |
getSubDocuments()
Retrieves an Enumeration of sub(Indexable) documents |
IndexableDocument |
getTransformedDocument()
Returns the transformed document object or null if no transformed document
during the indexation pipeline |
protected void |
handleDocumentId(org.xml.sax.Attributes atts)
|
void |
ignorableWhitespace(char[] chars,
int i,
int i1)
Currently has no function |
void |
processingInstruction(java.lang.String s,
java.lang.String s1)
Currently has no function |
void |
resetAttachedDocuments()
Reinits the Vector of attached documents |
protected void |
resetFields()
Resets the objects we need to store indexation data or creates them if they do not exist |
void |
setAttachedDocuments(java.util.Vector list)
Set's the list of attached documents for this document. |
void |
setBoost(float boost)
Sets a boost factor for scoring (currently Lucene specific) |
void |
setConsumer(org.apache.cocoon.xml.XMLConsumer consumer)
Set the XMLConsumer that will receive XML data.
|
void |
setContentHandler(org.xml.sax.ContentHandler handler)
Set the ContentHandler that will receive XML data.
|
void |
setDocumentLocator(org.xml.sax.Locator locator)
Currently has no function |
void |
setLexicalHandler(org.xml.sax.ext.LexicalHandler handler)
Set the LexicalHandler that will receive XML data.
|
void |
setMessageHandler(org.xml.sax.ContentHandler handler)
|
void |
setUpdateAttachedDocuments(boolean updateAttachedDocuments)
Indicates wheter the list of attached documents must be refreshed. |
protected void |
setUpTransformedDocument()
|
void |
setXMLFieldList(java.util.HashMap fieldList)
Sets the XMLFieldList of the DocumentBase where the document is stored. |
void |
setXMLTransformerHandler(javax.xml.transform.sax.TransformerHandler xmlFieldTransformer)
Sets the XMLTransformer used to parse the xml fields |
void |
skippedEntity(java.lang.String s)
Currently has no function |
void |
startCDATA()
Currently has no function |
void |
startDocument()
Currently has no function |
void |
startDTD(java.lang.String s,
java.lang.String s1,
java.lang.String s2)
Currently has no function |
void |
startElement(java.lang.String nsURI,
java.lang.String name,
java.lang.String qName,
org.xml.sax.Attributes atts)
|
void |
startEntity(java.lang.String s)
Currently has no function |
void |
startPrefixMapping(java.lang.String s,
java.lang.String s1)
Currently has no function |
boolean |
updateAttachedDocuments()
Indicates wheter the documents must be refreshed. |
| Methods inherited from class fr.gouv.culture.sdx.document.AbstractDocument |
getClassNameSuffix, getInputSource, getLength, getMimeType, getPreferredFilename, getRepositoryForStorage, getURL, initToSax, initVolatileObjectsToSax, openStream, save, setContent, setContent, setContent, setContent, setIdGenerator, setIdGenerator, setMimeType, setPreferredFilename, setPreferredFilename, setRepositoryForStorage, setURL |
| Methods inherited from class fr.gouv.culture.sdx.utils.AbstractSdxObject |
configure, configureDescription, contextualize, enableLogging, getBaseAttributes, getConfiguration, getContext, getDescription, getEncoding, getId, getLocale, getLog, getServiceManager, getXmlLang, service, setDescription, setEncoding, setId, setLocale, setUpSdxObject, setUpSdxObject, setXmlLang, toSAX, verifyConfigurationResources |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface fr.gouv.culture.sdx.document.IndexableDocument |
addAdditionalSystemFields, setTransformedDocument, setTransformedDocument, startIndexing |
| Methods inherited from interface fr.gouv.culture.sdx.document.Document |
getDocType, getLength, getMimeType, getPreferredFilename, getRepositoryForStorage, getURL, openStream, save, setContent, setContent, setContent, setContent, setId, setIdGenerator, setIdGenerator, setMimeType, setPreferredFilename, setRepositoryForStorage, setURL |
| Methods inherited from interface fr.gouv.culture.sdx.utils.SdxObject |
getLog |
| Methods inherited from interface org.apache.avalon.framework.logger.LogEnabled |
enableLogging |
| Methods inherited from interface org.apache.avalon.framework.context.Contextualizable |
contextualize |
| Methods inherited from interface org.apache.avalon.framework.service.Serviceable |
service |
| Methods inherited from interface org.apache.avalon.framework.configuration.Configurable |
configure |
| Methods inherited from interface fr.gouv.culture.sdx.utils.Identifiable |
getId |
| Methods inherited from interface fr.gouv.culture.sdx.utils.Describable |
getDescription, setDescription |
| Methods inherited from interface fr.gouv.culture.sdx.utils.Encodable |
getEncoding, setEncoding |
| Methods inherited from interface fr.gouv.culture.sdx.utils.Localizable |
getLocale, getXmlLang, setLocale, setXmlLang |
| Methods inherited from interface org.apache.excalibur.xml.sax.XMLizable |
toSAX |
| Field Detail |
protected java.lang.String DOC_NAMESPACE
protected java.lang.String DOC_ROOT_ELEMENT_NAME
protected java.lang.String DOC_FIELD_ELEMENT_NAME
protected java.lang.String DOC_ATTACHEDOC_ELEMENT_NAME
protected java.lang.String DOC_MSG_ELEMENT_NAME
protected org.apache.avalon.framework.parameters.Parameters nsTable
protected java.util.Vector properties
protected java.lang.StringBuffer characterBuffer
protected java.lang.String currentFieldName
protected int openSdxDocElems
protected java.util.Vector attachedDocuments
protected java.util.Vector subDocuments
protected IndexableDocument transformedDoc
protected IndexableDocument subDoc
protected java.io.ByteArrayOutputStream subDocBytes
protected boolean withinSdxElement
protected boolean withinXmlField
protected org.xml.sax.ContentHandler _msgHandler
protected float _boost
org.apache.lucene.document.Document#boostprotected float _currentFieldBoost
protected java.util.HashMap _xmlFieldList
protected javax.xml.transform.sax.TransformerHandler _xmlFieldTransformer
protected java.io.ByteArrayOutputStream _xmlFieldOutput
protected org.apache.cocoon.xml.XMLConsumer xmlConsumer
XMLConsumer receiving SAX events.
protected org.xml.sax.ContentHandler contentHandler
ContentHandler receiving SAX events.
protected org.xml.sax.ext.LexicalHandler lexicalHandler
LexicalHandler receiving SAX events.
protected AbstractIndexableDocument.StoreHandler storeHandler
| Constructor Detail |
public AbstractIndexableDocument()
| Method Detail |
public void startElement(java.lang.String nsURI,
java.lang.String name,
java.lang.String qName,
org.xml.sax.Attributes atts)
throws org.xml.sax.SAXException
startElement in interface org.xml.sax.ContentHandlerorg.xml.sax.SAXException
protected void handleDocumentId(org.xml.sax.Attributes atts)
throws SDXException
SDXException
protected java.lang.String generateId()
throws SDXException
SDXException
public void characters(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException
characters in interface org.xml.sax.ContentHandlerorg.xml.sax.SAXException
public void comment(char[] chars,
int i,
int i1)
throws org.xml.sax.SAXException
comment in interface org.xml.sax.ext.LexicalHandlerorg.xml.sax.SAXException
public void endCDATA()
throws org.xml.sax.SAXException
endCDATA in interface org.xml.sax.ext.LexicalHandlerorg.xml.sax.SAXException
public void endDTD()
throws org.xml.sax.SAXException
endDTD in interface org.xml.sax.ext.LexicalHandlerorg.xml.sax.SAXException
public void endDocument()
throws org.xml.sax.SAXException
endDocument in interface org.xml.sax.ContentHandlerorg.xml.sax.SAXException
public void endEntity(java.lang.String s)
throws org.xml.sax.SAXException
endEntity in interface org.xml.sax.ext.LexicalHandlerorg.xml.sax.SAXException
public void endPrefixMapping(java.lang.String s)
throws org.xml.sax.SAXException
endPrefixMapping in interface org.xml.sax.ContentHandlerorg.xml.sax.SAXException
public void ignorableWhitespace(char[] chars,
int i,
int i1)
throws org.xml.sax.SAXException
ignorableWhitespace in interface org.xml.sax.ContentHandlerorg.xml.sax.SAXException
public void processingInstruction(java.lang.String s,
java.lang.String s1)
throws org.xml.sax.SAXException
processingInstruction in interface org.xml.sax.ContentHandlerorg.xml.sax.SAXExceptionpublic void setDocumentLocator(org.xml.sax.Locator locator)
setDocumentLocator in interface org.xml.sax.ContentHandler
public void skippedEntity(java.lang.String s)
throws org.xml.sax.SAXException
skippedEntity in interface org.xml.sax.ContentHandlerorg.xml.sax.SAXException
public void startCDATA()
throws org.xml.sax.SAXException
startCDATA in interface org.xml.sax.ext.LexicalHandlerorg.xml.sax.SAXException
public void startDTD(java.lang.String s,
java.lang.String s1,
java.lang.String s2)
throws org.xml.sax.SAXException
startDTD in interface org.xml.sax.ext.LexicalHandlerorg.xml.sax.SAXException
public void startDocument()
throws org.xml.sax.SAXException
startDocument in interface org.xml.sax.ContentHandlerorg.xml.sax.SAXException
public void startEntity(java.lang.String s)
throws org.xml.sax.SAXException
startEntity in interface org.xml.sax.ext.LexicalHandlerorg.xml.sax.SAXException
public void startPrefixMapping(java.lang.String s,
java.lang.String s1)
throws org.xml.sax.SAXException
startPrefixMapping in interface org.xml.sax.ContentHandlerorg.xml.sax.SAXException
public void endElement(java.lang.String nsURI,
java.lang.String name,
java.lang.String qName)
throws org.xml.sax.SAXException
endElement in interface org.xml.sax.ContentHandlerorg.xml.sax.SAXExceptionpublic void setConsumer(org.apache.cocoon.xml.XMLConsumer consumer)
XMLConsumer that will receive XML data.
setContentHandler(consumer)
and setLexicalHandler(consumer).
public void setContentHandler(org.xml.sax.ContentHandler handler)
ContentHandler that will receive XML data.
ContentHandler instance
accessing the protected super.contentHandler field.
public void setLexicalHandler(org.xml.sax.ext.LexicalHandler handler)
LexicalHandler that will receive XML data.
LexicalHandler instance
accessing the protected super.lexicalHandler field.
java.lang.IllegalStateException - If the LexicalHandler or
the XMLConsumer were
already set.public java.util.Enumeration getFieldValues()
getFieldValues in interface IndexableDocument
public void addAttachedDocument(java.lang.String id,
java.net.URL baseURL,
java.lang.String url,
java.lang.String mimetype,
java.lang.String repoId)
throws SDXException
id - The document id.baseURL - The base URL, usually the parent document's URLurl - URL of the attached document.mimetype - Mime type of the document, can be null.
SDXExceptionpublic void setAttachedDocuments(java.util.Vector list)
list - The list of attached documents.public boolean updateAttachedDocuments()
public void setUpdateAttachedDocuments(boolean updateAttachedDocuments)
updateAttachedDocuments - A boolean indicator.public java.util.Enumeration getAttachedDocuments()
getAttachedDocuments in interface IndexableDocumentprotected void resetFields()
public void resetAttachedDocuments()
resetAttachedDocuments in interface IndexableDocumentpublic IndexableDocument getTransformedDocument()
null if no transformed document
during the indexation pipeline
- Specified by:
getTransformedDocument in interface IndexableDocument
protected void setUpTransformedDocument()
throws SDXException
SDXExceptionpublic java.util.Enumeration getSubDocuments()
getSubDocuments in interface IndexableDocumentpublic AbstractIndexableDocument.StoreHandler getStoreHandler()
getStoreHandler in interface IndexableDocumentpublic void setMessageHandler(org.xml.sax.ContentHandler handler)
setMessageHandler in interface IndexableDocumentpublic void setBoost(float boost)
setBoost in interface IndexableDocumentDocument.setBoost(float)public float getBoost()
getBoost in interface IndexableDocumentDocument.getBoost()public void setXMLFieldList(java.util.HashMap fieldList)
IndexableDocument
setXMLFieldList in interface IndexableDocumentfr.gouv.culture.sdx.document.IndexableDocument#setFieldList(java.util.HashMap)public void setXMLTransformerHandler(javax.xml.transform.sax.TransformerHandler xmlFieldTransformer)
IndexableDocument
setXMLTransformerHandler in interface IndexableDocumentfr.gouv.culture.sdx.document.IndexableDocument#setXMLTransformer(javax.xml.transform.Transformer)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||