Class AbstractCMSComponentModelVisitor<CMSCOMPONENTTYPE extends AbstractCMSComponentModel>
java.lang.Object
de.hybris.platform.cmsfacades.synchronization.itemvisitors.AbstractCMSComponentModelVisitor<CMSCOMPONENTTYPE>
- Type Parameters:
CMSCOMPONENTTYPE- the component type that extendsAbstractCMSComponentModel
- All Implemented Interfaces:
ItemVisitor<CMSCOMPONENTTYPE>,org.springframework.beans.factory.InitializingBean
- Direct Known Subclasses:
AbstractCMSComponentContainerModelVisitor,AbstractMediaContainerComponentModelVisitor,CMSLinkComponentModelVisitor,DefaultAbstractCMSComponentModelVisitor,NavigationBarCollectionComponentModelVisitor,NavigationBarComponentModelVisitor,NavigationComponentModelVisitor,VideoComponentModelVisitor
public abstract class AbstractCMSComponentModelVisitor<CMSCOMPONENTTYPE extends AbstractCMSComponentModel>
extends Object
implements ItemVisitor<CMSCOMPONENTTYPE>, org.springframework.beans.factory.InitializingBean
Abstract class for visiting
AbstractCMSComponentModel models for the cms synchronization service to work
properly. In this implementation, it will collect all component's child (collection or not) extending or being
CMSItemModel-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidprotected voidcollectChildItems(CMSCOMPONENTTYPE source, List<ItemModel> toVisit, AttributeDescriptorModel attributeDescriptorModel) Collects all child items of typeCMSItemModelfor the provided source component.getAllIgnoredAttributeTypesInConfigHierarchy(List<String> allSuperTypeCodes) Returns all type codes that must be ignored during iteration over component attributes.getAllSuperTypeCodes(CMSCOMPONENTTYPE componentType) Get the list of all the super typeCodes given a composedType, including the composedType typeCode.protected AttributeDescriptorModelHelperServiceprotected List<AttributeDescriptorModel>Returns the list of attributes for component type.protected ObjectgetAttributeValue(CMSCOMPONENTTYPE source, AttributeDescriptorModel attributeDescriptorModel) Gets the value by calling the getter for the attribute defined by the provided attribute descriptor.Returns the configuration for the type code.getIgnoreAttributeTypeClasses(CMSCOMPONENTTYPE componentType) Returns all type classes that must be ignored during iteration over component attributes.protected ModelServiceprotected TypeServiceprotected booleanisAttributeAllowed(CMSCOMPONENTTYPE componentType, AttributeDescriptorModel attribute) Verifies whether the attribute is allowed for future visiting.protected booleanisClassAssignableFrom(Class clazz, AttributeDescriptorModel attributeDescriptor) voidsetAttributeDescriptorModelHelperService(AttributeDescriptorModelHelperService attributeDescriptorModelHelperService) voidsetConfigurationService(ConfigurationService configurationService) voidsetIgnoreAttributeTypeCodeConfigs(Map<String, List<String>> ignoreAttributeTypeCodeConfigs) voidsetModelService(ModelService modelService) voidsetTypeService(TypeService typeService) Returns visited items for a giventheSourceitem within given contestctx
-
Field Details
-
SYNCHRONIZATION_COMPONENT_ATTRIBUTE_CACHE_EXPIRATION_TIME
- See Also:
-
-
Constructor Details
-
AbstractCMSComponentModelVisitor
public AbstractCMSComponentModelVisitor()
-
-
Method Details
-
afterPropertiesSet
public void afterPropertiesSet()- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean
-
visit
Description copied from interface:ItemVisitorReturns visited items for a giventheSourceitem within given contestctx- Specified by:
visitin interfaceItemVisitor<CMSCOMPONENTTYPE extends AbstractCMSComponentModel>- Parameters:
source- given itempath- path to given itemctx- visitor context- Returns:
- relevant items for a given
theSourceitem
-
getAttributesFromCacheOrRetrieve
Returns the list of attributes for component type. It retrieves them from the cache if available, or generated if cache is empty.- Parameters:
source- the source component type- Returns:
- the list of attributes.
-
isAttributeAllowed
protected boolean isAttributeAllowed(CMSCOMPONENTTYPE componentType, AttributeDescriptorModel attribute) Verifies whether the attribute is allowed for future visiting.- Parameters:
componentType- the type for which to retrieve the list of ignored attribute types from config.attribute- the attribute to verify- Returns:
- true if the attribute must be visited earlier, false otherwise.
-
getIgnoreAttributeTypeClasses
Returns all type classes that must be ignored during iteration over component attributes.- Parameters:
componentType- the type for which to retrieve the list of ignored attribute types from config.- Returns:
- the list of classes.
-
collectChildItems
protected void collectChildItems(CMSCOMPONENTTYPE source, List<ItemModel> toVisit, AttributeDescriptorModel attributeDescriptorModel) Collects all child items of typeCMSItemModelfor the provided source component.- Parameters:
source- - the component which attributes is inspected to collect child itemstoVisit- - the list of items collected which will be used by the synchronization serviceattributeDescriptorModel- - the attribute descriptor object containing the information about the attribute of interest
-
getAttributeValue
protected Object getAttributeValue(CMSCOMPONENTTYPE source, AttributeDescriptorModel attributeDescriptorModel) Gets the value by calling the getter for the attribute defined by the provided attribute descriptor.When the attribute is not readable (due to configurations in *items.xml), the ModelService will return an
AttributeNotSupportedExceptionand the attribute will not be added to the list of items to visit by the synchronization service.- Parameters:
source- - the source object which the getter method will be calledattributeDescriptorModel- - the attribute descriptor object containing the information about the attribute of interest- Returns:
- the result of the getter; can be
NULL
-
isClassAssignableFrom
-
getAllIgnoredAttributeTypesInConfigHierarchy
Returns all type codes that must be ignored during iteration over component attributes.- Parameters:
allSuperTypeCodes- the list of type codes for which the configuration must be retrieved.- Returns:
- the list of type codes that must be ignored.
-
getAllSuperTypeCodes
Get the list of all the super typeCodes given a composedType, including the composedType typeCode. -
getIgnoreAttributeConfigurationByTypeCode
Returns the configuration for the type code.- Parameters:
typeCode- the type code for which return the configuration.- Returns:
- the
Optionalconfiguration that contains a list of type codes that must be ignored.
-
getTypeService
-
setTypeService
-
getModelService
-
setModelService
-
getAttributeDescriptorModelHelperService
-
setAttributeDescriptorModelHelperService
public void setAttributeDescriptorModelHelperService(AttributeDescriptorModelHelperService attributeDescriptorModelHelperService) -
getIgnoreAttributeTypeCodeConfigs
-
setIgnoreAttributeTypeCodeConfigs
-
getConfigurationService
-
setConfigurationService
-