Package org.ametys.cms.search.systemprop
Class CommentsSystemProperty
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.cms.search.systemprop.AbstractSystemProperty
-
- org.ametys.cms.search.systemprop.CommentsSystemProperty
-
- All Implemented Interfaces:
SystemProperty,LogEnabled,PluginAware,Configurable,Serviceable
public class CommentsSystemProperty extends AbstractSystemProperty
SystemPropertywhich represents the comments of a content.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ametys.cms.search.model.SystemProperty
SystemProperty.EnumeratorDefinition
-
-
Field Summary
-
Fields inherited from class org.ametys.cms.search.systemprop.AbstractSystemProperty
_description, _i18nUtils, _id, _label, _pluginName, _resolver, _userHelper
-
-
Constructor Summary
Constructors Constructor Description CommentsSystemProperty()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IntegergetColumnWidth()Get the column width.SystemProperty.EnumeratorDefinitiongetEnumeratorDefinition(Configuration configuration)Get the definition of an enumerator.ObjectgetJsonValue(Content content, boolean full)Get the jsonified valueQuerygetQuery(Object value, Query.Operator operator, String language, Map<String,Object> contextualParameters)Get theQueryassociated to the given value.StringgetRenderer()Get the renderer.Collection<SchemaDefinition>getSchemaDefinitions()Get the schema definitions brought by this property.SearchFieldgetSearchField()Get theSearchFieldrepresenting this system property.MetadataTypegetType()Get the property type.ObjectgetValue(Content content)Get the typed raw value for this field in the given result content.StringgetWidget()Get the default widget to use when rendering this property as a criterion.voidindex(Content content, org.apache.solr.common.SolrInputDocument document)Index the system property in a solr document.booleanisMultiple()Get the multiple status of the property.booleanisSortable()Get if the property can be sorted on.-
Methods inherited from class org.ametys.cms.search.systemprop.AbstractSystemProperty
_indexBooleanValue, _indexBooleanValues, _indexDateValue, _indexDateValues, _indexDoubleValue, _indexDoubleValues, _indexGeocodeValue, _indexLongValue, _indexLongValues, _indexStringValue, _indexStringValues, _indexUserValue, _indexUserValues, _parseI18nizableText, configure, getDescription, getId, getLabel, getSortValue, parseBoolean, parseDate, parseDouble, parseLong, parseString, parseStringArray, parseUserArray, saxValue, service, setPluginInfo
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ametys.cms.search.model.SystemProperty
getContentTypeId, getConverter, getWidgetParameters, isDisplayable, isFacetable, isSearchable
-
-
-
-
Constructor Detail
-
CommentsSystemProperty
public CommentsSystemProperty()
-
-
Method Detail
-
getType
public MetadataType getType()
Description copied from interface:SystemPropertyGet the property type.- Returns:
- the property type.
-
isMultiple
public boolean isMultiple()
Description copied from interface:SystemPropertyGet the multiple status of the property.- Returns:
trueif the property can have multiple values,falseotherwise.
-
isSortable
public boolean isSortable()
Description copied from interface:SystemPropertyGet if the property can be sorted on.- Returns:
trueif the property can be sorted on,falseotherwise.
-
getQuery
public Query getQuery(Object value, Query.Operator operator, String language, Map<String,Object> contextualParameters)
Description copied from interface:SystemPropertyGet theQueryassociated to the given value.- Parameters:
value- the user-submitted value for this property.operator- In advanced search mode, the operator chosen by the user.nullto use the criterion-defined operator (simple search mode).language- The current search language.contextualParameters- the search contextual parameters.- Returns:
- The
Queryassociated to the given value.
-
getWidget
public String getWidget()
Description copied from interface:SystemPropertyGet the default widget to use when rendering this property as a criterion.- Returns:
- The default widget to use, or
nullif no specific widget is necessary.
-
getRenderer
public String getRenderer()
Description copied from interface:SystemPropertyGet the renderer.- Returns:
- The column renderer.
-
getColumnWidth
public Integer getColumnWidth()
Description copied from interface:SystemPropertyGet the column width.- Returns:
- the default column width, can be null.
-
getSearchField
public SearchField getSearchField()
Description copied from interface:SystemPropertyGet theSearchFieldrepresenting this system property.- Returns:
- The search field representing this system property.
-
getSchemaDefinitions
public Collection<SchemaDefinition> getSchemaDefinitions()
Description copied from interface:SystemPropertyGet the schema definitions brought by this property.- Specified by:
getSchemaDefinitionsin interfaceSystemProperty- Overrides:
getSchemaDefinitionsin classAbstractSystemProperty- Returns:
- The schema definitions used by this property.
-
index
public void index(Content content, org.apache.solr.common.SolrInputDocument document)
Description copied from interface:SystemPropertyIndex the system property in a solr document.- Specified by:
indexin interfaceSystemProperty- Overrides:
indexin classAbstractSystemProperty- Parameters:
content- The content to index.document- The solr document to index into.
-
getValue
public Object getValue(Content content)
Description copied from interface:SystemPropertyGet the typed raw value for this field in the given result content. The returned object depends on this field's type:
-MetadataType.STRINGmust return String or String[] if multiple
-MetadataType.DATEorMetadataType.DATETIMEmust return Date or Date[] if multiple
-MetadataType.LONGmust return Long or Long[] if multiple
-MetadataType.DOUBLEmust return Double or Double[] if multiple
-MetadataType.CONTENTmust return String or String[] if multiple
-MetadataType.GEOCODEmust return Map<String, Double>
-MetadataType.USERmust return UserIdentity or UserIdentity[] if multiple
-MetadataType.MULTILINGUAL_STRINGmust returnMultilingualString
Others types are not supported.- Parameters:
content- The result content- Returns:
- The typed value, cast to the appropriate object according its type.
-
getJsonValue
public Object getJsonValue(Content content, boolean full)
Description copied from interface:SystemPropertyGet the jsonified value- Parameters:
content- the result contentfull-trueto get full value.- Returns:
- the content field value
-
getEnumeratorDefinition
public SystemProperty.EnumeratorDefinition getEnumeratorDefinition(Configuration configuration)
Description copied from interface:SystemPropertyGet the definition of an enumerator.- Parameters:
configuration- The enumerator configuration.- Returns:
- The enumerator definition or null if the property is not enumerated.
-
-