Site Manager Developer Manual / Version 2310
Table Of Contents<Editor> <DocumentTypes> <Comparator class= "hox.corem.editor.generic.GenericDocumentTypeComparator"/> . . </DocumentTypes> . <Explorer name="FirstExplorer"> <TreeSorter> <Comparator class="my.comparator"/> </TreeSorter> </Explorer> </Editor>
Example 5.10. Example for the use of a Comparator
A comparator is used for sorting objects. There are different comparators for sorting different object types:
Document types shown in the File|New resource menu in the Site Manager.
Columns
Folders shown in the folder view of the Site Manager.
Workflows shown in the File|New workflow menu in the Site Manager.
Comparators for sorting document types
Default comparator |
Sorted objects |
Description |
---|---|---|
Document types: |
The default comparator sorts the document types in alphabetic order. Own comparators must implement
the interface |
Table 5.27. Comparators for document types
Server side comparators for sorting rows
For rows, there exists no default comparator. A row can be sorted according to the different columns which are shown. Own comparators must implement hox.corem.editor.toolkit.table.NamedDocumentVersionComparator. The following table shows the predefined column comparators which are implicitly used by the provided column classes.
Comparator |
Sort order |
---|---|
BlobComparator |
Size of file, if equal the MIME type. |
BooleanComparator |
True > false |
DateComparator |
Chronological |
DocumentVersionComparator |
Version |
IdComparator |
Numeric |
IntegerComparator |
Numeric |
LinkListComparator |
Document type in alphabetic order, if equal the number of list entries. |
NameComparator |
Alphabetical |
DocumentPathComparator |
Alphabetical |
ResourceDisplacementComparator |
Sort order:
|
StringComparator |
Alphabetical |
DocumentTypeComparator |
Alphabetical |
Table 5.28. Server-side comparators for sorting rows
Client side comparators for sorting rows
For rows, there exists no default comparator. A row can be sorted according to the different columns which are shown. Own comparators must implement hox.corem.editor.toolkit.table.NamedDocumentVersionComparator. Client side comparators get objects of types hox.corem.editor.proxy.DocumentVersionHolder. The following table shows the predefined column comparators which can be used on the client side.
Comparator |
Sort order |
---|---|
NameComparator |
Alphabetical |
NullComparator |
Alphabetical |
StringComparator |
Alphabetical |
TypeComparator |
Alphabetical |
Table 5.29. Client-side comparators for sorting rows
Comparators for sorting folders
Default comparator |
Sorted objects |
Description |
---|---|---|
Folders: |
The default comparator sorts the folders in alphabetic order. Own comparators must implement
|
Table 5.30. Comparators for sorting folders
Comparators for sorting workflows
Default comparator |
Sorted objects |
Description |
---|---|---|
Workflows: |
The default comparator sorts the workflows in alphabetic order. Own comparators must implement
|
Table 5.31. Comparators for sorting workflows