Class XMLTemplateSerializer
- java.lang.Object
-
- org.nuxeo.template.serializer.executors.XMLTemplateSerializer
-
- All Implemented Interfaces:
TemplateSerializer
public class XMLTemplateSerializer extends Object implements TemplateSerializer
TemplateInput
parameters are stored in theDocumentModel
as a single String Property via XML Serialization. This class contains the Serialization/Deserialization logic.- Since:
- 11.1
- Author:
- Tiry ([email protected]), bjalon ([email protected])
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static class
XMLTemplateSerializer.TemplateInputBadFormat
-
Field Summary
Fields Modifier and Type Field Description static String
DATE_FORMAT
static org.dom4j.QName
fieldsTag
static org.dom4j.QName
fieldTag
static org.dom4j.Namespace
ns
static String
XML_NAMESPACE
static String
XML_NAMESPACE_PREFIX
-
Constructor Summary
Constructors Constructor Description XMLTemplateSerializer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description List<TemplateInput>
deserialize(String xml)
Transform String to a List of TemplateInput.protected void
doSerialization(org.dom4j.Element field, TemplateInput param)
protected TemplateInput
extractTemplateInputFromXMLNode(org.dom4j.Element node)
protected Boolean
getIsAutoloopFromXMLNode(org.dom4j.Element elem)
protected Boolean
getIsReadonlyFromXMLNode(org.dom4j.Element elem)
protected String
getNameFromXMLNode(org.dom4j.Element elem)
protected InputType
getTypeFromXMLNode(org.dom4j.Element elem)
String
serialize(List<TemplateInput> params)
Transform the List of TemplateInput to String.
-
-
-
Field Detail
-
XML_NAMESPACE
public static final String XML_NAMESPACE
- See Also:
- Constant Field Values
-
XML_NAMESPACE_PREFIX
public static final String XML_NAMESPACE_PREFIX
- See Also:
- Constant Field Values
-
ns
public static final org.dom4j.Namespace ns
-
fieldsTag
public static final org.dom4j.QName fieldsTag
-
fieldTag
public static final org.dom4j.QName fieldTag
-
DATE_FORMAT
public static final String DATE_FORMAT
- See Also:
- Constant Field Values
-
-
Method Detail
-
deserialize
public List<TemplateInput> deserialize(String xml)
Description copied from interface:TemplateSerializer
Transform String to a List of TemplateInput. TemplateInput represent a field that will be finally added into the context of the file rendition. Please for more information look the documentation ofTemplateSerializerService
- Specified by:
deserialize
in interfaceTemplateSerializer
- Parameters:
xml
- String containing a list of fields' description serialized- Returns:
- the serialized content
-
extractTemplateInputFromXMLNode
protected TemplateInput extractTemplateInputFromXMLNode(org.dom4j.Element node)
-
getIsReadonlyFromXMLNode
protected Boolean getIsReadonlyFromXMLNode(org.dom4j.Element elem)
-
getIsAutoloopFromXMLNode
protected Boolean getIsAutoloopFromXMLNode(org.dom4j.Element elem)
-
getNameFromXMLNode
protected String getNameFromXMLNode(org.dom4j.Element elem)
-
getTypeFromXMLNode
protected InputType getTypeFromXMLNode(org.dom4j.Element elem)
-
serialize
public String serialize(List<TemplateInput> params)
Description copied from interface:TemplateSerializer
Transform the List of TemplateInput to String. Used to store a rendition context in the Document TemplateBased. Please for more information look the documentation ofTemplateSerializerService
- Specified by:
serialize
in interfaceTemplateSerializer
-
doSerialization
protected void doSerialization(org.dom4j.Element field, TemplateInput param)
-
-