May 02, 2024 22:11 Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients Sample Returns Supported Clients SampleSupported Clients
SmartClient
WebClient
NGClient
Property Summary
Array
bytes
A byte array holding the content of the Media object.
String
mimeType
The MIME type of the Media object.
Methods Summary
String
getName()
The name of the Media object.
UUID
getUUID()
Returns the UUID of this media
Property Details
bytes
A byte array holding the content of the Media object.
var ballBytes = plugins.file.readFile('d:/ball.jpg');
var mapBytes = plugins.file.readFile('d:/map.png');
var ballImage = solutionModel.newMedia('ball.jpg', ballBytes);
application.output('original image name: ' + ballImage.getName());
ballImage.bytes = mapBytes;
ballImage.mimeType = 'image/png';
application.output('image name after change: ' + ballImage.getName()); // The name remains unchanged. Only the content (bytes) are changed.
application.output('image mime type: ' + ballImage.mimeType);
application.output('image size: ' + ballImage.bytes.length);
mimeType
The MIME type of the Media object.
Some examples are: 'image/jpg', 'image/png', etc.
var ballBytes = plugins.file.readFile('d:/ball.jpg');
var mapBytes = plugins.file.readFile('d:/map.png');
var ballImage = solutionModel.newMedia('ball.jpg', ballBytes);
application.output('original image name: ' + ballImage.getName());
ballImage.bytes = mapBytes;
ballImage.mimeType = 'image/png';
application.output('image name after change: ' + ballImage.getName()); // The name remains unchanged. Only the content (bytes) are changed.
application.output('image mime type: ' + ballImage.mimeType);
application.output('image size: ' + ballImage.bytes.length);
Methods Details
getName()
The name of the Media object.
var ballBytes = plugins.file.readFile('d:/ball.jpg');
var mapBytes = plugins.file.readFile('d:/map.png');
var ballImage = solutionModel.newMedia('ball.jpg', ballBytes);
application.output('original image name: ' + ballImage.getName());
ballImage.bytes = mapBytes;
ballImage.mimeType = 'image/png';
application.output('image name after change: ' + ballImage.getName()); // The name remains unchanged. Only the content (bytes) are changed.
application.output('image mime type: ' + ballImage.mimeType);
application.output('image size: ' + ballImage.bytes.length);
getUUID()
Returns the UUID of this media
var ballImg = plugins.file.readFile('d:/ball.jpg');
application.output(ballImg.getUUID().toString());