Child pages
  • JSMedia

Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
{div:style=display:none} DO NOT EDIT THE CONTENT OF THIS PAGE DIRECTLY (EXCEPT INSIDE THE DIV BELOW WITH ID=DESCRIPTION), UNLESS YOU KNOW WHAT YOU'RE DOING. THE STRUCTURE OF THE CONTENT IS VITAL IN BEING ABLE TO AUTO UPDATE THE CONTENT THROUGH THE DOC GENERATOR{div} {div:id=description}{div}\\ {table:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{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:id=|class=servoy sSummary}{colgroup}{column:width=80px|padding=0px}{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}{tbody}{tr}{td}[UUID]{td}{td}[#getUUID]\() Returns the UUID of this media{td}{tr}{tbody}{table}\\ {table:id=property|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Property Details{th}{tr}{tbody:id=bytes}{tr:id=name}{td}h6.bytes{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}byte[]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=mimeType}{tr:id=name}{td}h6.mimeType{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}\\ {table:id=function|class=servoy sDetail}{colgroup}{column:width=100%|padding=0px}{column}{colgroup}{tr:style=height: 30px;}{th:colspan=1}Method Details{th}{tr}{tbody:id=getName}{tr:id=name}{td}h6.getName{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[String]{span}{span:style=font-weight: bold;}getName{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[String] -- A String holding the name of this Media object.{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{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}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{tbody:id=getUUID}{tr:id=name}{td}h6.getUUID{td}{tr}{tr:id=sig}{td}{span:style=margin-right: 5px;}[UUID]{span}{span:style=font-weight: bold;}getUUID{span}{span}\(){span}{td}{tr}{tr:id=ret}{td}*Returns*\\{div:class=sIndent}[UUID]{div}{td}{tr}{tr:id=sam}{td}*Sample*\\{div:class=sIndent}{code:language=javascript} var ballImg = plugins.file.readFile('d:/ball.jpg'); application.output(ballImg.getUUID().toString()); {code}{div}{td}{tr}{tr:class=lastDetailRow}{td}{td}{tr}{tbody}{table}
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.
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.
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.
ret

Returns

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

Supported Clients

sIndentSmartClient,WebClient,NGClient
sam

Sample

sIdentjavascript
lastDetailRow
getUUIDname

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