Package org.ametys.cms.search.cocoon
Class ContentGridComponent
- java.lang.Object
-
- org.ametys.cms.search.cocoon.ContentGridComponent
-
- All Implemented Interfaces:
Component,Contextualizable,Serviceable
public class ContentGridComponent extends Object implements Contextualizable, Serviceable, Component
Generates the columns information for the grid based upon a view of a contenttype
-
-
Field Summary
Fields Modifier and Type Field Description protected AmetysObjectResolver_ametysObjectResolverThe AmetysObjectResolver instanceprotected ColumnHelper_columnHelperThe helper for columnsprotected ContentHelper_contentHelperThe ContentHelper instanceprotected ContentTypeExtensionPoint_contentTypeExtensionPointThe contenttypes extension pointprotected ContentTypesHelper_contentTypesHelperThe ContentTypesHelper instanceprotected ContentValuesExtractorFactory_contentValuesExtractorFactoryThe ContentValuesExtractorFactoryprotected Context_contextCocoon contextprotected ServiceManager_managerThe service managerprotected AmetysObjectResolver_resolverThe Ametys object resolverprotected SearchUIModelHelper_searchUIModelHelperThe search model helper.protected ServerCommHelper_serverCommHelperThe servercomm helperstatic StringROLEThe avalon role
-
Constructor Summary
Constructors Constructor Description ContentGridComponent()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private Map<String,Object>_definitionToColumnJSON(ModelItem definition, ContentType contentType)private List<Map<String,Object>>_generateColumns(List<ViewItem> viewItems, ContentType contentType)private Configuration_getColumnConfiguration(ModelItem modelItem, ContentType contentType)private ContentType_getContentType(String contentTypeId)private View_getView(ContentType contentType, String viewName)voidcontextualize(Context context)Map<String,Object>getColumnsAndValues(List<String> contentIds, String contentTypeId, String viewName)Generates the columns informations for a View of a ContentTypeMap<String,Object>getContentData(Content content, ContentValuesExtractorFactory.ContentValuesExtractor extractor, Locale defaultLocale, Map<String,Object> contextualParameters)Generate standard content data.voidservice(ServiceManager manager)
-
-
-
Field Detail
-
_serverCommHelper
protected ServerCommHelper _serverCommHelper
The servercomm helper
-
_resolver
protected AmetysObjectResolver _resolver
The Ametys object resolver
-
_contentTypeExtensionPoint
protected ContentTypeExtensionPoint _contentTypeExtensionPoint
The contenttypes extension point
-
_searchUIModelHelper
protected SearchUIModelHelper _searchUIModelHelper
The search model helper.
-
_columnHelper
protected ColumnHelper _columnHelper
The helper for columns
-
_manager
protected ServiceManager _manager
The service manager
-
_contentValuesExtractorFactory
protected ContentValuesExtractorFactory _contentValuesExtractorFactory
The ContentValuesExtractorFactory
-
_ametysObjectResolver
protected AmetysObjectResolver _ametysObjectResolver
The AmetysObjectResolver instance
-
_contentTypesHelper
protected ContentTypesHelper _contentTypesHelper
The ContentTypesHelper instance
-
_contentHelper
protected ContentHelper _contentHelper
The ContentHelper instance
-
-
Constructor Detail
-
ContentGridComponent
public ContentGridComponent()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
getColumnsAndValues
public Map<String,Object> getColumnsAndValues(List<String> contentIds, String contentTypeId, String viewName) throws ProcessingException, IllegalArgumentException
Generates the columns informations for a View of a ContentType- Parameters:
contentIds- The contents identifierscontentTypeId- The content type id. Mandatory.viewName- The view of the content type.- Returns:
- The columns informations
- Throws:
IllegalArgumentException- If one argument is not as expectedProcessingException- If an error occurred while processing the columns
-
_generateColumns
private List<Map<String,Object>> _generateColumns(List<ViewItem> viewItems, ContentType contentType) throws ProcessingException
- Throws:
ProcessingException
-
_definitionToColumnJSON
private Map<String,Object> _definitionToColumnJSON(ModelItem definition, ContentType contentType) throws ProcessingException
- Throws:
ProcessingException
-
_getColumnConfiguration
private Configuration _getColumnConfiguration(ModelItem modelItem, ContentType contentType)
-
_getContentType
private ContentType _getContentType(String contentTypeId) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
_getView
private View _getView(ContentType contentType, String viewName) throws IllegalArgumentException
- Throws:
IllegalArgumentException
-
getContentData
public Map<String,Object> getContentData(Content content, ContentValuesExtractorFactory.ContentValuesExtractor extractor, Locale defaultLocale, Map<String,Object> contextualParameters)
Generate standard content data.- Parameters:
content- The content.extractor- The content values extractor which generates.defaultLocale- the default locale for localized values if content's language is null.contextualParameters- The search contextual parameters.- Returns:
- A Map containing the content data.
-
-