public class AutomationRenderer extends Object
Modifier and Type | Field and Description |
---|---|
protected static org.apache.commons.logging.Log |
log |
Constructor and Description |
---|
AutomationRenderer() |
Modifier and Type | Method and Description |
---|---|
static String |
getFilenameWithExtension(String filename,
String mimeType,
String defaultExtension)
Generate a revised filename whose extension is either based on the supplied mimeType if applicable or the
supplied default extension.
|
static String |
getVariant(DocumentModel doc,
RenditionDefinition definition)
Generates the optional
RENDITION_VARIANT_PROPERTY value for a given RenditionDefinition . |
static boolean |
isRenditionAvailable(DocumentModel doc,
RenditionDefinition def)
Test if the Rendition is available on the given DocumentModel
|
static List<Blob> |
render(DocumentModel doc,
RenditionDefinition definition,
CoreSession session)
Generate the rendition Blobs for a given
RenditionDefinition . |
protected static final org.apache.commons.logging.Log log
public AutomationRenderer()
public static boolean isRenditionAvailable(DocumentModel doc, RenditionDefinition def)
doc
- the target DocumentModel
def
- the RenditionDefinition
to usepublic static List<Blob> render(DocumentModel doc, RenditionDefinition definition, CoreSession session)
RenditionDefinition
. Return is a List of Blob for bigger
flexibility (typically HTML rendition with resources)doc
- the target DocumentModel
definition
- the RenditionDefinition
to usesession
- the CoreSession
to usepublic static String getVariant(DocumentModel doc, RenditionDefinition definition)
RENDITION_VARIANT_PROPERTY
value for a given RenditionDefinition
.doc
- the target documentdefinition
- the rendition definition to useRENDITION_VARIANT_PROPERTY
value, or null
public static String getFilenameWithExtension(String filename, String mimeType, String defaultExtension)
filename
- the filename to usemimeType
- the mimeType from which the assigned extension is deriveddefaultExtension
- the default extension to be assigned if the mimeType has no corresponding extensionCopyright © 2016 Nuxeo SA. All rights reserved.