Class DocumentTemplateProcessor
java.lang.Object
com.flowable.template.engine.impl.processor.DocumentTemplateProcessor
- All Implemented Interfaces:
TemplateProcessor
- Direct Known Subclasses:
AsposePdfTemplateProcessor
,AsposeWordTemplateProcessor
public abstract class DocumentTemplateProcessor extends java.lang.Object implements TemplateProcessor
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
OUTPUT_TYPE_PDF
protected static java.lang.String
OUTPUT_TYPE_WORD
protected java.lang.String
supportedContentType
protected TemplateResourceResolver
templateResourceResolver
-
Constructor Summary
Constructors Constructor Description DocumentTemplateProcessor(TemplateResourceResolver templateResourceResolver, java.lang.String supportedContentType)
-
Method Summary
Modifier and Type Method Description boolean
canRender(TemplateModel templateModel, TemplateVariationModel templateVariation)
Before a template is rendered, the service will call this method to check, whether this processor is able to handle the given template.protected org.flowable.content.api.ContentItem
createContentItem(org.flowable.common.engine.api.variable.VariableContainer variableContainer, java.lang.String outputDocumentName, java.lang.String outputDocumentType, byte[] documentBytes)
protected abstract org.flowable.content.api.ContentItem
createProcessorContentItem(org.flowable.content.api.ContentService contentService, java.lang.String outputDocumentName, java.lang.String outputDocumentType)
protected java.io.InputStream
getContentInputStream(TemplateHolder templateHolder)
protected org.flowable.content.api.ContentService
getContentService()
protected org.flowable.common.engine.impl.el.ExpressionManager
getExpressionManager(java.util.Map<java.lang.String,java.lang.Object> payload)
protected java.lang.String
getFromPayloadOrDefault(java.util.Map<java.lang.String,java.lang.Object> payload, java.lang.String key, java.lang.String defaultValue)
protected org.flowable.common.engine.api.variable.VariableContainer
getVariableContainer(java.util.Map<java.lang.String,java.lang.Object> payload)
protected boolean
isContentItemGenerationEnabled(java.util.Map<java.lang.String,java.lang.Object> templateProcessingSettings)
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.flowable.template.api.processor.TemplateProcessor
processTemplate, processTemplate
-
Field Details
-
OUTPUT_TYPE_PDF
protected static final java.lang.String OUTPUT_TYPE_PDF- See Also:
- Constant Field Values
-
OUTPUT_TYPE_WORD
protected static final java.lang.String OUTPUT_TYPE_WORD- See Also:
- Constant Field Values
-
templateResourceResolver
-
supportedContentType
protected java.lang.String supportedContentType
-
-
Constructor Details
-
DocumentTemplateProcessor
public DocumentTemplateProcessor(TemplateResourceResolver templateResourceResolver, java.lang.String supportedContentType)
-
-
Method Details
-
canRender
Description copied from interface:TemplateProcessor
Before a template is rendered, the service will call this method to check, whether this processor is able to handle the given template. Typically, this is based on the type / subType of the template.- Specified by:
canRender
in interfaceTemplateProcessor
- Parameters:
templateModel
- the template definition containing meta information like type and sub type of the templatetemplateVariation
- the template to check, if it can be rendered by this processor- Returns:
true
if it can be rendered by this processor,false
otherwise
-
createProcessorContentItem
protected abstract org.flowable.content.api.ContentItem createProcessorContentItem(org.flowable.content.api.ContentService contentService, java.lang.String outputDocumentName, java.lang.String outputDocumentType) -
createContentItem
protected org.flowable.content.api.ContentItem createContentItem(org.flowable.common.engine.api.variable.VariableContainer variableContainer, java.lang.String outputDocumentName, java.lang.String outputDocumentType, byte[] documentBytes) throws java.io.IOException- Throws:
java.io.IOException
-
getFromPayloadOrDefault
protected java.lang.String getFromPayloadOrDefault(java.util.Map<java.lang.String,java.lang.Object> payload, java.lang.String key, java.lang.String defaultValue) -
getExpressionManager
protected org.flowable.common.engine.impl.el.ExpressionManager getExpressionManager(java.util.Map<java.lang.String,java.lang.Object> payload) -
getVariableContainer
protected org.flowable.common.engine.api.variable.VariableContainer getVariableContainer(java.util.Map<java.lang.String,java.lang.Object> payload) -
getContentInputStream
-
getContentService
protected org.flowable.content.api.ContentService getContentService() -
isContentItemGenerationEnabled
protected boolean isContentItemGenerationEnabled(java.util.Map<java.lang.String,java.lang.Object> templateProcessingSettings)
-