Package org.ametys.odf.cdmfr
Class CDMHelper
java.lang.Object
org.ametys.odf.cdmfr.CDMHelper
Helper for export tasks.
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
date2CDM
(ContentHandler contentHandler, String tagName, LocalDate value) SAX a date in a CDM document.static void
richText2CDM
(ContentHandler contentHandler, String tag, RichText richText, DataContext richTextContext, SourceResolver sourceResolver) Transform a docbook in a CDM infoBlock way.static void
richText2CDM
(ContentHandler contentHandler, String tag, RichText richText, DataContext richTextContext, SourceResolver sourceResolver, boolean writeIfEmpty) Transform a docbook in a CDM infoBlock way.static void
richText2CDM
(ContentHandler contentHandler, String tag, RichText richText, DataContext richTextContext, SourceResolver sourceResolver, boolean writeIfEmpty, boolean rawHtmlExpert) Transform a docbook in a CDM infoBlock way.static void
richText2CDM
(ContentHandler contentHandler, String tag, RichText richText, DataContext richTextContext, SourceResolver sourceResolver, boolean writeIfEmpty, boolean rawHtmlExpert, AttributesImpl attrs) Transform a docbook in a CDM infoBlock way.static void
richText2CDM
(ContentHandler contentHandler, String tag, RichText richText, DataContext richTextContext, SourceResolver sourceResolver, boolean writeIfEmpty, AttributesImpl attrs) Transform a docbook in a CDM infoBlock way.static void
richText2CDM
(ContentHandler contentHandler, String tag, RichText richText, DataContext richTextContext, SourceResolver sourceResolver, AttributesImpl attrs) Transform a docbook in a CDM infoBlock way.static void
richText2CDM
(ContentHandler contentHandler, RichText richText, DataContext richTextContext, SourceResolver sourceResolver) Transform a docbook in a CDM infoBlock way.static void
richText2CDM
(ContentHandler contentHandler, RichText richText, DataContext richTextContext, SourceResolver sourceResolver, boolean rawHtmlExpert) Transform a docbook in a CDM infoBlock way.
-
Field Details
-
CDM_DATE_FORMATTER
The CDM date formatter.
-
-
Method Details
-
richText2CDM
public static void richText2CDM(ContentHandler contentHandler, String tag, RichText richText, DataContext richTextContext, SourceResolver sourceResolver) throws SAXException Transform a docbook in a CDM infoBlock way.- Parameters:
contentHandler
- the handler to SAX CDM.tag
- the surrounding tag.richText
- the richText. Ifnull
, nothing is SAXed.richTextContext
- The context of the richsourceResolver
- the Cocoon SourceResolver.- Throws:
SAXException
- if an error occurs.
-
richText2CDM
public static void richText2CDM(ContentHandler contentHandler, String tag, RichText richText, DataContext richTextContext, SourceResolver sourceResolver, AttributesImpl attrs) throws SAXException Transform a docbook in a CDM infoBlock way.- Parameters:
contentHandler
- the handler to SAX CDM.tag
- the surrounding tag.richText
- the richText. Ifnull
, nothing is SAXed.richTextContext
- The context of the richsourceResolver
- 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, DataContext richTextContext, SourceResolver sourceResolver, boolean writeIfEmpty) throws SAXException Transform a docbook in a CDM infoBlock way.- Parameters:
contentHandler
- the handler to SAX CDM.tag
- the surrounding tag.richText
- the richText. Ifnull
, nothing is SAXed.richTextContext
- The context of the richsourceResolver
- 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, DataContext richTextContext, SourceResolver sourceResolver, boolean writeIfEmpty, boolean rawHtmlExpert) throws SAXException Transform a docbook in a CDM infoBlock way.- Parameters:
contentHandler
- the handler to SAX CDM.tag
- the surrounding tag.richText
- the richText. Ifnull
, nothing is SAXed.richTextContext
- The context of the richsourceResolver
- 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, DataContext richTextContext, SourceResolver sourceResolver, boolean writeIfEmpty, AttributesImpl attrs) throws SAXException Transform a docbook in a CDM infoBlock way.- Parameters:
contentHandler
- the handler to SAX CDM.tag
- the surrounding tag.richText
- the richText. Ifnull
, nothing is SAXed.richTextContext
- The context of the richwriteIfEmpty
- 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, DataContext richTextContext, SourceResolver sourceResolver, boolean writeIfEmpty, boolean rawHtmlExpert, AttributesImpl attrs) throws SAXException Transform a docbook in a CDM infoBlock way.- Parameters:
contentHandler
- the handler to SAX CDM.tag
- the surrounding tag.richText
- the richText. Ifnull
, nothing is SAXed.richTextContext
- The context of the richwriteIfEmpty
- 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, DataContext richTextContext, SourceResolver sourceResolver) throws SAXException Transform a docbook in a CDM infoBlock way.- Parameters:
contentHandler
- the handler to SAX CDM.richText
- the richText. Ifnull
, nothing is SAXedrichTextContext
- The context of the richsourceResolver
- the Cocoon SourceResolver.- Throws:
SAXException
- if an error occurs.
-
richText2CDM
public static void richText2CDM(ContentHandler contentHandler, RichText richText, DataContext richTextContext, SourceResolver sourceResolver, boolean rawHtmlExpert) throws SAXException Transform a docbook in a CDM infoBlock way.- Parameters:
contentHandler
- the handler to SAX CDM.richText
- the richText. Ifnull
, nothing is SAXed.richTextContext
- The context of the richsourceResolver
- 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.
-