Package org.ametys.cms.search.ui.model
Class StaticSearchUIModelColumnsParser
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.runtime.model.AbstractViewParser
org.ametys.cms.contenttype.AbstractContentTypeViewParser
org.ametys.cms.search.ui.model.StaticSearchUIModelColumnsParser
- All Implemented Interfaces:
ViewParser
,Component
,LogEnabled
,Serviceable
Component that parses the columns of a
StaticSearchUIModel
-
Field Summary
Modifier and TypeFieldDescriptionprotected Collection<ContentType>
Content types containing the item available in the search model's columnsFields inherited from class org.ametys.cms.contenttype.AbstractContentTypeViewParser
_contentTypeExtensionPoint, _contentTypesHelper, _systemPropertyExtensionPoint
Fields inherited from class org.ametys.runtime.model.AbstractViewParser
__VIEW_REFERENCE_PATTERN, __VIEW_REFERENCE_REGEX
Fields inherited from interface org.ametys.runtime.model.ViewParser
ADD_GROUP_TAG_NAME, ADD_ITEM_TAG_NAME, ALL_ITEMS_REFERENCE, ITEM_REFERENCE_ATTRIBUTE_NAME, REMOVE_ITEM_TAG_NAME
-
Constructor Summary
ConstructorDescriptionStaticSearchUIModelColumnsParser
(Collection<ContentType> contentTypes) Creates aStaticSearchUIModel
's columns parser -
Method Summary
Modifier and TypeMethodDescriptionprotected ModelViewItem
_createModelViewItemInstance
(ModelItem modelItem) Creates an instance ofModelViewItem
due to the givenModelItem
protected ViewItem
Creates aViewItem
instance, that will be the copy of an existing view item in a referenced viewprotected void
_fillViewGeneralInformation
(ModelHelper.ConfigurationAndPluginName viewConfiguration, View view, View existingView, Collection<? extends Model> model) Fill the general information of the given view (label, description, ...)protected Collection<? extends Model>
Retrieves the model corresponding to the view to parseprotected ModelItem
_getModelItem
(ModelHelper.ConfigurationAndPluginName itemConfiguration, String modelItemName, Collection<? extends ModelItemAccessor> parents) Retrieves the model item with the given nameprotected String
_parseViewName
(ModelHelper.ConfigurationAndPluginName viewConfiguration) Parses the name of the viewprotected ModelViewItem
createModelViewItem
(ModelHelper.ConfigurationAndPluginName itemConfiguration, ModelItem modelItem, View referenceView, boolean override) Creates the model view item corresponding to the given configurationprotected ModelViewItem
createModelViewItemForAllItemsReference
(ModelHelper.ConfigurationAndPluginName itemConfiguration, ModelItem modelItem, View referenceView, boolean override) Creates the model view item corresponding to the given configuration, in cas of all items referencesoverrideView
(ModelHelper.ConfigurationAndPluginName viewConfiguration, View existingView) Parses a view configuration to override aView
object.Methods inherited from class org.ametys.cms.contenttype.AbstractContentTypeViewParser
_parseContentAttributeViewItem, _parseViewElement, _parseViewReference, service
Methods inherited from class org.ametys.runtime.model.AbstractViewParser
_addItemToOverriddenView, _addItemToViewItemAccessor, _createViewItemAccessor, _getAddItemChildConfiguration, _getModelItemReference, _insertItemInViewItemAccessor, _isAddingGroupConfiguration, _isAddingItemConfiguration, _isRemovingItemConfiguration, _parseModelViewItem, _parseSimpleViewItemGroup, _parseSimpleViewItemGroupChild, _parseViewChild, _parseViewItemAccessorChild, _removeViewItemFromView, parseAllModelViewItems, parseView
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
_contentTypes
Content types containing the item available in the search model's columns
-
-
Constructor Details
-
StaticSearchUIModelColumnsParser
Creates aStaticSearchUIModel
's columns parser- Parameters:
contentTypes
- The content types containing the item available in the search model's columns
-
-
Method Details
-
_parseViewName
protected String _parseViewName(ModelHelper.ConfigurationAndPluginName viewConfiguration) throws ConfigurationException Description copied from class:AbstractViewParser
Parses the name of the view- Overrides:
_parseViewName
in classAbstractViewParser
- Parameters:
viewConfiguration
- the view's configuration- Returns:
- the view's name
- Throws:
ConfigurationException
- if an error occurs while parsing the view's name
-
overrideView
public View overrideView(ModelHelper.ConfigurationAndPluginName viewConfiguration, View existingView) throws ConfigurationException Description copied from interface:ViewParser
Parses a view configuration to override aView
object.- Specified by:
overrideView
in interfaceViewParser
- Overrides:
overrideView
in classAbstractViewParser
- Parameters:
viewConfiguration
- the configuration of the view to parseexistingView
- The view to override- Returns:
- the overridden view
- Throws:
ConfigurationException
- if the configuration is not valid.
-
_fillViewGeneralInformation
protected void _fillViewGeneralInformation(ModelHelper.ConfigurationAndPluginName viewConfiguration, View view, View existingView, Collection<? extends Model> model) throws ConfigurationException Description copied from class:AbstractViewParser
Fill the general information of the given view (label, description, ...)- Overrides:
_fillViewGeneralInformation
in classAbstractViewParser
- Parameters:
viewConfiguration
- the configuration of the view to fillview
- the view to fillexistingView
- the existing view, that may already contain general informationmodel
- The model of the view- Throws:
ConfigurationException
- if the configuration is not valid.
-
_getModel
Description copied from class:AbstractViewParser
Retrieves the model corresponding to the view to parse- Specified by:
_getModel
in classAbstractViewParser
- Returns:
- the model
-
_getModelItem
protected ModelItem _getModelItem(ModelHelper.ConfigurationAndPluginName itemConfiguration, String modelItemName, Collection<? extends ModelItemAccessor> parents) throws ConfigurationException Description copied from class:AbstractViewParser
Retrieves the model item with the given name- Overrides:
_getModelItem
in classAbstractContentTypeViewParser
- Parameters:
itemConfiguration
- configuration of the model view itemmodelItemName
- the model item nameparents
- the accessors containing the model item- Returns:
- the model item
- Throws:
ConfigurationException
- if the configuration is not valid.
-
createModelViewItemForAllItemsReference
protected ModelViewItem createModelViewItemForAllItemsReference(ModelHelper.ConfigurationAndPluginName itemConfiguration, ModelItem modelItem, View referenceView, boolean override) throws ConfigurationException Description copied from class:AbstractViewParser
Creates the model view item corresponding to the given configuration, in cas of all items references- Overrides:
createModelViewItemForAllItemsReference
in classAbstractViewParser
- Parameters:
itemConfiguration
- configuration of the model view itemmodelItem
- the model itemreferenceView
- view that references the itemoverride
-true
if the configuration is an override,false
otherwise- Returns:
- the created model view item
- Throws:
ConfigurationException
- if the configuration is not valid.
-
createModelViewItem
protected ModelViewItem createModelViewItem(ModelHelper.ConfigurationAndPluginName itemConfiguration, ModelItem modelItem, View referenceView, boolean override) throws ConfigurationException Description copied from class:AbstractViewParser
Creates the model view item corresponding to the given configuration- Overrides:
createModelViewItem
in classAbstractViewParser
- Parameters:
itemConfiguration
- configuration of the model view itemmodelItem
- the model itemreferenceView
- view that references the itemoverride
-true
if the configuration is an override,false
otherwise- Returns:
- the created model view item
- Throws:
ConfigurationException
- if the configuration is not valid.
-
_createModelViewItemInstance
Description copied from class:AbstractViewParser
Creates an instance ofModelViewItem
due to the givenModelItem
- Overrides:
_createModelViewItemInstance
in classAbstractViewParser
- Parameters:
modelItem
- the model item corresponding to the view item to create- Returns:
- the created view item
-
_createViewItemCopyInstanceForReferencedView
Description copied from class:AbstractContentTypeViewParser
Creates aViewItem
instance, that will be the copy of an existing view item in a referenced view- Overrides:
_createViewItemCopyInstanceForReferencedView
in classAbstractContentTypeViewParser
- Parameters:
viewItem
- the view item that will be copied- Returns:
- the created
ViewItem
instance
-