|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TemplateStore
This interface provides access to systems for storage and retrieval of templates. There is the concept of an original and a working template. The working template is derived from the original template to allow for performant populating. If the original template is acceptable for population processing, then no working template need be specified. Custom implementations of this interface need to note the following:
docmosis.template.store.location=custom:my.own.CustomTemplateStore or docmosis.template.store.location=custom:my.own.CustomTemplateStore:myParamValueThe first setting will instantiate my.own.CustomTemplateStore by calling the no-argument constructor. The second setting will instantiate my.own.CustomTemplateStore by calling the constructor with a single String parameter and pass the "myParamValue" value in the parameter.
Method Summary | |
---|---|
void |
deleteAll()
Delete all templates in the store. |
void |
deleteTemplate(TemplateIdentifier templateId)
Delete the given template from the store. |
void |
deleteTemplates(TemplateContext context,
boolean includeSubContexts)
Delete all templates in the given context. |
TemplateDetails[] |
findByContext(TemplateContext templateContext,
boolean includeSubContexts)
Get the list of templates for the given context. |
InputStream |
getOriginalTemplate(TemplateIdentifier templateId)
Get the original template provided in storeTemplate(). |
Template |
getTemplate(TemplateIdentifier templateId)
Get the (working) template identified by the given templateId. |
TemplateAnalysis |
getTemplateAnalysis(TemplateIdentifier templateId)
Get the template analysis for the template identified by the given template info. |
long |
getTemplateStoredTime(TemplateIdentifier templateId)
Return the time that the template was stored in this template store. |
TemplateDetails |
storeTemplate(TemplateIdentifier templateId,
InputStream origTemplateSource,
Long origTemplateLastModified,
InputStream workingTemplateSource,
TemplateAnalysis analysis,
InputStream thumbnail,
boolean overwrite,
boolean templateErrorsFatal,
String plainTextFieldPrefix,
String plainTextFieldSuffix,
boolean allowPaddedFields,
com.docmosis.util.properties.PropertiesProvider propertyOverrides)
Store the given InputStream as a template using the given templateId. |
Method Detail |
---|
TemplateDetails storeTemplate(TemplateIdentifier templateId, InputStream origTemplateSource, Long origTemplateLastModified, InputStream workingTemplateSource, TemplateAnalysis analysis, InputStream thumbnail, boolean overwrite, boolean templateErrorsFatal, String plainTextFieldPrefix, String plainTextFieldSuffix, boolean allowPaddedFields, com.docmosis.util.properties.PropertiesProvider propertyOverrides) throws IOException, TemplateAlreadyExistsException, TemplateStoreException
templateId
- the unique identification for this template.origTemplateSource
- an InputStream over the "original" template. This is the
raw template as provided by whatever source (eg a user).origTemplateLastModified
- if not null, specifies the last modified of the origina template.workingTemplateSource
- an InputStream over a working template source. This is
expected to be a converted form of the original template that is suitable for populating
by a TemplatePopulator. Specify null if the origTemplateSource should be used as the working
template. The working template is returned by getTemplate().analysis
- the analysis for the template. This may be null and is expected to be
constructed dynamically by some TemplateStore implementations, so most implementations should
simply store what is given.thumbnail
- an image thumbnail for the template. This may be null and is expected to be
constructed dynamically by some TemplateStore implementations, so most implementations of this interface
should simply store what is given.overwrite
- if true, any existing template will be overwritten.templateErrorsFatal
- if true, errors detected in the template will result in a TemplateStoreException.
If false, errors will be highlighted in the template (where possible) and thus be visible when the
document is rendered. Most implementations of this interface can ignore this parameter because it is
used by the TemplateStore implementation that will provide the TemplateAnalysis.plainTextFieldPrefix
- if not null, specifies a prefix to use when analysing templates
to identify Docmosis fields in plain text. Most implementations of this interface can ignore this parameter because it is
used by the TemplateStore implementation that will provide the TemplateAnalysis.plainTextFieldSuffix
- this is the partner to plainTextFieldPrefix and identifies the end of the
field. Most implementations of this interface can ignore this parameter because it is
used by the TemplateStore implementation that will provide the TemplateAnalysis.allowPaddedFields
- when processing the template allow fields padded with spaces to
be included as fields. Most implementations of this interface can ignore this parameter because it is
used by the TemplateStore implementation that will provide the TemplateAnalysis.propertyOverrides
- optional overriding properties to customize processing
IOException
- if an error occurs storing the template
TemplateAlreadyExistsException
- if the template is already present and overwrite is not
true
TemplateStoreException
- if any other unexpected error occurs.Template getTemplate(TemplateIdentifier templateId) throws IOException, TemplateNotFoundException, TemplateStoreException
templateId
- the identifier for the template
IOException
- if an error occurs obtaining the template
TemplateNotFoundException
- if the specified template cannot be found
TemplateStoreException
TemplateDetails[] findByContext(TemplateContext templateContext, boolean includeSubContexts) throws IOException, TemplateStoreException
templateContext
- the context under which to find templatesincludeSubContexts
- if true, templates under subcontexts will be returned.
IOException
- if an error occurs obtaining the template
TemplateStoreException
- if a problem occurs specific to the storeInputStream getOriginalTemplate(TemplateIdentifier templateId) throws IOException, TemplateNotFoundException
templateId
- details of the template to retrieve.
IOException
- if an IO problem occurs.
TemplateNotFoundException
- if the specified template is not foundTemplateAnalysis getTemplateAnalysis(TemplateIdentifier templateId) throws IOException, TemplateNotFoundException, TemplateStoreException
templateId
-
TemplateNotFoundException
- if the template cannot be located
TemplateStoreException
- if an error occurs retrieving the analysis
IOException
- if an error occurs obtaining the analysisvoid deleteTemplate(TemplateIdentifier templateId) throws TemplateStoreException
templateId
- the identifier for the template
TemplateStoreException
- if the template could not be deleted.void deleteTemplates(TemplateContext context, boolean includeSubContexts) throws TemplateStoreException
context
- the template context in which all templates are to be deletedincludeSubContexts
- if true all templates in contexts under the given
context will also be deleted.
TemplateStoreException
- if any of the templates could not be deletedvoid deleteAll() throws TemplateStoreException
context
- the template context in which all templates are to be deleted
TemplateStoreException
- if any of the templates could not be deletedlong getTemplateStoredTime(TemplateIdentifier templateId) throws TemplateStoreException
TemplateStoreException
- if an error occurred while retrieving this information.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |