public abstract class AbstractSystemProperty extends AbstractLogEnabled implements SystemProperty, Serviceable, Configurable, PluginAware
SystemProperty
.SystemProperty.EnumeratorDefinition
Modifier and Type | Field and Description |
---|---|
protected I18nizableText |
_description
The property description.
|
protected I18nUtils |
_i18nUtils
The i18n utils.
|
protected String |
_id
The property ID.
|
protected I18nizableText |
_label
The property label.
|
protected String |
_pluginName
The property plugin name.
|
protected AmetysObjectResolver |
_resolver
The ametys object resolver
|
protected UserHelper |
_userHelper
The user helper
|
Constructor and Description |
---|
AbstractSystemProperty() |
Modifier and Type | Method and Description |
---|---|
protected void |
_indexBooleanValue(SearchField field,
Boolean value,
SolrInputDocument document)
Index Boolean value
|
protected void |
_indexBooleanValues(SearchField field,
Boolean[] values,
SolrInputDocument document)
Index multiple Boolean values
|
protected void |
_indexDateValue(SearchField field,
Date value,
SolrInputDocument document)
Index Date value
|
protected void |
_indexDateValues(SearchField field,
Date[] values,
SolrInputDocument document)
Index multiple Date values
|
protected void |
_indexDoubleValue(SearchField field,
Double value,
SolrInputDocument document)
Index Double value
|
protected void |
_indexDoubleValues(SearchField field,
Double[] values,
SolrInputDocument document)
Index multiple Double values
|
protected void |
_indexGeocodeValue(SearchField field,
Map<String,Double> value,
SolrInputDocument document)
Index geocode value
|
protected void |
_indexLongValue(SearchField field,
Long value,
SolrInputDocument document)
Index Long value
|
protected void |
_indexLongValues(SearchField field,
Long[] values,
SolrInputDocument document)
Index multiple Long values
|
protected void |
_indexStringValue(SearchField field,
String value,
SolrInputDocument document)
Index String value
|
protected void |
_indexStringValues(SearchField field,
String[] values,
SolrInputDocument document)
Index multiple String values
|
protected void |
_indexUserValue(SearchField field,
UserIdentity value,
SolrInputDocument document)
Index UserIdentity value
|
protected void |
_indexUserValues(SearchField field,
UserIdentity[] values,
SolrInputDocument document)
Index multiple UserIdentity values
|
protected 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) |
void |
configure(Configuration configuration) |
I18nizableText |
getDescription()
Get the system property description.
|
String |
getId()
Get the system property ID.
|
I18nizableText |
getLabel()
Get the system property label.
|
Collection<SchemaDefinition> |
getSchemaDefinitions()
Get the schema definitions brought by this property.
|
Object |
getSortValue(Content content)
Get the sort value represented by this field in the given result content.
|
void |
index(Content content,
SolrInputDocument document)
Index the system property in a solr document.
|
protected boolean |
parseBoolean(Object value)
Get the value as a boolean.
|
protected AdaptableDate |
parseDate(Object value)
Get the value as a date.
|
protected double |
parseDouble(Object value)
Get the value as a double.
|
protected long |
parseLong(Object value)
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 String
|
protected UserIdentity[] |
parseUserArray(Object value)
Get the value as array of
UserIdentity |
void |
saxValue(ContentHandler handler,
Content content)
SAX the value
|
void |
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. |
getLogger, setLogger
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getColumnWidth, getContentTypeId, getConverter, getEnumeratorDefinition, getJsonValue, getQuery, getRenderer, getSearchField, getType, getValue, getWidget, getWidgetParameters, isDisplayable, isFacetable, isMultiple, isSearchable, isSortable
protected I18nUtils _i18nUtils
protected I18nizableText _label
protected I18nizableText _description
protected String _pluginName
protected UserHelper _userHelper
protected AmetysObjectResolver _resolver
public AbstractSystemProperty()
public void setPluginInfo(String pluginName, String featureName, String id)
PluginAware
setPluginInfo
in interface PluginAware
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this componentpublic void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
ConfigurationException
public String getId()
SystemProperty
getId
in interface SystemProperty
public I18nizableText getLabel()
SystemProperty
getLabel
in interface SystemProperty
public I18nizableText getDescription()
SystemProperty
getDescription
in interface SystemProperty
public void index(Content content, SolrInputDocument document)
SystemProperty
index
in interface SystemProperty
content
- The content to index.document
- The solr document to index into.public Object getSortValue(Content content)
SystemProperty
getSortValue
in interface SystemProperty
content
- the result content.public void saxValue(ContentHandler handler, Content content) throws SAXException
SystemProperty
saxValue
in interface SystemProperty
handler
- The content handler to sax intocontent
- The contentSAXException
- If an error occurred while saxingprivate void _saxContentValue(ContentHandler handler, String value, Locale locale) throws SAXException
SAXException
private void _saxUserIdentityValue(ContentHandler handler, UserIdentity value) throws SAXException
SAXException
private void _saxGeocodeValue(ContentHandler handler, Map<String,Double> value) throws SAXException
SAXException
private void _saxSingleValue(ContentHandler handler, Object value) throws SAXException
SAXException
public Collection<SchemaDefinition> getSchemaDefinitions()
SystemProperty
getSchemaDefinitions
in interface SystemProperty
protected I18nizableText _parseI18nizableText(Configuration config, String pluginName, String name) throws ConfigurationException
config
- the configuration to use.pluginName
- the current plugin name.name
- the child name.ConfigurationException
- if the configuration is not valid.protected String parseString(Object value)
value
- The value as an object.protected long parseLong(Object value)
value
- The value as an object.protected double parseDouble(Object value)
value
- The value as an object.protected boolean parseBoolean(Object value)
value
- The value as an object, can be a Boolean or a String.protected AdaptableDate parseDate(Object value)
value
- The value as an object, can be a Date or a String.protected UserIdentity[] parseUserArray(Object value)
UserIdentity
value
- The value to parseUserIdentity
protected String[] parseStringArray(Object value)
value
- The value as an object to parseprotected void _indexStringValues(SearchField field, String[] values, SolrInputDocument document)
field
- The search fieldvalues
- The valuesdocument
- The Solr document to index intoprotected void _indexStringValue(SearchField field, String value, SolrInputDocument document)
field
- The search fieldvalue
- The valuedocument
- The Solr document to index intoprotected void _indexDateValues(SearchField field, Date[] values, SolrInputDocument document)
field
- The search fieldvalues
- The valuesdocument
- The Solr document to index intoprotected void _indexDateValue(SearchField field, Date value, SolrInputDocument document)
field
- The search fieldvalue
- The valuedocument
- The Solr document to index intoprotected void _indexLongValues(SearchField field, Long[] values, SolrInputDocument document)
field
- The search fieldvalues
- The valuesdocument
- The Solr document to index intoprotected void _indexLongValue(SearchField field, Long value, SolrInputDocument document)
field
- The search fieldvalue
- The valuedocument
- The Solr document to index intoprotected void _indexDoubleValues(SearchField field, Double[] values, SolrInputDocument document)
field
- The search fieldvalues
- The valuesdocument
- The Solr document to index intoprotected void _indexDoubleValue(SearchField field, Double value, SolrInputDocument document)
field
- The search fieldvalue
- The valuedocument
- The Solr document to index intoprotected void _indexBooleanValues(SearchField field, Boolean[] values, SolrInputDocument document)
field
- The search fieldvalues
- The valuesdocument
- The Solr document to index intoprotected void _indexBooleanValue(SearchField field, Boolean value, SolrInputDocument document)
field
- The search fieldvalue
- The valuedocument
- The Solr document to index intoprotected void _indexUserValues(SearchField field, UserIdentity[] values, SolrInputDocument document)
field
- The search fieldvalues
- The valuesdocument
- The Solr document to index intoprotected void _indexUserValue(SearchField field, UserIdentity value, SolrInputDocument document)
field
- The search fieldvalue
- The valuedocument
- The Solr document to index intoprotected void _indexGeocodeValue(SearchField field, Map<String,Double> value, SolrInputDocument document)
field
- The search fieldvalue
- The valuedocument
- The Solr document to index into