Class MetadataSearchUIColumn
java.lang.Object
org.ametys.runtime.parameter.Parameter<MetadataType>
org.ametys.cms.search.ui.model.impl.AbstractSearchUIColumn
org.ametys.cms.search.ui.model.impl.MetadataSearchUIColumn
- All Implemented Interfaces:
Field,MetadataResultField,ResultField,SearchUIColumn,Configurable,Contextualizable,Serviceable
public class MetadataSearchUIColumn
extends AbstractSearchUIColumn
implements MetadataResultField, Serviceable, Configurable, Contextualizable
Default implementation of a search ui column for a content's attribute
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ModelItemThe attribute represented by the columnprotected Collection<String>The types of the content on which this attribute column appliesprotected ContextThe contextprotected ContentTypeExtensionPointThe content type extension point.protected ContentTypesHelperThe content type helper.protected StringThe full attribute path.protected booleanTrue if the attribute is joined, false otherwise.protected ContentSearchHelperThe search helper.protected ServiceManagerThe service manager -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected boolean_isEditable(Configuration configuration, ModelItem attribute, boolean multiLevelMultiple) Computed editable status of this column from its attribute definition and configurationprotected boolean_isSortable(Configuration configuration, ModelItem attribute, boolean multiplePath) Computed sortable status of this column from its attribute definition and configurationprotected boolean_isSortableMetadata(ModelItem attribute) Determines if the column is sortable according its attribute definitionvoidconfigure(Configuration configuration) protected voidconfigureConverter(String converter, ModelItem attribute) Configure the column converter.protected voidconfigureRenderer(String renderer, ModelItem attribute) Configure the column renderer.voidcontextualize(Context context) Get the content types of the contents on which this attribute column appliesGet the path of attribute (separated by '/')getFullValue(Content content, Locale defaultLocale) Get the value represented by this field in the given result content.Get theSearchFieldrepresenting this result field.Get the subcolumns informations (for repeaters for example)Get the value represented by this field in the given result content.protected booleanisEditionAllowed(ModelItem attribute) Determines if the inline edition is allowedbooleanDetermines if this column is a path to a joined attributebooleanDetermines if this column represents a CONTENT attribute with a multilingual titlevoidservice(ServiceManager manager) voidsetContentTypes(Collection<String> contentTypes) Set the content types of the contents on which this attribute column appliesvoidsetFieldPath(String attributePath) Set the attribute pathvoidsetJoinedAttribute(boolean joinedAttribute) Set if this column is a path to a joined attributevoidsetTypeContentWithMultilingualTitle(boolean multilingual) Set if this column represents a CONTENT attribute with a multilingual titleMethods inherited from class org.ametys.cms.search.ui.model.impl.AbstractSearchUIColumn
_configureI18nizableText, getContentTypeId, getConverter, getDefaultSorter, getRenderer, getWidth, isEditable, isHidden, isMultiple, isSortable, setContentTypeId, setConverter, setDefaultSorter, setEditable, setHidden, setMultiple, setRenderer, setSortable, setWidthMethods inherited from class org.ametys.runtime.parameter.Parameter
getDefaultValue, getDescription, getEnumerator, getId, getLabel, getPluginName, getType, getValidator, getWidget, getWidgetParameters, setDefaultValue, setDescription, setEnumerator, setId, setLabel, setPluginName, setType, setValidator, setWidget, setWidgetParametersMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ametys.cms.search.model.Field
getContentTypeId, getEnumerator, getType, isMultipleMethods inherited from interface org.ametys.cms.search.model.ResultField
getIdMethods inherited from interface org.ametys.cms.search.ui.model.SearchUIColumn
getDescription, getLabel, getValidator, getWidget, getWidgetParameters
-
Field Details
-
_smanager
The service manager -
_context
The context -
_cTypeEP
The content type extension point. -
_cTypeHelper
The content type helper. -
_searchHelper
The search helper. -
_fullAttributePath
The full attribute path. -
_joinedAttribute
True if the attribute is joined, false otherwise. -
_contentTypes
The types of the content on which this attribute column applies -
_attribute
The attribute represented by the column
-
-
Constructor Details
-
MetadataSearchUIColumn
public MetadataSearchUIColumn()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
contextualize
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
configure
- Specified by:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
_isSortable
protected boolean _isSortable(Configuration configuration, ModelItem attribute, boolean multiplePath) Computed sortable status of this column from its attribute definition and configuration- Parameters:
configuration- the column's configurationattribute- the attribute definitionmultiplePath- if path is multiple- Returns:
- true if this column is sortable
-
_isEditable
protected boolean _isEditable(Configuration configuration, ModelItem attribute, boolean multiLevelMultiple) Computed editable status of this column from its attribute definition and configuration- Parameters:
configuration- the column's configurationattribute- the attribute definitionmultiLevelMultiple- if path contains a multiple attrbute or a repeater.- Returns:
- true if this column is editable
-
isEditionAllowed
Determines if the inline edition is allowed- Parameters:
attribute- The attribute definition- Returns:
- true if the attribute is editable
-
configureRenderer
Configure the column renderer.- Parameters:
renderer- A specific renderer. If null, it will be deduced from the attribute definition.attribute- The attribute definition.
-
configureConverter
Configure the column converter.- Parameters:
converter- A specific converter. If null, it will be deduced from the metadata definition.attribute- The attribute definition.
-
setFieldPath
Set the attribute path- Parameters:
attributePath- the path to attribute
-
getFieldPath
Get the path of attribute (separated by '/')- Specified by:
getFieldPathin interfaceMetadataResultField- Returns:
- the path of attribute
-
getContentTypes
Get the content types of the contents on which this attribute column applies- Returns:
- the content types
-
setContentTypes
Set the content types of the contents on which this attribute column applies- Parameters:
contentTypes- the content types
-
isJoinedAttribute
Determines if this column is a path to a joined attribute- Returns:
- true if is a joined attribute
-
setJoinedAttribute
Set if this column is a path to a joined attribute- Parameters:
joinedAttribute- true if is a joined attribute
-
isTypeContentWithMultilingualTitle
Determines if this column represents a CONTENT attribute with a multilingual title- Returns:
- true if this column represents a CONTENT attribute with a multilingual title
-
setTypeContentWithMultilingualTitle
Set if this column represents a CONTENT attribute with a multilingual title- Parameters:
multilingual- true if this column represents a CONTENT attribute with a multilingual title
-
getValue
Description copied from interface:ResultFieldGet the value represented by this field in the given result content.- Specified by:
getValuein interfaceResultField- Parameters:
content- the result content.defaultLocale- the default locale for localized value if the content's language is null- Returns:
- the content field value (cast to the appropriate object).
-
getFullValue
Description copied from interface:ResultFieldGet the value represented by this field in the given result content.- Specified by:
getFullValuein interfaceResultField- Parameters:
content- the result content.defaultLocale- the default locale for localized value if the content's language is null- Returns:
- the content field value (cast to the appropriate object).
-
getSearchField
Description copied from interface:ResultFieldGet theSearchFieldrepresenting this result field.- Specified by:
getSearchFieldin interfaceResultField- Overrides:
getSearchFieldin classAbstractSearchUIColumn- Returns:
- The
SearchFieldrepresenting this result field.
-
_isSortableMetadata
Determines if the column is sortable according its attribute definition- Parameters:
attribute- the attribute definition- Returns:
- true if type is sortable
-
getSubColumns
Description copied from interface:SearchUIColumnGet the subcolumns informations (for repeaters for example)- Specified by:
getSubColumnsin interfaceSearchUIColumn- Returns:
- the full columns informations or
nullif none is defined.
-