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 |
|---|---|
static String |
TEMPLATEBASED_FACET |
| Constructor and Description |
|---|
TemplateBasedDocumentAdapterImpl(DocumentModel doc) |
| Modifier and Type | Method and Description |
|---|---|
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(boolean save) |
DocumentModel |
initializeFromTemplate(String templateName,
boolean save)
Initialize the template parameters from the associated template
|
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.
|
DocumentModel |
setTemplate(DocumentModel template,
boolean save)
Associate the document to a Template.
|
getAdaptedDoc, saveequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAdaptedDocpublic static final String TEMPLATEBASED_FACET
public TemplateBasedDocumentAdapterImpl(DocumentModel doc) throws ClientException
ClientExceptionpublic DocumentModel setTemplate(DocumentModel template, boolean save) throws ClientException
TemplateBasedDocumentsetTemplate in interface TemplateBasedDocumenttemplate - DocumentModel holding the templatesave - flag to indicate if target DocumentModel must be saved or notPropertyExceptionClientExceptionpublic DocumentModel removeTemplateBinding(String templateName, boolean save) throws ClientException
TemplateBasedDocumentDocumentModelremoveTemplateBinding in interface TemplateBasedDocumentClientExceptionpublic TemplateSourceDocument getSourceTemplate(String templateName) throws Exception
TemplateBasedDocumentTemplateSourceDocument for a given template namegetSourceTemplate in interface TemplateBasedDocumenttemplateName - name of the templateTemplateSourceDocumentExceptionpublic DocumentRef getSourceTemplateDocRef(String templateName) throws Exception
TemplateBasedDocumentDocumentRef for a given template namegetSourceTemplateDocRef in interface TemplateBasedDocumenttemplateName - name of the templateDocumentRefExceptionpublic DocumentModel getSourceTemplateDoc(String templateName) throws Exception
TemplateBasedDocumentDocumentModel for a given template namegetSourceTemplateDoc in interface TemplateBasedDocumenttemplateName - name of the templateDocumentModelExceptionpublic 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) throws Exception
Exceptionpublic DocumentModel initializeFromTemplate(String templateName, boolean save) throws Exception
TemplateBasedDocumentinitializeFromTemplate in interface TemplateBasedDocumentsave - flag to indicate if target DocumentModel must be saved or notExceptionpublic Blob renderWithTemplate(String templateName) throws Exception
TemplateBasedDocumentrenderWithTemplate in interface TemplateBasedDocumentBlobExceptionpublic Blob renderAndStoreAsAttachment(String templateName, boolean save) throws Exception
TemplateBasedDocumentrenderAndStoreAsAttachment in interface TemplateBasedDocumentsave - flag to indicate if target DocumentModel must be saved or notBlobExceptionpublic boolean isBidirectional()
public Blob getTemplateBlob(String templateName) throws Exception
TemplateBasedDocumentBlob of the associated templategetTemplateBlob in interface TemplateBasedDocumentExceptionpublic boolean hasParams(String templateName) throws ClientException
TemplateBasedDocumenthasParams in interface TemplateBasedDocumentClientExceptionpublic List<TemplateInput> getParams(String templateName) throws ClientException
TemplateBasedDocumentgetParams in interface TemplateBasedDocumentClientExceptionpublic DocumentModel saveParams(String templateName, List<TemplateInput> params, boolean save) throws Exception
TemplateBasedDocumentsaveParams in interface TemplateBasedDocumentparams - the updated list of parameterssave - flag to indicate if target DocumentModel must be saved or notExceptionpublic boolean hasEditableParams(String templateName) throws ClientException
TemplateBasedDocumenthasEditableParams in interface TemplateBasedDocumentClientExceptionpublic String getTemplateNameForRendition(String renditionName)
TemplateBasedDocumentgetTemplateNameForRendition in interface TemplateBasedDocumentpublic List<String> getTemplateNames()
TemplateBasedDocumentgetTemplateNames in interface TemplateBasedDocumentCopyright © 2015 Nuxeo SA. All rights reserved.