Package org.ametys.cms.search.ui.model
Class ColumnHelper
- java.lang.Object
-
- org.ametys.cms.search.ui.model.ColumnHelper
-
- All Implemented Interfaces:
Component
,Serviceable
public class ColumnHelper extends Object implements Component, Serviceable
Component providing methods to manipulatecolumns
for search models.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ColumnHelper.Column
A column and its (optional) label(package private) static class
ColumnHelper.ColumnTransformer
-
Field Summary
Fields Modifier and Type Field Description protected ContentTypeExtensionPoint
_cTypeEP
The content type extension pointprotected ContentTypesHelper
_cTypeHelper
The content type helper.protected SystemPropertyExtensionPoint
_systemPropEP
The system property extension point.static String
ROLE
The Avalon role
-
Constructor Summary
Constructors Constructor Description ColumnHelper()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private List<String>
_fieldNamesFromModel(IndexingModel indexingModel, String prefix)
private List<String>
_fieldNamesFromModels(Set<IndexingModel> indexingModels, String prefix)
private boolean
_filterComposite(IndexingField field)
private boolean
_filterComposite(ModelItem metaDef)
private List<ColumnHelper.Column>
_getColumns(List<String> columns, Set<String> contentTypeIds)
private List<String>
_getFieldsForContentAttribute(ContentAttributeDefinition contentAttributeDefinition, String parentPath)
private List<String>
_getFieldsForGroup(ModelItemGroup modelItemGroup, String parentPath)
private List<String>
_getFieldsForPath(String attributePath, Set<ContentType> commonContentTypes)
private String
_getJoinedContentTypeIds(Set<ContentType> contentTypes)
private String
_leftTrim(String s)
List<ColumnHelper.Column>
getColumns(String columnsStr, Set<String> contentTypeIds)
From a string representing columns, returns the list of column ids with their (optional) labels.List<ColumnHelper.Column>
getColumns(List<String> columns, Set<String> contentTypeIds)
From a list of string representing columns, returns the list of column ids with their (optional) labels.(package private) List<String>
getWildcardAttributeColumnPaths(Set<ContentType> commonContentTypes, String attributePath)
(package private) List<String>
getWildcardSystemColumnPaths(Set<ContentType> commonContentTypes, String path, boolean allowComposite)
(package private) boolean
isWildcardColumn(String path)
void
service(ServiceManager manager)
-
-
-
Field Detail
-
_cTypeEP
protected ContentTypeExtensionPoint _cTypeEP
The content type extension point
-
_cTypeHelper
protected ContentTypesHelper _cTypeHelper
The content type helper.
-
_systemPropEP
protected SystemPropertyExtensionPoint _systemPropEP
The system property extension point.
-
-
Constructor Detail
-
ColumnHelper
public ColumnHelper()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
getColumns
public List<ColumnHelper.Column> getColumns(String columnsStr, Set<String> contentTypeIds)
From a string representing columns, returns the list of column ids with their (optional) labels.- Parameters:
columnsStr
- The columns as a stringcontentTypeIds
- The common content type- Returns:
- the list of column ids with their (optional) labels.
-
getColumns
public List<ColumnHelper.Column> getColumns(List<String> columns, Set<String> contentTypeIds)
From a list of string representing columns, returns the list of column ids with their (optional) labels.- Parameters:
columns
- The columnscontentTypeIds
- The common content type- Returns:
- the list of column ids with their (optional) labels.
-
_getColumns
private List<ColumnHelper.Column> _getColumns(List<String> columns, Set<String> contentTypeIds)
-
isWildcardColumn
boolean isWildcardColumn(String path)
-
getWildcardAttributeColumnPaths
List<String> getWildcardAttributeColumnPaths(Set<ContentType> commonContentTypes, String attributePath) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
_getFieldsForPath
private List<String> _getFieldsForPath(String attributePath, Set<ContentType> commonContentTypes)
-
_getFieldsForContentAttribute
private List<String> _getFieldsForContentAttribute(ContentAttributeDefinition contentAttributeDefinition, String parentPath)
-
_getFieldsForGroup
private List<String> _getFieldsForGroup(ModelItemGroup modelItemGroup, String parentPath)
-
_fieldNamesFromModels
private List<String> _fieldNamesFromModels(Set<IndexingModel> indexingModels, String prefix)
-
_fieldNamesFromModel
private List<String> _fieldNamesFromModel(IndexingModel indexingModel, String prefix)
-
_filterComposite
private boolean _filterComposite(IndexingField field)
-
_filterComposite
private boolean _filterComposite(ModelItem metaDef)
-
getWildcardSystemColumnPaths
List<String> getWildcardSystemColumnPaths(Set<ContentType> commonContentTypes, String path, boolean allowComposite)
-
_getJoinedContentTypeIds
private String _getJoinedContentTypeIds(Set<ContentType> contentTypes)
-
-