Package org.ametys.odf.cdmfr
Class CDMHelper
- java.lang.Object
-
- org.ametys.odf.cdmfr.CDMHelper
-
-
Field Summary
Fields Modifier and Type Field Description static DateTimeFormatter
CDM_DATE_FORMATTER
The CDM date formatter.
-
Constructor Summary
Constructors Modifier Constructor Description private
CDMHelper()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
date2CDM(ContentHandler contentHandler, String tagName, LocalDate value)
SAX a date in a CDM document.static void
richText2CDM(ContentHandler contentHandler, String tag, RichText richText, SourceResolver sourceResolver)
Transform a docbook metadata in a CDM infoBlock way.static void
richText2CDM(ContentHandler contentHandler, String tag, RichText richText, SourceResolver sourceResolver, boolean writeIfEmpty)
Transform a docbook metadata in a CDM infoBlock way.static void
richText2CDM(ContentHandler contentHandler, String tag, RichText richText, SourceResolver sourceResolver, boolean writeIfEmpty, boolean rawHtmlExpert)
Transform a docbook metadata in a CDM infoBlock way.static void
richText2CDM(ContentHandler contentHandler, String tag, RichText richText, SourceResolver sourceResolver, boolean writeIfEmpty, boolean rawHtmlExpert, AttributesImpl attrs)
Transform a docbook metadata in a CDM infoBlock way.static void
richText2CDM(ContentHandler contentHandler, String tag, RichText richText, SourceResolver sourceResolver, boolean writeIfEmpty, AttributesImpl attrs)
Transform a docbook metadata in a CDM infoBlock way.static void
richText2CDM(ContentHandler contentHandler, String tag, RichText richText, SourceResolver sourceResolver, AttributesImpl attrs)
Transform a docbook metadata in a CDM infoBlock way.static void
richText2CDM(ContentHandler contentHandler, RichText richText, SourceResolver sourceResolver)
Transform a docbook metadata in a CDM infoBlock way.static void
richText2CDM(ContentHandler contentHandler, RichText richText, SourceResolver sourceResolver, boolean rawHtmlExpert)
Transform a docbook metadata in a CDM infoBlock way.
-
-
-
Field Detail
-
CDM_DATE_FORMATTER
public static final DateTimeFormatter CDM_DATE_FORMATTER
The CDM date formatter.
-
-
Constructor Detail
-
CDMHelper
private CDMHelper()
-
-
Method Detail
-
richText2CDM
public static void richText2CDM(ContentHandler contentHandler, String tag, RichText richText, SourceResolver sourceResolver) throws SAXException
Transform a docbook metadata in a CDM infoBlock way.- Parameters:
contentHandler
- the handler to SAX CDM.tag
- the surrounding tag.richText
- the metadata. If richText is null, nothing is SAXed.sourceResolver
- the Cocoon SourceResolver.- Throws:
SAXException
- if an error occurs.
-
richText2CDM
public static void richText2CDM(ContentHandler contentHandler, String tag, RichText richText, SourceResolver sourceResolver, AttributesImpl attrs) throws SAXException
Transform a docbook metadata in a CDM infoBlock way.- Parameters:
contentHandler
- the handler to SAX CDM.tag
- the surrounding tag.richText
- the metadata. If richText is null, nothing is SAXed.sourceResolver
- the Cocoon SourceResolver.attrs
- The attributes to SAX- Throws:
SAXException
- if an error occurs.
-
richText2CDM
public static void richText2CDM(ContentHandler contentHandler, String tag, RichText richText, SourceResolver sourceResolver, boolean writeIfEmpty) throws SAXException
Transform a docbook metadata in a CDM infoBlock way.- Parameters:
contentHandler
- the handler to SAX CDM.tag
- the surrounding tag.richText
- the metadata. If richText is null, nothing is SAXed.sourceResolver
- the Cocoon SourceResolver.writeIfEmpty
- true to sax CDM info block even if the rich text is empty- Throws:
SAXException
- if an error occurs.
-
richText2CDM
public static void richText2CDM(ContentHandler contentHandler, String tag, RichText richText, SourceResolver sourceResolver, boolean writeIfEmpty, boolean rawHtmlExpert) throws SAXException
Transform a docbook metadata in a CDM infoBlock way.- Parameters:
contentHandler
- the handler to SAX CDM.tag
- the surrounding tag.richText
- the metadata. If richText is null, nothing is SAXed.sourceResolver
- the Cocoon SourceResolver.writeIfEmpty
- true to sax CDM info block even if the rich text is emptyrawHtmlExpert
- true to export HTML expert as raw CDATA. If false, parse and resolve HTML expert code.- Throws:
SAXException
- if an error occurs.
-
richText2CDM
public static void richText2CDM(ContentHandler contentHandler, String tag, RichText richText, SourceResolver sourceResolver, boolean writeIfEmpty, AttributesImpl attrs) throws SAXException
Transform a docbook metadata in a CDM infoBlock way.- Parameters:
contentHandler
- the handler to SAX CDM.tag
- the surrounding tag.richText
- the metadata. If richText is null, nothing is SAXedwriteIfEmpty
- true to sax CDM info block even if the rich text is emptyattrs
- The attributes to SAXsourceResolver
- the Cocoon SourceResolver.- Throws:
SAXException
- if an error occurs.
-
richText2CDM
public static void richText2CDM(ContentHandler contentHandler, String tag, RichText richText, SourceResolver sourceResolver, boolean writeIfEmpty, boolean rawHtmlExpert, AttributesImpl attrs) throws SAXException
Transform a docbook metadata in a CDM infoBlock way.- Parameters:
contentHandler
- the handler to SAX CDM.tag
- the surrounding tag.richText
- the metadata. If richText is null, nothing is SAXedwriteIfEmpty
- true to sax CDM info block even if the rich text is emptyrawHtmlExpert
- true to export HTML expert as raw CDATA. If false, parse and resolve HTML expert code.attrs
- The attributes to SAXsourceResolver
- the Cocoon SourceResolver.- Throws:
SAXException
- if an error occurs.
-
richText2CDM
public static void richText2CDM(ContentHandler contentHandler, RichText richText, SourceResolver sourceResolver) throws SAXException
Transform a docbook metadata in a CDM infoBlock way.- Parameters:
contentHandler
- the handler to SAX CDM.richText
- the metadata. If richText is null, nothing is SAXedsourceResolver
- the Cocoon SourceResolver.- Throws:
SAXException
- if an error occurs.
-
richText2CDM
public static void richText2CDM(ContentHandler contentHandler, RichText richText, SourceResolver sourceResolver, boolean rawHtmlExpert) throws SAXException
Transform a docbook metadata in a CDM infoBlock way.- Parameters:
contentHandler
- the handler to SAX CDM.richText
- the metadata. If richText is null, nothing is SAXedsourceResolver
- the Cocoon SourceResolver.rawHtmlExpert
- true to export HTML expert as raw CDATA. If false, parse and resolve HTML expert code.- Throws:
SAXException
- if an error occurs.
-
date2CDM
public static void date2CDM(ContentHandler contentHandler, String tagName, LocalDate value) throws SAXException
SAX a date in a CDM document.- Parameters:
contentHandler
- The content handler to SAX into.tagName
- The element name.value
- The date value.- Throws:
SAXException
- if an error occurs.
-
-