Class ContentItemHelper
java.lang.Object
com.flowable.content.engine.impl.ContentItemHelper
- Author:
- Yvo Swillens
-
Method Summary
Modifier and TypeMethodDescriptionstatic voidcopyMetadata(ContentItemEntity source, ContentItemEntity target) Copies allMetadataInstanceEntityrows fromsourcetotarget(creating fresh persistent rows for the target's id).static RenditionItemEntitycreateAndReturnRenditionItem(ContentEngineConfiguration contentEngineConfiguration, ContentItemEntity contentItem, RenditionType renditionType, String mimeType) static RenditionItemEntitycreateAndReturnRenditionItem(ContentEngineConfiguration contentEngineConfiguration, ContentItemEntity contentItem, String renditionType, String renditionTypeFileExtension, String mimeType) protected static voidcreateProvisionalRenditionItems(ContentItemEntity contentItem) static voidcreateProvisionalRenditionItems(ContentItemEntity contentItem, String documentAgentDefinitionId) protected static voidcreateRenditionItem(ContentEngineConfiguration contentEngineConfiguration, ContentItemEntity contentItem, RenditionType renditionType, String mimeType, String documentAgentDefinitionId) static InputStreamgetContent(org.flowable.content.api.ContentItem contentItem, org.flowable.content.api.ContentStorage contentStorage, ContentCryptoHandler contentCryptoHandler) static booleanisEligibleForDocumentEvent(org.flowable.content.api.ContentItem contentItem) Returns whetherDOCUMENT_*business events should be dispatched for the given content item.static voidsaveContentItem(org.flowable.content.api.ContentItem contentItem, InputStream inputStream) Saves a content item viasaveContentItem(ContentItem, InputStream, boolean)withfireDocumentCreatedEvent = true.static voidsaveContentItem(org.flowable.content.api.ContentItem contentItem, InputStream inputStream, boolean fireDocumentCreatedEvent) Saves a content item.
-
Method Details
-
isEligibleForDocumentEvent
public static boolean isEligibleForDocumentEvent(org.flowable.content.api.ContentItem contentItem) Returns whetherDOCUMENT_*business events should be dispatched for the given content item. The following content items exist asContentItemrows but are not yet user-facing documents and are filtered out:- folders (
mimeType == application/vnd.folder) - items with the
provisionalflag 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.
- folders (
-
saveContentItem
public static void saveContentItem(org.flowable.content.api.ContentItem contentItem, InputStream inputStream) Saves a content item viasaveContentItem(ContentItem, InputStream, boolean)withfireDocumentCreatedEvent = true. Used by the standard save path; the helper will dispatchDOCUMENT_CREATEDwhen 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. WhenfireDocumentCreatedEventistrueand the entity transitions into the document state (a fresh non-provisional insert, or an update where the entity stops being effectively provisional), aDOCUMENT_CREATEDevent is dispatched in addition to the legacyCONTENT_ITEM_SAVED. Passfalsefrom commands that dispatch their own document-level event (copy / new-version / revert). -
copyMetadata
Copies allMetadataInstanceEntityrows fromsourcetotarget(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
-
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)
-