Child pages
  • JSMedia

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
{hidden} DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY, UNLESS YOU KNOW WHAT YOU'RE DOING. THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO EXTRACT CHANGES FROM THE PAGE AND MERGE THEM BACK INTO SERVOY SOURCE{hidden} {sub-section:description|text=}{sub-section}\\ {table:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Property Summary{th}{tr}{tbody}{tr}{td}byte[]{td}{td}[#bytes] A byte array holding the content of the Media object.{td}{tr}{tbody}{tbody}{tr}{td}[String]{td}{td}[#mimeType] The MIME type of the Media object.{td}{tr}{tbody}{table}\\ {table:class=servoy sSummery}{colgroup}{column:width=80px}{column}{column}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=2}Method Summary{th}{tr}{tbody}{tr}{td}[String]{td}{td}[#getName]\() The name of the Media object.{td}{tr}{tbody}{table}\\ {table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{tbody:id=38DB59C9-A973-416B-948D-A3C4A764D49B}{tr:id=name}{td}h6.bytes{td}{tr}{tr:id=des}{td}{sub-section:38DB59C9-A973-416B-948D-A3C4A764D49B_des|text=|trigger=button}{sub-section}{sub-section:38DB59C9-A973-416B-948D-A3C4A764D49B_des|trigger=none|class=sIndent}
Wiki Markup
Cache
indextrue
refresh100d
showRefreshtrue
iddoc
titleRefresh page
showDatetrue
retryEnable

servoy sReturnTypes2100%height: 30px;2Supported ClientssWordListSmartClientsWordListWebClientsWordListNGClient

servoy sSummary12%30%58%height: 30px;3Property SummaryA byte array holding the content of the Media object.The MIME type of the Media object.

servoy sSummary12%30%58%height: 30px;3Methods SummaryReturns this media's bytes a a String converting it with the UTF-8 Charset.The name of the Media object.Returns the UUID of this mediavoidSets the bytes of this media to the give String that is converted to bytes using the UTF-8 Charset.

propertyservoy sDetail2100%height:30px2Property Detailsbytesname

bytes

dessIndent
A byte array holding the content of the Media object.
{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:38DB59C9-A973-416B-948D-A3C4A764D49B_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:38DB59C9-A973-416B-948D-A3C4A764D49B_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:38DB59C9-A973-416B-948D-A3C4A764D49B_ret|text=|trigger=button}{sub-section}{sub-section:38DB59C9-A973-416B-948D-A3C4A764D49B_ret|trigger=none|class=sIndent}byte[]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:38DB59C9-A973-416B-948D-A3C4A764D49B_see|text=|trigger=button}{sub-section}{sub-section:38DB59C9-A973-416B-948D-A3C4A764D49B_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:38DB59C9-A973-416B-948D-A3C4A764D49B_see|text=|trigger=button}{sub-section}{sub-section:38DB59C9-A973-416B-948D-A3C4A764D49B_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:38DB59C9-A973-416B-948D-A3C4A764D49B_sam|text=|trigger=button}{sub-section}{sub-section:38DB59C9-A973-416B-948D-A3C4A764D49B_sam|class=sIndent|trigger=none}{code:language=javascript} 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); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=C56E50F0-EEE3-4AD7-A935-208399B21B60}{tr:id=name}{td}h6.mimeType{td}{tr}{tr:id=des}{td}{sub-section:C56E50F0-EEE3-4AD7-A935-208399B21B60_des|text=|trigger=button}{sub-section}{sub-section:C56E50F0-EEE3-4AD7-A935-208399B21B60_des|trigger=none|class=sIndent}
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowmimeTypename

mimeType

dessIndent
The MIME type of the Media object.

Some examples are: 'image/jpg', 'image/png', etc.
{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:C56E50F0-EEE3-4AD7-A935-208399B21B60_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:C56E50F0-EEE3-4AD7-A935-208399B21B60_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:C56E50F0-EEE3-4AD7-A935-208399B21B60_ret|text=|trigger=button}{sub-section}{sub-section:C56E50F0-EEE3-4AD7-A935-208399B21B60_ret|trigger=none|class=sIndent}[String]{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:C56E50F0-EEE3-4AD7-A935-208399B21B60_see|text=|trigger=button}{sub-section}{sub-section:C56E50F0-EEE3-4AD7-A935-208399B21B60_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:C56E50F0-EEE3-4AD7-A935-208399B21B60_see|text=|trigger=button}{sub-section}{sub-section:C56E50F0-EEE3-4AD7-A935-208399B21B60_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:C56E50F0-EEE3-4AD7-A935-208399B21B60_sam|text=|trigger=button}{sub-section}{sub-section:C56E50F0-EEE3-4AD7-A935-208399B21B60_sam|class=sIndent|trigger=none}{code:language=javascript} 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); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\ {table:class=servoy sDetail}{colgroup}{column:width=100%}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=244E5D76-10FB-422A-BC15-DF6D6739AB62}{tr:id=name}{td}h6.getName{td}{tr}{tr:id=sig}{td}{span:style=float: left; margin-right: 5px;}[String]{span}{span:id=iets|style=float: left; font-weight: bold;}getName{span}{span:id=iets|style=float: left;}\(){span}{td}{tr}{tr:id=des}{td}{sub-section:244E5D76-10FB-422A-BC15-DF6D6739AB62_des|text=|trigger=button}{sub-section}{sub-section:244E5D76-10FB-422A-BC15-DF6D6739AB62_des|trigger=none|class=sIndent}
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow

functionservoy sDetail2100%height:30px2Methods DetailsgetAsStringname

getAsString()

dessIndent
Returns this media's bytes a a String converting it with the UTF-8 Charset.
Returns null if it couldn't convert it or the bytes where null.
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowgetNamename

getName()

dessIndent
The name of the Media object.
{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=prs}{td}*Parameters*\\{sub-section:244E5D76-10FB-422A-BC15-DF6D6739AB62_prs|text=|trigger=button}{sub-section}{div:class=sIndent}{sub-section:244E5D76-10FB-422A-BC15-DF6D6739AB62_prs|trigger=none}{sub-section}{div}{td}{tr}{builder-show}{tr:id=ret}{td}*Returns*\\{sub-section:244E5D76-10FB-422A-BC15-DF6D6739AB62_ret|text=|trigger=button}{sub-section}{sub-section:244E5D76-10FB-422A-BC15-DF6D6739AB62_ret|trigger=none|class=sIndent}[String] -- A String holding the name of this Media object.{sub-section}{td}{tr}{builder-show:permission=edit}{tr:id=see}{td}*Also see*\\{sub-section:244E5D76-10FB-422A-BC15-DF6D6739AB62_see|text=|trigger=button}{sub-section}{sub-section:244E5D76-10FB-422A-BC15-DF6D6739AB62_see|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{builder-show:permission=edit}{tr:id=link}{td}*External links*\\{sub-section:244E5D76-10FB-422A-BC15-DF6D6739AB62_see|text=|trigger=button}{sub-section}{sub-section:244E5D76-10FB-422A-BC15-DF6D6739AB62_link|class=sIndent|trigger=none}{sub-section}{td}{tr}{builder-show}{tr:id=sam}{td}*Sample*\\{sub-section:244E5D76-10FB-422A-BC15-DF6D6739AB62_sam|text=|trigger=button}{sub-section}{sub-section:244E5D76-10FB-422A-BC15-DF6D6739AB62_sam|class=sIndent|trigger=none}{code:language=javascript} 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); {code}{sub-section}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
ret

Returns

sIndent A String holding the name of this Media object.
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRowgetUUIDname

getUUID()

dessIndent
Returns the UUID of this media
ret

Returns

sIndent
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
setAsStringname

setAsString(string)

dessIndent
Sets the bytes of this media to the give String that is converted to bytes using the UTF-8 Charset.
prs

Parameters

sIndentstring ;
clients

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow