Class PageTitleAttributeConverter

java.lang.Object
sk.iway.iwcm.system.jpa.PageTitleAttributeConverter
All Implemented Interfaces:
jakarta.persistence.AttributeConverter<String,String>

public class PageTitleAttributeConverter extends Object implements jakarta.persistence.AttributeConverter<String,String>
Keeps page and history titles safe on both database writes and reads. USES ALSO Tools.convertToHtmlTags(value) to convert legacy *|...|* to HTML PageTitleAttributeConverter
  • Constructor Details

    • PageTitleAttributeConverter

      public PageTitleAttributeConverter()
  • Method Details

    • convertToDatabaseColumn

      public String convertToDatabaseColumn(String value)
      Specified by:
      convertToDatabaseColumn in interface jakarta.persistence.AttributeConverter<String,String>
    • convertToEntityAttribute

      public String convertToEntityAttribute(String value)
      Specified by:
      convertToEntityAttribute in interface jakarta.persistence.AttributeConverter<String,String>
    • sanitizeTitle

      public static String sanitizeTitle(String value)
      Retains safe title formatting after decoding the legacy WebJET HTML notation. Page titles cannot opt into executable HTML through the jpaentity bypass.
      Parameters:
      value - title or navigation label, possibly loaded through JDBC
      Returns:
      sanitized HTML, preserving null