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 a
Content
(content types, language, current workflow step, ...)-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
Representation of an Enumerator, used to generate an Enumerator on the fly. -
Method Summary
Modifier and TypeMethodDescriptiondefault Integer
Get the column width.default String
In case of a Content reference field, the content type ID.default String
Get the property column converter.Get the system property description.getEnumeratorDefinition
(Configuration configuration) Get the definition of an enumerator.getId()
Get the system property ID.default Object
getJsonValue
(Content content, boolean full) Get the jsonified valuegetLabel()
Get the system property label.getQuery
(Object value, Query.Operator operator, String language, Map<String, Object> contextualParameters) Get theQuery
associated to the given value.default String
Get the renderer.Get the schema definitions brought by this property.Get theSearchField
representing this system property.default Object
getSortValue
(Content content) Get the sort value represented by this field in the given result content.getType()
Get the property type.Get the typed raw value for this field in the given result content.default String
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 the system property in a solr document.default boolean
Get if the property can be displayed (i.e.default boolean
Gets if the property can be facetableboolean
Get the multiple status of the property.default boolean
Get if the property can be searched on (i.e.default boolean
Get if the property can be sorted on.void
saxValue
(ContentHandler handler, Content content) SAX the value
-
Method Details
-
getId
Get the system property ID.- Returns:
- The property ID.
-
getLabel
Get the system property label.- Returns:
- The property label.
-
getDescription
Get the system property description.- Returns:
- The property description.
-
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
Get the definition of an enumerator.- Parameters:
configuration
- The enumerator configuration.- Returns:
- The enumerator definition or null if the property is not enumerated.
-
getContentTypeId
In case of a Content reference field, the content type ID.- Returns:
- the content type ID.
-
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
Get if the property can be displayed (i.e. used in a ResultField).- Returns:
true
if the property can be displayed,false
otherwise.
-
isSortable
Get if the property can be sorted on.- Returns:
true
if the property can be sorted on,false
otherwise.
-
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
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
Get the widget parameters.- Parameters:
configuration
- The system property configuration- Returns:
- The widget parameters as a Map.
-
getRenderer
Get the renderer.- Returns:
- The column renderer.
-
getConverter
Get the property column converter.- Returns:
- The property column converter.
-
getColumnWidth
Get the column width.- Returns:
- the default column width, can be null.
-
index
Index the system property in a solr document.- Parameters:
content
- The content to index.document
- The solr document to index into.
-
getSearchField
Get theSearchField
representing this system property.- Returns:
- The search field representing this system property.
-
getValue
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
Get the jsonified value- Parameters:
content
- the result contentfull
-true
to get full value.- Returns:
- the content field value
-
saxValue
SAX the value- Parameters:
handler
- The content handler to sax intocontent
- The content- Throws:
SAXException
- If an error occurred while saxing
-
getSortValue
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
Get the schema definitions brought by this property.- Returns:
- The schema definitions used by this property.
-