fr.gouv.culture.sdx.oai
Class BasicOAIMetadataFormat

java.lang.Object
  extended byorg.apache.avalon.framework.logger.AbstractLoggable
      extended byorg.apache.cocoon.xml.AbstractXMLProducer
          extended byorg.apache.cocoon.xml.AbstractXMLPipe
              extended byfr.gouv.culture.oai.OAIObjectImpl
                  extended byfr.gouv.culture.oai.AbstractOAIMetadataFormat
                      extended byfr.gouv.culture.sdx.oai.BasicOAIMetadataFormat
All Implemented Interfaces:
org.apache.avalon.framework.component.Composable, org.apache.avalon.framework.configuration.Configurable, org.xml.sax.ContentHandler, org.xml.sax.ext.LexicalHandler, org.apache.avalon.framework.logger.LogEnabled, org.apache.avalon.framework.logger.Loggable, OAIMetadataFormat, OAIObject, org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.excalibur.pool.Recyclable, org.apache.cocoon.xml.XMLConsumer, org.apache.avalon.excalibur.xml.XMLizable, org.apache.cocoon.xml.XMLPipe, org.apache.cocoon.xml.XMLProducer
Direct Known Subclasses:
SDXOAIMetadataFormat

public class BasicOAIMetadataFormat
extends AbstractOAIMetadataFormat
implements org.apache.avalon.framework.component.Composable

Created by IntelliJ IDEA. User: rpandey Date: May 8, 2003 Time: 3:06:48 PM To change this template use Options | File Templates.


Nested Class Summary
 
Nested classes inherited from class 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  java.lang.String ELEMENT_NAME_PIPELINE
          Configuration node names
protected  org.apache.avalon.framework.component.ComponentManager manager
          The component manager for this object
protected  Pipeline pipe
          The pipeline for for this object
protected  java.util.Hashtable props
          The properties for this metadata format
 
Fields inherited from class fr.gouv.culture.oai.AbstractOAIMetadataFormat
formatName, metadataMappings, namespace, prefix, rootElement, schemaUrl
 
Fields inherited from class fr.gouv.culture.oai.OAIObjectImpl
logger
 
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, lexicalHandler, xmlConsumer
 
Fields inherited from interface fr.gouv.culture.oai.OAIObject
HTTP_HEADER_NAME_FROM, HTTP_HEADER_NAME_USER_AGENT, NUMBER_RECORDS_PER_RESPONSE
 
Constructor Summary
BasicOAIMetadataFormat()
           
 
Method Summary
protected  void aggregateFields(java.lang.String fieldName, java.lang.String valueToConcat)
          Aggregates field values to temporary storage
 void compose(org.apache.avalon.framework.component.ComponentManager componentManager)
          Establishes the component manager for this object
 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 setProperties(java.util.Hashtable props)
          Establishes the properties 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
enableLogging, 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.AbstractLoggable
getLogger, setLogger, 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.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.component.ComponentManager manager
The component manager for this object


props

protected java.util.Hashtable props
The properties for this metadata format


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_PIPELINE

protected final java.lang.String ELEMENT_NAME_PIPELINE
Configuration node names

See Also:
Constant Field Values

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

compose

public void compose(org.apache.avalon.framework.component.ComponentManager componentManager)
             throws org.apache.avalon.framework.component.ComponentException
Establishes the component manager for this object

Specified by:
compose in interface org.apache.avalon.framework.component.Composable
Throws:
org.apache.avalon.framework.component.ComponentException

setProperties

public void setProperties(java.util.Hashtable props)
Establishes the properties for this object


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-2004 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.