Class CDMHelper

java.lang.Object
org.ametys.odf.cdmfr.CDMHelper

public final class CDMHelper extends Object
Helper for export tasks.
  • Field Details

  • 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. If null, nothing is SAXed.
      richTextContext - The context of the rich
      sourceResolver - 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. If null, nothing is SAXed.
      richTextContext - The context of the rich
      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, 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. If null, nothing is SAXed.
      richTextContext - The context of the rich
      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, 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. If null, nothing is SAXed.
      richTextContext - The context of the rich
      sourceResolver - the Cocoon SourceResolver.
      writeIfEmpty - true to sax CDM info block even if the rich text is empty
      rawHtmlExpert - 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. If null, nothing is SAXed.
      richTextContext - The context of the rich
      writeIfEmpty - true to sax CDM info block even if the rich text is empty
      attrs - The attributes to SAX
      sourceResolver - 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. If null, nothing is SAXed.
      richTextContext - The context of the rich
      writeIfEmpty - true to sax CDM info block even if the rich text is empty
      rawHtmlExpert - true to export HTML expert as raw CDATA. If false, parse and resolve HTML expert code.
      attrs - The attributes to SAX
      sourceResolver - 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. If null, nothing is SAXed
      richTextContext - The context of the rich
      sourceResolver - 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. If null, nothing is SAXed.
      richTextContext - The context of the rich
      sourceResolver - 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.