Start page / Template development / Template syntax / Data types / MappingMedium

MappingMedium data typeAvailable from FirstSpirit Version 4.0

Value range of the MappingMedium data type

In FirstSpirit it is possible to specify mouse-sensitive areas for a picture (also called link-sensitive graphics). The IMAGEMAP input component can be used to provide a picture with mouse-sensitive areas. The input component returns an object of the data type MappingMedium. This object can be used to generate the HTML source code for an image map.

For further information on the MappingMedium data type, see API documentation: de.espirit.firstspirit.access.editor.value.MappingMedium

For further information about the output of imagemaps see also data type Area.

Definition using the standard input components

Different input components can be defined in the form area of a page or section template. These form elements can then be used to insert the actual editorial contents into the page. The Standard input components supported by FirstSpirit return different data types.

The following standard input components return an object of data type MappingMedium :

Then, with the help of a $CMS_VALUE(...)$ instruction, methods can then be applied to this object:

$CMS_VALUE(IDENTIFIER.METHOD)$

Under IDENTIFIER, the resultname parameter, defined in the input component, must be specified.

Methods on MappingMedium objects

The table below lists all methods which can be invoked on objects of data type MappingMedium.

The object is generated by the following form objects:
CMS_INPUT_IMAGEMAP
Method name Return type Brief description Available since
equals(Object) boolean
getAltText String Stored comment in the input component 4.0
getAreas List Output of the hot-spots of an image map 4.0
getClass Class Class of the invoking object
getComment String Stored comment in the input component 4.0
getElement Referenceable Returns the element of the binary medium. 4.0.101
getElementName String Returns the element name of the binary medium. 4.1.10
getFile File Returns the file of the binary medium. 4.0.69
getFolder MediaFolder Returns the folder of the binary medium. 4.0.69
getHeight int Height of the stored medium in the input component 4.0
getImage Media Provides the medium the map bases upon. 4.0
getLanguage Language Returns the language of the binary medium. 4.0
getMedium Media Stored medium in the input component 4.0
getPicture Picture Returns the picture of the binary medium. 4.0.69
getRemoteName String Stored name of the remote project 4.0
getResolution Resolution Resolution of the stored medium 4.0
getType BinaryMedium$Type Returns the type of this binary medium. 4.0.69
getWidth int Width of the stored medium in the input component 4.0
isCase(Object) boolean
isEmpty boolean Checks whether an expression is empty 4.0
isNull boolean Checks whether an expression is null (zero)
print void
set(String, Object) Object
setAltText(String) void Sets an alt text for the medium. 4.0
setAreas(List) void Allows to define the areas mapping to links. 4.0
setComment(String) void Sets a comment. 4.0
setElementName(String) void Set the element name. 4.1.10
setFolder(MediaFolder) void Sets the folder of the binary medium. 4.0.69
setMedium(Media) void Sets the medium of the binary medium. 4.0
setRemoteName(String) void Sets a remote name for the medium 4.0
setResolution(Resolution) void Define the resolution to be used for the medium 4.0
toJSON String Convert to a JSON-compatible string representation including necessary quotes and escaping for immediate use. Handles Maps, Collections, Arrays, Numbers, Strings, Boolean, Date, and JsonElement. A date instance will be converted to an ISO-8601 formatted date string. Any object other than above will be converted using its 'toString()' value. 5.2.11
toString String
type String

equals(Object)

Method name Return type Available since
equals(Object) boolean

getAltText

The .getAltText() (in Bean syntax: .altText) method returns the value stored in the input component for the comment field.

The returned object is a character string (see java.lang.String).

Method name Return type Available since
getAltText String 4.0

getAreas

The hot-spots or active areas of a CMS_INPUT_IMAGEMAP input component can be output using the getAreas() (in Bean syntax: .areas) method.

As several hot-spots or active areas can be entered within a CMS_INPUT_IMAGEMAP input component, the instruction $CMS_FOR(...)$ is used to enable the attributes of each individual area to be output:

$CMS_FOR(AREA, st_imagemap.getAreas())

Several different methods can be applied to the AREA variable.

Method name Return type Available since
getAreas List 4.0

getClass

The .getClass() (in Bean syntax: .class) method returns the class of the invoking object (cf. java.lang.Class).

Invocation:

$CMS_VALUE(myString.class)$
$CMS_VALUE(myString.getClass())$

Output:

java.lang.String
Method name Return type Available since
getClass Class

getComment

The .getComment() (in Bean syntax: .comment) method returns the value stored in the input component for the comment field.

The returned object is a character string (see java.lang.String).

Important The method is a synonym for the method: .getAltText(). The method has been installed for compatibility reasons and may well be dropped in a subsequent version.
Method name Return type Available since
getComment String 4.0

getElement

Returns the element of the binary medium.
Method name Return type Available since
getElement Referenceable 4.0.101

getElementName

Returns the element name of the binary medium.
Method name Return type Available since
getElementName String 4.1.10

getFile

Returns the file of the binary medium.
Method name Return type Available since
getFile File 4.0.69

getFolder

Returns the folder of the binary medium.
Method name Return type Available since
getFolder MediaFolder 4.0.69

getHeight

The .getHeight() (in Bean syntax: .height) method returns the height of the medium stored in the input component (cf. Input Component IMAGEMAP).

The returned object is an integer (see java.lang.Integer).

Method name Return type Available since
getHeight int 4.0

getImage

Provides the medium the map bases upon.
Method name Return type Available since
getImage Media 4.0

getLanguage

Returns the language of the binary medium.
Method name Return type Available since
getLanguage Language 4.0

getMedium

The .getMedium() (in Bean syntax: .medium) method returns the medium selected in the input component (labelling: Reference).

The returned object is a medium (see de.espirit.firstspirit.access.store.mediastore.Media).

The medium can be used in a $CMS_REF(...)$ instruction for determination of the URL:

<a href="$CMS_REF(referenzname)$">Text</a>
Method name Return type Available since
getMedium Media 4.0

getPicture

Returns the picture of the binary medium.
Method name Return type Available since
getPicture Picture 4.0.69

getRemoteName

The .getRemoteName() (in Bean syntax: .remoteName) method returns the value stored in the input component the stored name of the remote project.

The value is stored in the input component if an element (e.g. page reference, picture, file, etc.) from a remote project was selected.

The returned object is a character string (see java.lang.String).

Method name Return type Available since
getRemoteName String 4.0

getResolution

The .getResolution() (in Bean syntax: .resolution) method returns the selected resolution of the stored medium in the input component (cf. Input Components IMAGEMAP).

The resolution can be selected when choosing the picture from the media store.

The returned object is a resolution (see de.espirit.firstspirit.access.project.Resolution).

The resolution can be used in a $CMS_REF(...)$ instruction for determination of the URL:

<img src="$CMS_REF(st_cmsImagemap.medium, res:st_cmsImagemap.resolution)$">
Method name Return type Available since
getResolution Resolution 4.0

getType

Returns the type of this binary medium.
Method name Return type Available since
getType BinaryMedium$Type 4.0.69

getWidth

The .getWidth() (in Bean syntax: .width) method returns the width of the medium stored in the input component (cf. Input Component IMAGEMAP).

The returned object is an integer (see java.lang.Integer).

Method name Return type Available since
getWidth int 4.0

isCase(Object)

Method name Return type Available since
isCase(Object) boolean

isEmpty

The .isEmpty() (in Bean syntax: .isEmpty) method checks whether an expression or object is empty, e.g. storeElement.isEmpty(). The result of the semantic check depends on the expression or object, e.g. a character string is empty if it does not contain any characters. In the case of objects with complex values or objects, the object decides when it is empty. The data type DomElement for example always contains an empty document, thus it is never null. For this reason, checking an empty DOM editor input component by using the method .isNull() returns the value false, whereas checking the component with .isEmpty() would return the value true.

The method .isEmpty() returns a Boolean value as the check result. true is the check result if the expression or object is empty and false if not.

Method name Return type Available since
isEmpty boolean 4.0

isNull

The .isNull() (in Bean syntax: .isNull) method checks whether an expression or object is null , e.g. storeElement.isNull(). In the case of objects with complex values or objects, the object decides when it is null. The data type DomElement for example always contains an empty document, thus it is never null. For this reason, checking an empty DOM editor input component by using the method .isNull() returns the value false, whereas checking the component with .isEmpty() would return the value true.

The method .isNull() returns a Boolean value as the check result. true is the check result if the expression or object is null and false if not.

Method name Return type Available since
isNull boolean

print

Method name Return type Available since
print void

set(String, Object)

Method name Return type Available since
set(String, Object) Object

setAltText(String)

Sets an alt text for the medium.
Method name Return type Available since
setAltText(String) void 4.0

setAreas(List)

Allows to define the areas mapping to links.
Method name Return type Available since
setAreas(List) void 4.0

setComment(String)

Sets a comment.
Method name Return type Available since
setComment(String) void 4.0

setElementName(String)

Set the element name.
Method name Return type Available since
setElementName(String) void 4.1.10

setFolder(MediaFolder)

Sets the folder of the binary medium.
Method name Return type Available since
setFolder(MediaFolder) void 4.0.69

setMedium(Media)

Sets the medium of the binary medium.
Method name Return type Available since
setMedium(Media) void 4.0

setRemoteName(String)

Sets a remote name for the medium
Method name Return type Available since
setRemoteName(String) void 4.0

setResolution(Resolution)

Define the resolution to be used for the medium
Method name Return type Available since
setResolution(Resolution) void 4.0

toJSON

Convert to a JSON-compatible string representation including necessary quotes and escaping for immediate use. Handles Maps, Collections, Arrays, Numbers, Strings, Boolean, Date, and JsonElement. A date instance will be converted to an ISO-8601 formatted date string. Any object other than above will be converted using its 'toString()' value.
Method name Return type Available since
toJSON String 5.2.11

toString

Method name Return type Available since
toString String

type

Method name Return type Available since
type String

© 2005 - 2024 Crownpeak Technology GmbH | All rights reserved. | FirstSpirit 2024.13 | Data privacy