fr.gouv.culture.sdx.documentbase
Interface DocumentBase

All Superinterfaces:
org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.logger.LogEnabled, Searchable, org.apache.cocoon.xml.XMLizable
All Known Subinterfaces:
SDXThesaurus
All Known Implementing Classes:
AbstractDocumentBase, LuceneThesaurus

public interface DocumentBase
extends org.apache.cocoon.xml.XMLizable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.context.Contextualizable, Searchable

A location where documents are indexed, stored, searched and retrieved.


Field Summary
static java.lang.String ATTRIBUTE_ID
          The attribute giving the id of this document base ; required unless for a userDocumentBase.
static java.lang.String ATTRIBUTE_TYPE
          The required attribute giving the type of this document base.
static java.lang.String CLASS_NAME_SUFFIX
          The document base's class name suffix.
static java.lang.String ELEMENT_NAME_DOCUMENT_BASE
          Element name in the configuration file.
static java.lang.String ELEMENT_NAME_DOCUMENT_BASES
          Super-element name in the configuration file.
static java.lang.String PACKAGE_QUALNAME
          The document base's package name (including trailing separator ".").
 
Method Summary
 java.util.Date creationDate()
           
 void delete(Document[] docs, org.xml.sax.ContentHandler handler)
          Deletes documents.
 void delete(Document doc, org.xml.sax.ContentHandler handler)
          Deletes a document.
 Repository getDefaultRepository()
          Returns the default repository for the DocumentBase.
 java.io.InputStream getDocument(Document doc)
          Provides the requested SDX document as an InputStream.
 void getDocument(Document doc, java.io.OutputStream os)
          Supplies the provided output stream with the requested document
 void getDocument(ParsableDocument doc, org.apache.cocoon.xml.XMLConsumer consumer)
          Sends a document as SAX events.
 void getDocument(ParsableDocument doc, org.apache.cocoon.xml.XMLConsumer consumer, boolean docTypeKnown)
          Sends a document as SAX events.
 java.lang.String getId()
          Returns the document base id.
 Pipeline getIndexationPipeline()
          Returns the default indexation pipeline used for indexation in this document base.
 java.lang.String getMimeType(Document doc)
          Supplies the mimeType for the the document if it exists.
 OAIHarvester getOAIHarvester()
          Gets the AbstractDocumentBaseOAIHarvester for the documentbase if one exists
 OAIRepository getOAIRepository()
          Gets the OAIRepository for the documentbase if one exists
 Repository getRepository(java.lang.String id)
          Returns a repository which is owned by this document base using its id.
 void index(IndexableDocument[] docs, Repository repository, IndexParameters params, org.xml.sax.ContentHandler handler)
          Indexes documents and stores them in a repository.
 void index(IndexableDocument doc, Repository repository, IndexParameters params, org.xml.sax.ContentHandler handler)
          Indexes a document and stores it in a repository.
 void init()
          Initializes the document base.
 boolean isDefault()
          Returns true if this document base is the default in the application.
 java.util.Date lastModificationDate()
           
 void setId(java.lang.String id)
          Sets the document base id.
 void setProperties(java.util.Hashtable props)
          Sets the properties object for the implementing class.
 
Methods inherited from interface org.apache.cocoon.xml.XMLizable
toSAX
 
Methods inherited from interface org.apache.avalon.framework.configuration.Configurable
configure
 
Methods inherited from interface org.apache.avalon.framework.logger.LogEnabled
enableLogging
 
Methods inherited from interface org.apache.avalon.framework.component.Composable
compose
 
Methods inherited from interface org.apache.avalon.framework.context.Contextualizable
contextualize
 
Methods inherited from interface fr.gouv.culture.sdx.search.Searchable
getIndex
 

Field Detail

ELEMENT_NAME_DOCUMENT_BASES

public static final java.lang.String ELEMENT_NAME_DOCUMENT_BASES
Super-element name in the configuration file.

See Also:
Constant Field Values

ELEMENT_NAME_DOCUMENT_BASE

public static final java.lang.String ELEMENT_NAME_DOCUMENT_BASE
Element name in the configuration file.

See Also:
Constant Field Values

ATTRIBUTE_ID

public static final java.lang.String ATTRIBUTE_ID
The attribute giving the id of this document base ; required unless for a userDocumentBase.

See Also:
Constant Field Values

ATTRIBUTE_TYPE

public static final java.lang.String ATTRIBUTE_TYPE
The required attribute giving the type of this document base.

See Also:
Constant Field Values

PACKAGE_QUALNAME

public static final java.lang.String PACKAGE_QUALNAME
The document base's package name (including trailing separator ".").

See Also:
Constant Field Values

CLASS_NAME_SUFFIX

public static final java.lang.String CLASS_NAME_SUFFIX
The document base's class name suffix.

See Also:
Constant Field Values
Method Detail

init

public void init()
          throws SDXException,
                 org.apache.avalon.framework.configuration.ConfigurationException
Initializes the document base.

This method must be called after the logger has been set and the configuration done.

Throws:
SDXException
org.apache.avalon.framework.configuration.ConfigurationException

setProperties

public void setProperties(java.util.Hashtable props)
Sets the properties object for the implementing class.

Parameters:
props - The desired properties object

setId

public void setId(java.lang.String id)
           throws SDXException
Sets the document base id.

Parameters:
id - The id (should not be null).
Throws:
SDXException

getId

public java.lang.String getId()
Returns the document base id.

Specified by:
getId in interface Searchable

isDefault

public boolean isDefault()
Returns true if this document base is the default in the application.


getRepository

public Repository getRepository(java.lang.String id)
                         throws SDXException
Returns a repository which is owned by this document base using its id.

Parameters:
id - The requested repository's id.
Returns:
The requested repository, or the default repository is the id doesn't match any repository id. TODO : dangerous behaviour IMHO -pb
Throws:
SDXException

getDefaultRepository

public Repository getDefaultRepository()
Returns the default repository for the DocumentBase.


getIndexationPipeline

public Pipeline getIndexationPipeline()
Returns the default indexation pipeline used for indexation in this document base.


index

public void index(IndexableDocument doc,
                  Repository repository,
                  IndexParameters params,
                  org.xml.sax.ContentHandler handler)
           throws SDXException,
                  org.xml.sax.SAXException,
                  org.apache.cocoon.ProcessingException
Indexes a document and stores it in a repository.

Parameters:
doc - The document to index and add.
repository - The repository where the document have to be stored.
params - Parameters governing the indexing process.
handler - The SAX events consumer that receives informations about the indexing process.
Throws:
SDXException
org.xml.sax.SAXException
org.apache.cocoon.ProcessingException

index

public void index(IndexableDocument[] docs,
                  Repository repository,
                  IndexParameters params,
                  org.xml.sax.ContentHandler handler)
           throws SDXException,
                  org.xml.sax.SAXException,
                  org.apache.cocoon.ProcessingException
Indexes documents and stores them in a repository.

Parameters:
docs - The documents to index and add.
repository - The repository where the documents have to be stored.
params - Parameters governing the indexing process.
handler - The SAX events consumer that receives informations about the indexing process.
Throws:
SDXException
org.xml.sax.SAXException
org.apache.cocoon.ProcessingException

delete

public void delete(Document doc,
                   org.xml.sax.ContentHandler handler)
            throws SDXException,
                   org.xml.sax.SAXException,
                   org.apache.cocoon.ProcessingException
Deletes a document.

Parameters:
doc - The id of the document to delete.
handler - The SAX events consumer that receives informations about the deletion process.
Throws:
SDXException
org.xml.sax.SAXException
org.apache.cocoon.ProcessingException

delete

public void delete(Document[] docs,
                   org.xml.sax.ContentHandler handler)
            throws SDXException,
                   org.xml.sax.SAXException,
                   org.apache.cocoon.ProcessingException
Deletes documents.

Parameters:
docs - The documents to delete.
handler - The SAX events consumer that receives informations about the deletion process.
Throws:
SDXException
org.xml.sax.SAXException
org.apache.cocoon.ProcessingException

getDocument

public void getDocument(ParsableDocument doc,
                        org.apache.cocoon.xml.XMLConsumer consumer)
                 throws SDXException
Sends a document as SAX events.

Parameters:
doc - A ParsableDocument, i.e. XMLDocument or HTMLDocument.
consumer - A SAX content handler to feed with events. The wrapped contentHandler for including events within an XSP page contentHandler should be created using IncludeXMLConsumer stripper = new IncludeXMLConsumer(xspContentHandler); and then the "stripper" should be passed to this method
Throws:
SDXException

getDocument

public void getDocument(ParsableDocument doc,
                        org.apache.cocoon.xml.XMLConsumer consumer,
                        boolean docTypeKnown)
                 throws SDXException
Sends a document as SAX events.

Parameters:
doc - A ParsableDocument, i.e. XMLDocument or HTMLDocument.
consumer - A SAX content handler to feed with events.
docTypeKnown - If set to false implementations should attempt to determine the doctyp(see LuceneDocumentBase) The wrapped contentHandler for including events within an XSP page contentHandler should be created using IncludeXMLConsumer stripper = new IncludeXMLConsumer(xspContentHandler); and then the "stripper" should be passed to this method
Throws:
SDXException

getDocument

public void getDocument(Document doc,
                        java.io.OutputStream os)
                 throws SDXException
Supplies the provided output stream with the requested document

Parameters:
doc - The document.
os - The output stream.
Throws:
SDXException

getDocument

public java.io.InputStream getDocument(Document doc)
                                throws SDXException
Provides the requested SDX document as an InputStream.

Parameters:
doc - The document.
Returns:
An input stream.
Throws:
SDXException

getMimeType

public java.lang.String getMimeType(Document doc)
                             throws SDXException
Supplies the mimeType for the the document if it exists. otherwise the default mimetype should be returned TODO : dangerous behaviour IMHO -pb

Parameters:
doc - The document.
Throws:
SDXException

getOAIRepository

public OAIRepository getOAIRepository()
Gets the OAIRepository for the documentbase if one exists

Returns:

getOAIHarvester

public OAIHarvester getOAIHarvester()
Gets the AbstractDocumentBaseOAIHarvester for the documentbase if one exists

Returns:

lastModificationDate

public java.util.Date lastModificationDate()

creationDate

public java.util.Date creationDate()


Copyright © 2000-2004 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.