public class TemplateSourceDocumentAdapterImpl extends AbstractTemplateDocument implements Serializable, TemplateSourceDocument
TemplateSourceDocument. It mainly expect from the underlying DocumentModel to have
the "Template" facet.| Modifier and Type | Field and Description |
|---|---|
static String |
TEMPLATE_APPLICABLE_TYPES_ALL |
static String |
TEMPLATE_APPLICABLE_TYPES_PROP |
static String |
TEMPLATE_DATA_PROP |
static String |
TEMPLATE_FACET |
static String |
TEMPLATE_FORCED_TYPES_ITEM_PROP |
static String |
TEMPLATE_FORCED_TYPES_NONE |
static String |
TEMPLATE_FORCED_TYPES_PROP |
static String |
TEMPLATE_NAME_PROP |
static String |
TEMPLATE_OUTPUT_PROP |
static String |
TEMPLATE_OVERRIDE_PROP |
static String |
TEMPLATE_RENDITION_NONE |
static String |
TEMPLATE_RENDITION_PROP |
static String |
TEMPLATE_TYPE_AUTO |
static String |
TEMPLATE_TYPE_PROP |
static String |
TEMPLATE_USEASMAIN_PROP |
adaptedDoc, logINIT_DONE_FLAG| Constructor and Description |
|---|
TemplateSourceDocumentAdapterImpl(DocumentModel doc) |
| Modifier and Type | Method and Description |
|---|---|
List<TemplateInput> |
addInput(TemplateInput input)
Add or update a
TemplateInput to the list of template parameters. |
boolean |
allowInstanceOverride()
Return flag to indicate if Documents associated to this template can override parametes value
|
protected String |
computeTemplateName() |
List<String> |
getApplicableTypes()
Get List of Document Types than can be associated to this Template.
|
String |
getFileName()
Shortcut to access the underlying
Blob filename |
List<String> |
getForcedTypes()
Get List of Document Types that must be automatically bound to this template at creation time
|
String |
getId()
Shortcut to access the underlying
DocumentModel uuid |
String |
getLabel()
Return label key used for template
|
String |
getName()
Shortcut to access the underlying
DocumentModel name |
String |
getOutputFormat()
Return the expected mime-type of the resulting rendering
|
List<TemplateInput> |
getParams()
Retrieve the parameters associated to the Template file
|
String |
getParamsAsString()
Return the String representation of the parameters of the template
|
String |
getTargetRenditionName()
Get the associated Rendition if any
|
List<TemplateBasedDocument> |
getTemplateBasedDocuments()
Get the list of
TemplateBasedDocuments associated to this template |
Blob |
getTemplateBlob()
Retrieve the Blob holding the template file
|
protected String |
getTemplateParamsXPath() |
protected TemplateProcessor |
getTemplateProcessor() |
String |
getTemplateType()
Return the template Type (i.e.
|
String |
getTitle()
Shortcut to access the underlying
DocumentModel title |
String |
getVersionLabel()
Shortcut to access the underlying
DocumentModel versionLabel |
boolean |
hasEditableParams()
Indicate of the associated Template has editable parameters or not
|
boolean |
hasInput(String inputName)
Returns whether or not the
TemplateInput already exists, based on the name, in the template. |
void |
initTemplate(boolean save)
Initialize the DocumentModel
finds associated TemplateProcessor
extract Template parameters
|
void |
initTypesBindings()
Initialize the Types2Template binding
|
void |
removeForcedType(String type,
boolean save)
Remove Type mapping for this template
|
DocumentModel |
saveParams(List<TemplateInput> params,
boolean save)
Save parameters changes
|
void |
setForcedTypes(String[] forcedTypes,
boolean save)
Update the Type mapping for this template
|
void |
setOutputFormat(String mimetype,
boolean save)
Sets the expected output mime-type.
|
void |
setTargetRenditioName(String renditionName,
boolean save)
Associate Template to a Rendition
|
void |
setTemplateBlob(Blob blob,
boolean save)
Write accessor to the
Blob used to store the template |
boolean |
useAsMainContent()
Indicate if the template can be used as main blob in the
TemplateBasedDocument (i.e. |
doSave, getAdaptedDoc, getSession, saveclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetAdaptedDoc, savepublic static final String TEMPLATE_DATA_PROP
public static final String TEMPLATE_NAME_PROP
public static final String TEMPLATE_TYPE_PROP
public static final String TEMPLATE_TYPE_AUTO
public static final String TEMPLATE_APPLICABLE_TYPES_PROP
public static final String TEMPLATE_APPLICABLE_TYPES_ALL
public static final String TEMPLATE_FORCED_TYPES_PROP
public static final String TEMPLATE_FORCED_TYPES_ITEM_PROP
public static final String TEMPLATE_FORCED_TYPES_NONE
public static final String TEMPLATE_RENDITION_NONE
public static final String TEMPLATE_OUTPUT_PROP
public static final String TEMPLATE_OVERRIDE_PROP
public static final String TEMPLATE_USEASMAIN_PROP
public static final String TEMPLATE_RENDITION_PROP
public static final String TEMPLATE_FACET
public TemplateSourceDocumentAdapterImpl(DocumentModel doc)
protected String getTemplateParamsXPath()
public List<TemplateInput> getParams()
TemplateSourceDocumentgetParams in interface TemplateSourceDocumentpublic boolean hasEditableParams()
TemplateSourceDocumenthasEditableParams in interface TemplateSourceDocumentpublic DocumentModel saveParams(List<TemplateInput> params, boolean save)
TemplateSourceDocumentsaveParams in interface TemplateSourceDocumentparams - the updated list of parameterssave - flag to indicate if target DocumentModel must be saved or notprotected TemplateProcessor getTemplateProcessor()
public String getParamsAsString() throws PropertyException
TemplateSourceDocumentgetParamsAsString in interface TemplateSourceDocumentPropertyExceptionpublic List<TemplateInput> addInput(TemplateInput input)
TemplateSourceDocumentTemplateInput to the list of template parameters.addInput in interface TemplateSourceDocumentpublic boolean hasInput(String inputName)
TemplateSourceDocumentTemplateInput already exists, based on the name, in the template.hasInput in interface TemplateSourceDocumentpublic String getTemplateType()
TemplateSourceDocumentTemplateProcessor name.getTemplateType in interface TemplateSourceDocumentTemplateProcessor name if any, null otherwisepublic void initTemplate(boolean save)
TemplateSourceDocumentinitTemplate in interface TemplateSourceDocumentsave - flag to indicate if target DocumentModel must be saved or notprotected String computeTemplateName()
public boolean allowInstanceOverride()
TemplateSourceDocumentallowInstanceOverride in interface TemplateSourceDocumentpublic void initTypesBindings()
TemplateSourceDocumentinitTypesBindings in interface TemplateSourceDocumentpublic List<String> getApplicableTypes()
TemplateSourceDocumentgetApplicableTypes in interface TemplateSourceDocumentpublic List<String> getForcedTypes()
TemplateSourceDocumentgetForcedTypes in interface TemplateSourceDocumentpublic void removeForcedType(String type, boolean save)
TemplateSourceDocumentremoveForcedType in interface TemplateSourceDocumentpublic void setForcedTypes(String[] forcedTypes, boolean save)
TemplateSourceDocumentsetForcedTypes in interface TemplateSourceDocumentpublic List<TemplateBasedDocument> getTemplateBasedDocuments()
TemplateSourceDocumentTemplateBasedDocuments associated to this templategetTemplateBasedDocuments in interface TemplateSourceDocumentpublic String getOutputFormat()
TemplateSourceDocumentgetOutputFormat in interface TemplateSourceDocumentpublic void setOutputFormat(String mimetype, boolean save)
TemplateSourceDocumentsetOutputFormat in interface TemplateSourceDocumentpublic boolean useAsMainContent()
TemplateSourceDocumentTemplateBasedDocument (i.e. if the template is
editable by the end user)useAsMainContent in interface TemplateSourceDocumentpublic Blob getTemplateBlob()
TemplateSourceDocumentgetTemplateBlob in interface TemplateSourceDocumentpublic void setTemplateBlob(Blob blob, boolean save)
TemplateSourceDocumentBlob used to store the templatesetTemplateBlob in interface TemplateSourceDocumentpublic String getName()
TemplateSourceDocumentDocumentModel namegetName in interface TemplateSourceDocumentpublic String getFileName()
TemplateSourceDocumentBlob filenamegetFileName in interface TemplateSourceDocumentpublic String getTitle()
TemplateSourceDocumentDocumentModel titlegetTitle in interface TemplateSourceDocumentpublic String getVersionLabel()
TemplateSourceDocumentDocumentModel versionLabelgetVersionLabel in interface TemplateSourceDocumentpublic String getId()
TemplateSourceDocumentDocumentModel uuidgetId in interface TemplateSourceDocumentpublic String getLabel()
TemplateSourceDocumentgetLabel in interface TemplateSourceDocumentpublic String getTargetRenditionName()
TemplateSourceDocumentgetTargetRenditionName in interface TemplateSourceDocumentpublic void setTargetRenditioName(String renditionName, boolean save)
TemplateSourceDocumentsetTargetRenditioName in interface TemplateSourceDocumentCopyright © 2018 Nuxeo. All rights reserved.