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
,ProfiledGroupsTagsSystemProperty
,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 class
SystemProperty.EnumeratorDefinition
Representation 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 Integer
getColumnWidth()
Get the column width.default String
getContentTypeId()
In case of a Content reference field, the content type ID.default String
getConverter()
Get the property column converter.I18nizableText
getDescription()
Get the system property description.default SystemProperty.EnumeratorDefinition
getEnumeratorDefinition(Configuration configuration)
Get the definition of an enumerator.String
getId()
Get the system property ID.default Object
getJsonValue(Content content, boolean full)
Get the jsonified valueI18nizableText
getLabel()
Get the system property label.Query
getQuery(Object value, Query.Operator operator, String language, Map<String,Object> contextualParameters)
Get theQuery
associated to the given value.default String
getRenderer()
Get the renderer.Collection<SchemaDefinition>
getSchemaDefinitions()
Get the schema definitions brought by this property.SearchField
getSearchField()
Get theSearchField
representing this system property.default Object
getSortValue(Content content)
Get the sort value represented by this field in the given result content.MetadataType
getType()
Get the property type.Object
getValue(Content content)
Get the typed raw value for this field in the given result content.default String
getWidget()
Get the default widget to use when rendering this property as a criterion.default Map<String,I18nizableText>
getWidgetParameters(Configuration configuration)
Get the widget parameters.void
index(Content content, org.apache.solr.common.SolrInputDocument document)
Index the system property in a solr document.default boolean
isDisplayable()
Get if the property can be displayed (i.e.default boolean
isFacetable()
Gets if the property can be facetableboolean
isMultiple()
Get the multiple status of the property.default boolean
isSearchable()
Get if the property can be searched on (i.e.default boolean
isSortable()
Get if the property can be sorted on.void
saxValue(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:
true
if the property can have multiple values,false
otherwise.
-
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:
true
if the property can be searched on,false
otherwise.
-
isDisplayable
default boolean isDisplayable()
Get if the property can be displayed (i.e. used in a ResultField).- Returns:
true
if the property can be displayed,false
otherwise.
-
isSortable
default boolean isSortable()
Get if the property can be sorted on.- Returns:
true
if the property can be sorted on,false
otherwise.
-
isFacetable
default boolean isFacetable()
Gets if the property can be facetable- Returns:
true
if the property can be facetable,false
otherwise.
-
getQuery
Query getQuery(Object value, Query.Operator operator, String language, Map<String,Object> contextualParameters)
Get theQuery
associated to the given value.- Parameters:
value
- the user-submitted value for this property.operator
- In advanced search mode, the operator chosen by the user.null
to use the criterion-defined operator (simple search mode).language
- The current search language.contextualParameters
- the search contextual parameters.- Returns:
- The
Query
associated 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
null
if 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 theSearchField
representing 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.STRING
must return String or String[] if multiple
-MetadataType.DATE
orMetadataType.DATETIME
must return Date or Date[] if multiple
-MetadataType.LONG
must return Long or Long[] if multiple
-MetadataType.DOUBLE
must return Double or Double[] if multiple
-MetadataType.CONTENT
must return String or String[] if multiple
-MetadataType.GEOCODE
must return Map<String, Double>
-MetadataType.USER
must return UserIdentity or UserIdentity[] if multiple
-MetadataType.MULTILINGUAL_STRING
must 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
-true
to 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.
-
-