Class TemplateSourceDocumentAdapterImpl
java.lang.Object
org.nuxeo.template.adapters.AbstractTemplateDocument
org.nuxeo.template.adapters.source.TemplateSourceDocumentAdapterImpl
- All Implemented Interfaces:
Serializable,TemplateSourceDocument
public class TemplateSourceDocumentAdapterImpl
extends AbstractTemplateDocument
implements Serializable, TemplateSourceDocument
Default implementation of
TemplateSourceDocument. It mainly expect from the underlying DocumentModel to have
the "Template" facet.- Author:
- Tiry ([email protected])
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class org.nuxeo.template.adapters.AbstractTemplateDocument
adaptedDocFields inherited from interface org.nuxeo.template.api.adapters.TemplateSourceDocument
INIT_DONE_FLAG -
Constructor Summary
Constructors -
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 valueprotected StringGet 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 fileprotected Stringprotected TemplateProcessorReturn 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 templatesaveParams(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)Methods inherited from class org.nuxeo.template.adapters.AbstractTemplateDocument
doSave, getAdaptedDoc, getSession, saveMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.nuxeo.template.api.adapters.TemplateSourceDocument
getAdaptedDoc, save
-
Field Details
-
TEMPLATE_DATA_PROP
- See Also:
-
TEMPLATE_NAME_PROP
- See Also:
-
TEMPLATE_TYPE_PROP
- See Also:
-
TEMPLATE_TYPE_AUTO
- See Also:
-
TEMPLATE_APPLICABLE_TYPES_PROP
- See Also:
-
TEMPLATE_APPLICABLE_TYPES_ALL
- See Also:
-
TEMPLATE_FORCED_TYPES_PROP
- See Also:
-
TEMPLATE_FORCED_TYPES_ITEM_PROP
- See Also:
-
TEMPLATE_FORCED_TYPES_NONE
- See Also:
-
TEMPLATE_RENDITION_NONE
- See Also:
-
TEMPLATE_OUTPUT_PROP
- See Also:
-
TEMPLATE_OVERRIDE_PROP
- See Also:
-
TEMPLATE_USEASMAIN_PROP
- See Also:
-
TEMPLATE_RENDITION_PROP
- See Also:
-
TEMPLATE_FACET
- See Also:
-
-
Constructor Details
-
TemplateSourceDocumentAdapterImpl
-
-
Method Details
-
getTemplateParamsXPath
-
getParams
Description copied from interface:TemplateSourceDocumentRetrieve the parameters associated to the Template file- Specified by:
getParamsin interfaceTemplateSourceDocument
-
hasEditableParams
public boolean hasEditableParams()Description copied from interface:TemplateSourceDocumentIndicate of the associated Template has editable parameters or not- Specified by:
hasEditableParamsin interfaceTemplateSourceDocument
-
saveParams
Description copied from interface:TemplateSourceDocumentSave parameters changes- Specified by:
saveParamsin interfaceTemplateSourceDocument- Parameters:
params- the updated list of parameterssave- flag to indicate if target DocumentModel must be saved or not- Returns:
- the updated DocumentModel
-
getTemplateProcessor
-
getParamsAsString
Description copied from interface:TemplateSourceDocumentReturn the String representation of the parameters of the template- Specified by:
getParamsAsStringin interfaceTemplateSourceDocument- Throws:
PropertyException
-
addInput
Description copied from interface:TemplateSourceDocumentAdd or update aTemplateInputto the list of template parameters.- Specified by:
addInputin interfaceTemplateSourceDocument
-
hasInput
Description copied from interface:TemplateSourceDocumentReturns whether or not theTemplateInputalready exists, based on the name, in the template.- Specified by:
hasInputin interfaceTemplateSourceDocument
-
getTemplateType
Description copied from interface:TemplateSourceDocumentReturn the template Type (i.e. the associatedTemplateProcessorname.- Specified by:
getTemplateTypein interfaceTemplateSourceDocument- Returns:
TemplateProcessorname if any, null otherwise
-
initTemplate
public void initTemplate(boolean save) Description copied from interface:TemplateSourceDocumentInitialize the DocumentModel- finds associated TemplateProcessor
- extract Template parameters
- Specified by:
initTemplatein interfaceTemplateSourceDocument- Parameters:
save- flag to indicate if target DocumentModel must be saved or not
-
computeTemplateName
-
allowInstanceOverride
public boolean allowInstanceOverride()Description copied from interface:TemplateSourceDocumentReturn flag to indicate if Documents associated to this template can override parametes value- Specified by:
allowInstanceOverridein interfaceTemplateSourceDocument
-
initTypesBindings
public void initTypesBindings()Description copied from interface:TemplateSourceDocumentInitialize the Types2Template binding- Specified by:
initTypesBindingsin interfaceTemplateSourceDocument
-
getApplicableTypes
Description copied from interface:TemplateSourceDocumentGet List of Document Types than can be associated to this Template.- Specified by:
getApplicableTypesin interfaceTemplateSourceDocument- Returns:
- List of Document Types or an empty List
-
getForcedTypes
Description copied from interface:TemplateSourceDocumentGet List of Document Types that must be automatically bound to this template at creation time- Specified by:
getForcedTypesin interfaceTemplateSourceDocument- Returns:
- List of Document Types or an empty List
-
removeForcedType
Description copied from interface:TemplateSourceDocumentRemove Type mapping for this template- Specified by:
removeForcedTypein interfaceTemplateSourceDocument
-
setForcedTypes
Description copied from interface:TemplateSourceDocumentUpdate the Type mapping for this template- Specified by:
setForcedTypesin interfaceTemplateSourceDocument
-
getTemplateBasedDocuments
Description copied from interface:TemplateSourceDocumentGet the list ofTemplateBasedDocuments associated to this template- Specified by:
getTemplateBasedDocumentsin interfaceTemplateSourceDocument
-
getOutputFormat
Description copied from interface:TemplateSourceDocumentReturn the expected mime-type of the resulting rendering- Specified by:
getOutputFormatin interfaceTemplateSourceDocument
-
setOutputFormat
Description copied from interface:TemplateSourceDocumentSets the expected output mime-type. If the expected mime-type is different from the output of the rendering, converters will be applied.- Specified by:
setOutputFormatin interfaceTemplateSourceDocument
-
useAsMainContent
public boolean useAsMainContent()Description copied from interface:TemplateSourceDocumentIndicate if the template can be used as main blob in theTemplateBasedDocument(i.e. if the template is editable by the end user)- Specified by:
useAsMainContentin interfaceTemplateSourceDocument
-
getTemplateBlob
Description copied from interface:TemplateSourceDocumentRetrieve the Blob holding the template file- Specified by:
getTemplateBlobin interfaceTemplateSourceDocument
-
setTemplateBlob
Description copied from interface:TemplateSourceDocumentWrite accessor to theBlobused to store the template- Specified by:
setTemplateBlobin interfaceTemplateSourceDocument
-
getName
Description copied from interface:TemplateSourceDocumentShortcut to access the underlyingDocumentModelname- Specified by:
getNamein interfaceTemplateSourceDocument
-
getFileName
Description copied from interface:TemplateSourceDocumentShortcut to access the underlyingBlobfilename- Specified by:
getFileNamein interfaceTemplateSourceDocument- Returns:
- name
-
getTitle
Description copied from interface:TemplateSourceDocumentShortcut to access the underlyingDocumentModeltitle- Specified by:
getTitlein interfaceTemplateSourceDocument- Returns:
- template filename
-
getVersionLabel
Description copied from interface:TemplateSourceDocumentShortcut to access the underlyingDocumentModelversionLabel- Specified by:
getVersionLabelin interfaceTemplateSourceDocument- Returns:
- versionLabel
-
getId
Description copied from interface:TemplateSourceDocumentShortcut to access the underlyingDocumentModeluuid- Specified by:
getIdin interfaceTemplateSourceDocument- Returns:
- UUID
-
getLabel
Description copied from interface:TemplateSourceDocumentReturn label key used for template- Specified by:
getLabelin interfaceTemplateSourceDocument
-
getTargetRenditionName
Description copied from interface:TemplateSourceDocumentGet the associated Rendition if any- Specified by:
getTargetRenditionNamein interfaceTemplateSourceDocument- Returns:
- Rendition name or null
-
setTargetRenditioName
Description copied from interface:TemplateSourceDocumentAssociate Template to a Rendition- Specified by:
setTargetRenditioNamein interfaceTemplateSourceDocument
-