Package org.ametys.cms.search.model
Interface SystemProperty
-
- All Known Implementing Classes:
AbstractSystemProperty,AbstractUserSystemProperty,CollectionsSystemProperty,CommentsSystemProperty,ContentPrivacySystemProperty,ContentTypeSystemProperty,ContributorSystemProperty,CreationDateSystemProperty,CreatorSystemProperty,FirstValidationSystemProperty,FulltextSystemProperty,LanguageSystemProperty,LastMajorValidationSystemProperty,LastModifiedSystemProperty,LastValidationSystemProperty,OrphanSystemProperty,PagesSystemProperty,ParentContentSystemProperty,SharedSystemProperty,SiteSystemProperty,SiteTypeSystemProperty,TagsSystemProperty,TagsSystemProperty,WorkflowStepSystemProperty,WorkflowStepSystemProperty
public interface SystemProperty
Represents a universal property of aContent(content types, language, current workflow step, ...)
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classSystemProperty.EnumeratorDefinitionRepresentation of an Enumerator, used to generate an Enumerator on the fly.
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default IntegergetColumnWidth()Get the column width.default StringgetContentTypeId()In case of a Content reference field, the content type ID.default StringgetConverter()Get the property column converter.I18nizableTextgetDescription()Get the system property description.default SystemProperty.EnumeratorDefinitiongetEnumeratorDefinition(Configuration configuration)Get the definition of an enumerator.StringgetId()Get the system property ID.default ObjectgetJsonValue(Content content, boolean full)Get the jsonified valueI18nizableTextgetLabel()Get the system property label.QuerygetQuery(Object value, Query.Operator operator, String language, Map<String,Object> contextualParameters)Get theQueryassociated to the given value.default StringgetRenderer()Get the renderer.Collection<SchemaDefinition>getSchemaDefinitions()Get the schema definitions brought by this property.SearchFieldgetSearchField()Get theSearchFieldrepresenting this system property.default ObjectgetSortValue(Content content)Get the sort value represented by this field in the given result content.MetadataTypegetType()Get the property type.ObjectgetValue(Content content)Get the typed raw value for this field in the given result content.default StringgetWidget()Get the default widget to use when rendering this property as a criterion.default Map<String,I18nizableText>getWidgetParameters(Configuration configuration)Get the widget parameters.voidindex(Content content, org.apache.solr.common.SolrInputDocument document)Index the system property in a solr document.default booleanisDisplayable()Get if the property can be displayed (i.e.default booleanisFacetable()Gets if the property can be facetablebooleanisMultiple()Get the multiple status of the property.default booleanisSearchable()Get if the property can be searched on (i.e.default booleanisSortable()Get if the property can be sorted on.voidsaxValue(ContentHandler handler, Content content)SAX the value
-
-
-
Method Detail
-
getLabel
I18nizableText getLabel()
Get the system property label.- Returns:
- The property label.
-
getDescription
I18nizableText getDescription()
Get the system property description.- Returns:
- The property description.
-
getType
MetadataType getType()
Get the property type.- Returns:
- the property type.
-
isMultiple
boolean isMultiple()
Get the multiple status of the property.- Returns:
trueif the property can have multiple values,falseotherwise.
-
getEnumeratorDefinition
default SystemProperty.EnumeratorDefinition getEnumeratorDefinition(Configuration configuration)
Get the definition of an enumerator.- Parameters:
configuration- The enumerator configuration.- Returns:
- The enumerator definition or null if the property is not enumerated.
-
getContentTypeId
default String getContentTypeId()
In case of a Content reference field, the content type ID.- Returns:
- the content type ID.
-
isSearchable
default boolean isSearchable()
Get if the property can be searched on (i.e. used in a SearchCriterion).- Returns:
trueif the property can be searched on,falseotherwise.
-
isDisplayable
default boolean isDisplayable()
Get if the property can be displayed (i.e. used in a ResultField).- Returns:
trueif the property can be displayed,falseotherwise.
-
isSortable
default boolean isSortable()
Get if the property can be sorted on.- Returns:
trueif the property can be sorted on,falseotherwise.
-
isFacetable
default boolean isFacetable()
Gets if the property can be facetable- Returns:
trueif the property can be facetable,falseotherwise.
-
getQuery
Query getQuery(Object value, Query.Operator operator, String language, Map<String,Object> contextualParameters)
Get 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
default String getWidget()
Get 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.
-
getWidgetParameters
default Map<String,I18nizableText> getWidgetParameters(Configuration configuration)
Get the widget parameters.- Parameters:
configuration- The system property configuration- Returns:
- The widget parameters as a Map.
-
getRenderer
default String getRenderer()
Get the renderer.- Returns:
- The column renderer.
-
getConverter
default String getConverter()
Get the property column converter.- Returns:
- The property column converter.
-
getColumnWidth
default Integer getColumnWidth()
Get the column width.- Returns:
- the default column width, can be null.
-
index
void index(Content content, org.apache.solr.common.SolrInputDocument document)
Index the system property in a solr document.- Parameters:
content- The content to index.document- The solr document to index into.
-
getSearchField
SearchField getSearchField()
Get theSearchFieldrepresenting this system property.- Returns:
- The search field representing this system property.
-
getValue
Object getValue(Content content)
Get 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
default Object getJsonValue(Content content, boolean full)
Get the jsonified value- Parameters:
content- the result contentfull-trueto get full value.- Returns:
- the content field value
-
saxValue
void saxValue(ContentHandler handler, Content content) throws SAXException
SAX the value- Parameters:
handler- The content handler to sax intocontent- The content- Throws:
SAXException- If an error occurred while saxing
-
getSortValue
default Object getSortValue(Content content)
Get the sort value represented by this field in the given result content.- Parameters:
content- the result content.- Returns:
- the content sort value, must be scalar (String, long, double, Date).
-
getSchemaDefinitions
Collection<SchemaDefinition> getSchemaDefinitions()
Get the schema definitions brought by this property.- Returns:
- The schema definitions used by this property.
-
-