Package org.ametys.cms.contenttype
Class AbstractContentTypeViewParser
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.runtime.model.AbstractViewParser
org.ametys.cms.contenttype.AbstractContentTypeViewParser
- All Implemented Interfaces:
ViewParser
,Component
,LogEnabled
,Serviceable
- Direct Known Subclasses:
ContentTypeViewParser
,StaticSearchUIModelColumnsParser
public abstract class AbstractContentTypeViewParser
extends AbstractViewParser
implements Component, Serviceable
Abstract component that parses view's configuration for content types
-
Field Summary
Modifier and TypeFieldDescriptionprotected ContentTypeExtensionPoint
The content type extension pointprotected ContentTypesHelper
The content types helperprotected SystemPropertyExtensionPoint
The system property extension pointFields 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
-
Method Summary
Modifier and TypeMethodDescriptionprotected ViewItem
Creates aViewItem
instance, that will be the copy of an existing view item in a referenced viewprotected ModelItem
_getModelItem
(ModelHelper.ConfigurationAndPluginName itemConfiguration, String modelItemName, Collection<? extends ModelItemAccessor> parents) Retrieves the model item with the given nameprotected ViewElement
_parseContentAttributeViewItem
(ModelHelper.ConfigurationAndPluginName itemConfiguration, ContentAttributeDefinition definition, View referenceView, boolean override) Parses the view item referencing an attribute of type contentprotected ViewElement
_parseViewElement
(ModelHelper.ConfigurationAndPluginName itemConfiguration, ElementDefinition definition, View referenceView, boolean override) Parses the view elementprotected void
_parseViewReference
(String viewName, ViewItemAccessor viewItemAccessor, ModelItemAccessor modelItemAccessor) Parses the view reference to add items of the view to the given item accessorvoid
service
(ServiceManager manager) Methods inherited from class org.ametys.runtime.model.AbstractViewParser
_addItemToOverriddenView, _addItemToViewItemAccessor, _createModelViewItemInstance, _createViewItemAccessor, _fillViewGeneralInformation, _getAddItemChildConfiguration, _getModel, _getModelItemReference, _insertItemInViewItemAccessor, _isAddingGroupConfiguration, _isAddingItemConfiguration, _isRemovingItemConfiguration, _parseModelViewItem, _parseSimpleViewItemGroup, _parseSimpleViewItemGroupChild, _parseViewChild, _parseViewItemAccessorChild, _parseViewName, _removeViewItemFromView, createModelViewItem, overrideView, parseAllModelViewItems, parseView
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Field Details
-
_contentTypeExtensionPoint
The content type extension point -
_contentTypesHelper
The content types helper -
_systemPropertyExtensionPoint
The system property extension point
-
-
Constructor Details
-
AbstractContentTypeViewParser
public AbstractContentTypeViewParser()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
_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 classAbstractViewParser
- 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.
-
_parseViewElement
protected ViewElement _parseViewElement(ModelHelper.ConfigurationAndPluginName itemConfiguration, ElementDefinition definition, View referenceView, boolean override) throws ConfigurationException Description copied from class:AbstractViewParser
Parses the view element- Overrides:
_parseViewElement
in classAbstractViewParser
- Parameters:
itemConfiguration
- configuration of the view itemdefinition
- definition of the elementreferenceView
- view that references the itemoverride
-true
if the configuration is an override,false
otherwise- Returns:
- the view item
- Throws:
ConfigurationException
- if the configuration is not valid
-
_parseContentAttributeViewItem
protected ViewElement _parseContentAttributeViewItem(ModelHelper.ConfigurationAndPluginName itemConfiguration, ContentAttributeDefinition definition, View referenceView, boolean override) throws ConfigurationException Parses the view item referencing an attribute of type content- Parameters:
itemConfiguration
- configuration of the view itemdefinition
- definition of the attributereferenceView
- view that references the itemoverride
-true
if the configuration is an override,false
otherwise- Returns:
- the view item
- Throws:
ConfigurationException
- if the configuration is not valid
-
_parseViewReference
protected void _parseViewReference(String viewName, ViewItemAccessor viewItemAccessor, ModelItemAccessor modelItemAccessor) throws ConfigurationException Description copied from class:AbstractViewParser
Parses the view reference to add items of the view to the given item accessor- Specified by:
_parseViewReference
in classAbstractViewParser
- Parameters:
viewName
- the name of the referenced viewviewItemAccessor
- the view item accessor referencing the viewmodelItemAccessor
- the definition of the model item containing the referenced view- Throws:
ConfigurationException
- if the configuration is not valid
-
_createViewItemCopyInstanceForReferencedView
Creates aViewItem
instance, that will be the copy of an existing view item in a referenced view- Parameters:
viewItem
- the view item that will be copied- Returns:
- the created
ViewItem
instance
-