public class JSPreviewManager extends JSBaseScriptableObject implements com.brightech.utils.Metrics, com.brightech.mb.preview.ITaskConstants
myLogger
CONST, DONTENUM, EMPTY, PERMANENT, READONLY, UNINITIALIZED_CONST
kDay, kDurationFormat, kGb, kHour, kHourDurationFormat, kKb, kMb, kMinute, kMinutesInHour, kSecond, kSecondInMinute, kWeek, kYear, kYearInSeconds
Constructor and Description |
---|
JSPreviewManager() |
Modifier and Type | Method and Description |
---|---|
void |
jsFunction_addRequest(java.lang.String theFormat,
int theAssetId,
User theUser,
java.lang.String theOutputPath,
java.lang.String theScale,
java.lang.String theResolution,
java.lang.String theColorspace)
Deprecated.
|
int |
jsFunction_addRequestForAsset(int theAssetId,
User theUser,
Parameters theParameters)
Add loading dock request to queue.
|
int |
jsFunction_addRequestForAssetWithPreset(int theAssetId,
User theUser,
java.lang.String thePresetName,
java.lang.String theOutputPath)
Adds request to queue with given conversion preset.
|
java.lang.String |
jsFunction_addRequestForFile(java.lang.String theFilePath,
java.lang.String theOutPath,
java.lang.String theFormat,
boolean theWait)
Add a request for any file to be converted to a new format.
|
java.lang.String |
jsFunction_addRequestForFileTempOutput(java.lang.String theFilePath,
java.lang.String theFormat,
boolean theWait)
Add a request for any file to be converted to a new format and automatically create a temporary output path.
|
void |
jsFunction_addScriptRequest(ManagedFile theAsset,
java.lang.String theOutputPath,
java.lang.String theScriptPath,
java.lang.Boolean theEditsOriginal,
Parameters theParameters)
Add a request to have the preview system execute a script asynchronously.
|
boolean |
jsFunction_addViewRequest(int theAssetId,
java.lang.String theView)
Put a request into the preview system to generate any missing "onDemand" views.
|
void |
jsFunction_extractAndWriteContent(int theAssetId)
Extracts and writes content for the specified asset.
|
void |
jsFunction_regeneratePreview(ManagedFile theFile)
Regenerate previews for a specific asset
|
void |
jsFunction_removeCurrentlyProcessingRequests(int theAssetId)
Removes any currently processing high-res requests from Asset View.
|
boolean |
jsFunction_setPreviewFromFile(int theAssetId,
FileBase theFile,
java.lang.String theView)
Sets a particular preview for an asset id from a file.
|
applyDescriptorToAttributeBitset, associateValue, avoidObjectDetection, buildDataDescriptor, callMethod, callMethod, checkPropertyChange, checkPropertyDefinition, defineClass, defineClass, defineClass, defineConst, defineConstProperty, defineFunctionProperties, defineOwnProperties, defineOwnProperty, defineOwnProperty, defineProperty, defineProperty, defineProperty, defineProperty, defineProperty, delete, delete, delete, deleteProperty, deleteProperty, ensureScriptable, ensureScriptableObject, ensureSymbolScriptable, equivalentValues, get, get, get, get, getAllIds, getArrayPrototype, getAssociatedValue, getAttributes, getAttributes, getAttributes, getAttributes, getAttributes, getClassName, getClassPrototype, getDefaultValue, getDefaultValue, getExternalArrayData, getExternalArrayLength, getFunctionPrototype, getGeneratorFunctionPrototype, getGetterOrSetter, getIds, getObjectPrototype, getOwnPropertyDescriptor, getParentScope, getProperty, getProperty, getProperty, getPropertyIds, getPrototype, getSlot, getTopLevelScope, getTopScopeValue, getTypedProperty, getTypedProperty, getTypeOf, has, has, has, hasInstance, hasProperty, hasProperty, hasProperty, isAccessorDescriptor, isConst, isDataDescriptor, isEmpty, isExtensible, isFalse, isGenericDescriptor, isGetterOrSetter, isSealed, isTrue, preventExtensions, put, put, put, putConst, putConstProperty, putProperty, putProperty, putProperty, redefineProperty, sameValue, sealObject, setAttributes, setAttributes, setAttributes, setAttributes, setAttributes, setExternalArrayData, setGetterOrSetter, setParentScope, setPrototype, size
public void jsFunction_regeneratePreview(ManagedFile theFile) throws com.brightech.mb.web.fs.FileSystemException
theFile
- the file to regenerate previews forcom.brightech.mb.web.fs.FileSystemException
- exception throw if issue w/file@Deprecated public void jsFunction_addRequest(java.lang.String theFormat, int theAssetId, User theUser, java.lang.String theOutputPath, java.lang.String theScale, java.lang.String theResolution, java.lang.String theColorspace)
JSPreviewManager.jsFunction_addRequestForAsset(int, User, Parameters)
insteadtheFormat
- the format, e.g. "JPEG".theAssetId
- the asset ID, an integer.theUser
- the user object.theOutputPath
- the output path If a custom output path is defined, the request will not appear in the loading dock.theScale
- the scale to convert to. E.g. "50%x50%".theResolution
- the resolution to convert to. E.g. "72dpi", "300dpi", or "350x400" (pixels).theColorspace
- the colorspace to convert to. E.g. "RGB".public void jsFunction_addScriptRequest(ManagedFile theAsset, java.lang.String theOutputPath, java.lang.String theScriptPath, java.lang.Boolean theEditsOriginal, Parameters theParameters)
theAsset
- The original asset to generate a preview of.theOutputPath
- The file to output the preview to.theScriptPath
- The script to run.theEditsOriginal
- Does the script edit the original asset?theParameters
- Additional optional parameters to pass to the script worker (these paramters do not necessarily
propagate to the script itself).public int jsFunction_addRequestForAsset(int theAssetId, User theUser, Parameters theParameters) throws java.lang.InterruptedException
theAssetId
- the asset IDtheUser
- the usertheParameters
- the parameters for the conversionjava.lang.InterruptedException
- Thrown if this method is interrupted. Workflows should rethrow this exception
if they catch it to ensure that interrupted workflows terminate properly.public int jsFunction_addRequestForAssetWithPreset(int theAssetId, User theUser, java.lang.String thePresetName, java.lang.String theOutputPath) throws java.lang.InterruptedException
theAssetId
- the asset idtheUser
- the userthePresetName
- the preset nametheOutputPath
- the output path. Default path will be built if output path is null (optional)java.lang.InterruptedException
- thrown if this method is interruptedpublic java.lang.String jsFunction_addRequestForFile(java.lang.String theFilePath, java.lang.String theOutPath, java.lang.String theFormat, boolean theWait) throws java.net.MalformedURLException, java.lang.InterruptedException
theFilePath
- Full path of file to be convertedtheOutPath
- Full path of conversion outputtheFormat
- Format to convert totheWait
- true
to wait for processing to complete, false
otherwisejava.net.MalformedURLException
- Error creating downoad urljava.lang.InterruptedException
- Thrown if this method is interrupted. Workflows should rethrow this exception
if they catch it to ensure that interrupted workflows terminate properly.public java.lang.String jsFunction_addRequestForFileTempOutput(java.lang.String theFilePath, java.lang.String theFormat, boolean theWait) throws java.io.IOException, java.lang.InterruptedException
theFilePath
- Full path of file to be convertedtheFormat
- Full path of conversion outputtheWait
- true
to wait for processing to complete, false
otherwisejava.io.IOException
- Error creating temp file or download urljava.lang.InterruptedException
- Thrown if this method is interrupted. Workflows should rethrow this exception
if they catch it to ensure that interrupted workflows terminate properly.public boolean jsFunction_addViewRequest(int theAssetId, java.lang.String theView)
theAssetId
- the asset id to generate the views fortheView
- the specific view to generate (at present, we simply generate all on demand views and save to the db)true
if a view task has been added, false
otherwisepublic void jsFunction_extractAndWriteContent(int theAssetId)
theAssetId
- the asset ID.public boolean jsFunction_setPreviewFromFile(int theAssetId, FileBase theFile, java.lang.String theView) throws java.io.IOException
theAssetId
- we are setting the preview on.theFile
- the file we are getting the preview from.theView
- the view we want to set (high, viewex, thumbnail).java.io.IOException
public void jsFunction_removeCurrentlyProcessingRequests(int theAssetId)
theAssetId
- the asset id to remove request forCopyright © 2023 MediaBeacon, Inc. All Rights Reserved.