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, log
INIT_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
TemplateBasedDocument s 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, save
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getAdaptedDoc, save
public 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()
TemplateSourceDocument
getParams
in interface TemplateSourceDocument
public boolean hasEditableParams()
TemplateSourceDocument
hasEditableParams
in interface TemplateSourceDocument
public DocumentModel saveParams(List<TemplateInput> params, boolean save)
TemplateSourceDocument
saveParams
in interface TemplateSourceDocument
params
- the updated list of parameterssave
- flag to indicate if target DocumentModel must be saved or notprotected TemplateProcessor getTemplateProcessor()
public String getParamsAsString() throws PropertyException
TemplateSourceDocument
getParamsAsString
in interface TemplateSourceDocument
PropertyException
public List<TemplateInput> addInput(TemplateInput input)
TemplateSourceDocument
TemplateInput
to the list of template parameters.addInput
in interface TemplateSourceDocument
public boolean hasInput(String inputName)
TemplateSourceDocument
TemplateInput
already exists, based on the name, in the template.hasInput
in interface TemplateSourceDocument
public String getTemplateType()
TemplateSourceDocument
TemplateProcessor
name.getTemplateType
in interface TemplateSourceDocument
TemplateProcessor
name if any, null otherwisepublic void initTemplate(boolean save)
TemplateSourceDocument
initTemplate
in interface TemplateSourceDocument
save
- flag to indicate if target DocumentModel must be saved or notprotected String computeTemplateName()
public boolean allowInstanceOverride()
TemplateSourceDocument
allowInstanceOverride
in interface TemplateSourceDocument
public void initTypesBindings()
TemplateSourceDocument
initTypesBindings
in interface TemplateSourceDocument
public List<String> getApplicableTypes()
TemplateSourceDocument
getApplicableTypes
in interface TemplateSourceDocument
public List<String> getForcedTypes()
TemplateSourceDocument
getForcedTypes
in interface TemplateSourceDocument
public void removeForcedType(String type, boolean save)
TemplateSourceDocument
removeForcedType
in interface TemplateSourceDocument
public void setForcedTypes(String[] forcedTypes, boolean save)
TemplateSourceDocument
setForcedTypes
in interface TemplateSourceDocument
public List<TemplateBasedDocument> getTemplateBasedDocuments()
TemplateSourceDocument
TemplateBasedDocument
s associated to this templategetTemplateBasedDocuments
in interface TemplateSourceDocument
public String getOutputFormat()
TemplateSourceDocument
getOutputFormat
in interface TemplateSourceDocument
public void setOutputFormat(String mimetype, boolean save)
TemplateSourceDocument
setOutputFormat
in interface TemplateSourceDocument
public boolean useAsMainContent()
TemplateSourceDocument
TemplateBasedDocument
(i.e. if the template is
editable by the end user)useAsMainContent
in interface TemplateSourceDocument
public Blob getTemplateBlob()
TemplateSourceDocument
getTemplateBlob
in interface TemplateSourceDocument
public void setTemplateBlob(Blob blob, boolean save)
TemplateSourceDocument
Blob
used to store the templatesetTemplateBlob
in interface TemplateSourceDocument
public String getName()
TemplateSourceDocument
DocumentModel
namegetName
in interface TemplateSourceDocument
public String getFileName()
TemplateSourceDocument
Blob
filenamegetFileName
in interface TemplateSourceDocument
public String getTitle()
TemplateSourceDocument
DocumentModel
titlegetTitle
in interface TemplateSourceDocument
public String getVersionLabel()
TemplateSourceDocument
DocumentModel
versionLabelgetVersionLabel
in interface TemplateSourceDocument
public String getId()
TemplateSourceDocument
DocumentModel
uuidgetId
in interface TemplateSourceDocument
public String getLabel()
TemplateSourceDocument
getLabel
in interface TemplateSourceDocument
public String getTargetRenditionName()
TemplateSourceDocument
getTargetRenditionName
in interface TemplateSourceDocument
public void setTargetRenditioName(String renditionName, boolean save)
TemplateSourceDocument
setTargetRenditioName
in interface TemplateSourceDocument
Copyright © 2016 Nuxeo SA. All rights reserved.