de.espirit.firstspirit.generate
Interface ContentProcessor


public interface ContentProcessor

A content processor can alter or transform the produced content during the generation process.
During generation the usage of a content processor instance compomises three steps:

  1. The method ContentProcessor.init(de.espirit.firstspirit.access.GenerationContext,java.io.OutputStream) is called.
  2. A writer is requested where the content is directed to (ContentProcessor.getWriter()).
  3. The end of the content stream is signaled by a call to ContentProcessor.finish().

Since:
4.0.17

Method Summary
 void cleanUp()
          Called in case of failure to allow gracefully clean up (of resources, file handles, etc).
 void finish()
          This method is called after all content has been written and the writer from ContentProcessor.getWriter() has been closed.
 Writer getWriter()
          This method is called after ContentProcessor.init(de.espirit.firstspirit.access.GenerationContext,java.io.OutputStream).
 void init(GenerationContext gc, OutputStream out)
           
 boolean needsPrivilegedAccessToMediafiles()
          If during preview processing a content processor needs to access referenced media files the implementation must return true.
 

Method Detail

init

void init(GenerationContext gc,
          OutputStream out)
          throws IOException
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
This method is called after ContentProcessor.init(de.espirit.firstspirit.access.GenerationContext,java.io.OutputStream).

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 ContentProcessor.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


Copyright © 2012 e-Spirit AG. All Rights Reserved. Build 4.2.480