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 |
---|---|
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
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
|
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, save
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAdaptedDoc
public static final String TEMPLATEBASED_FACET
public TemplateBasedDocumentAdapterImpl(DocumentModel doc) throws ClientException
ClientException
public DocumentModel setTemplate(DocumentModel template, boolean save) throws ClientException
TemplateBasedDocument
setTemplate
in interface TemplateBasedDocument
template
- DocumentModel holding the templatesave
- flag to indicate if target DocumentModel must be saved or notPropertyException
ClientException
public DocumentModel removeTemplateBinding(String templateName, boolean save) throws ClientException
TemplateBasedDocument
DocumentModel
removeTemplateBinding
in interface TemplateBasedDocument
ClientException
public TemplateSourceDocument getSourceTemplate(String templateName) throws Exception
TemplateBasedDocument
TemplateSourceDocument
for a given template namegetSourceTemplate
in interface TemplateBasedDocument
templateName
- name of the templateTemplateSourceDocument
Exception
public DocumentRef getSourceTemplateDocRef(String templateName) throws Exception
TemplateBasedDocument
DocumentRef
for a given template namegetSourceTemplateDocRef
in interface TemplateBasedDocument
templateName
- name of the templateDocumentRef
Exception
public DocumentModel getSourceTemplateDoc(String templateName) throws Exception
TemplateBasedDocument
DocumentModel
for a given template namegetSourceTemplateDoc
in interface TemplateBasedDocument
templateName
- name of the templateDocumentModel
Exception
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) throws Exception
Exception
public DocumentModel initializeFromTemplate(String templateName, boolean save) throws Exception
TemplateBasedDocument
initializeFromTemplate
in interface TemplateBasedDocument
save
- flag to indicate if target DocumentModel must be saved or notException
public Blob renderWithTemplate(String templateName) throws Exception
TemplateBasedDocument
renderWithTemplate
in interface TemplateBasedDocument
Blob
Exception
public Blob renderAndStoreAsAttachment(String templateName, boolean save) throws Exception
TemplateBasedDocument
renderAndStoreAsAttachment
in interface TemplateBasedDocument
save
- flag to indicate if target DocumentModel must be saved or notBlob
Exception
public boolean isBidirectional()
public Blob getTemplateBlob(String templateName) throws Exception
TemplateBasedDocument
Blob
of the associated templategetTemplateBlob
in interface TemplateBasedDocument
Exception
public boolean hasParams(String templateName) throws ClientException
TemplateBasedDocument
hasParams
in interface TemplateBasedDocument
ClientException
public List<TemplateInput> getParams(String templateName) throws ClientException
TemplateBasedDocument
getParams
in interface TemplateBasedDocument
ClientException
public DocumentModel saveParams(String templateName, List<TemplateInput> params, boolean save) throws Exception
TemplateBasedDocument
saveParams
in interface TemplateBasedDocument
params
- the updated list of parameterssave
- flag to indicate if target DocumentModel must be saved or notException
public boolean hasEditableParams(String templateName) throws ClientException
TemplateBasedDocument
hasEditableParams
in interface TemplateBasedDocument
ClientException
public String getTemplateNameForRendition(String renditionName)
TemplateBasedDocument
getTemplateNameForRendition
in interface TemplateBasedDocument
public List<String> getTemplateNames()
TemplateBasedDocument
getTemplateNames
in interface TemplateBasedDocument
Copyright © 2013 Nuxeo SA. All Rights Reserved.