public abstract class AbstractSearchUICriterion extends Parameter<MetadataType> implements SearchUICriterion, Serviceable, Configurable
SearchUIModel
.Modifier and Type | Field and Description |
---|---|
protected ContentHelper |
_contentHelper
The content type extension point.
|
private String |
_contentTypeId |
protected ContentTypeExtensionPoint |
_cTypeEP
The content type extension point.
|
private I18nizableText |
_group |
private boolean |
_hidden |
private boolean |
_multiple |
private String |
_onChangeClassName |
private String |
_onInitClassName |
private String |
_onSubmitClassName |
protected AmetysObjectResolver |
_resolver
The ametys object resolver.
|
protected UserManager |
_userManager
The user manager.
|
protected UserPopulationDAO |
_userPopulationDAO
The user population DAO
|
Constructor and Description |
---|
AbstractSearchUICriterion() |
Modifier and Type | Method and Description |
---|---|
protected I18nizableText |
_configureI18nizableText(Configuration config,
I18nizableText defaultValue)
Configure an i18nizable text
|
protected boolean |
_initializeValidator(ThreadSafeComponentManager<Validator> validatorManager,
String pluginName,
String role,
Configuration config)
Initialize the validator.
|
void |
configure(Configuration configuration) |
protected void |
configureId(Configuration configuration)
Configure the criterion ID.
|
protected void |
configureLabelsAndGroup(Configuration configuration)
Configure the labels and group.
|
protected void |
configureUIProperties(Configuration configuration)
Configure the standard UI properties (hidden, init class, change class, submit class).
|
protected void |
configureValues(Configuration configuration)
Configure the default value.
|
protected String |
configureWidget(Configuration configuration,
String defaultWidget,
MetadataType type)
Configure widget of the criterion
|
protected Map<String,I18nizableText> |
configureWidgetParameters(Configuration configuration,
Map<String,I18nizableText> defaultParams,
MetadataType type,
String contentTypeId)
Configure widget parameters of the criterion
|
String |
getChangeClassName()
Get the JS class name to execute on 'change' event
|
String |
getContentTypeId()
Get the content type ID (only when the search criteria is of type CONTENT).
|
I18nizableText |
getFacetLabel(String value,
Locale currentLocale)
Get the label of a facet value.
|
I18nizableText |
getGroup()
Get the group of the search criteria
|
String |
getInitClassName()
Get the JS class name to execute on 'init' event
|
protected MetadataDefinition |
getMetadataDefinition(MetadataIndexingField indexingField,
String[] remainingPathSegments,
List<String> joinPaths,
boolean addLast)
Get the metadata definition from the indexing field and compute the join paths.
|
SearchField |
getSearchField()
Get the
SearchField representing this search criterion. |
String |
getSubmitClassName()
Get the JS class name to execute on 'submit' event
|
boolean |
isHidden()
Determines if the criteria is hidden
|
boolean |
isMultiple()
Determines if the column value is multiple
|
void |
service(ServiceManager manager) |
void |
setChangeClassName(String className)
Set the JS class name to execute on 'change' event
|
void |
setContentTypeId(String contentTypeId)
Set the content type ID (only when the search criteria is of type CONTENT).
|
void |
setGroup(I18nizableText group)
Set the group of the search criteria
|
void |
setHidden(boolean hidden)
Set the hidden property of the criteria
|
void |
setInitClassName(String className)
Set the JS class name to execute on 'init' event
|
void |
setMultiple(boolean multiple)
Set the multiple property
|
void |
setSubmitClassName(String className)
Set the JS class name to execute on 'submit' event
|
getDefaultValue, getDescription, getEnumerator, getId, getLabel, getPluginName, getType, getValidator, getWidget, getWidgetParameters, setDefaultValue, setDescription, setEnumerator, setId, setLabel, setPluginName, setType, setValidator, setWidget, setWidgetParameters
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDefaultValue, getDescription, getFieldId, getLabel, getValidator, getWidget, getWidgetParameters
getId, getOperator, getQuery, getQuery, isFacetable, isFacetable, isSortable, isSortable
getEnumerator, getType
protected AmetysObjectResolver _resolver
protected ContentTypeExtensionPoint _cTypeEP
protected ContentHelper _contentHelper
protected UserManager _userManager
protected UserPopulationDAO _userPopulationDAO
private String _onInitClassName
private String _onSubmitClassName
private String _onChangeClassName
private boolean _hidden
private boolean _multiple
private I18nizableText _group
private String _contentTypeId
public AbstractSearchUICriterion()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void configure(Configuration configuration) throws ConfigurationException
configure
in interface Configurable
ConfigurationException
protected void configureId(Configuration configuration) throws ConfigurationException
configuration
- The search criterion configuration.ConfigurationException
- If an error occurs.protected void configureLabelsAndGroup(Configuration configuration) throws ConfigurationException
configuration
- The search criterion configuration.ConfigurationException
- If an error occurs.protected void configureValues(Configuration configuration) throws ConfigurationException
configuration
- The search criterion configuration.ConfigurationException
- If an error occurs.protected void configureUIProperties(Configuration configuration) throws ConfigurationException
configuration
- The search criterion configuration.ConfigurationException
- If an error occurs.protected String configureWidget(Configuration configuration, String defaultWidget, MetadataType type)
configuration
- The search criterion configuration.defaultWidget
- The default widget to use if not present in configuration. If MetadataType.RICH_TEXT
or MetadataType.MULTILINGUAL_STRING
, it will be forced.type
- the type which must be supported by the widgetprotected Map<String,I18nizableText> configureWidgetParameters(Configuration configuration, Map<String,I18nizableText> defaultParams, MetadataType type, String contentTypeId) throws ConfigurationException
configuration
- The search criterion configuration.defaultParams
- The default widget parameters to override with configurationtype
- the type which must be supported by the widget. If MetadataType.CONTENT
or MetadataType.SUB_CONTENT
, some parameters will be forced.contentTypeId
- For MetadataType.CONTENT
or MetadataType.SUB_CONTENT
types only. The id of the content type.ConfigurationException
- If an error occurs.public String getInitClassName()
getInitClassName
in interface SearchUICriterion
public void setInitClassName(String className)
className
- the JS class namepublic String getSubmitClassName()
getSubmitClassName
in interface SearchUICriterion
public void setSubmitClassName(String className)
className
- the JS class namepublic String getChangeClassName()
getChangeClassName
in interface SearchUICriterion
public void setChangeClassName(String className)
className
- the JS class namepublic I18nizableText getGroup()
getGroup
in interface SearchUICriterion
null
if the search criteria does not belong to any group, the name of the group otherwisepublic void setGroup(I18nizableText group)
group
- the group this search criteria will be added topublic boolean isHidden()
isHidden
in interface SearchUICriterion
true
if the criteria is hiddenpublic void setHidden(boolean hidden)
hidden
- true to hide the search criteriapublic void setMultiple(boolean multiple)
multiple
- the multiple propertypublic boolean isMultiple()
isMultiple
in interface Field
true
if the value is multiplepublic String getContentTypeId()
getContentTypeId
in interface Field
public void setContentTypeId(String contentTypeId)
contentTypeId
- the content type ID.public I18nizableText getFacetLabel(String value, Locale currentLocale)
SearchUICriterion
getFacetLabel
in interface SearchUICriterion
value
- the facet value.currentLocale
- the current localepublic SearchField getSearchField()
SearchCriterion
SearchField
representing this search criterion.getSearchField
in interface SearchCriterion
SearchField
representing this search criterion.protected boolean _initializeValidator(ThreadSafeComponentManager<Validator> validatorManager, String pluginName, String role, Configuration config) throws ConfigurationException
validatorManager
- The validator manager.pluginName
- The plugin name.role
- The validator role.config
- The validator configuration.ConfigurationException
- If an error occurs.protected I18nizableText _configureI18nizableText(Configuration config, I18nizableText defaultValue)
config
- The Configuration.defaultValue
- The default value as an I18nizableText.protected MetadataDefinition getMetadataDefinition(MetadataIndexingField indexingField, String[] remainingPathSegments, List<String> joinPaths, boolean addLast) throws ConfigurationException
indexingField
- The initial indexing fieldremainingPathSegments
- The path to access the metadata or an another indexing field from the initial indexing fieldjoinPaths
- The consecutive's path in case of joint to access the field/metadataaddLast
- true
to add the last join path element to the list, false
otherwise.ConfigurationException
- If an error occurs.