Class AbstractCMSComponentModelVisitor<CMSCOMPONENTTYPE extends AbstractCMSComponentModel>

    • Field Detail

      • SYNCHRONIZATION_COMPONENT_ATTRIBUTE_CACHE_EXPIRATION_TIME

        public static final java.lang.String SYNCHRONIZATION_COMPONENT_ATTRIBUTE_CACHE_EXPIRATION_TIME
        See Also:
        Constant Field Values
    • Constructor Detail

      • AbstractCMSComponentModelVisitor

        public AbstractCMSComponentModelVisitor()
    • Method Detail

      • afterPropertiesSet

        public void afterPropertiesSet()
        Specified by:
        afterPropertiesSet in interface org.springframework.beans.factory.InitializingBean
      • visit

        public java.util.List<ItemModel> visit​(CMSCOMPONENTTYPE source,
                                               java.util.List<ItemModel> path,
                                               java.util.Map<java.lang.String,​java.lang.Object> ctx)
        Description copied from interface: ItemVisitor
        Returns visited items for a given theSource item within given contest ctx
        Specified by:
        visit in interface ItemVisitor<CMSCOMPONENTTYPE extends AbstractCMSComponentModel>
        Parameters:
        source - given item
        path - path to given item
        ctx - visitor context
        Returns:
        relevant items for a given theSource item
      • getAttributesFromCacheOrRetrieve

        protected java.util.List<AttributeDescriptorModel> getAttributesFromCacheOrRetrieve​(CMSCOMPONENTTYPE source)
        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

        protected java.util.List<java.lang.Class<?>> getIgnoreAttributeTypeClasses​(CMSCOMPONENTTYPE componentType)
        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,
                                         java.util.List<ItemModel> toVisit,
                                         AttributeDescriptorModel attributeDescriptorModel)
        Collects all child items of type CMSItemModel for the provided source component.
        Parameters:
        source - - the component which attributes is inspected to collect child items
        toVisit - - the list of items collected which will be used by the synchronization service
        attributeDescriptorModel - - the attribute descriptor object containing the information about the attribute of interest
      • getAttributeValue

        protected java.lang.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 AttributeNotSupportedException and 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 called
        attributeDescriptorModel - - the attribute descriptor object containing the information about the attribute of interest
        Returns:
        the result of the getter; can be NULL
      • isClassAssignableFrom

        protected boolean isClassAssignableFrom​(java.lang.Class clazz,
                                                AttributeDescriptorModel attributeDescriptor)
      • getAllIgnoredAttributeTypesInConfigHierarchy

        protected java.util.List<java.lang.String> getAllIgnoredAttributeTypesInConfigHierarchy​(java.util.List<java.lang.String> allSuperTypeCodes)
        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

        protected java.util.List<java.lang.String> getAllSuperTypeCodes​(CMSCOMPONENTTYPE componentType)
        Get the list of all the super typeCodes given a composedType, including the composedType typeCode.
        Parameters:
        componentType - the component type
        Returns:
        the List of String representation of all the super typeCodes given a composedType, including the composedType typeCode.
      • getIgnoreAttributeConfigurationByTypeCode

        protected java.util.Optional<java.util.List<java.lang.String>> getIgnoreAttributeConfigurationByTypeCode​(java.lang.String typeCode)
        Returns the configuration for the type code.
        Parameters:
        typeCode - the type code for which return the configuration.
        Returns:
        the Optional configuration that contains a list of type codes that must be ignored.
      • getTypeService

        protected TypeService getTypeService()
      • setTypeService

        public void setTypeService​(TypeService typeService)
      • getModelService

        protected ModelService getModelService()
      • setModelService

        public void setModelService​(ModelService modelService)
      • getIgnoreAttributeTypeCodeConfigs

        public java.util.Map<java.lang.String,​java.util.List<java.lang.String>> getIgnoreAttributeTypeCodeConfigs()
      • setIgnoreAttributeTypeCodeConfigs

        public void setIgnoreAttributeTypeCodeConfigs​(java.util.Map<java.lang.String,​java.util.List<java.lang.String>> ignoreAttributeTypeCodeConfigs)
      • setConfigurationService

        public void setConfigurationService​(ConfigurationService configurationService)