public class DefaultMetadataSearchUIColumn extends AbstractSearchUIColumn implements MetadataResultField, Serviceable
Modifier and Type | Field and Description |
---|---|
protected Collection<String> |
_contentTypes
The content types of the contents on which this metadata column applies
|
protected ContentTypeExtensionPoint |
_cTypeEP
The content type extension point.
|
protected ContentTypesHelper |
_cTypeHelper
The content type helper.
|
protected String |
_fullMetadataPath
The full metadata path.
|
protected boolean |
_joinedMetadata
True if the metadata is joined, false otherwise.
|
protected ContentSearchHelper |
_searchHelper
The search helper.
|
Constructor and Description |
---|
DefaultMetadataSearchUIColumn()
Default empty constructor
|
DefaultMetadataSearchUIColumn(MetadataDefinition metadataDefinition,
String fullMetadataPath,
Collection<String> contentTypes)
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
_configure(MetadataDefinition metadataDefinition,
I18nizableText label,
I18nizableText description,
int width,
boolean hidden,
boolean editable,
boolean sortable,
boolean multiple,
boolean multiLevelMultiple,
String defaultSorter,
String renderer,
String converter,
Collection<String> contentTypes,
boolean allowSortOnMultipleJoin)
Configure the metadata search ui column
|
private boolean |
_isSortableMetadata(MetadataDefinition metadataDefinition) |
protected void |
configureConverter(String converter,
MetadataDefinition metadataDefinition)
Configure the column converter.
|
protected void |
configureRenderer(String renderer,
MetadataDefinition metadataDefinition)
Configure the column renderer.
|
String |
getFieldPath()
Get the path of metadata (separated by '/')
|
Object |
getFullValue(Content content,
Locale defaultLocale)
Get the value represented by this field in the given result content.
|
SearchField |
getSearchField()
Get the
SearchField representing this result field. |
Object |
getValue(Content content,
Locale defaultLocale)
Get the value represented by this field in the given result content.
|
protected boolean |
isEditionAllowed(MetadataDefinition definition)
Determines if the inline edition is allowed
|
void |
service(ServiceManager manager) |
void |
setFieldPath(String metadataPath)
Set the metadata path
|
_configureI18nizableText, getContentTypeId, getConverter, getDefaultSorter, getRenderer, getWidth, isEditable, isHidden, isMultiple, isSortable, setContentTypeId, setConverter, setDefaultSorter, setEditable, setHidden, setMultiple, setRenderer, setSortable, setWidth
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
getId
getContentTypeId, getEnumerator, getType, isMultiple
getDescription, getLabel, getValidator, getWidget, getWidgetParameters
protected ContentTypeExtensionPoint _cTypeEP
protected ContentTypesHelper _cTypeHelper
protected ContentSearchHelper _searchHelper
protected String _fullMetadataPath
protected boolean _joinedMetadata
protected Collection<String> _contentTypes
public DefaultMetadataSearchUIColumn()
public DefaultMetadataSearchUIColumn(MetadataDefinition metadataDefinition, String fullMetadataPath, Collection<String> contentTypes)
metadataDefinition
- The metadata definitionfullMetadataPath
- The full metadata pathcontentTypes
- The content types of the contents on which this metadata column appliespublic void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
protected void _configure(MetadataDefinition metadataDefinition, I18nizableText label, I18nizableText description, int width, boolean hidden, boolean editable, boolean sortable, boolean multiple, boolean multiLevelMultiple, String defaultSorter, String renderer, String converter, Collection<String> contentTypes, boolean allowSortOnMultipleJoin)
metadataDefinition
- The definitionlabel
- The column labeldescription
- The column descriptionwidth
- The column widthhidden
- True if the column should be hiddeneditable
- True if the column is editablesortable
- True to allow sorting the columnmultiple
- True if the value is multiplemultiLevelMultiple
- If the metadata path contains a multiple metadata or a repeaterdefaultSorter
- The default column sorterrenderer
- A specific renderer to use. If null, it will be deduced from the metadata definitionconverter
- A specific converter to use. If null, it will be deduced from the metadata definitioncontentTypes
- The content types of the contents on which this metadata column appliesallowSortOnMultipleJoin
- True to allow sort when the join path contains at least one mutliple metadata (intermediates only)protected boolean isEditionAllowed(MetadataDefinition definition)
definition
- The metadata definitionprotected void configureRenderer(String renderer, MetadataDefinition metadataDefinition)
renderer
- A specific renderer. If null, it will be deduced from the metadata definition.metadataDefinition
- The metadata definition.protected void configureConverter(String converter, MetadataDefinition metadataDefinition)
converter
- A specific converter. If null, it will be deduced from the metadata definition.metadataDefinition
- The metadata definition.private boolean _isSortableMetadata(MetadataDefinition metadataDefinition)
public void setFieldPath(String metadataPath)
metadataPath
- the path to metadatapublic String getFieldPath()
getFieldPath
in interface MetadataResultField
public Object getValue(Content content, Locale defaultLocale)
ResultField
getValue
in interface ResultField
content
- the result content.defaultLocale
- the default locale for localized value if the content's language is nullpublic Object getFullValue(Content content, Locale defaultLocale)
ResultField
getFullValue
in interface ResultField
content
- the result content.defaultLocale
- the default locale for localized value if the content's language is nullpublic SearchField getSearchField()
ResultField
SearchField
representing this result field.getSearchField
in interface ResultField
getSearchField
in class AbstractSearchUIColumn
SearchField
representing this result field.