public class TemplateBasedDocumentAdapterImpl extends AbstractTemplateDocument implements Serializable, TemplateBasedDocument
TemplateBasedDocument adapter. This adapter mainly expect from the underlying
DocumentModel to have the "TemplateBased" facet| Modifier and Type | Field and Description |
|---|---|
protected TemplateBindings |
bindings |
static String |
TEMPLATEBASED_FACET |
adaptedDoc| Constructor and Description |
|---|
TemplateBasedDocumentAdapterImpl(DocumentModel doc) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
doSave() |
protected OutputFormatDescriptor |
getOutputFormatDescriptor(String outputFormat) |
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
|
protected TemplateProcessor |
getTemplateProcessor(String templateName) |
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(boolean save) |
DocumentModel |
initializeFromTemplate(String templateName,
boolean save)
Initialize the template parameters from the associated template
|
protected OperationContext |
initOperationContext(Blob blob,
String templateName) |
boolean |
isBidirectional() |
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.
|
protected void |
setBlob(Blob blob) |
DocumentModel |
setTemplate(DocumentModel template,
boolean save)
Associate the document to a Template.
|
getAdaptedDoc, getSession, saveclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAdaptedDocpublic static final String TEMPLATEBASED_FACET
protected final TemplateBindings bindings
public TemplateBasedDocumentAdapterImpl(DocumentModel doc)
public DocumentModel setTemplate(DocumentModel template, boolean save)
TemplateBasedDocumentsetTemplate in interface TemplateBasedDocumenttemplate - DocumentModel holding the templatesave - flag to indicate if target DocumentModel must be saved or notpublic DocumentModel removeTemplateBinding(String templateName, boolean save)
TemplateBasedDocumentDocumentModelremoveTemplateBinding in interface TemplateBasedDocumentpublic TemplateSourceDocument getSourceTemplate(String templateName)
TemplateBasedDocumentTemplateSourceDocument for a given template namegetSourceTemplate in interface TemplateBasedDocumenttemplateName - name of the templateTemplateSourceDocumentpublic DocumentRef getSourceTemplateDocRef(String templateName)
TemplateBasedDocumentDocumentRef for a given template namegetSourceTemplateDocRef in interface TemplateBasedDocumenttemplateName - name of the templateDocumentRefpublic DocumentModel getSourceTemplateDoc(String templateName)
TemplateBasedDocumentDocumentModel for a given template namegetSourceTemplateDoc in interface TemplateBasedDocumenttemplateName - name of the templateDocumentModelpublic List<TemplateSourceDocument> getSourceTemplates()
TemplateBasedDocumentTemplateSourceDocuments that are bound to the underlying DocumentModelgetSourceTemplates in interface TemplateBasedDocumentpublic String getTemplateType(String templateName)
TemplateBasedDocumentgetTemplateType in interface TemplateBasedDocumentpublic DocumentModel initializeFromTemplate(boolean save)
public DocumentModel initializeFromTemplate(String templateName, boolean save)
TemplateBasedDocumentinitializeFromTemplate in interface TemplateBasedDocumentsave - flag to indicate if target DocumentModel must be saved or notprotected void doSave()
doSave in class AbstractTemplateDocumentpublic Blob renderWithTemplate(String templateName)
TemplateBasedDocumentrenderWithTemplate in interface TemplateBasedDocumentBlobprotected OperationContext initOperationContext(Blob blob, String templateName)
public Blob renderAndStoreAsAttachment(String templateName, boolean save)
TemplateBasedDocumentrenderAndStoreAsAttachment in interface TemplateBasedDocumentsave - flag to indicate if target DocumentModel must be saved or notBlobpublic boolean isBidirectional()
public Blob getTemplateBlob(String templateName)
TemplateBasedDocumentBlob of the associated templategetTemplateBlob in interface TemplateBasedDocumentpublic boolean hasParams(String templateName)
TemplateBasedDocumenthasParams in interface TemplateBasedDocumentpublic List<TemplateInput> getParams(String templateName)
TemplateBasedDocumentgetParams in interface TemplateBasedDocumentpublic DocumentModel saveParams(String templateName, List<TemplateInput> params, boolean save)
TemplateBasedDocumentsaveParams in interface TemplateBasedDocumentparams - the updated list of parameterssave - flag to indicate if target DocumentModel must be saved or notprotected TemplateProcessor getTemplateProcessor(String templateName)
protected OutputFormatDescriptor getOutputFormatDescriptor(String outputFormat)
public boolean hasEditableParams(String templateName)
TemplateBasedDocumenthasEditableParams in interface TemplateBasedDocumentpublic String getTemplateNameForRendition(String renditionName)
TemplateBasedDocumentgetTemplateNameForRendition in interface TemplateBasedDocumentpublic List<String> getTemplateNames()
TemplateBasedDocumentgetTemplateNames in interface TemplateBasedDocumentCopyright © 2019 Nuxeo. All rights reserved.