Class SemanticAnnotationIndexingField
- java.lang.Object
-
- org.ametys.cms.contenttype.indexing.SemanticAnnotationIndexingField
-
- All Implemented Interfaces:
CustomIndexingField
,IndexingField
public class SemanticAnnotationIndexingField extends Object implements CustomIndexingField
IndexingField realizing the indexation of semantic annotations.
-
-
Field Summary
Fields Modifier and Type Field Description private static String
__ANNOTATION_PREFIX
protected SemanticAnnotation
_annotation
The referenced semantic annotation.protected ContentType
_contentType
The declaring content type.protected List<String>
_metaPaths
The metadata paths.
-
Constructor Summary
Constructors Constructor Description SemanticAnnotationIndexingField(SemanticAnnotation annotation, Collection<String> metaPaths, ContentType contentType)
Build a SemanticAnnotationIndexingField.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private void
addAnnotationValues(List<String> values, CompositeMetadata metaHolder, MetadataDefinitionHolder metaDefHolder, String metaPath)
Add the annotation values from a given rich text to the global value list.private void
addAnnotationValues(List<String> allValues, RichText richText)
Add the annotation values from a given rich text to the global value list.I18nizableText
getDescription()
Get the field description.I18nizableText
getLabel()
Get the field label.String
getName()
Get the field's nameMetadataType
getType()
Get the typeObject[]
getValues(Content content)
Get a content's values to index.
-
-
-
Field Detail
-
__ANNOTATION_PREFIX
private static final String __ANNOTATION_PREFIX
- See Also:
- Constant Field Values
-
_annotation
protected SemanticAnnotation _annotation
The referenced semantic annotation.
-
_metaPaths
protected List<String> _metaPaths
The metadata paths.
-
_contentType
protected ContentType _contentType
The declaring content type.
-
-
Constructor Detail
-
SemanticAnnotationIndexingField
public SemanticAnnotationIndexingField(SemanticAnnotation annotation, Collection<String> metaPaths, ContentType contentType)
Build a SemanticAnnotationIndexingField.- Parameters:
annotation
- The semantic annotation.metaPaths
- The paths of the rich text metadatas declaring the annotation.contentType
- The declaring content type.
-
-
Method Detail
-
getName
public String getName()
Description copied from interface:IndexingField
Get the field's name- Specified by:
getName
in interfaceIndexingField
- Returns:
- the field's name
-
getLabel
public I18nizableText getLabel()
Description copied from interface:IndexingField
Get the field label.- Specified by:
getLabel
in interfaceIndexingField
- Returns:
- the field label.
-
getDescription
public I18nizableText getDescription()
Description copied from interface:IndexingField
Get the field description.- Specified by:
getDescription
in interfaceIndexingField
- Returns:
- the field description.
-
getType
public MetadataType getType()
Description copied from interface:IndexingField
Get the type- Specified by:
getType
in interfaceIndexingField
- Returns:
- the type
-
getValues
public Object[] getValues(Content content)
Description copied from interface:CustomIndexingField
Get a content's values to index.- Specified by:
getValues
in interfaceCustomIndexingField
- Parameters:
content
- The content being indexed.- Returns:
- the values to index.
-
addAnnotationValues
private void addAnnotationValues(List<String> values, CompositeMetadata metaHolder, MetadataDefinitionHolder metaDefHolder, String metaPath)
Add the annotation values from a given rich text to the global value list.- Parameters:
values
- The global value list to fill.metaHolder
- The current metadata holder.metaDefHolder
- The current metadata definition holder.metaPath
- The metadata path from the current metadata holder.
-
addAnnotationValues
private void addAnnotationValues(List<String> allValues, RichText richText)
Add the annotation values from a given rich text to the global value list.- Parameters:
allValues
- The global value list to fill.richText
- The rich text.
-
-