Class ExportFormat

java.lang.Object
io.goobi.viewer.model.export.ExportFormat

public class ExportFormat extends Object
Describes one configurable XSLT-based search export format as defined in config_viewer.xml under <search><export><format>.

Each instance holds the format's unique name, enable flag, XSLT file name, HTTP content type and file extension. New export formats can be added at runtime by simply adding another <format> element and dropping the corresponding XSLT stylesheet into the config or classpath directory.

Example configuration:


 <format name="bibtex" enabled="true" xslt="solr2bibtex.xsl"
         contentType="text/plain" fileExtension="bib" />
 
  • Constructor Details

    • ExportFormat

      public ExportFormat(String name, boolean enabled, String xslt, String contentType, String fileExtension)
      Creates a new export format descriptor.
      Parameters:
      name - unique format identifier used in the REST path (e.g. "bibtex")
      enabled - whether this format is currently active
      xslt - file name of the XSLT stylesheet (e.g. "solr2bibtex.xsl")
      contentType - HTTP content type for the response (e.g. "text/plain")
      fileExtension - file extension for the download file (e.g. "bib")
  • Method Details

    • getName

      public String getName()
      Returns:
      the unique format identifier (e.g. "bibtex", "endnote", "ris")
    • isEnabled

      public boolean isEnabled()
      Returns:
      true if this export format is enabled in the configuration
    • getXslt

      public String getXslt()
      Returns:
      the XSLT stylesheet file name used for the transformation
    • getContentType

      public String getContentType()
      Returns:
      the HTTP content type to set on the response (e.g. "application/xml")
    • getFileExtension

      public String getFileExtension()
      Returns:
      the file extension for the downloaded file (e.g. "xml", "bib", "ris")
    • toString

      public String toString()
      Overrides:
      toString in class Object