Package org.nuxeo.template.api.adapters
Interface TemplateSourceDocument
- All Known Implementing Classes:
TemplateSourceDocumentAdapterImpl
public interface TemplateSourceDocument
It is mainly the source used by
TemplateBasedDocument to handle the rendering.- Author:
- Tiry ([email protected])
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionaddInput(TemplateInput input) Add or update aTemplateInputto the list of template parameters.booleanReturn flag to indicate if Documents associated to this template can override parametes valueReturn the underlying adaptedDocumentModelsGet List of Document Types than can be associated to this Template.Shortcut to access the underlyingBlobfilenameGet List of Document Types that must be automatically bound to this template at creation timegetId()Shortcut to access the underlyingDocumentModeluuidgetLabel()Return label key used for templategetName()Shortcut to access the underlyingDocumentModelnameReturn the expected mime-type of the resulting renderingRetrieve the parameters associated to the Template fileReturn the String representation of the parameters of the templateGet the associated Rendition if anyGet the list ofTemplateBasedDocuments associated to this templateRetrieve the Blob holding the template fileReturn the template Type (i.e. the associatedTemplateProcessorname.getTitle()Shortcut to access the underlyingDocumentModeltitleShortcut to access the underlyingDocumentModelversionLabelbooleanIndicate of the associated Template has editable parameters or notbooleanReturns whether or not theTemplateInputalready exists, based on the name, in the template.voidinitTemplate(boolean save) Initialize the DocumentModel finds associated TemplateProcessor extract Template parametersvoidInitialize the Types2Template bindingvoidremoveForcedType(String type, boolean save) Remove Type mapping for this templatesave()Save changes in the underlyingDocumentModelsaveParams(List<TemplateInput> params, boolean save) Save parameters changesvoidsetForcedTypes(String[] forcedTypes, boolean save) Update the Type mapping for this templatevoidsetOutputFormat(String mimetype, boolean save) Sets the expected output mime-type.voidsetTargetRenditioName(String renditionName, boolean save) Associate Template to a RenditionvoidsetTemplateBlob(Blob blob, boolean save) Write accessor to theBlobused to store the templatebooleanIndicate if the template can be used as main blob in theTemplateBasedDocument(i.e. if the template is editable by the end user)
-
Field Details
-
INIT_DONE_FLAG
- See Also:
-
-
Method Details
-
getParamsAsString
Return the String representation of the parameters of the template- Throws:
PropertyException
-
addInput
Add or update aTemplateInputto the list of template parameters. -
hasInput
Returns whether or not theTemplateInputalready exists, based on the name, in the template. -
getTemplateType
String getTemplateType()Return the template Type (i.e. the associatedTemplateProcessorname.- Returns:
TemplateProcessorname 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
Retrieve the Blob holding the template file- Throws:
PropertyException
-
getParams
Retrieve the parameters associated to the Template file- Throws:
PropertyException
-
saveParams
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 adaptedDocumentModels -
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
Get List of Document Types than can be associated to this Template.- Returns:
- List of Document Types or an empty List
-
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 ofTemplateBasedDocuments associated to this template -
removeForcedType
Remove Type mapping for this template -
setForcedTypes
Update the Type mapping for this template -
setOutputFormat
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 underlyingDocumentModelname -
getFileName
String getFileName()Shortcut to access the underlyingBlobfilename- Returns:
- name
-
getTitle
String getTitle()Shortcut to access the underlyingDocumentModeltitle- Returns:
- template filename
-
getVersionLabel
String getVersionLabel()Shortcut to access the underlyingDocumentModelversionLabel- Returns:
- versionLabel
-
getId
String getId()Shortcut to access the underlyingDocumentModeluuid- Returns:
- UUID
-
getLabel
String getLabel()Return label key used for template -
setTargetRenditioName
Associate Template to a Rendition -
getTargetRenditionName
String getTargetRenditionName()Get the associated Rendition if any- Returns:
- Rendition name or null
-
setTemplateBlob
Write accessor to theBlobused to store the template
-