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 Object implements TemplateProcessor
-
-
Field Summary
Fields Modifier and Type Field Description protected static StringOUTPUT_TYPE_PDFprotected static StringOUTPUT_TYPE_WORDprotected StringsupportedContentTypeprotected TemplateResourceResolvertemplateResourceResolver
-
Constructor Summary
Constructors Constructor Description DocumentTemplateProcessor(TemplateResourceResolver templateResourceResolver, String supportedContentType)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description booleancanRender(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 ContentItemcreateContentItem(VariableContainer variableContainer, String outputDocumentName, String outputDocumentType, byte[] documentBytes)protected abstract ContentItemcreateProcessorContentItem(ContentService contentService, String outputDocumentName, String outputDocumentType)protected InputStreamgetContentInputStream(TemplateHolder templateHolder)protected ContentServicegetContentService()protected ExpressionManagergetExpressionManager(Map<String,Object> payload)protected StringgetFromPayloadOrDefault(Map<String,Object> payload, String key, String defaultValue)protected VariableContainergetVariableContainer(Map<String,Object> payload)protected booleanisContentItemGenerationEnabled(Map<String,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 Detail
-
OUTPUT_TYPE_PDF
protected static final String OUTPUT_TYPE_PDF
- See Also:
- Constant Field Values
-
OUTPUT_TYPE_WORD
protected static final String OUTPUT_TYPE_WORD
- See Also:
- Constant Field Values
-
templateResourceResolver
protected TemplateResourceResolver templateResourceResolver
-
supportedContentType
protected String supportedContentType
-
-
Constructor Detail
-
DocumentTemplateProcessor
public DocumentTemplateProcessor(TemplateResourceResolver templateResourceResolver, String supportedContentType)
-
-
Method Detail
-
canRender
public boolean canRender(TemplateModel templateModel, TemplateVariationModel templateVariation)
Description copied from interface:TemplateProcessorBefore 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:
canRenderin 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:
trueif it can be rendered by this processor,falseotherwise
-
createProcessorContentItem
protected abstract ContentItem createProcessorContentItem(ContentService contentService, String outputDocumentName, String outputDocumentType)
-
createContentItem
protected ContentItem createContentItem(VariableContainer variableContainer, String outputDocumentName, String outputDocumentType, byte[] documentBytes) throws IOException
- Throws:
IOException
-
getFromPayloadOrDefault
protected String getFromPayloadOrDefault(Map<String,Object> payload, String key, String defaultValue)
-
getExpressionManager
protected ExpressionManager getExpressionManager(Map<String,Object> payload)
-
getVariableContainer
protected VariableContainer getVariableContainer(Map<String,Object> payload)
-
getContentInputStream
protected InputStream getContentInputStream(TemplateHolder templateHolder)
-
getContentService
protected ContentService getContentService()
-
-