public class TemplateBasedDocumentAdapterImpl extends AbstractTemplateDocument implements Serializable, TemplateBasedDocument
TemplateBasedDocument
adapter. This adapter mainly expect from the underlying
DocumentModel
to have the "TemplateBased" facetModifier and Type | Field and Description |
---|---|
protected TemplateBindings |
bindings |
static String |
TEMPLATEBASED_FACET |
adaptedDoc, log
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
TemplateSourceDocument s 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, save
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAdaptedDoc
public static final String TEMPLATEBASED_FACET
protected final TemplateBindings bindings
public TemplateBasedDocumentAdapterImpl(DocumentModel doc)
public DocumentModel setTemplate(DocumentModel template, boolean save)
TemplateBasedDocument
setTemplate
in interface TemplateBasedDocument
template
- DocumentModel holding the templatesave
- flag to indicate if target DocumentModel must be saved or notpublic DocumentModel removeTemplateBinding(String templateName, boolean save)
TemplateBasedDocument
DocumentModel
removeTemplateBinding
in interface TemplateBasedDocument
public TemplateSourceDocument getSourceTemplate(String templateName)
TemplateBasedDocument
TemplateSourceDocument
for a given template namegetSourceTemplate
in interface TemplateBasedDocument
templateName
- name of the templateTemplateSourceDocument
public DocumentRef getSourceTemplateDocRef(String templateName)
TemplateBasedDocument
DocumentRef
for a given template namegetSourceTemplateDocRef
in interface TemplateBasedDocument
templateName
- name of the templateDocumentRef
public DocumentModel getSourceTemplateDoc(String templateName)
TemplateBasedDocument
DocumentModel
for a given template namegetSourceTemplateDoc
in interface TemplateBasedDocument
templateName
- name of the templateDocumentModel
public List<TemplateSourceDocument> getSourceTemplates()
TemplateBasedDocument
TemplateSourceDocument
s that are bound to the underlying DocumentModel
getSourceTemplates
in interface TemplateBasedDocument
public String getTemplateType(String templateName)
TemplateBasedDocument
getTemplateType
in interface TemplateBasedDocument
public DocumentModel initializeFromTemplate(boolean save)
public DocumentModel initializeFromTemplate(String templateName, boolean save)
TemplateBasedDocument
initializeFromTemplate
in interface TemplateBasedDocument
save
- flag to indicate if target DocumentModel must be saved or notprotected void doSave()
doSave
in class AbstractTemplateDocument
public Blob renderWithTemplate(String templateName)
TemplateBasedDocument
renderWithTemplate
in interface TemplateBasedDocument
Blob
protected OperationContext initOperationContext(Blob blob, String templateName)
public Blob renderAndStoreAsAttachment(String templateName, boolean save)
TemplateBasedDocument
renderAndStoreAsAttachment
in interface TemplateBasedDocument
save
- flag to indicate if target DocumentModel must be saved or notBlob
public boolean isBidirectional()
public Blob getTemplateBlob(String templateName)
TemplateBasedDocument
Blob
of the associated templategetTemplateBlob
in interface TemplateBasedDocument
public boolean hasParams(String templateName)
TemplateBasedDocument
hasParams
in interface TemplateBasedDocument
public List<TemplateInput> getParams(String templateName)
TemplateBasedDocument
getParams
in interface TemplateBasedDocument
public DocumentModel saveParams(String templateName, List<TemplateInput> params, boolean save)
TemplateBasedDocument
saveParams
in interface TemplateBasedDocument
params
- 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)
TemplateBasedDocument
hasEditableParams
in interface TemplateBasedDocument
public String getTemplateNameForRendition(String renditionName)
TemplateBasedDocument
getTemplateNameForRendition
in interface TemplateBasedDocument
public List<String> getTemplateNames()
TemplateBasedDocument
getTemplateNames
in interface TemplateBasedDocument
Copyright © 2016 Nuxeo SA. All rights reserved.