Class ComponentTypeStructureConverter

    • Constructor Detail

      • ComponentTypeStructureConverter

        public ComponentTypeStructureConverter()
    • Method Detail

      • throwTypePermissionException

        protected void throwTypePermissionException​(java.lang.String permissionName,
                                                    java.lang.String typeCode)
        Parameters:
        permissionName - permission name
        typeCode - type code
      • buildAttributeDescriptorModel

        protected AttributeDescriptorModel buildAttributeDescriptorModel​(ComposedTypeModel composedTypeModel,
                                                                         ComponentTypeAttributeStructure attribute)
        Creates a new AttributeDescriptor with basic data copied from the provided attribute.
        Parameters:
        composedTypeModel - - the composed type model containing the provided attribute
        attribute - - the attribute from where to copy the new descriptor data
        Returns:
        the newly created attribute descriptor
      • getAttributeDescriptor

        protected AttributeDescriptorModel getAttributeDescriptor​(ComposedTypeModel type,
                                                                  ComponentTypeAttributeStructure originalAttribute)
        Get AttributeDescriptor matching with the qualifier of the attribute for the type provided.
        Parameters:
        type - - the composed type model in which to search for the descriptor
        originalAttribute - - the attribute whose descriptor to search for.
        Returns:
        the attribute descriptor matching the given criteria
      • convertAttributeAndEvaluatePermissions

        protected ComponentTypeAttributeData convertAttributeAndEvaluatePermissions​(ComposedTypeModel composedType,
                                                                                    ComponentTypeAttributeStructure attributeStructure)
        This method converts the attribute attribute descriptor to a POJO using the structure attribute's populators and evaluates its permissions.
        Parameters:
        composedType - - the composed type model containing the attribute to convert.
        attributeStructure - - the attribute to convert
        Returns:
        the component type attribute POJO. Will be null if user has no read-permissions.
      • isReadOnlyMode

        protected boolean isReadOnlyMode()
        Checks whether the structure api should return fields in read only mode (editable = false)
        Returns:
        TRUE if the read only mode is used, FALSE otherwise.
      • hasReadPermissionOnAttribute

        protected boolean hasReadPermissionOnAttribute​(AttributeDescriptorModel attributeDescriptorModel)
        Checks whether the current principal has read permission on the attribute provided.
        Parameters:
        attributeDescriptorModel - - The descriptor that specifies the attribute whose read permission to check.
        Returns:
        true if the current principal has been granted read permission on the attribute; false otherwise.
        Throws:
        AttributePermissionException - - When principal does not have read permission for a required attribute.
      • enclosingTypeHasAttribute

        protected boolean enclosingTypeHasAttribute​(ComposedTypeModel enclosingType,
                                                    java.lang.String qualifier)
        Checks whether the component type contains the attribute identified by the qualifier provided.
        Parameters:
        enclosingType - - The item where to look for the expected attribute
        qualifier - - The qualifier of the attribute to find
        Returns:
        true if the attribute is found; false otherwise.
      • setStringDecapitalizer

        public void setStringDecapitalizer​(StringDecapitalizer stringDecapitalizer)
      • getComponentTypeAttributeDataFactory

        protected org.springframework.beans.factory.ObjectFactory<ComponentTypeAttributeData> getComponentTypeAttributeDataFactory()
      • setComponentTypeAttributeDataFactory

        public void setComponentTypeAttributeDataFactory​(org.springframework.beans.factory.ObjectFactory<ComponentTypeAttributeData> componentTypeAttributeDataFactory)
      • getTypeService

        protected TypeService getTypeService()
      • setTypeService

        public void setTypeService​(TypeService typeService)
      • setPermissionCRUDService

        public void setPermissionCRUDService​(PermissionCRUDService permissionCRUDService)
      • setCmsPermissionChecker

        public void setCmsPermissionChecker​(CMSPermissionChecker cmsPermissionChecker)
      • setCmsAdminSiteService

        public void setCmsAdminSiteService​(CMSAdminSiteService cmsAdminSiteService)