fr.gouv.culture.sdx.oai
Class BasicOAIMetadataFormat

java.lang.Object
  extended by org.apache.avalon.framework.logger.AbstractLogEnabled
      extended by org.apache.cocoon.xml.AbstractXMLProducer
          extended by org.apache.cocoon.xml.AbstractXMLPipe
              extended by fr.gouv.culture.oai.OAIObjectImpl
                  extended by fr.gouv.culture.oai.AbstractOAIMetadataFormat
                      extended by fr.gouv.culture.sdx.oai.BasicOAIMetadataFormat
All Implemented Interfaces:
OAIMetadataFormat, OAIObject, org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.excalibur.pool.Recyclable, org.apache.avalon.framework.configuration.Configurable, org.apache.avalon.framework.context.Contextualizable, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.service.Serviceable, org.apache.cocoon.xml.XMLPipe, org.apache.cocoon.xml.XMLProducer, org.apache.excalibur.xml.sax.XMLConsumer, org.apache.excalibur.xml.sax.XMLizable, org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler
Direct Known Subclasses:
SDXOAIMetadataFormat

public class BasicOAIMetadataFormat
extends AbstractOAIMetadataFormat
implements org.apache.avalon.framework.service.Serviceable


Nested Class Summary
 
Nested classes/interfaces inherited from interface fr.gouv.culture.oai.OAIObject
OAIObject.Node
 
Field Summary
protected  java.util.Hashtable aggregatedFields
          Object for temporary storage of aggregated sdx fields
protected  java.lang.String ATTRIBUTE_NAME_METADATA_PREFIX
          Configuration node names
protected  java.lang.String ATTRIBUTE_NAME_NAME
          Configuration node names
protected  java.lang.String ATTRIBUTE_NAME_NAMESPACE
          Configuration node names
protected  java.lang.String ATTRIBUTE_NAME_REPEATED
          Configuration node names
protected  java.lang.String ATTRIBUTE_NAME_ROOT_ELEMENT
          Configuration node names
protected  java.lang.String ATTRIBUTE_NAME_SCHEMA_URL
          Configuration node names
protected  java.lang.String ATTRIBUTE_NAME_SDXFIELD
          Configuration node names
protected  java.lang.String ATTRIBUTE_NAME_SEPARATOR
          Configuration node names
protected  java.lang.String ATTRIBUTE_VALUE_CONCATENATE
          Configuration node names
protected  org.apache.avalon.framework.parameters.Parameters concatenateFields
          Parameters object containing information about which sdx fields to concatenate
protected  java.lang.String DEFAULT_CONCATENATED_FIELD_SEPARATOR
          Default separator for field concatenation
protected  java.lang.String ELEMENT_NAME_OAI_FIELD
          Configuration node names
protected  java.lang.String ELEMENT_NAME_OAI_FIELDS
          Configuration node names
protected  org.apache.avalon.framework.service.ServiceManager manager
          The service manager for this object
protected  Pipeline pipe
          The pipeline for for this object
 
Fields inherited from class fr.gouv.culture.oai.AbstractOAIMetadataFormat
formatName, metadataMappings, namespace, prefix, rootElement, schemaUrl
 
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
BasicOAIMetadataFormat()
           
 
Method Summary
protected  void aggregateFields(java.lang.String fieldName, java.lang.String valueToConcat)
          Aggregates field values to temporary storage
 void configure(org.apache.avalon.framework.configuration.Configuration configuration)
          Configures this object
protected  void configureFields(org.apache.avalon.framework.configuration.Configuration configuration)
          Configures field mappings
protected  void configurePipeline(org.apache.avalon.framework.configuration.Configuration configuration)
          Configures the pipeline for process documents and search fields
 void endMetadataFormatRootElement()
          Sends any aggregated fields before sending the END event for the root element of the metadata format
 Pipeline getAddRootAttributePipe()
          Retrieves a special pipeline for adding an attribute to the root element of the metadata format
 Pipeline getPipeline()
          Retrieves the pipeline for processing documents into metadata
protected  void sendAggregatedFields()
          Sends all aggregatged fields
 void sendElement(java.lang.String origName, java.lang.String value)
          Sends an element to the object's consumer doing any aggregation and/or concatenation
 void service(org.apache.avalon.framework.service.ServiceManager serviceManager)
          Establishes the service manager for this object
 
Methods inherited from class fr.gouv.culture.oai.AbstractOAIMetadataFormat
getMappings, getName, getNamespace, getPrefix, getSchemaUrl, prepareAndSendElement, setMappings, setName, setNamespace, setPrefix, setSchemaUrl, startMetadataFormatRootElement, toSAX
 
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 org.apache.avalon.framework.logger.LogEnabled
enableLogging
 
Methods inherited from interface org.apache.avalon.framework.context.Contextualizable
contextualize
 
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

manager

protected org.apache.avalon.framework.service.ServiceManager manager
The service manager for this object


pipe

protected Pipeline pipe
The pipeline for for this object


concatenateFields

protected org.apache.avalon.framework.parameters.Parameters concatenateFields
Parameters object containing information about which sdx fields to concatenate


aggregatedFields

protected java.util.Hashtable aggregatedFields
Object for temporary storage of aggregated sdx fields


DEFAULT_CONCATENATED_FIELD_SEPARATOR

protected java.lang.String DEFAULT_CONCATENATED_FIELD_SEPARATOR
Default separator for field concatenation


ELEMENT_NAME_OAI_FIELDS

protected final java.lang.String ELEMENT_NAME_OAI_FIELDS
Configuration node names

See Also:
Constant Field Values

ELEMENT_NAME_OAI_FIELD

protected final java.lang.String ELEMENT_NAME_OAI_FIELD
Configuration node names

See Also:
Constant Field Values

ATTRIBUTE_NAME_NAME

protected final java.lang.String ATTRIBUTE_NAME_NAME
Configuration node names

See Also:
Constant Field Values

ATTRIBUTE_NAME_METADATA_PREFIX

protected final java.lang.String ATTRIBUTE_NAME_METADATA_PREFIX
Configuration node names

See Also:
Constant Field Values

ATTRIBUTE_NAME_NAMESPACE

protected final java.lang.String ATTRIBUTE_NAME_NAMESPACE
Configuration node names

See Also:
Constant Field Values

ATTRIBUTE_NAME_SCHEMA_URL

protected final java.lang.String ATTRIBUTE_NAME_SCHEMA_URL
Configuration node names

See Also:
Constant Field Values

ATTRIBUTE_NAME_ROOT_ELEMENT

protected final java.lang.String ATTRIBUTE_NAME_ROOT_ELEMENT
Configuration node names

See Also:
Constant Field Values

ATTRIBUTE_NAME_SDXFIELD

protected final java.lang.String ATTRIBUTE_NAME_SDXFIELD
Configuration node names

See Also:
Constant Field Values

ATTRIBUTE_NAME_REPEATED

protected final java.lang.String ATTRIBUTE_NAME_REPEATED
Configuration node names

See Also:
Constant Field Values

ATTRIBUTE_NAME_SEPARATOR

protected final java.lang.String ATTRIBUTE_NAME_SEPARATOR
Configuration node names

See Also:
Constant Field Values

ATTRIBUTE_VALUE_CONCATENATE

protected final java.lang.String ATTRIBUTE_VALUE_CONCATENATE
Configuration node names

See Also:
Constant Field Values
Constructor Detail

BasicOAIMetadataFormat

public BasicOAIMetadataFormat()
Method Detail

service

public void service(org.apache.avalon.framework.service.ServiceManager serviceManager)
             throws org.apache.avalon.framework.service.ServiceException
Establishes the service manager for this object

Specified by:
service in interface org.apache.avalon.framework.service.Serviceable
Throws:
org.apache.avalon.framework.service.ServiceException

configure

public void configure(org.apache.avalon.framework.configuration.Configuration configuration)
               throws org.apache.avalon.framework.configuration.ConfigurationException
Configures this object

Specified by:
configure in interface org.apache.avalon.framework.configuration.Configurable
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

configureFields

protected void configureFields(org.apache.avalon.framework.configuration.Configuration configuration)
                        throws org.apache.avalon.framework.configuration.ConfigurationException
Configures field mappings

Parameters:
configuration -
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

configurePipeline

protected void configurePipeline(org.apache.avalon.framework.configuration.Configuration configuration)
                          throws org.apache.avalon.framework.configuration.ConfigurationException
Configures the pipeline for process documents and search fields

Parameters:
configuration -
Throws:
org.apache.avalon.framework.configuration.ConfigurationException

sendElement

public void sendElement(java.lang.String origName,
                        java.lang.String value)
                 throws org.xml.sax.SAXException
Sends an element to the object's consumer doing any aggregation and/or concatenation

Specified by:
sendElement in interface OAIMetadataFormat
Overrides:
sendElement in class AbstractOAIMetadataFormat
Parameters:
origName -
value -
Throws:
org.xml.sax.SAXException
See Also:
AbstractOAIMetadataFormat.prepareAndSendElement(java.lang.String, java.lang.String)

aggregateFields

protected void aggregateFields(java.lang.String fieldName,
                               java.lang.String valueToConcat)
Aggregates field values to temporary storage

Parameters:
fieldName -
valueToConcat -

sendAggregatedFields

protected void sendAggregatedFields()
                             throws org.xml.sax.SAXException
Sends all aggregatged fields

Throws:
org.xml.sax.SAXException

endMetadataFormatRootElement

public void endMetadataFormatRootElement()
                                  throws org.xml.sax.SAXException
Sends any aggregated fields before sending the END event for the root element of the metadata format

Specified by:
endMetadataFormatRootElement in interface OAIMetadataFormat
Overrides:
endMetadataFormatRootElement in class AbstractOAIMetadataFormat
Throws:
org.xml.sax.SAXException

getPipeline

public Pipeline getPipeline()
Retrieves the pipeline for processing documents into metadata

Returns:

getAddRootAttributePipe

public Pipeline getAddRootAttributePipe()
Retrieves a special pipeline for adding an attribute to the root element of the metadata format

Returns:


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