public abstract class BaseRenderEngine extends Object implements RenderEngine
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_EXTENSION |
Constructor and Description |
---|
BaseRenderEngine() |
Modifier and Type | Method and Description |
---|---|
void |
configure(Map<String,String> engineProperties)
Configures the rendering engine with the specified properties.
|
protected static com.saperion.common.io.InputStreamDescriptor |
createInputStreamDescriptor(byte[] content,
String filename) |
protected static com.saperion.common.io.InputStreamDescriptor |
createInputStreamDescriptor(byte[] content,
URL url) |
static String |
getFileFromUrl(URL url) |
Map<String,String> |
getProperties() |
String |
parseExtension(String filename)
Parses the extension the filename.
|
List<Rendition> |
render(com.saperion.common.io.InputStreamDescriptor content,
Options options)
Loads the content that should be rendered with the specified options and creates the list
containing the renditions.
|
abstract List<Rendition> |
safeRender(com.saperion.common.io.InputStreamDescriptor content,
SourceFormat format,
Options options)
Creates the collection of
instances which represent rendered
content incl. |
boolean |
supportsSourceFormat(SourceFormat format)
Checks if the source format is supported.
|
boolean |
supportsTargetFormat(TargetFormat format)
Checks if the target format is supported.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getSupportedSourceFormats, getSupportedTargetFormats
public static final String DEFAULT_EXTENSION
public void configure(Map<String,String> engineProperties)
configure
in interface RenderEngine
engineProperties
- Configuration for the Render EngineRenderEngine.configure(java.util.Map)
public List<Rendition> render(com.saperion.common.io.InputStreamDescriptor content, Options options) throws TimeoutException, RenderingException
render
in interface RenderEngine
content
- Content as InputStreamDescriptor
which should be rendered incl. filenameoptions
- Options
which are describing how to render the contentRendition
instances which represent rendered
content incl. informationsTimeoutException
- if a timeout was specified and it was reachedRenderingException
- if engine is not available or internal initialization failuresRenderEngine.render(com.saperion.common.io.InputStreamDescriptor,
com.saperion.connector.options.Options)
public boolean supportsSourceFormat(SourceFormat format)
supportsSourceFormat
in interface RenderEngine
format
- the source format to be checkedSourceFormat
which was recognized from the content filename is
supportedsupportsSourceFormat(com.saperion.connector.formats.SourceFormat)
public boolean supportsTargetFormat(TargetFormat format)
supportsTargetFormat
in interface RenderEngine
format
- the target format to be checkedTargetFormat
which specifies how to render is supportedsupportsTargetFormat(com.saperion.connector.formats.TargetFormat)
public String parseExtension(String filename)
filename
- filename which should be parsedpublic Map<String,String> getProperties()
public abstract List<Rendition> safeRender(com.saperion.common.io.InputStreamDescriptor content, SourceFormat format, Options options) throws TimeoutException, RenderingException
Rendition
instances which represent rendered
content incl. information. content
- Content as InputStreamDescriptor
which should be rendered incl. filenameformat
- SourceFormat
determined by the file extensionoptions
- Options
which are describing how to render the contentRendition
instances which represent rendered
content incl. informationsFormatNotSupportedException
- if the input or output format is not supportedPreconditionFailedException
- if parts of the options are missingTimeoutException
- if a timeout was specified and it was reachedRenderingException
- if engine is not available or internal initialization failuresprotected static com.saperion.common.io.InputStreamDescriptor createInputStreamDescriptor(byte[] content, URL url)
protected static com.saperion.common.io.InputStreamDescriptor createInputStreamDescriptor(byte[] content, String filename)
Copyright © 2016 SAPERION AG. All rights reserved.