public class JSExternalApplicationExecutor extends JSBaseScriptableObject
myLogger
Constructor and Description |
---|
JSExternalApplicationExecutor() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
jsFunction_executeCommand(org.mozilla.javascript.NativeArray theCommands,
int theTimeout,
org.mozilla.javascript.NativeArray theSysEnv)
Executes a commands.
|
static java.lang.String |
jsFunction_getCacheDirectory()
Get the directory where MB is storing webapp content
|
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 java.lang.String jsFunction_executeCommand(org.mozilla.javascript.NativeArray theCommands, int theTimeout, org.mozilla.javascript.NativeArray theSysEnv) throws java.lang.Exception
//Creates rendition of a file that's uploaded into MB, links it together using asset links.
//REM the Pouf example
//convert "C:\Users\Me\Desktop\soccer.png" -duplicate 5 +append "C:\Users\Me\Desktop\pouf.png"
var kConvertCommand = "C:\\Program Files\\MediaBeacon\\MediaBeacon\\bin\\ImageMagick\\convert.exe";
var shortName = asset.name.substr(0, asset.name.lastIndexOf('.'));
function main()
{
var aDestination = asset.parent.path + shortName + "_" + "pouf.png";
var aTokenGenCmd = [];
aTokenGenCmd.push(kConvertCommand);
aTokenGenCmd.push("-rp");
aTokenGenCmd.push(asset.path);
aTokenGenCmd.push("-duplicate");
aTokenGenCmd.push("5");
aTokenGenCmd.push("+append");
aTokenGenCmd.push("-rp");
aTokenGenCmd.push(aDestination);
externalApplicationExecutor.executeCommand(aTokenGenCmd);
var aDestinationManagedFile = fileManager.fileImport(new UnmanagedFile(aDestination));
linkManager.createLinkById(asset.assetId, aDestinationManagedFile.assetId, false, "Pouf");
}
main();
theCommands
- the commands to executetheTimeout
- (optional) number of seconds before command execution is terminated. set to Zero or leave empty for no timeouttheSysEnv
- environment used for the command.java.lang.Exception
public static java.lang.String jsFunction_getCacheDirectory()
Copyright © 2023 MediaBeacon, Inc. All Rights Reserved.