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 aSystemProperty.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.ametys.cms.search.model.SystemProperty
SystemProperty.EnumeratorDefinition
-
-
Field Summary
Fields Modifier and Type Field Description protected I18nizableText_descriptionThe property description.protected I18nUtils_i18nUtilsThe i18n utils.protected String_idThe property ID.protected I18nizableText_labelThe property label.protected String_pluginNameThe property plugin name.protected AmetysObjectResolver_resolverThe ametys object resolverprotected UserHelper_userHelperThe user helper
-
Constructor Summary
Constructors Constructor Description AbstractSystemProperty()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected 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.private void_saxContentValue(ContentHandler handler, String value, Locale locale)private void_saxGeocodeValue(ContentHandler handler, Map<String,Double> value)private void_saxSingleValue(ContentHandler handler, Object value)private void_saxUserIdentityValue(ContentHandler handler, UserIdentity value)voidconfigure(Configuration configuration)I18nizableTextgetDescription()Get the system property description.StringgetId()Get the system property ID.I18nizableTextgetLabel()Get the system property label.Collection<SchemaDefinition>getSchemaDefinitions()Get the schema definitions brought by this property.ObjectgetSortValue(Content content)Get the sort value represented by this field in the given result content.voidindex(Content content, org.apache.solr.common.SolrInputDocument document)Index the system property in a solr document.protected booleanparseBoolean(Object value)Get the value as a boolean.protected AdaptableDateparseDate(Object value)Get the value as a date.protected doubleparseDouble(Object value)Get the value as a double.protected longparseLong(Object value)Get the value as a long.protected StringparseString(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 ofUserIdentityvoidsaxValue(ContentHandler handler, Content content)SAX the valuevoidservice(ServiceManager manager)voidsetPluginInfo(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 Detail
-
_i18nUtils
protected I18nUtils _i18nUtils
The i18n utils.
-
_label
protected I18nizableText _label
The property label.
-
_description
protected I18nizableText _description
The property description.
-
_pluginName
protected String _pluginName
The property plugin name.
-
_userHelper
protected UserHelper _userHelper
The user helper
-
_resolver
protected AmetysObjectResolver _resolver
The ametys object resolver
-
-
Constructor Detail
-
AbstractSystemProperty
public AbstractSystemProperty()
-
-
Method Detail
-
setPluginInfo
public void setPluginInfo(String pluginName, String featureName, String id)
Description copied from interface:PluginAwareSets 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:
setPluginInfoin 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
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
getId
public String getId()
Description copied from interface:SystemPropertyGet the system property ID.- Specified by:
getIdin interfaceSystemProperty- Returns:
- The property ID.
-
getLabel
public I18nizableText getLabel()
Description copied from interface:SystemPropertyGet the system property label.- Specified by:
getLabelin interfaceSystemProperty- Returns:
- The property label.
-
getDescription
public I18nizableText getDescription()
Description copied from interface:SystemPropertyGet the system property description.- Specified by:
getDescriptionin interfaceSystemProperty- Returns:
- The property description.
-
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- Parameters:
content- The content to index.document- The solr document to index into.
-
getSortValue
public Object getSortValue(Content content)
Description copied from interface:SystemPropertyGet the sort value represented by this field in the given result content.- Specified by:
getSortValuein interfaceSystemProperty- Parameters:
content- the result content.- Returns:
- the content sort value, must be scalar (String, long, double, Date).
-
saxValue
public void saxValue(ContentHandler handler, Content content) throws SAXException
Description copied from interface:SystemPropertySAX the value- Specified by:
saxValuein interfaceSystemProperty- Parameters:
handler- The content handler to sax intocontent- The content- Throws:
SAXException- If an error occurred while saxing
-
_saxContentValue
private void _saxContentValue(ContentHandler handler, String value, Locale locale) throws SAXException
- Throws:
SAXException
-
_saxUserIdentityValue
private void _saxUserIdentityValue(ContentHandler handler, UserIdentity value) throws SAXException
- Throws:
SAXException
-
_saxGeocodeValue
private void _saxGeocodeValue(ContentHandler handler, Map<String,Double> value) throws SAXException
- Throws:
SAXException
-
_saxSingleValue
private void _saxSingleValue(ContentHandler handler, Object value) throws SAXException
- Throws:
SAXException
-
getSchemaDefinitions
public Collection<SchemaDefinition> getSchemaDefinitions()
Description copied from interface:SystemPropertyGet the schema definitions brought by this property.- Specified by:
getSchemaDefinitionsin 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
protected String parseString(Object value)
Get the value as a long.- Parameters:
value- The value as an object.- Returns:
- The value as a long.
-
parseLong
protected long parseLong(Object value)
Get the value as a long.- Parameters:
value- The value as an object.- Returns:
- The value as a long.
-
parseDouble
protected double parseDouble(Object value)
Get the value as a double.- Parameters:
value- The value as an object.- Returns:
- The value as a double.
-
parseBoolean
protected boolean parseBoolean(Object value)
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
protected AdaptableDate parseDate(Object value)
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
protected UserIdentity[] parseUserArray(Object value)
Get the value as array ofUserIdentity- Parameters:
value- The value to parse- Returns:
- A array of
UserIdentity
-
parseStringArray
protected String[] parseStringArray(Object value)
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
-
-