Start page
Start page

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

Table data type

Value range of the Table data type

In FirstSpirit it is possible to enter data in tabular form. Such data is usually stored structured in XML markup language. This is necessary as (in addition to the rows and cells) several contents must contain special markups, highlighting and information for specific parts.

In order to be able to output or further process the contents stored in this way, these input components return an object of the data type Table .

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 Table :

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 Table objects

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

The object is generated by the following form objects:
CMS_INPUT_DOMTABLE
Method name Return type Brief description Available since
addColumn(int) void
addRow(int) void
compareTo(Comparable) int
deleteColumn(int) void
deleteRow(int) void
diff(Element) Element
equals(Object) boolean
getCell(int, int) TableCell
getClass Class Class of the invoking object
getColumns int Number of columns in a table
getDom Element
getRows int Number of rows in a table
isCase(Object) boolean
isEmpty boolean Checks whether an expression is empty
isNull boolean Checks whether an expression is null (zero)
print void
replace(Table) void
set(String, Object) Object
toJson String Convert to JSON string representtion (only handles Maps, Collections, Arrays, Numbers, and Strings) 4.2.14
toString String
type String

addColumn(int)

Method name Return type Available since
addColumn(int) void

addRow(int)

Method name Return type Available since
addRow(int) void

compareTo(Comparable)

Method name Return type Available since
compareTo(Comparable) int

deleteColumn(int)

Method name Return type Available since
deleteColumn(int) void

deleteRow(int)

Method name Return type Available since
deleteRow(int) void

diff(Element)

Method name Return type Available since
diff(Element) Element

equals(Object)

Method name Return type Available since
equals(Object) boolean

getCell(int, int)

Method name Return type Available since
getCell(int, int) TableCell

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

getColumns

The .getColumns() (in Bean syntax: .columns) method returns the number of columns in a table.

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

Method name Return type Available since
getColumns int

getDom

Method name Return type Available since
getDom Element

getRows

The .getRows() (in Bean syntax: .rows) method returns the number of rows in a table.

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

Method name Return type Available since
getRows int

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

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

replace(Table)

Method name Return type Available since
replace(Table) void

set(String, Object)

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

toJson

Convert to JSON string representtion (only handles Maps, Collections, Arrays, Numbers, and Strings)
Method name Return type Available since
toJson String 4.2.14

toString

Method name Return type Available since
toString String

type

Method name Return type Available since
type String

© 2005 - 2015 e-Spirit AG | All rights reserved. | Last change: 2013-12-09