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 the DocumentModel 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])
  • Field Details

    • XML_NAMESPACE

      public static final String XML_NAMESPACE
      See Also:
    • XML_NAMESPACE_PREFIX

      public static final String XML_NAMESPACE_PREFIX
      See Also:
    • 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:
  • Constructor Details

    • XMLTemplateSerializer

      public XMLTemplateSerializer()
  • Method Details

    • 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 of TemplateSerializerService
      Specified by:
      deserialize in interface TemplateSerializer
      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 of TemplateSerializerService
      Specified by:
      serialize in interface TemplateSerializer
    • doSerialization

      protected void doSerialization(org.dom4j.Element field, TemplateInput param)