public interface TemplateBasedDocument
DocumentModel that support rendering via a
Template. This Document can be associated with a
TemplateSourceDocument that provides the rendering template as well
as the default inputs used for rendering.| Modifier and Type | Method and Description |
|---|---|
DocumentModel |
getAdaptedDoc()
Return the underlying adapted
DocumentModel |
List<TemplateInput> |
getParams(String templateName)
Retrieve parameters for the associated template
|
TemplateSourceDocument |
getSourceTemplate(String templateName)
Retrieve the
TemplateSourceDocument for a given template name |
DocumentModel |
getSourceTemplateDoc(String templateName)
Retrieve the Template
DocumentModel for a given template name |
DocumentRef |
getSourceTemplateDocRef(String templateName)
Retrieve the Template
DocumentRef for a given template name |
List<TemplateSourceDocument> |
getSourceTemplates()
List all
TemplateSourceDocuments that are bound to the underlying
DocumentModel |
Blob |
getTemplateBlob(String templateName)
Return the
Blob of the associated template |
String |
getTemplateNameForRendition(String renditionName)
Find the template associated to a given RenditionName
|
List<String> |
getTemplateNames()
Get the names of all the associated templates
|
String |
getTemplateType(String templateName)
Return the template type for a given template name
|
boolean |
hasEditableParams(String templateName)
Indicate of the associated Template has editable parameters or not
|
boolean |
hasParams(String templateName)
Indicate of the associated Template requires parameters or not
|
DocumentModel |
initializeFromTemplate(String templateName,
boolean save)
Initialize the template parameters from the associated template
|
DocumentModel |
removeTemplateBinding(String templateName,
boolean save)
Detach a template from the underlying
DocumentModel |
Blob |
renderAndStoreAsAttachment(String templateName,
boolean save)
Render the named template against the underlying DocumentModel and store
the result in the main Blob
|
Blob |
renderWithTemplate(String templateName)
Render the named template against the underlying DocumentModel
|
DocumentModel |
saveParams(String templateName,
List<TemplateInput> params,
boolean save)
Save parameters changes.
|
DocumentModel |
setTemplate(DocumentModel template,
boolean save)
Associate the document to a Template.
|
DocumentModel setTemplate(DocumentModel template, boolean save) throws PropertyException, ClientException
template - DocumentModel holding the templatesave - flag to indicate if target DocumentModel must be saved or notPropertyExceptionClientExceptionTemplateSourceDocument getSourceTemplate(String templateName) throws Exception
TemplateSourceDocument for a given template nametemplateName - name of the templateTemplateSourceDocumentExceptionDocumentRef getSourceTemplateDocRef(String templateName) throws Exception
DocumentRef for a given template nametemplateName - name of the templateDocumentRefExceptionDocumentModel getSourceTemplateDoc(String templateName) throws Exception
DocumentModel for a given template nametemplateName - name of the templateDocumentModelExceptionList<TemplateSourceDocument> getSourceTemplates()
TemplateSourceDocuments that are bound to the underlying
DocumentModelString getTemplateType(String templateName)
templateName - DocumentModel initializeFromTemplate(String templateName, boolean save) throws Exception
templateName - save - flag to indicate if target DocumentModel must be saved or notExceptionBlob renderAndStoreAsAttachment(String templateName, boolean save) throws Exception
Blob renderWithTemplate(String templateName) throws Exception
boolean hasParams(String templateName) throws ClientException
templateName - ClientExceptionList<TemplateInput> getParams(String templateName) throws ClientException
templateName - ClientExceptionDocumentModel saveParams(String templateName, List<TemplateInput> params, boolean save) throws Exception
templateName - params - the updated list of parameterssave - flag to indicate if target DocumentModel must be saved or notExceptionDocumentModel getAdaptedDoc()
DocumentModelBlob getTemplateBlob(String templateName) throws Exception
Blob of the associated templatetemplateName - Exceptionboolean hasEditableParams(String templateName) throws ClientException
templateName - ClientExceptionString getTemplateNameForRendition(String renditionName)
renditionName - List<String> getTemplateNames()
DocumentModel removeTemplateBinding(String templateName, boolean save) throws ClientException
DocumentModeltemplateName - save - ClientExceptionCopyright © 2014 Nuxeo SA. All rights reserved.