Package org.nuxeo.template.api.adapters
Interface TemplateSourceDocument
-
- All Known Implementing Classes:
TemplateSourceDocumentAdapterImpl
public interface TemplateSourceDocument
It is mainly the source used byTemplateBasedDocument
to handle the rendering.- Author:
- Tiry (tdelprat@nuxeo.com)
-
-
Field Summary
Fields Modifier and Type Field Description static String
INIT_DONE_FLAG
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<TemplateInput>
addInput(TemplateInput input)
Add or update aTemplateInput
to the list of template parameters.boolean
allowInstanceOverride()
Return flag to indicate if Documents associated to this template can override parametes valueDocumentModel
getAdaptedDoc()
Return the underlying adaptedDocumentModel
sList<String>
getApplicableTypes()
Get List of Document Types than can be associated to this Template.String
getFileName()
Shortcut to access the underlyingBlob
filenameList<String>
getForcedTypes()
Get List of Document Types that must be automatically bound to this template at creation timeString
getId()
Shortcut to access the underlyingDocumentModel
uuidString
getLabel()
Return label key used for templateString
getName()
Shortcut to access the underlyingDocumentModel
nameString
getOutputFormat()
Return the expected mime-type of the resulting renderingList<TemplateInput>
getParams()
Retrieve the parameters associated to the Template fileString
getParamsAsString()
Return the String representation of the parameters of the templateString
getTargetRenditionName()
Get the associated Rendition if anyList<TemplateBasedDocument>
getTemplateBasedDocuments()
Get the list ofTemplateBasedDocument
s associated to this templateBlob
getTemplateBlob()
Retrieve the Blob holding the template fileString
getTemplateType()
Return the template Type (i.e.String
getTitle()
Shortcut to access the underlyingDocumentModel
titleString
getVersionLabel()
Shortcut to access the underlyingDocumentModel
versionLabelboolean
hasEditableParams()
Indicate of the associated Template has editable parameters or notboolean
hasInput(String inputName)
Returns whether or not theTemplateInput
already exists, based on the name, in the template.void
initTemplate(boolean save)
Initialize the DocumentModel finds associated TemplateProcessor extract Template parametersvoid
initTypesBindings()
Initialize the Types2Template bindingvoid
removeForcedType(String type, boolean save)
Remove Type mapping for this templateDocumentModel
save()
Save changes in the underlyingDocumentModel
DocumentModel
saveParams(List<TemplateInput> params, boolean save)
Save parameters changesvoid
setForcedTypes(String[] forcedTypes, boolean save)
Update the Type mapping for this templatevoid
setOutputFormat(String mimetype, boolean save)
Sets the expected output mime-type.void
setTargetRenditioName(String renditionName, boolean save)
Associate Template to a Renditionvoid
setTemplateBlob(Blob blob, boolean save)
Write accessor to theBlob
used to store the templateboolean
useAsMainContent()
Indicate if the template can be used as main blob in theTemplateBasedDocument
(i.e.
-
-
-
Field Detail
-
INIT_DONE_FLAG
static final String INIT_DONE_FLAG
- See Also:
- Constant Field Values
-
-
Method Detail
-
getParamsAsString
String getParamsAsString() throws PropertyException
Return the String representation of the parameters of the template- Throws:
PropertyException
-
addInput
List<TemplateInput> addInput(TemplateInput input)
Add or update aTemplateInput
to the list of template parameters.
-
hasInput
boolean hasInput(String inputName)
Returns whether or not theTemplateInput
already exists, based on the name, in the template.
-
getTemplateType
String getTemplateType()
Return the template Type (i.e. the associatedTemplateProcessor
name.- Returns:
TemplateProcessor
name if any, null otherwise
-
initTemplate
void initTemplate(boolean save)
Initialize the DocumentModel- finds associated TemplateProcessor
- extract Template parameters
- Parameters:
save
- flag to indicate if target DocumentModel must be saved or not
-
initTypesBindings
void initTypesBindings()
Initialize the Types2Template binding
-
getTemplateBlob
Blob getTemplateBlob() throws PropertyException
Retrieve the Blob holding the template file- Throws:
PropertyException
-
getParams
List<TemplateInput> getParams() throws PropertyException
Retrieve the parameters associated to the Template file- Throws:
PropertyException
-
saveParams
DocumentModel saveParams(List<TemplateInput> params, boolean save)
Save parameters changes- Parameters:
params
- the updated list of parameterssave
- flag to indicate if target DocumentModel must be saved or not- Returns:
- the updated DocumentModel
-
getAdaptedDoc
DocumentModel getAdaptedDoc()
Return the underlying adaptedDocumentModel
s
-
save
DocumentModel save()
Save changes in the underlyingDocumentModel
-
allowInstanceOverride
boolean allowInstanceOverride()
Return flag to indicate if Documents associated to this template can override parametes value
-
hasEditableParams
boolean hasEditableParams()
Indicate of the associated Template has editable parameters or not
-
getApplicableTypes
List<String> getApplicableTypes()
Get List of Document Types than can be associated to this Template.- Returns:
- List of Document Types or an empty List
-
getForcedTypes
List<String> getForcedTypes()
Get List of Document Types that must be automatically bound to this template at creation time- Returns:
- List of Document Types or an empty List
-
getTemplateBasedDocuments
List<TemplateBasedDocument> getTemplateBasedDocuments()
Get the list ofTemplateBasedDocument
s associated to this template
-
removeForcedType
void removeForcedType(String type, boolean save)
Remove Type mapping for this template
-
setForcedTypes
void setForcedTypes(String[] forcedTypes, boolean save)
Update the Type mapping for this template
-
setOutputFormat
void setOutputFormat(String mimetype, boolean save)
Sets the expected output mime-type. If the expected mime-type is different from the output of the rendering, converters will be applied.
-
getOutputFormat
String getOutputFormat()
Return the expected mime-type of the resulting rendering
-
useAsMainContent
boolean useAsMainContent()
Indicate if the template can be used as main blob in theTemplateBasedDocument
(i.e. if the template is editable by the end user)
-
getName
String getName()
Shortcut to access the underlyingDocumentModel
name
-
getFileName
String getFileName()
Shortcut to access the underlyingBlob
filename- Returns:
- name
-
getTitle
String getTitle()
Shortcut to access the underlyingDocumentModel
title- Returns:
- template filename
-
getVersionLabel
String getVersionLabel()
Shortcut to access the underlyingDocumentModel
versionLabel- Returns:
- versionLabel
-
getId
String getId()
Shortcut to access the underlyingDocumentModel
uuid- Returns:
- UUID
-
setTargetRenditioName
void setTargetRenditioName(String renditionName, boolean save)
Associate Template to a Rendition
-
getTargetRenditionName
String getTargetRenditionName()
Get the associated Rendition if any- Returns:
- Rendition name or null
-
setTemplateBlob
void setTemplateBlob(Blob blob, boolean save)
Write accessor to theBlob
used to store the template
-
-