The sort function for report templates. The context name of this class is "sorter". Use $sorter to access public functions of this class through templates.
Name
Type
Description
Parameter(s)
collection
java.util.Collection
A collection to be sorted
fieldName
java.lang.String
A fieldName to be sorted and the sort direction.
Return
-
java.util.Collection
A sorted collection.
For example:
Code Block
language
text
#foreach ($rel in $sorter.sort($package, "name"))
$rel.name
#end
$package is the collection to be sorted.
"name:desc" is separated by ":" in two parts:
The first part is to identify fieldName to be sorted.
The second part is the option to identify the sorting direction. Sometimes, the direction is not identified. It is ascending by default.
The sort function for report templates. This function allows case-sensitive sorting.
Name
Type
Description
Parameter(s)
collection
java.util.Collection
A collection to be sorted.
fieldName
java.lang.String
A fieldName to be sorted and the sort direction.
isCaseInsensitive
boolean
True if case-insensitive sorting.
Return
-
java.util.Collection
A sorted collection.
$sorter.sort(collection)
This is the sort function for report templates. The context name of this class is "sorter". Use $sorter to access public functions of this class through the templates.
Name
Type
Description
Parameter(s)
collection
java.util.Collection
A collection to be sorted.
Return
-
java.util.Collection
A sorted collection.
For example:
Code Block
language
text
#foreach ($rel in $sorter.sort($package))
$rel.name
#end
$package is a collection to be sorted.
Tip
The collection will be sorted by name, in ascending order, by default.
This sort function allows specifying more than one field name to be sorted. The priority of fields is ranked by the sequence in the fieldNameCollection parameter.
Name
Type
Description
Parameter(s)
collection
java.util.Collection
A collection to be sorted.
fieldNameCollection
java.util.Collection
A collection of field names, sorted by the priority of field name order in the collection.
direction
java.lang.String
Sorting direction. It is either "asc" or "desc". If this field is not entered, "asc" is used by default.
Return
-
java.util.Collection
A sorted collection.
For example:
Code Block
language
text
#foreach ($p in $sorter.sort($Package, ["version", "name"], "desc"))
$p.name
#end
This sort function allows specifying more than one field name to be sorted. The priority of fields is ranked by the sequence in the fieldNameCollection parameter. This function allows case-sensitive sorting.
Name
Type
Description
Parameter(s)
collection
java.util.Collection
A collection to be sorted.
fieldName
java.lang.String
A fieldName to be sorted and the sort direction.
direction
java.lang.String
Sorting direction. It is either "asc" or "desc". If this field is not entered, "asc" is used by default.
isCaseInsensitive
boolean
True if case-insensitive sorting.
Return
-
java.util.Collection
A sorted collection.
$sorter.sortByFirstNumber(collection, fieldName)
The sortByFirstNumber function is for report templates. The context name of this class is "sorter". Use $sorter to access public functions of this class through templates.
Name
Type
Description
Parameter(s)
collection
java.util.Collection
A collection to be sorted.
fieldName
java.lang.String
A fieldName to be sorted and the sorting direction.
Return
-
java.util.Collection
A sorted collection.
For example:
Code Block
language
text
#foreach ($rel in $sorter.sortByFirstNumber($package, "name:desc"))
$rel.name
#end
$package is a collection to be sorted by FirstNumber.
"name:desc" is separated by ":" in two parts:
The first part is to identify fieldName to be sorted.
The second part is the option to identify the sorting direction. Sometimes, the direction is not identified. It is ascending by default.
$sorter.sortByFirstNumber(collection)
The sortByFirstNumber function for report templates. The context name of this class is "sorter". Use $sorter to access public functions of this class through templates.
Name
Type
Description
Parameter(s)
collection
java.util.Collection
A collection to be sorted.
Return
-
java.util.Collection
A sorted collection.
For example:
Code Block
language
text
#foreach ($rel in $sorter.sortByFirstNumber($package))
$rel.name
#end
$package is a collection to be sorted by FirstNumber.
$sorter.sortByLocale(collection, String)
This is a function to sort for report templates. The context name of this class is "sorter". Use $sorter to access public functions of this class through templates. To sort a given collection by a particular language, identify the country code to specify the language.
Name
Type
Description
Parameter(s)
collection
java.util.Collection
A collection to be sorted.
countryCode
java.lang.String
The country code to specify a language to perform sorting.
Return
-
java.util.Collection
A sorted collection.
For example:
Code Block
language
text
#foreach ($p in $sorter.sortByLocale($package, "DE"))
$p.name
#end
$package is a collection to be sorted by country code.
"DE" is the country code for GERMANY (ISO country code).
Tip
This method sorts a collection by “name” attribute of each element by default.
$sorter.sortByLocale(collection, String, String)
This is a function to sort for report templates. The context name of this class is "sorter". Use $sorter to access public functions of this class through templates. To sort a given collection by a particular language, specify the language by identifying the country code and field name.
Name
Type
Description
Parameter(s)
collection
java.util.Collection
A collection to be sorted.
fieldName
java.lang.String
A fieldName to b 0e sorted.
countryCode
java.lang.String
The country code to specify a language to perform sorting.
Return
-
java.util.Collection
A sorted collection.
For example:
Code Block
language
text
#foreach ($p in $sorter.sortByLocale($package, "name", "DE"))
$p.name
#end
$package is the collection to be sorted.
“name” is the field name to be sorted.
"DE" is the country code for GERMANY (ISO country code).
$sorter.humanSort(collection, fieldName)
This is a special function to sort text in a human-like order. It splits text into numeric and non-numeric chunks and sorts them in numerical order. For example, "foo10" is ordered after "foo2".
Name
Type
Description
Parameter(s)
collection
java.util.Collection
A collection to be sorted.
fieldName
java.lang.String
A fieldName to be sorted and the sorting direction.
Return
-
java.util.Collection
A sorted collection.
For example:
Code Block
language
text
#foreach ($rel in $sorter.humanSort($package, "name:desc"))
$rel.name
#end
$package is the collection to be sorted.
"name:desc" is separated by ":" in two parts:
The first part is to identify fieldName to be sorted.
The second part is the option to identify the sorting scheme. Sometimes, the order is not identified. It is ascending by default.
This is a special function to sort text in a human-like order. It splits text into numeric and non-numeric chunks and sorts them in numerical order. For example, "foo10" is ordered after "foo2". This function allows case-sensitive sorting.
Name
Type
Description
Parameter(s)
collection
java.util.Collection
A collection to be sorted.
fieldName
java.lang.String
A fieldName to be sorted and the sorting direction.
isCaseInsensitive
boolean
True if case-insensitive sorting.
Return
-
java.util.Collection
A sorted collection.
$sorter.humanSort(collection)
This is a special function to sort text in a human-like order. It splits text into numeric and non-numeric chunks and sorts them in numerical order. For example, "foo10" is ordered after "foo2".
Name
Type
Description
Parameter(s)
collection
java.util.Collection
A collection to be sorted.
Return
-
java.util.Collection
A sorted collection.
For example:
Code Block
language
text
#foreach ($rel in $sorter.humanSort($package))
$rel.name
#end
This humanSort function allows specifying more than one field name to be sorted. The priority of fields is ranked by the sequence in the fieldNameCollection parameter.
Name
Type
Description
Parameter(s)
collection
java.util.Collection
A collection to be sorted.
fieldNameCollection
java.util.Collection
A collection of field names, sorted by the priority of field name order in the collection.
direction
java.lang.String
Sorting direction. It is either "asc" or "desc". If this field is not entered, "asc" is used by default.
Return
-
java.util.Collection
A sorted collection.
For example:
Code Block
language
text
#foreach ($p in $sorter.humanSort($Package, ["version", "name"], "desc"))
$p.name
#end
This humanSort function allows specifying more than one field name to be sorted. The priority of fields is ranked by the sequence in the fieldNameCollection parameter. This function allows case-sensitive sorting.
Name
Type
Description
Parameter(s)
collection
java.util.Collection
A collection to be sorted.
fieldName
java.lang.String
A fieldName to be sorted and the sorting direction.
direction
java.lang.String
Sorting direction. It is either "asc" or "desc". If this field is not entered, "asc" is used by default.
isCaseInsensitive
boolean
True if case-insensitive sorting.
Return
-
java.util.Collection
A sorted collection.
$sorter.containmentTreeSort(collection)
This function is for sorting elements that match the Containment tree order.
This function is for sorting a collection item by specifying an applied stereotype name and tag name and forcing a tag value to convert to a numeric before sorting.
Name
Type
Description
Parameter(s)
collection
java.util.Collection
A collection to be sorted.
stereotypeName
java.lang.String
An applied stereotype name.
tagName
java.lang.String
A tag name of the applied stereotype and the sorting direction.
forceNumber
boolean
True if a tag value is converted to a numeric before sorting.
This function is for sorting a collection item by specifying an applied stereotype object and tag name and forcing a tag value to convert to a numeric before sorting.