Package org.ametys.cms.search.systemprop
Class AbstractSystemProperty
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.cms.search.systemprop.AbstractSystemProperty
- All Implemented Interfaces:
SystemProperty
,LogEnabled
,PluginAware
,Configurable
,Serviceable
- Direct Known Subclasses:
AbstractUserSystemProperty
,CollectionsSystemProperty
,CommentsSystemProperty
,ContentPrivacySystemProperty
,ContentTypeSystemProperty
,CreationDateSystemProperty
,FirstValidationSystemProperty
,FulltextSystemProperty
,LanguageSystemProperty
,LastMajorValidationSystemProperty
,LastModifiedSystemProperty
,LastValidationSystemProperty
,OrphanSystemProperty
,PagesSystemProperty
,ParentContentSystemProperty
,SharedSystemProperty
,SiteSystemProperty
,SiteTypeSystemProperty
,TagsSystemProperty
,WorkflowStepSystemProperty
public abstract class AbstractSystemProperty
extends AbstractLogEnabled
implements SystemProperty, Serviceable, Configurable, PluginAware
Abstract class providing standard behavior and helper methods for a
SystemProperty
.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.ametys.cms.search.model.SystemProperty
SystemProperty.EnumeratorDefinition
-
Field Summary
Modifier and TypeFieldDescriptionprotected I18nizableText
The property description.protected I18nUtils
The i18n utils.protected String
The property ID.protected I18nizableText
The property label.protected String
The property plugin name.protected AmetysObjectResolver
The ametys object resolverprotected UserHelper
The user helperprotected UserManager
The user manager -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
_indexBooleanValue
(SearchField field, Boolean value, org.apache.solr.common.SolrInputDocument document) Index Boolean valueprotected void
_indexBooleanValues
(SearchField field, Boolean[] values, org.apache.solr.common.SolrInputDocument document) Index multiple Boolean valuesprotected void
_indexDateValue
(SearchField field, Date value, org.apache.solr.common.SolrInputDocument document) Index Date valueprotected void
_indexDateValues
(SearchField field, Date[] values, org.apache.solr.common.SolrInputDocument document) Index multiple Date valuesprotected void
_indexDoubleValue
(SearchField field, Double value, org.apache.solr.common.SolrInputDocument document) Index Double valueprotected void
_indexDoubleValues
(SearchField field, Double[] values, org.apache.solr.common.SolrInputDocument document) Index multiple Double valuesprotected void
_indexGeocodeValue
(SearchField field, Map<String, Double> value, org.apache.solr.common.SolrInputDocument document) Index geocode valueprotected void
_indexLongValue
(SearchField field, Long value, org.apache.solr.common.SolrInputDocument document) Index Long valueprotected void
_indexLongValues
(SearchField field, Long[] values, org.apache.solr.common.SolrInputDocument document) Index multiple Long valuesprotected void
_indexStringValue
(SearchField field, String value, org.apache.solr.common.SolrInputDocument document) Index String valueprotected void
_indexStringValues
(SearchField field, String[] values, org.apache.solr.common.SolrInputDocument document) Index multiple String valuesprotected void
_indexUserValue
(SearchField field, UserIdentity value, org.apache.solr.common.SolrInputDocument document) Index UserIdentity valueprotected void
_indexUserValues
(SearchField field, UserIdentity[] values, org.apache.solr.common.SolrInputDocument document) Index multiple UserIdentity valuesprotected I18nizableText
_parseI18nizableText
(Configuration config, String pluginName, String name) Parse an i18n text.void
configure
(Configuration configuration) Get the system property description.getId()
Get the system property ID.getLabel()
Get the system property label.Get the schema definitions brought by this property.getSortValue
(Content content) Get the sort value represented by this field in the given result content.void
Index the system property in a solr document.protected boolean
parseBoolean
(Object value) Get the value as a boolean.protected AdaptableDate
Get the value as a date.protected double
parseDouble
(Object value) Get the value as a double.protected long
Get the value as a long.protected String
parseString
(Object value) Get the value as a long.protected String[]
parseStringArray
(Object value) Get the value as a array of Stringprotected UserIdentity[]
parseUserArray
(Object value) Get the value as array ofUserIdentity
void
saxValue
(ContentHandler handler, Content content) SAX the valuevoid
service
(ServiceManager manager) void
setPluginInfo
(String pluginName, String featureName, String id) Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.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
getColumnWidth, getContentTypeId, getConverter, getEnumeratorDefinition, getJsonValue, getQuery, getRenderer, getSearchField, getType, getValue, getWidget, getWidgetParameters, isDisplayable, isFacetable, isMultiple, isSearchable, isSortable
-
Field Details
-
_i18nUtils
The i18n utils. -
_id
The property ID. -
_label
The property label. -
_description
The property description. -
_pluginName
The property plugin name. -
_userHelper
The user helper -
_resolver
The ametys object resolver -
_userManager
The user manager
-
-
Constructor Details
-
AbstractSystemProperty
public AbstractSystemProperty()
-
-
Method Details
-
setPluginInfo
Description copied from interface:PluginAware
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.- Specified by:
setPluginInfo
in interfacePluginAware
- Parameters:
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this component
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
configure
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
getId
Description copied from interface:SystemProperty
Get the system property ID.- Specified by:
getId
in interfaceSystemProperty
- Returns:
- The property ID.
-
getLabel
Description copied from interface:SystemProperty
Get the system property label.- Specified by:
getLabel
in interfaceSystemProperty
- Returns:
- The property label.
-
getDescription
Description copied from interface:SystemProperty
Get the system property description.- Specified by:
getDescription
in interfaceSystemProperty
- Returns:
- The property description.
-
index
Description copied from interface:SystemProperty
Index the system property in a solr document.- Specified by:
index
in interfaceSystemProperty
- Parameters:
content
- The content to index.document
- The solr document to index into.
-
getSortValue
Description copied from interface:SystemProperty
Get the sort value represented by this field in the given result content.- Specified by:
getSortValue
in interfaceSystemProperty
- Parameters:
content
- the result content.- Returns:
- the content sort value, must be scalar (String, long, double, Date).
-
saxValue
Description copied from interface:SystemProperty
SAX the value- Specified by:
saxValue
in interfaceSystemProperty
- Parameters:
handler
- The content handler to sax intocontent
- The content- Throws:
SAXException
- If an error occurred while saxing
-
getSchemaDefinitions
Description copied from interface:SystemProperty
Get the schema definitions brought by this property.- Specified by:
getSchemaDefinitions
in interfaceSystemProperty
- Returns:
- The schema definitions used by this property.
-
_parseI18nizableText
protected I18nizableText _parseI18nizableText(Configuration config, String pluginName, String name) throws ConfigurationException Parse an i18n text.- Parameters:
config
- the configuration to use.pluginName
- the current plugin name.name
- the child name.- Returns:
- the i18n text.
- Throws:
ConfigurationException
- if the configuration is not valid.
-
parseString
Get the value as a long.- Parameters:
value
- The value as an object.- Returns:
- The value as a long.
-
parseLong
Get the value as a long.- Parameters:
value
- The value as an object.- Returns:
- The value as a long.
-
parseDouble
Get the value as a double.- Parameters:
value
- The value as an object.- Returns:
- The value as a double.
-
parseBoolean
Get the value as a boolean.- Parameters:
value
- The value as an object, can be a Boolean or a String.- Returns:
- The value as a boolean.
-
parseDate
Get the value as a date.- Parameters:
value
- The value as an object, can be a Date or a String.- Returns:
- The value as a Date object.
-
parseUserArray
Get the value as array ofUserIdentity
- Parameters:
value
- The value to parse- Returns:
- A array of
UserIdentity
-
parseStringArray
Get the value as a array of String- Parameters:
value
- The value as an object to parse- Returns:
- The values as a String array
-
_indexStringValues
protected void _indexStringValues(SearchField field, String[] values, org.apache.solr.common.SolrInputDocument document) Index multiple String values- Parameters:
field
- The search fieldvalues
- The valuesdocument
- The Solr document to index into
-
_indexStringValue
protected void _indexStringValue(SearchField field, String value, org.apache.solr.common.SolrInputDocument document) Index String value- Parameters:
field
- The search fieldvalue
- The valuedocument
- The Solr document to index into
-
_indexDateValues
protected void _indexDateValues(SearchField field, Date[] values, org.apache.solr.common.SolrInputDocument document) Index multiple Date values- Parameters:
field
- The search fieldvalues
- The valuesdocument
- The Solr document to index into
-
_indexDateValue
protected void _indexDateValue(SearchField field, Date value, org.apache.solr.common.SolrInputDocument document) Index Date value- Parameters:
field
- The search fieldvalue
- The valuedocument
- The Solr document to index into
-
_indexLongValues
protected void _indexLongValues(SearchField field, Long[] values, org.apache.solr.common.SolrInputDocument document) Index multiple Long values- Parameters:
field
- The search fieldvalues
- The valuesdocument
- The Solr document to index into
-
_indexLongValue
protected void _indexLongValue(SearchField field, Long value, org.apache.solr.common.SolrInputDocument document) Index Long value- Parameters:
field
- The search fieldvalue
- The valuedocument
- The Solr document to index into
-
_indexDoubleValues
protected void _indexDoubleValues(SearchField field, Double[] values, org.apache.solr.common.SolrInputDocument document) Index multiple Double values- Parameters:
field
- The search fieldvalues
- The valuesdocument
- The Solr document to index into
-
_indexDoubleValue
protected void _indexDoubleValue(SearchField field, Double value, org.apache.solr.common.SolrInputDocument document) Index Double value- Parameters:
field
- The search fieldvalue
- The valuedocument
- The Solr document to index into
-
_indexBooleanValues
protected void _indexBooleanValues(SearchField field, Boolean[] values, org.apache.solr.common.SolrInputDocument document) Index multiple Boolean values- Parameters:
field
- The search fieldvalues
- The valuesdocument
- The Solr document to index into
-
_indexBooleanValue
protected void _indexBooleanValue(SearchField field, Boolean value, org.apache.solr.common.SolrInputDocument document) Index Boolean value- Parameters:
field
- The search fieldvalue
- The valuedocument
- The Solr document to index into
-
_indexUserValues
protected void _indexUserValues(SearchField field, UserIdentity[] values, org.apache.solr.common.SolrInputDocument document) Index multiple UserIdentity values- Parameters:
field
- The search fieldvalues
- The valuesdocument
- The Solr document to index into
-
_indexUserValue
protected void _indexUserValue(SearchField field, UserIdentity value, org.apache.solr.common.SolrInputDocument document) Index UserIdentity value- Parameters:
field
- The search fieldvalue
- The valuedocument
- The Solr document to index into
-
_indexGeocodeValue
protected void _indexGeocodeValue(SearchField field, Map<String, Double> value, org.apache.solr.common.SolrInputDocument document) Index geocode value- Parameters:
field
- The search fieldvalue
- The valuedocument
- The Solr document to index into
-