|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.avalon.framework.logger.AbstractLogEnabled org.apache.cocoon.xml.AbstractXMLProducer org.apache.cocoon.xml.AbstractXMLPipe fr.gouv.culture.oai.OAIObjectImpl fr.gouv.culture.oai.AbstractOAIRepository fr.gouv.culture.sdx.oai.AbstractDocumentBaseOAIRepository
public abstract class AbstractDocumentBaseOAIRepository
Abstract oai repository for DocumentBases providing common behaviors
TODORefactor: bring appropriate methods up from sub-classes
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface fr.gouv.culture.sdx.oai.DocumentBaseOAIRepository |
---|
DocumentBaseOAIRepository.ConfigurationNode |
Nested classes/interfaces inherited from interface fr.gouv.culture.oai.OAIObject |
---|
OAIObject.Node |
Field Summary | |
---|---|
protected Database |
_database
The database for this object |
protected org.apache.avalon.framework.context.DefaultContext |
context
The framework's context. |
protected DocumentBase |
documentBase
The underlying document base |
protected java.lang.String |
documentBaseId
The document base's id |
protected java.lang.String |
externalIdPrefix
|
protected java.lang.String |
id
|
protected boolean |
isDefault
|
protected org.apache.avalon.framework.service.ServiceManager |
manager
The framework's service manager. |
protected int |
numRecordsPerResponse
The number of records for before issuing a resumption tokent |
static java.lang.String |
PARAMETER_NAME_SDX_FIELD
|
static java.lang.String |
PARAMETER_NAME_SET_NAME
|
static java.lang.String |
PARAMETER_NAME_SET_SPEC
|
protected IDGenerator |
resumptionTokenIdGen
|
Fields inherited from class fr.gouv.culture.oai.AbstractOAIRepository |
---|
adminEmails, baseURL, compression, deletedRecord, description, earliestDatestamp, granularity, metadataFormats, protocolVersion, repositoryName |
Fields inherited from class fr.gouv.culture.oai.OAIObjectImpl |
---|
_context, logger |
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
---|
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer |
Fields inherited from interface fr.gouv.culture.oai.OAIObject |
---|
HTTP_HEADER_NAME_FROM, HTTP_HEADER_NAME_USER_AGENT, NUMBER_RECORDS_PER_RESPONSE, STRING_DATEFORMAT_GRANULARITY_DAY, STRING_DATEFORMAT_GRANULARITY_SECOND |
Constructor Summary | |
---|---|
AbstractDocumentBaseOAIRepository()
|
Method Summary | |
---|---|
protected java.lang.String |
buildExternalOaiId(OAIRequest request,
java.lang.String docId)
Deprecated. Since 2.4.0 use buildExternalOaiId(String) instead. |
protected java.lang.String |
buildExternalOaiId(java.lang.String docId)
Builds an SDX/OAI identifier for a document This identifier is used to populate the identifier OAI element. |
protected java.lang.String |
buildUrlLocator(OAIRequest request,
java.lang.String docId)
Builds an URL locator for the document with the provided id |
void |
configure(org.apache.avalon.framework.configuration.Configuration configuration)
Basic configuration |
protected void |
configureAdminEmails(org.apache.avalon.framework.configuration.Configuration configuration)
Configures (sets) the adminEmails class-field from a configuration object |
protected void |
configureBaseURL(org.apache.avalon.framework.configuration.Configuration configuration)
Configures (sets) the baseURL class-field from a configuration object |
protected void |
configureDatabase(org.apache.avalon.framework.configuration.Configuration configuration)
Configures (sets) the database class-field from a configuration object |
protected void |
configureDefault(org.apache.avalon.framework.configuration.Configuration configuration)
Configures the default flag : true if this OAI repository
is the default one, false or null if not. |
protected void |
configureDescription(org.apache.avalon.framework.configuration.Configuration configuration)
Configures (sets) the description class-field from a configuration object |
protected void |
configureExternalIdPrefix(org.apache.avalon.framework.configuration.Configuration configuration)
Configures (sets) the external OAI id prefix from a configuration object. |
protected void |
configureId(org.apache.avalon.framework.configuration.Configuration configuration)
Configures the id of this OAI repository |
protected void |
configureResumptionTokenIDGenerator(org.apache.avalon.framework.configuration.Configuration configuration)
|
protected java.lang.String |
createResumptionToken(OAIRequest request)
Builds a resumption token for a request and the database entity to store needed informations. |
protected java.lang.String |
deriveInternalSdxId(OAIRequest request,
java.lang.String fullOaiId)
Deprecated. Since SDX 2.4.0, use deriveInternalSdxId(String) instead. |
protected java.lang.String |
deriveInternalSdxId(java.lang.String fullOaiId)
Retrieves an internal SDX identifier from a full OAI identifier |
java.lang.String |
getId()
Returns the identifier for this OAI repository as a String. |
protected java.lang.String |
getRepositoryId()
Returns the internal identifier for this OAI repository. |
java.lang.String |
getResumptionTokenCursor(java.lang.String resumptionToken)
Returns the cursor index of the provided resumption token |
protected java.lang.String |
getResumptionTokenProperty(java.lang.String resumptionToken,
java.lang.String propertyName)
Returns a property value for provided resumption token |
boolean |
isDefault()
Returns the default flag value |
void |
service(org.apache.avalon.framework.service.ServiceManager serviceManager)
|
void |
setDefault()
|
void |
unsetDefault()
|
Methods inherited from class fr.gouv.culture.oai.OAIObjectImpl |
---|
contextualize, enableLogging, endElement, getContext, sendElement, sendElementContent, startElement |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLPipe |
---|
characters, comment, endCDATA, endDocument, endDTD, endElement, endEntity, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startCDATA, startDocument, startDTD, startEntity, startPrefixMapping |
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer |
---|
recycle, setConsumer, setContentHandler, setLexicalHandler |
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled |
---|
getLogger, setupLogger, setupLogger, setupLogger |
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.oai.OAIRepository |
---|
addDeletedRecord, getAdminEmails, getBaseURL, getCompression, getDeletedRecord, getDescription, getEarliestDatestamp, getGranularity, getProtocolVersion, getRecord, getRepositoryName, getResumptionToken, identify, listIdentifiers, listMetadataFormats, listRecords, listSets, purgeDeletedRecords, removeDeletedRecord, verifyParameters |
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.excalibur.xml.sax.XMLizable |
---|
toSAX |
Methods inherited from interface org.xml.sax.ContentHandler |
---|
characters, endDocument, endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startDocument, startElement, startPrefixMapping |
Methods inherited from interface org.xml.sax.ext.LexicalHandler |
---|
comment, endCDATA, endDTD, endEntity, startCDATA, startDTD, startEntity |
Methods inherited from interface org.apache.cocoon.xml.XMLProducer |
---|
setConsumer |
Field Detail |
---|
protected org.apache.avalon.framework.service.ServiceManager manager
protected org.apache.avalon.framework.context.DefaultContext context
protected DocumentBase documentBase
protected Database _database
protected java.lang.String documentBaseId
protected int numRecordsPerResponse
protected IDGenerator resumptionTokenIdGen
protected java.lang.String externalIdPrefix
protected java.lang.String id
protected boolean isDefault
public static final java.lang.String PARAMETER_NAME_SDX_FIELD
public static final java.lang.String PARAMETER_NAME_SET_NAME
public static final java.lang.String PARAMETER_NAME_SET_SPEC
Constructor Detail |
---|
public AbstractDocumentBaseOAIRepository()
Method Detail |
---|
public void service(org.apache.avalon.framework.service.ServiceManager serviceManager) throws org.apache.avalon.framework.service.ServiceException
service
in interface org.apache.avalon.framework.service.Serviceable
org.apache.avalon.framework.service.ServiceException
public void configure(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
configure
in interface org.apache.avalon.framework.configuration.Configurable
org.apache.avalon.framework.configuration.ConfigurationException
protected void configureId(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
configuration
-
org.apache.avalon.framework.configuration.ConfigurationException
protected void configureDefault(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
true
if this OAI repository
is the default one, false
or null
if not.
configuration
-
org.apache.avalon.framework.configuration.ConfigurationException
public void setDefault()
public void unsetDefault()
public boolean isDefault()
true
if this OAI repository is the default one;
false
if not.protected void configureExternalIdPrefix(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
The prefix can be passed throught the configuration attribute:
<oai-repository oai-id-prefix="my.external.oai.id.prefix"If the configuration element does not contain an
oai-id-prefix
attribute, the prefix is based on the pattern: sdx:{baseURL}
sdx:www.sdx.org:
for the baseURL = http://www.sdx.org/
org.apache.avalon.framework.configuration.ConfigurationException
protected void configureResumptionTokenIDGenerator(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
org.apache.avalon.framework.configuration.ConfigurationException
protected void configureBaseURL(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
org.apache.avalon.framework.configuration.ConfigurationException
protected void configureDescription(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
org.apache.avalon.framework.configuration.ConfigurationException
protected void configureAdminEmails(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
org.apache.avalon.framework.configuration.ConfigurationException
protected void configureDatabase(org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationException
org.apache.avalon.framework.configuration.ConfigurationException
protected java.lang.String getRepositoryId()
Returns the internal identifier for this OAI repository. It's build
on the pattern : sdx_oai_r_{document base id}_{OAI repo id}
.
It's used, among other, to configure the SQL database, ie the table name.
public java.lang.String getId()
default
if it's the default OAI
repository, the id if not.ID configuration
protected java.lang.String buildExternalOaiId(OAIRequest request, java.lang.String docId)
buildExternalOaiId(String)
instead.
This identifier is used to populate the identifier OAI element. For example, the one wich is returned by the "ListIdentifiers" verb.
request
- The request from which the url will be used for id constructiondocId
- The sdx document identifierDeconstruction of id's built with this method
protected java.lang.String buildExternalOaiId(java.lang.String docId)
This identifier is used to populate the identifier OAI element. For example, the one wich is returned by the "ListIdentifiers" verb.
request
- The request from which the url will be used for id constructiondocId
- The sdx document identifierDeconstruction of id's built with this method
,
The configuration of the prefix
protected java.lang.String deriveInternalSdxId(OAIRequest request, java.lang.String fullOaiId)
deriveInternalSdxId(String)
instead.
request
- The request from which the url will be used for id constructionfullOaiId
- The OAI record identifierConstruction of id's passed as the fullOaiId
argument
protected java.lang.String deriveInternalSdxId(java.lang.String fullOaiId)
request
- The request from which the url will be used for id constructionfullOaiId
- The OAI record identifierconstruction of id's passed as the fullOaiId
argument
protected java.lang.String buildUrlLocator(OAIRequest request, java.lang.String docId)
request
- The requestdocId
- The id of the document for which to build the locator
TODORemove: this is tightly coupled to the external sdx/sdx/sitemap.xmapprotected java.lang.String createResumptionToken(OAIRequest request) throws SDXException
request
- The request
SDXException
public java.lang.String getResumptionTokenCursor(java.lang.String resumptionToken)
resumptionToken
- protected java.lang.String getResumptionTokenProperty(java.lang.String resumptionToken, java.lang.String propertyName)
resumptionToken
- The resumption token in questionpropertyName
- The property name for which a value is desired
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |