Interface ContentProcessor

All Superinterfaces:
Public

public interface ContentProcessor extends Public
A content processor can alter or transform the produced content during the generation process.
During generation the usage of a content processor instance comprises three steps:
  1. The method init(de.espirit.firstspirit.access.GenerationContext,java.io.OutputStream) is called.
  2. A writer is requested where the content is directed to (getWriter()).
  3. The end of the content stream is signaled by a call to finish().
Since:
4.0.17
  • Method Details

    • init

      void init(GenerationContext gc, OutputStream out) throws IOException
      Initializes the content processor.
      Parameters:
      gc - the generation context
      out - the output stream where the processed content should be directed to by this instance
      Throws:
      IOException
      Since:
      4.0.17
    • getWriter

      Writer getWriter() throws IOException
      Returns:
      the writer where the content is written to by the generation
      Throws:
      IOException
      Since:
      4.0.17
    • finish

      void finish() throws IOException
      This method is called after all content has been written and the writer from getWriter() has been closed.
      Throws:
      IOException
      Since:
      4.0.17
    • cleanUp

      void cleanUp()
      Called in case of failure to allow gracefully clean up (of resources, file handles, etc).
      Since:
      4.0.24
    • needsPrivilegedAccessToMediafiles

      boolean needsPrivilegedAccessToMediafiles()
      If during preview processing a content processor needs to access referenced media files the implementation must return true. Else every request to an media url will answered with the http error 403 (forbidden).
      Since:
      4.0.20