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.
|
Constructor and Description |
---|
AbstractSystemProperty() |
Modifier and Type | Method and Description |
---|---|
private void |
_indexSingleValue(SolrInputDocument document,
String fieldName,
Object value) |
protected I18nizableText |
_parseI18nizableText(Configuration config,
String pluginName,
String name)
Parse an i18n text.
|
void |
configure(Configuration configuration) |
Integer |
getColumnWidth()
Get the column width.
|
String |
getContentTypeId()
In case of a Content reference field, the content type ID.
|
String |
getConverter()
Get the property column converter.
|
I18nizableText |
getDescription()
Get the system property description.
|
SystemProperty.EnumeratorDefinition |
getEnumeratorDefinition(Collection<String> contentTypes,
Configuration configuration)
Get the definition of an enumerator.
|
Object |
getFullValue(Content content)
Get the value represented by this field in the given result content.
|
String |
getId()
Get the system property ID.
|
I18nizableText |
getLabel()
Get the system property label.
|
String |
getRenderer()
Get the renderer.
|
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.
|
String |
getWidget()
Get the default widget to use when rendering this property as a criterion.
|
Map<String,I18nizableText> |
getWidgetParameters()
Get the widget parameters.
|
void |
index(Content content,
SolrInputDocument document)
Index the system property in a solr document.
|
boolean |
isDisplayable()
Get if the property can be displayed (i.e.
|
boolean |
isSearchable()
Get if the property can be searched on (i.e.
|
protected boolean |
parseBoolean(Object value)
Get the value as a boolean.
|
protected Date |
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 |
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
getQuery, getSearchField, getType, getValue, isMultiple, isSortable
protected I18nUtils _i18nUtils
protected I18nizableText _label
protected I18nizableText _description
protected String _pluginName
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 SystemProperty.EnumeratorDefinition getEnumeratorDefinition(Collection<String> contentTypes, Configuration configuration)
SystemProperty
getEnumeratorDefinition
in interface SystemProperty
contentTypes
- The model's content types.configuration
- The enumerator configuration.public String getContentTypeId()
SystemProperty
getContentTypeId
in interface SystemProperty
public boolean isSearchable()
SystemProperty
isSearchable
in interface SystemProperty
true
if the property can be searched on, false
otherwise.public boolean isDisplayable()
SystemProperty
isDisplayable
in interface SystemProperty
true
if the property can be displayed, false
otherwise.public String getWidget()
SystemProperty
getWidget
in interface SystemProperty
null
if no specific widget is necessary.public Map<String,I18nizableText> getWidgetParameters()
SystemProperty
getWidgetParameters
in interface SystemProperty
public String getRenderer()
SystemProperty
getRenderer
in interface SystemProperty
public String getConverter()
SystemProperty
getConverter
in interface SystemProperty
public Integer getColumnWidth()
SystemProperty
getColumnWidth
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.private void _indexSingleValue(SolrInputDocument document, String fieldName, Object value)
public Object getFullValue(Content content)
SystemProperty
getFullValue
in interface SystemProperty
content
- the result content.public Object getSortValue(Content content)
SystemProperty
getSortValue
in interface SystemProperty
content
- the result content.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 Date 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 parse