Package ome.services.fulltext
Class BridgeHelper
- java.lang.Object
-
- ome.services.fulltext.BridgeHelper
-
- All Implemented Interfaces:
org.hibernate.search.bridge.FieldBridge,org.springframework.beans.factory.Aware,org.springframework.context.ApplicationEventPublisherAware
- Direct Known Subclasses:
FullTextBridge,ProjectWithImageNameBridge,TablesBridge
@Deprecated public abstract class BridgeHelper extends java.lang.Object implements org.hibernate.search.bridge.FieldBridge, org.springframework.context.ApplicationEventPublisherAwareDeprecated.Base class for building customFieldBridgeimplementations.- Since:
- 3.0-Beta3
-
-
Constructor Summary
Constructors Constructor Description BridgeHelper()Deprecated.
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidadd(org.apache.lucene.document.Document d, java.lang.String field, java.lang.String value, org.hibernate.search.bridge.LuceneOptions opts)Deprecated.Helper method which takes the parameters from theset(String, Object, Document, LuceneOptions)method (possibly modified) as well as the parsedStringvalue which should be added to the index, and adds two fields.protected voidaddContents(org.apache.lucene.document.Document d, java.lang.String name, ome.model.core.OriginalFile file, ome.io.nio.OriginalFilesService files, java.util.Map<java.lang.String,FileParser> parsers, org.hibernate.search.bridge.LuceneOptions opts)Deprecated.Second helper method used when parsing files.protected voidaddEnumIfNotNull(org.apache.lucene.document.Document d, java.lang.String field, ome.model.IEnum value, org.hibernate.search.bridge.LuceneOptions opts)Deprecated.Helper method which takes the parameters from theset(String, Object, Document, LuceneOptions)method (possibly modified) as well as theIEnumvalue which should be added to the index, and adds two fields.protected voidaddIfNotNull(org.apache.lucene.document.Document d, java.lang.String field, java.lang.String value, org.hibernate.search.bridge.LuceneOptions opts)Deprecated.Helper method which takes the parameters from theset(String, Object, Document, LuceneOptions)method (possibly modified) as well as the parsedStringvalue which should be added to the index, and adds two fields.static <T> TgetProxiedObject(T proxy)Deprecated.Simpler wrapper to handle superclass proxy objects (e.g.org.slf4j.Loggerlogger()Deprecated.protected java.lang.Iterable<java.io.Reader>parse(ome.model.core.OriginalFile file, ome.io.nio.OriginalFilesService files, java.util.Map<java.lang.String,FileParser> parsers)Deprecated.Attempts to parse the givenOriginalFile.protected <T extends ome.model.IObject>
voidreindex(T object)Deprecated.Publishes aReindexMessagewhich will get processed asynchronously.protected <T extends ome.model.IObject>
voidreindexAll(java.util.List<T> list)Deprecated.Publishes aReindexMessagewhich will get processed asynchronously.abstract voidset(java.lang.String name, java.lang.Object value, org.apache.lucene.document.Document document, org.hibernate.search.bridge.LuceneOptions opts)Deprecated.Method to be implemented by allbridges.voidsetApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher publisher)Deprecated.
-
-
-
Field Detail
-
COMBINED
public static final java.lang.String COMBINED
Deprecated.Name of theFieldwhich contains the union of all fields. This is also the default search field, so users need not append the value to search the full index. A field name need only be added to a search to eliminate other fields.- See Also:
- Constant Field Values
-
log
protected final org.slf4j.Logger log
Deprecated.
-
publisher
protected org.springframework.context.ApplicationEventPublisher publisher
Deprecated.
-
-
Method Detail
-
getProxiedObject
public static <T> T getProxiedObject(T proxy)
Deprecated.Simpler wrapper to handle superclass proxy objects (e.g. Annotation) which do * not behave properly with instanceof checks.- See Also:
- ticket:5076
-
logger
public final org.slf4j.Logger logger()
Deprecated.
-
setApplicationEventPublisher
public void setApplicationEventPublisher(org.springframework.context.ApplicationEventPublisher publisher)
Deprecated.- Specified by:
setApplicationEventPublisherin interfaceorg.springframework.context.ApplicationEventPublisherAware
-
set
public abstract void set(java.lang.String name, java.lang.Object value, org.apache.lucene.document.Document document, org.hibernate.search.bridge.LuceneOptions opts)Deprecated.Method to be implemented by allbridges. The "value" argument is an active Hibernate object, and so the full graph can be walked.- Specified by:
setin interfaceorg.hibernate.search.bridge.FieldBridge
-
addIfNotNull
protected void addIfNotNull(org.apache.lucene.document.Document d, java.lang.String field, java.lang.String value, org.hibernate.search.bridge.LuceneOptions opts)Deprecated.Helper method which takes the parameters from theset(String, Object, Document, LuceneOptions)method (possibly modified) as well as the parsedStringvalue which should be added to the index, and adds two fields. One with the given field name and another to theCOMBINEDfield which is the default search provided to users. In addition to storing the value as is, anotherFieldwill be added for both the named andCOMBINEDcases using aStringReaderto allow Lucene to tokenize theString.- Parameters:
d- Document as passed to the set method. Do not modify.field- Field name which probably should be modified. If this value is null, then the "value" will only be added to theCOMBINEDfield.value- Value which has been parsed out for this field. If null, then this is a no-op.opts- LuceneOptions, passed in from the runtime. If overriding on the interface values is required, seeSimpleLuceneOptions
-
addEnumIfNotNull
protected void addEnumIfNotNull(org.apache.lucene.document.Document d, java.lang.String field, ome.model.IEnum value, org.hibernate.search.bridge.LuceneOptions opts)Deprecated.Helper method which takes the parameters from theset(String, Object, Document, LuceneOptions)method (possibly modified) as well as theIEnumvalue which should be added to the index, and adds two fields. One with the given field name and another to theCOMBINEDfield which is the default search provided to users. In addition to storing the value as is, anotherFieldwill be added for both the named andCOMBINEDcases using aStringReaderto allow Lucene to tokenize theString.- Parameters:
d- Document as passed to the set method. Do not modify.field- Field name which probably should be modified. If this value is null, then the "value" will only be added to theCOMBINEDfield.value-IEnumwhoseIEnum.getValue()method will be called. If null, then this is a no-op.opts- LuceneOptions, passed in from the runtime. If overriding on the interface values is required, seeSimpleLuceneOptions
-
add
protected void add(org.apache.lucene.document.Document d, java.lang.String field, java.lang.String value, org.hibernate.search.bridge.LuceneOptions opts)Deprecated.Helper method which takes the parameters from theset(String, Object, Document, LuceneOptions)method (possibly modified) as well as the parsedStringvalue which should be added to the index, and adds two fields. One with the given field name and another to theCOMBINEDfield which is the default search provided to users. In addition to storing the value as is, anotherFieldwill be added for both the named andCOMBINEDcases using aStringReaderto allow Lucene to tokenize theString.- Parameters:
d- Document as passed to the set method. Do not modify.field- Field name which probably should be modified. If this value is null, then the "value" will only be added to theCOMBINEDfield.value- Value which has been parsed out for this field. Should not be null. If you need to store a null value in the index, use a null token like "null".opts- LuceneOptions, passed in from the runtime. If overriding on the interface values is required, seeSimpleLuceneOptions
-
addContents
protected void addContents(org.apache.lucene.document.Document d, java.lang.String name, ome.model.core.OriginalFile file, ome.io.nio.OriginalFilesService files, java.util.Map<java.lang.String,FileParser> parsers, org.hibernate.search.bridge.LuceneOptions opts)Deprecated.Second helper method used when parsing files. TheOriginalFilewill be passed toparse(OriginalFile, OriginalFilesService, Map)to generateReaderinstances, which will be read until they signal an end, however it is not the responsibility of this instance to close the Readers since this happens asynchronously. The contents of the file will be parsed both toCOMBINEDand "file.contents".- Parameters:
d-Documentas passed to set. Do not modify.name- String to be used as the name of the field. If null, then the contents will only be added to theCOMBINEDField.file- Non-null, possibly unloadedOriginalFilewhich is used to look up the file on disk.files-OriginalFilesServicewhich knows how to find where thisOriginalFileis stored on disk.parsers-MapofFileParserinstances to be used based on theFormatof theOriginalFileopts- The search option.
-
reindex
protected <T extends ome.model.IObject> void reindex(T object)
Deprecated.Publishes aReindexMessagewhich will get processed asynchronously.
-
reindexAll
protected <T extends ome.model.IObject> void reindexAll(java.util.List<T> list)
Deprecated.Publishes aReindexMessagewhich will get processed asynchronously.
-
parse
protected java.lang.Iterable<java.io.Reader> parse(ome.model.core.OriginalFile file, ome.io.nio.OriginalFilesService files, java.util.Map<java.lang.String,FileParser> parsers)Deprecated.Attempts to parse the givenOriginalFile. If any of the necessary components is null, then it will return an empty, but not nullIterable. Also looks for the catch all parser under "*"- Parameters:
file- Can be null.- Returns:
- will not be null.
-
-