|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.gouv.culture.sdx.utils.SdxObjectImpl
fr.gouv.culture.sdx.utils.database.DatabaseBacked
fr.gouv.culture.sdx.documentbase.AbstractDocumentBase
an abstract document base class handling most common behaviors
Field Summary | |
protected org.apache.avalon.framework.context.DefaultContext |
context
The framework's context. |
protected java.lang.String |
DBELEM_ATTRIBUTE_DEFAULT
The implied attribute stating whether the document base is to be used by default or not. |
protected java.lang.String |
DBELEM_ATTRIBUTE_KEEP_ORIGINAL
The implied attribute stating whether original documents should be stored or not. |
protected Repository |
defaultRepository
The default repository for this document base. |
protected java.lang.String |
ELEMENT_NAME_INDEX
The element used to define the indexation pipelines. |
static java.lang.String |
ELEMENT_NAME_OAI_HARVESTER
The element used to define an oai harvester. |
static java.lang.String |
ELEMENT_NAME_OAI_REPOSITORY
The element used to define an oai repository. |
protected java.lang.String |
ELEMENT_NAME_PIPELINE
The element used to define an indexation pipeline. |
protected Pipeline |
indexationPipeline
The default indexation pipeline |
static java.lang.String |
INTERNAL_FIELD_NAME_SDX_OAI_DELETED_RECORD
|
static java.lang.String |
INTERNAL_FIELD_NAME_SDXALL
Internal field name for a *fixed* value field. |
static java.lang.String |
INTERNAL_FIELD_NAME_SDXAPPID
Internal field name for application id. |
static java.lang.String |
INTERNAL_FIELD_NAME_SDXCONTENTLENGTH
Internal field name for document length in bytes. |
static java.lang.String |
INTERNAL_FIELD_NAME_SDXDBID
Internal field name for document base id. |
static java.lang.String |
INTERNAL_FIELD_NAME_SDXDOCID
Internal field name for document ids |
static java.lang.String |
INTERNAL_FIELD_NAME_SDXDOCTYPE
Internal field name for document type. |
static java.lang.String |
INTERNAL_FIELD_NAME_SDXMODDATE
Internal field name for modification date. |
static java.lang.String |
INTERNAL_FIELD_NAME_SDXREPOID
Internal field name for repository id. |
static java.lang.String |
INTERNAL_SDXALL_FIELD_VALUE
Internal value for this field. |
protected boolean |
isDefault
True if this document base is the default one in the application. |
protected java.util.Locale |
locale
The locale for this document base (found either in the configuration file or by using Locale.getDefault() ). |
protected OAIHarvester |
oaiHarv
The oai harvester wrapper for this document base |
protected OAIRepository |
oaiRepo
The oai repository wrapper for this document base |
protected java.lang.String |
PROPERTY_NAME_ATTACHED
Internal fields for relationships between documents (kind of metadata required/proposed by SDX) //TODO : move them to a framework/application/relationship class ? |
protected static java.lang.String |
PROPERTY_NAME_CONTENT_LENGTH
|
protected java.lang.String |
PROPERTY_NAME_DOCTYPE
A constant for the path property for the type of document, Binary, HTML, or XML. |
protected static java.lang.String |
PROPERTY_NAME_MIMETYPE
A constant for the path property for attached documents. |
protected java.lang.String |
PROPERTY_NAME_ORIGINAL
Internal value for this field : an original document relationship. |
protected java.lang.String |
PROPERTY_NAME_PARENT
|
protected static java.lang.String |
PROPERTY_NAME_REPO
A constant for the repository property in the database entities. |
protected java.lang.String |
PROPERTY_NAME_SUB
Internal value for this field : a sub-document document relationship. |
protected java.util.Hashtable |
repoConnectionPool
A pool of connections to the repositories. |
protected java.util.Hashtable |
repositories
The repositories that are owned by this document base. |
Fields inherited from class fr.gouv.culture.sdx.utils.database.DatabaseBacked |
_manager, ATTRIBUTE_ID, CLASS_NAME_SUFFIX, database, DATABASE_DIR_NAME, databaseConf, dbLocation, dbPath, DEFAULT_DATABASE_TYPE, ELEMENT_NAME_DATABASE, id, PACKAGE_QUALNAME, props |
Fields inherited from class fr.gouv.culture.sdx.utils.SdxObjectImpl |
encoding, logger |
Fields inherited from interface fr.gouv.culture.sdx.documentbase.DocumentBase |
ATTRIBUTE_ID, ATTRIBUTE_TYPE, CLASS_NAME_SUFFIX, ELEMENT_NAME_DOCUMENT_BASE, ELEMENT_NAME_DOCUMENT_BASES, PACKAGE_QUALNAME |
Constructor Summary | |
AbstractDocumentBase()
|
Method Summary | |
protected void |
addOaiDeletedRecord(IndexableDocument doc)
|
protected void |
configurePipeline(org.apache.avalon.framework.configuration.Configuration configuration)
|
void |
contextualize(org.apache.avalon.framework.context.Context context)
Contextualize this class. |
protected DatabaseEntity |
createEntityForDocMetaData(Document doc,
Repository repository,
java.lang.String[] parentDocId)
|
void |
delete(Document doc,
org.xml.sax.ContentHandler handler)
Deletes a document and any attached document(s) if not used by any other document(s). |
protected void |
deletePhysicalDocument(Document doc,
Repository repo,
org.xml.sax.ContentHandler handler)
This method does a special delete. |
Repository |
getDefaultRepository()
Returns the default repository for this document base. |
java.io.InputStream |
getDocument(Document doc)
Does param checks for subclasses |
void |
getDocument(Document doc,
java.io.OutputStream os)
Does param checks for subclasses |
void |
getDocument(ParsableDocument doc,
org.apache.cocoon.xml.XMLConsumer consumer)
Does param checks for subclasses |
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 otherwise the binary document default mimetype is returned |
OAIHarvester |
getOAIHarvester()
Gets the AbstractDocumentBaseOAIHarvester for the documentbase if one exists |
OAIRepository |
getOAIRepository()
Gets the OAIRepository for the documentbase if one exists |
protected RepositoryConnection |
getPooledRepositoryConnection(java.lang.String repoId)
|
Repository |
getRepository(java.lang.String id)
Gets a repository in this document base. |
boolean |
isDefault()
Returns true if this document base is the default in the application. |
protected void |
optimizeDatabase()
|
protected void |
optimizeRepositories()
This method should be called before releasePooledRepositoryConnections(); so we have something to optimize. |
protected void |
releasePooledRepositoryConnections()
|
protected void |
removeOaiDeletedRecord(IndexableDocument doc)
|
void |
setId(java.lang.String id)
Sets the document base id. |
void |
toSAX(org.xml.sax.ContentHandler hdl)
Feeds a SAX content handler with information about this document base. |
Methods inherited from class fr.gouv.culture.sdx.utils.database.DatabaseBacked |
compose, configure, getDatabase, init, setProperties |
Methods inherited from class fr.gouv.culture.sdx.utils.SdxObjectImpl |
enableLogging, getChildLogger, setEncoding |
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.documentbase.DocumentBase |
creationDate, delete, getDocument, index, index, init, lastModificationDate, setProperties |
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 fr.gouv.culture.sdx.search.Searchable |
getIndex |
Field Detail |
protected org.apache.avalon.framework.context.DefaultContext context
protected boolean isDefault
protected Pipeline indexationPipeline
protected java.util.Hashtable repositories
protected Repository defaultRepository
protected OAIRepository oaiRepo
protected OAIHarvester oaiHarv
protected java.util.Locale locale
Locale.getDefault()
).
protected java.util.Hashtable repoConnectionPool
protected final java.lang.String PROPERTY_NAME_ATTACHED
protected final java.lang.String PROPERTY_NAME_ORIGINAL
protected final java.lang.String PROPERTY_NAME_SUB
protected final java.lang.String PROPERTY_NAME_PARENT
protected final java.lang.String DBELEM_ATTRIBUTE_DEFAULT
protected final java.lang.String DBELEM_ATTRIBUTE_KEEP_ORIGINAL
protected final java.lang.String ELEMENT_NAME_INDEX
protected final java.lang.String ELEMENT_NAME_PIPELINE
public static final java.lang.String ELEMENT_NAME_OAI_REPOSITORY
public static final java.lang.String ELEMENT_NAME_OAI_HARVESTER
protected static final java.lang.String PROPERTY_NAME_REPO
protected static final java.lang.String PROPERTY_NAME_MIMETYPE
protected static final java.lang.String PROPERTY_NAME_CONTENT_LENGTH
protected final java.lang.String PROPERTY_NAME_DOCTYPE
public static final java.lang.String INTERNAL_FIELD_NAME_SDXDOCID
public static final java.lang.String INTERNAL_FIELD_NAME_SDXALL
public static final java.lang.String INTERNAL_SDXALL_FIELD_VALUE
public static final java.lang.String INTERNAL_FIELD_NAME_SDXAPPID
public static final java.lang.String INTERNAL_FIELD_NAME_SDXDBID
public static final java.lang.String INTERNAL_FIELD_NAME_SDXREPOID
public static final java.lang.String INTERNAL_FIELD_NAME_SDXDOCTYPE
public static final java.lang.String INTERNAL_FIELD_NAME_SDXMODDATE
public static final java.lang.String INTERNAL_FIELD_NAME_SDXCONTENTLENGTH
public static final java.lang.String INTERNAL_FIELD_NAME_SDX_OAI_DELETED_RECORD
Constructor Detail |
public AbstractDocumentBase()
Method Detail |
public void contextualize(org.apache.avalon.framework.context.Context context) throws org.apache.avalon.framework.context.ContextException
contextualize
in interface org.apache.avalon.framework.context.Contextualizable
context
- The context provided by Cocoon.
org.apache.avalon.framework.context.ContextException
public void setId(java.lang.String id) throws SDXException
setId
in interface DocumentBase
setId
in class DatabaseBacked
id
- The id (shoud not be null
).
SDXException
public java.lang.String getId()
getId
in interface DocumentBase
getId
in class DatabaseBacked
public boolean isDefault()
true
if this document base is the default in the application.
isDefault
in interface DocumentBase
public Pipeline getIndexationPipeline()
getIndexationPipeline
in interface DocumentBase
public java.lang.String getMimeType(Document doc) throws SDXException
getMimeType
in interface DocumentBase
doc
- The document.
SDXException
protected void configurePipeline(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
org.apache.avalon.framework.configuration.ConfigurationException
public void getDocument(ParsableDocument doc, org.apache.cocoon.xml.XMLConsumer consumer) throws SDXException
getDocument
in interface DocumentBase
doc
- consumer
-
SDXException
public void getDocument(Document doc, java.io.OutputStream os) throws SDXException
getDocument
in interface DocumentBase
doc
- os
-
SDXException
public java.io.InputStream getDocument(Document doc) throws SDXException
getDocument
in interface DocumentBase
doc
-
SDXException
public Repository getDefaultRepository()
getDefaultRepository
in interface DocumentBase
public Repository getRepository(java.lang.String id) throws SDXException
getRepository
in interface DocumentBase
id
- The repository's id, if null
for the default repository is returned
SDXException
public OAIRepository getOAIRepository()
DocumentBase
getOAIRepository
in interface DocumentBase
public OAIHarvester getOAIHarvester()
DocumentBase
getOAIHarvester
in interface DocumentBase
public void toSAX(org.xml.sax.ContentHandler hdl) throws org.xml.sax.SAXException, org.apache.cocoon.ProcessingException
toSAX
in interface org.apache.cocoon.xml.XMLizable
hdl
- A SAX content handler to feed with events.
org.xml.sax.SAXException
org.apache.cocoon.ProcessingException
protected void addOaiDeletedRecord(IndexableDocument doc) throws SDXException
SDXException
protected void removeOaiDeletedRecord(IndexableDocument doc) throws SDXException
SDXException
protected void optimizeDatabase() throws SDXException
SDXException
protected void optimizeRepositories() throws SDXException
SDXException
protected void releasePooledRepositoryConnections() throws SDXException
SDXException
protected RepositoryConnection getPooledRepositoryConnection(java.lang.String repoId) throws SDXException
SDXException
protected DatabaseEntity createEntityForDocMetaData(Document doc, Repository repository, java.lang.String[] parentDocId) throws SDXException
SDXException
public void delete(Document doc, org.xml.sax.ContentHandler handler) throws SDXException, org.xml.sax.SAXException, org.apache.cocoon.ProcessingException
delete
in interface DocumentBase
doc
- The document to delete.
* @param handler A content handler to feed with information.handler
- The SAX events consumer that receives informations about the deletion process.
SDXException
org.xml.sax.SAXException
org.apache.cocoon.ProcessingException
protected void deletePhysicalDocument(Document doc, Repository repo, org.xml.sax.ContentHandler handler) throws SDXException, org.xml.sax.SAXException, org.apache.cocoon.ProcessingException
doc
- handler
-
SDXException
org.xml.sax.SAXException
org.apache.cocoon.ProcessingException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |