fr.gouv.culture.sdx.utils.lucene
Class LuceneData

java.lang.Object
  extended by fr.gouv.culture.sdx.utils.AbstractSdxObject
      extended by fr.gouv.culture.sdx.utils.lucene.LuceneData
All Implemented Interfaces:
Describable, Encodable, Identifiable, Localizable, SdxObject, 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.excalibur.xml.sax.XMLizable

public class LuceneData
extends AbstractSdxObject

In progress, good idea, but we need a use case?-rbp This class basically provides an easy way to build a lucene document for store in a LuceneDataStore Created by IntelliJ IDEA. User: rpandey Date: Dec 12, 2002 Time: 2:14:55 PM To change this template use Options | File Templates.


Nested Class Summary
 
Nested classes/interfaces inherited from interface fr.gouv.culture.sdx.utils.SdxObject
SdxObject.ConfigurationNode
 
Field Summary
static java.lang.String allKey
           
static java.lang.String allValue
           
static java.lang.String CLASS_NAME_SUFFIX
           
static java.lang.String idKey
           
protected  java.util.Hashtable ldFields
           
static java.lang.String xmlLangKey
           
 
Fields inherited from class fr.gouv.culture.sdx.utils.AbstractSdxObject
_configuration, _context, _description, _encoding, _id, _locale, _logger, _manager, _xmlizable_objects, _xmlLang, isToSaxInitialized
 
Fields inherited from interface fr.gouv.culture.sdx.utils.Encodable
DEFAULT_ENCODING
 
Constructor Summary
LuceneData()
           
LuceneData(org.apache.lucene.document.Document lDoc)
           
 
Method Summary
 void addField(java.lang.String fieldName, java.lang.String value, java.lang.String type)
           
protected  void addLDField(org.apache.lucene.document.Field f)
           
protected  void addLDField(java.lang.String name, java.lang.String value)
          Builds a keyworld lucene field
protected  void addLDField(java.lang.String name, java.lang.String value, java.lang.String type)
           
protected  void deleteLDField(java.lang.String name)
           
protected  java.lang.String getClassNameSuffix()
          Sub classes should element this method to return their class name suffix for SAX output
 java.util.Enumeration getContentFields()
          Returns only the content LuceneDataFields, excluding the all, id, and xmllang fields
 LuceneDataField getField(java.lang.String key)
          Gets a specific LuceneDataField
 java.util.Enumeration getFields()
          Returns all LuceneDataFields
 java.lang.String getFieldValue(java.lang.String fieldName)
           
 java.lang.String[] getFieldValues(java.lang.String fieldName)
           
 java.lang.String getId()
           
 org.apache.lucene.document.Document getLuceneDocument()
          Returns a Lucene f based upon the current set of properties/LuceneDataFields.
protected  org.apache.lucene.document.Field getLuceneField(java.lang.String name, java.lang.String value)
          Returns a Lucene field for indexing a name/value pair.
 java.lang.String getXmlLang()
          Returns the xml:lang attibute value from the configuration
protected  boolean initToSax()
          Init the LinkedHashMap _xmlizable_objects with the objects in order to describ them in XML
protected  void initVolatileObjectsToSax()
          Init the LinkedHashMap _xmlizable_volatile_objects with the objects in order to describ them in XML Some objects need to be refresh each time a toSAX is called
 void removeField(java.lang.String fieldName)
           
 void removeValue(java.lang.String fieldName, java.lang.String value)
           
 void setId(java.lang.String id)
           
 void setXmlLang(java.lang.String xmlLang)
           
protected  void updateLDField(java.lang.String name, java.lang.String value)
           
 
Methods inherited from class fr.gouv.culture.sdx.utils.AbstractSdxObject
configure, configureDescription, contextualize, enableLogging, getBaseAttributes, getConfiguration, getContext, getDescription, getEncoding, getLocale, getLog, getServiceManager, service, setDescription, setEncoding, setLocale, setUpSdxObject, setUpSdxObject, toSAX, verifyConfigurationResources
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_NAME_SUFFIX

public static final java.lang.String CLASS_NAME_SUFFIX
See Also:
Constant Field Values

ldFields

protected java.util.Hashtable ldFields

allKey

public static final java.lang.String allKey
See Also:
Constant Field Values

allValue

public static final java.lang.String allValue
See Also:
Constant Field Values

idKey

public static final java.lang.String idKey
See Also:
Constant Field Values

xmlLangKey

public static final java.lang.String xmlLangKey
See Also:
Constant Field Values
Constructor Detail

LuceneData

public LuceneData()

LuceneData

public LuceneData(org.apache.lucene.document.Document lDoc)
Method Detail

setId

public void setId(java.lang.String id)
Specified by:
setId in interface Identifiable
Overrides:
setId in class AbstractSdxObject

setXmlLang

public void setXmlLang(java.lang.String xmlLang)
Specified by:
setXmlLang in interface Localizable
Overrides:
setXmlLang in class AbstractSdxObject

getXmlLang

public java.lang.String getXmlLang()
Description copied from class: AbstractSdxObject
Returns the xml:lang attibute value from the configuration

Specified by:
getXmlLang in interface Localizable
Overrides:
getXmlLang in class AbstractSdxObject

getId

public java.lang.String getId()
Specified by:
getId in interface Identifiable
Overrides:
getId in class AbstractSdxObject

addField

public void addField(java.lang.String fieldName,
                     java.lang.String value,
                     java.lang.String type)

removeField

public void removeField(java.lang.String fieldName)

removeValue

public void removeValue(java.lang.String fieldName,
                        java.lang.String value)

getFieldValues

public java.lang.String[] getFieldValues(java.lang.String fieldName)

getFieldValue

public java.lang.String getFieldValue(java.lang.String fieldName)

getLuceneDocument

public org.apache.lucene.document.Document getLuceneDocument()
Returns a Lucene f based upon the current set of properties/LuceneDataFields.


addLDField

protected void addLDField(java.lang.String name,
                          java.lang.String value)
Builds a keyworld lucene field


addLDField

protected void addLDField(java.lang.String name,
                          java.lang.String value,
                          java.lang.String type)

addLDField

protected void addLDField(org.apache.lucene.document.Field f)

updateLDField

protected void updateLDField(java.lang.String name,
                             java.lang.String value)

deleteLDField

protected void deleteLDField(java.lang.String name)

getField

public LuceneDataField getField(java.lang.String key)
Gets a specific LuceneDataField


getFields

public java.util.Enumeration getFields()
Returns all LuceneDataFields


getContentFields

public java.util.Enumeration getContentFields()
Returns only the content LuceneDataFields, excluding the all, id, and xmllang fields


getLuceneField

protected org.apache.lucene.document.Field getLuceneField(java.lang.String name,
                                                          java.lang.String value)
                                                   throws SDXException
Returns a Lucene field for indexing a name/value pair.

Parameters:
name - Name of the field.
value - Value of the field.
Throws:
SDXException

getClassNameSuffix

protected java.lang.String getClassNameSuffix()
Description copied from class: AbstractSdxObject
Sub classes should element this method to return their class name suffix for SAX output

Specified by:
getClassNameSuffix in class AbstractSdxObject

initToSax

protected boolean initToSax()
Description copied from class: AbstractSdxObject
Init the LinkedHashMap _xmlizable_objects with the objects in order to describ them in XML

Specified by:
initToSax in class AbstractSdxObject

initVolatileObjectsToSax

protected void initVolatileObjectsToSax()
Init the LinkedHashMap _xmlizable_volatile_objects with the objects in order to describ them in XML Some objects need to be refresh each time a toSAX is called

Specified by:
initVolatileObjectsToSax in class AbstractSdxObject


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