Class ContentItemPropertyELResolver

java.lang.Object
org.flowable.common.engine.impl.javax.el.ELResolver
com.flowable.platform.common.el.ContentItemPropertyELResolver

public class ContentItemPropertyELResolver extends org.flowable.common.engine.impl.javax.el.ELResolver
EL resolver that intercepts property access on CoreContentItem objects to handle lazy loading of metadata, renditions, and the document definition.

When accessing metadata, renditions or definition and they haven't been loaded, this resolver will automatically load the required data.

Additionally provides shorthand properties for typed renditions: thumbnailRendition, pdfRendition, structuredRendition return the matching RenditionItem, while thumbnailRenditionData and pdfRenditionData return the binary data as an InputStream.

structuredData returns the parsed structured rendition as a JsonNode; for email content items it returns a navigable StructuredEmailData that exposes the email payload fields, the content-item fields, and a cache-aware attachments list (e.g. ${email.structuredData.from}, ${email.structuredData.attachments}).

The approach of injecting directly into the cached entity (rather than re-querying the whole content item) is necessary for metadata and renditions, because the MyBatis entity cache would otherwise return the same already-cached instance with the initialized flags still false.

Author:
Micha Kiener
  • Field Details

  • Constructor Details

    • ContentItemPropertyELResolver

      public ContentItemPropertyELResolver()
  • Method Details

    • getCommonPropertyType

      public Class<?> getCommonPropertyType(org.flowable.common.engine.impl.javax.el.ELContext context, Object base)
      Specified by:
      getCommonPropertyType in class org.flowable.common.engine.impl.javax.el.ELResolver
    • getType

      public Class<?> getType(org.flowable.common.engine.impl.javax.el.ELContext context, Object base, Object property)
      Specified by:
      getType in class org.flowable.common.engine.impl.javax.el.ELResolver
    • getValue

      public Object getValue(org.flowable.common.engine.impl.javax.el.ELContext context, Object base, Object property)
      Specified by:
      getValue in class org.flowable.common.engine.impl.javax.el.ELResolver
    • isReadOnly

      public boolean isReadOnly(org.flowable.common.engine.impl.javax.el.ELContext context, Object base, Object property)
      Specified by:
      isReadOnly in class org.flowable.common.engine.impl.javax.el.ELResolver
    • setValue

      public void setValue(org.flowable.common.engine.impl.javax.el.ELContext context, Object base, Object property, Object value)
      Specified by:
      setValue in class org.flowable.common.engine.impl.javax.el.ELResolver
    • loadMetadataIntoContentItem

      protected void loadMetadataIntoContentItem(ContentItemEntity contentItemEntity)
    • loadRenditionsIntoContentItem

      protected void loadRenditionsIntoContentItem(ContentItemEntity contentItemEntity)
    • findRenditionByType

      protected RenditionItem findRenditionByType(String contentItemId, String renditionType)
    • getRenditionData

      protected Object getRenditionData(ContentEngineConfiguration config, CoreContentItem contentItem, RenditionItem renditionItem, String renditionType)
    • readRenditionDataAsJsonNode

      protected Object readRenditionDataAsJsonNode(ContentEngineConfiguration config, RenditionItem renditionItem)
    • renditionTypeFromProperty

      protected String renditionTypeFromProperty(String propertyName)