Class BaseRenderEngine
java.lang.Object
com.saperion.connector.render.engine.BaseRenderEngine
- All Implemented Interfaces:
RenderEngine
- Direct Known Subclasses:
ISYSRenderEngine
Render engine base implementation which does necessary pre-checks. (null, supported formats, ...)
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidConfigures the rendering engine with the specified properties.protected static InputStreamDescriptorcreateInputStreamDescriptor(byte[] content, String filename) protected static InputStreamDescriptorcreateInputStreamDescriptor(byte[] content, URL url) static StringgetFileFromUrl(URL url) parseExtension(String filename) Parses the extension the filename.render(InputStreamDescriptor content, Options options) Loads the content that should be rendered with the specified options and creates the list containing the renditions.safeRender(InputStreamDescriptor content, SourceFormat format, Options options) Creates the collection ofinstances which represent rendered content incl.RenditionbooleansupportsSourceFormat(SourceFormat format) Checks if the source format is supported.booleansupportsTargetFormat(TargetFormat format) Checks if the target format is supported.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.saperion.connector.render.engine.RenderEngine
getSupportedSourceFormats, getSupportedTargetFormats
-
Field Details
-
DEFAULT_EXTENSION
- See Also:
-
-
Constructor Details
-
BaseRenderEngine
public BaseRenderEngine()
-
-
Method Details
-
configure
Configures the rendering engine with the specified properties.- Specified by:
configurein interfaceRenderEngine- Parameters:
engineProperties- Configuration for the Render Engine- See Also:
-
render
public List<Rendition> render(InputStreamDescriptor content, Options options) throws TimeoutException, RenderingException Loads the content that should be rendered with the specified options and creates the list containing the renditions.- Specified by:
renderin interfaceRenderEngine- Parameters:
content- Content asInputStreamDescriptorwhich should be rendered incl. filenameoptions-Optionswhich are describing how to render the content- Returns:
- the collection of
instances which represent rendered content incl. informationsRendition - Throws:
TimeoutException- if a timeout was specified and it was reachedRenderingException- if engine is not available or internal initialization failures- See Also:
-
supportsSourceFormat
Checks if the source format is supported.- Specified by:
supportsSourceFormatin interfaceRenderEngine- Parameters:
format- the source format to be checked- Returns:
- true if the
SourceFormatwhich was recognized from the content filename is supported - See Also:
-
supportsTargetFormat
Checks if the target format is supported.- Specified by:
supportsTargetFormatin interfaceRenderEngine- Parameters:
format- the target format to be checked- Returns:
- true if the
TargetFormatwhich specifies how to render is supported - See Also:
-
parseExtension
Parses the extension the filename.- Parameters:
filename- filename which should be parsed- Returns:
- the extension or an empty string if nothing wDummyRenderEngineas found
-
getProperties
- Returns:
- configuration properties for the engine
-
safeRender
public abstract List<Rendition> safeRender(InputStreamDescriptor content, SourceFormat format, Options options) throws TimeoutException, RenderingException Creates the collection ofinstances which represent rendered content incl. information.Rendition
Method to be implemented by the specific render engine.- Parameters:
content- Content asInputStreamDescriptorwhich should be rendered incl. filenameformat-SourceFormatdetermined by the file extensionoptions-Optionswhich are describing how to render the content- Returns:
- the collection of
instances which represent rendered content incl. informationsRendition - Throws:
FormatNotSupportedException- 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 failures
-
createInputStreamDescriptor
-
getFileFromUrl
-
createInputStreamDescriptor
-