Class ContentItemHelper

java.lang.Object
com.flowable.content.engine.impl.ContentItemHelper

public class ContentItemHelper extends Object
Author:
Yvo Swillens
  • Method Details

    • isEligibleForDocumentEvent

      public static boolean isEligibleForDocumentEvent(org.flowable.content.api.ContentItem contentItem)
      Returns whether DOCUMENT_* business events should be dispatched for the given content item. The following content items exist as ContentItem rows but are not yet user-facing documents and are filtered out:
      • folders (mimeType == application/vnd.folder)
      • items with the provisional flag set
      • items linked to a form instance (scopeType == ScopeTypes.FORM) — even though their provisional flag is cleared during the intermediate form save, they are still in form-edit territory until the form is submitted and the scope is rebound to the real workflow.
    • saveContentItem

      public static void saveContentItem(org.flowable.content.api.ContentItem contentItem, InputStream inputStream)
      Saves a content item via saveContentItem(ContentItem, InputStream, boolean) with fireDocumentCreatedEvent = true. Used by the standard save path; the helper will dispatch DOCUMENT_CREATED when the entity transitions into the document state.
    • saveContentItem

      public static void saveContentItem(org.flowable.content.api.ContentItem contentItem, InputStream inputStream, boolean fireDocumentCreatedEvent)
      Saves a content item. When fireDocumentCreatedEvent is true and the entity transitions into the document state (a fresh non-provisional insert, or an update where the entity stops being effectively provisional), a DOCUMENT_CREATED event is dispatched in addition to the legacy CONTENT_ITEM_SAVED. Pass false from commands that dispatch their own document-level event (copy / new-version / revert).
    • copyMetadata

      public static void copyMetadata(ContentItemEntity source, ContentItemEntity target)
      Copies all MetadataInstanceEntity rows from source to target (creating fresh persistent rows for the target's id). When the target's metadata list is initialised in memory, the new instances are also appended to that list so the in-memory entity stays in sync with the DB. Used by copy / new-version / revert flows.
    • createProvisionalRenditionItems

      protected static void createProvisionalRenditionItems(ContentItemEntity contentItem)
    • createProvisionalRenditionItems

      public static void createProvisionalRenditionItems(ContentItemEntity contentItem, String documentAgentDefinitionId)
    • createRenditionItem

      protected static void createRenditionItem(ContentEngineConfiguration contentEngineConfiguration, ContentItemEntity contentItem, RenditionType renditionType, String mimeType, String documentAgentDefinitionId)
    • createAndReturnRenditionItem

      public static RenditionItemEntity createAndReturnRenditionItem(ContentEngineConfiguration contentEngineConfiguration, ContentItemEntity contentItem, RenditionType renditionType, String mimeType)
    • createAndReturnRenditionItem

      public static RenditionItemEntity createAndReturnRenditionItem(ContentEngineConfiguration contentEngineConfiguration, ContentItemEntity contentItem, String renditionType, String renditionTypeFileExtension, String mimeType)
    • getContent

      public static InputStream getContent(org.flowable.content.api.ContentItem contentItem, org.flowable.content.api.ContentStorage contentStorage, ContentCryptoHandler contentCryptoHandler)