@AlfrescoPublicApi public class TransformationOptions extends Object implements Cloneable
This base class provides some common, optional contextual information about the source and target nodes and properties used by the transformation.
Modifier and Type | Field and Description |
---|---|
static String |
OPT_INCLUDE_EMBEDDED |
static String |
OPT_SOURCE_CONTENT_PROPERTY |
static String |
OPT_SOURCE_NODEREF
Option map names to preserve backward compatibility
|
static String |
OPT_TARGET_CONTENT_PROPERTY |
static String |
OPT_TARGET_NODEREF |
static String |
OPT_USE |
static org.alfresco.service.cmr.repository.datatype.TypeConverter.Converter<String,Boolean> |
relaxedBooleanTypeConverter |
Constructor and Description |
---|
TransformationOptions()
Default constructor
|
TransformationOptions(Map<String,Object> optionsMap)
Constructor.
|
TransformationOptions(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef,
org.alfresco.service.namespace.QName sourceContentProperty,
org.alfresco.service.cmr.repository.NodeRef targetNodeRef,
org.alfresco.service.namespace.QName targetContentProperty)
Constructor
|
TransformationOptions(TransformationOptions options)
Deep clone constructor
|
Modifier and Type | Method and Description |
---|---|
void |
addSourceOptions(TransformationSourceOptions sourceOptions)
Adds the given sourceOptions to the sourceOptionsMap.
|
protected TransformationOptions |
clone() |
void |
copyFrom(TransformationOptions otherOptions)
Does the work of copying the given other TransformationOptions
values to this one
|
TransformationOptions |
deepCopy()
Creates a clone of the TransformationOptions
|
boolean |
equals(Object obj) |
Boolean |
getIncludeEmbedded()
If the source content includes embedded resources,
should the transformer attempt to transform these
as well?
Not many transformers do support embedded resources,
so this option will only affect those that can.
|
TransformationOptionLimits |
getLimits()
Returns max and limit values for time, size and pages in a single operation.
|
int |
getMaxPages()
Get the maximum number of pages read before an exception is thrown.
|
long |
getMaxSourceSizeKBytes()
Gets the maximum source content size, to skip transformations where
the source is just too large to expect it to perform.
|
int |
getPageLimit()
Get the page limit before returning EOF.
|
long |
getReadLimitKBytes()
Gets the limit in terms of the about of data read to limit transformations where
only the start of the content is needed.
|
long |
getReadLimitTimeMs()
Gets the limit in terms of the amount of data read (by time) to limit transformations where
only the start of the content is needed.
|
org.alfresco.service.namespace.QName |
getSourceContentProperty()
Get the source content property
|
org.alfresco.service.cmr.repository.NodeRef |
getSourceNodeRef()
Gets the source node reference
|
<T extends TransformationSourceOptions> |
getSourceOptions(Class<T> clazz)
Gets the appropriate source options for the given mimetype if available.
|
Collection<TransformationSourceOptions> |
getSourceOptionsList()
Gets the immutable list of source options further describing how the source should
be transformed based on its mimetype.
|
protected Map<Class<? extends TransformationSourceOptions>,TransformationSourceOptions> |
getSourceOptionsMap()
Gets the map of source options further describing how the source should
be transformed based on its mimetype
|
org.alfresco.service.namespace.QName |
getTargetContentProperty()
Get the target content property
|
org.alfresco.service.cmr.repository.NodeRef |
getTargetNodeRef()
Get the target node reference
|
long |
getTimeoutMs()
Gets the timeout (ms) on the InputStream after which an IOExecption is thrown
to terminate very slow transformations or a subprocess is terminated (killed).
|
String |
getUse()
The use to which the transform will be put.
|
int |
hashCode() |
void |
set(Map<String,Object> optionsMap)
Sets options from the supplied map.
|
void |
setIncludeEmbedded(Boolean includeEmbedded)
If the source content includes embedded resources,
should the transformer attempt to transform these
as well?
Not many transformers do support embedded resources,
so this option will only affect those that can.
|
void |
setLimits(TransformationOptionLimits limits)
Sets max and limit values for time, size and pages in a single operation.
|
void |
setMaxPages(int maxPages)
Set the number of pages read from the source before an exception is thrown.
|
void |
setMaxSourceSizeKBytes(long maxSourceSizeKBytes)
Sets a maximum source content size, to skip transformations where
the source is just too large to expect it to perform.
|
void |
setPageLimit(int pageLimit)
Set the number of pages read from the source before returning EOF.
|
void |
setReadLimitKBytes(long readLimitKBytes)
Sets a limit in terms of the about of data read to limit transformations where
only the start of the content is needed.
|
void |
setReadLimitTimeMs(long readLimitTimeMs)
Sets a limit in terms of the amount of data read (by time) to limit transformations where
only the start of the content is needed.
|
void |
setSourceContentProperty(org.alfresco.service.namespace.QName sourceContentProperty)
Set the source content property
|
void |
setSourceNodeRef(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef)
Set the source node reference
|
void |
setSourceOptionsList(Collection<TransformationSourceOptions> sourceOptionsList)
Sets the list of source options further describing how the source should
be transformed based on its mimetype.
|
void |
setTargetContentProperty(org.alfresco.service.namespace.QName targetContentProperty)
Set the target content property
|
void |
setTargetNodeRef(org.alfresco.service.cmr.repository.NodeRef targetNodeRef)
Set the taget node reference
|
void |
setTimeoutMs(long timeoutMs)
Sets a timeout (ms) on the InputStream after which an IOExecption is thrown
to terminate very slow transformations or to terminate (kill) a subprocess.
|
void |
setUse(String use)
The use to which the transform will be put.
|
Map<String,Object> |
toMap()
Convert the transformation options into a map.
|
String |
toString() |
String |
toString(boolean includeLimits) |
public static final String OPT_SOURCE_NODEREF
public static final String OPT_SOURCE_CONTENT_PROPERTY
public static final String OPT_TARGET_NODEREF
public static final String OPT_TARGET_CONTENT_PROPERTY
public static final String OPT_INCLUDE_EMBEDDED
public static final String OPT_USE
public TransformationOptions()
public TransformationOptions(TransformationOptions options)
public TransformationOptions(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef, org.alfresco.service.namespace.QName sourceContentProperty, org.alfresco.service.cmr.repository.NodeRef targetNodeRef, org.alfresco.service.namespace.QName targetContentProperty)
sourceNodeRef
- the source node referencesourceContentProperty
- the source content propertytargetNodeRef
- the target node referencetargetContentProperty
- the target content propertyprotected TransformationOptions clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
public void copyFrom(TransformationOptions otherOptions)
otherOptions
- the options to copypublic TransformationOptions deepCopy()
public void setSourceNodeRef(org.alfresco.service.cmr.repository.NodeRef sourceNodeRef)
sourceNodeRef
- the source node referencepublic org.alfresco.service.cmr.repository.NodeRef getSourceNodeRef()
public void setSourceContentProperty(org.alfresco.service.namespace.QName sourceContentProperty)
sourceContentProperty
- the source content propertypublic org.alfresco.service.namespace.QName getSourceContentProperty()
public void setTargetNodeRef(org.alfresco.service.cmr.repository.NodeRef targetNodeRef)
targetNodeRef
- the target node referencepublic org.alfresco.service.cmr.repository.NodeRef getTargetNodeRef()
public void setTargetContentProperty(org.alfresco.service.namespace.QName targetContentProperty)
targetContentProperty
- the target content propertypublic org.alfresco.service.namespace.QName getTargetContentProperty()
public void setIncludeEmbedded(Boolean includeEmbedded)
includeEmbedded
- the include embedded flag.public Boolean getIncludeEmbedded()
public void setUse(String use)
use
- to which the transform will be put.public String getUse()
public long getTimeoutMs()
public void setTimeoutMs(long timeoutMs)
timeoutMs
- in milliseconds. If less than or equal to zero (the default)
there is no timeout.
If greater than zero the readLimitTimeMs
must not be set.public long getReadLimitTimeMs()
public void setReadLimitTimeMs(long readLimitTimeMs)
readLimitTimeMs
- if less than or equal to zero (the default) there is no limit.
If greater than zero the timeoutMs
must not be set.public long getMaxSourceSizeKBytes()
public void setMaxSourceSizeKBytes(long maxSourceSizeKBytes)
maxSourceSizeKBytes
- if less than or equal to zero (the default) there is no limit.
If greater than zero the readLimitKBytes
must not be set.public long getReadLimitKBytes()
public void setReadLimitKBytes(long readLimitKBytes)
readLimitKBytes
- if less than or equal to zero (the default) there is no limit.
If greater than zero the maxSourceSizeKBytes
must not be set.public int getMaxPages()
public void setMaxPages(int maxPages)
maxPages
- the number of pages to be read from the source. If less than or equal to zero
(the default) no limit is applied.public int getPageLimit()
public void setPageLimit(int pageLimit)
pageLimit
- the number of pages to be read from the source. If less
than or equal to zero (the default) no limit is applied.public TransformationOptionLimits getLimits()
public void setLimits(TransformationOptionLimits limits)
protected Map<Class<? extends TransformationSourceOptions>,TransformationSourceOptions> getSourceOptionsMap()
public Collection<TransformationSourceOptions> getSourceOptionsList()
addSourceOptions(TransformationSourceOptions)
to add source options.public void setSourceOptionsList(Collection<TransformationSourceOptions> sourceOptionsList)
sourceOptionsList
- the source options listpublic void addSourceOptions(TransformationSourceOptions sourceOptions)
Note that if source options of the same class already exists a new merged source options object is added.
sourceOptions
- TransformationSourceOptionspublic <T extends TransformationSourceOptions> T getSourceOptions(Class<T> clazz)
public Map<String,Object> toMap()
Basic options (optional) are:
OPT_SOURCE_NODEREF
OPT_SOURCE_CONTENT_PROPERTY
OPT_TARGET_NODEREF
OPT_TARGET_CONTENT_PROPERTY
OPT_INCLUDE_EMBEDDED
OPT_USE
TransformationOptionLimits.OPT_TIMEOUT_MS
TransformationOptionLimits.OPT_READ_LIMIT_TIME_MS
TransformationOptionLimits.OPT_MAX_SOURCE_SIZE_K_BYTES
TransformationOptionLimits.OPT_READ_LIMIT_K_BYTES
TransformationOptionLimits.OPT_MAX_PAGES
TransformationOptionLimits.OPT_PAGE_LIMIT
Override this method to append option values to the map. Derived classes should call the base class before appending further values and returning the result.
public String toString(boolean includeLimits)
Copyright © 2005–2017 Alfresco Software. All rights reserved.