close

Filter

loading table of contents...

Site Manager Developer Manual / Version 2307

Table Of Contents

5.1.8 Comparator Classes

<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

GenericDocumentTypeComparator

Document types:

hox.corem.editor.proxy.DocumentTypeModel

The default comparator sorts the document types in alphabetic order. Own comparators must implement the interface java.util.Comparator

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:

  1. Published and deleted

  2. Published and moved

  3. Published and removed

  4. New and marked for deletion

  5. Moved out of trash

  6. New

  7. All others, if equal document type

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

GenericTreeComparator

Folders:

hox.corem.editor.proxy.ResourceHolder

The default comparator sorts the folders in alphabetic order. Own comparators must implement java.util.Comparator.

Table 5.30. Comparators for sorting folders


Comparators for sorting workflows

Default comparator

Sorted objects

Description

GenericProcessComparator

Workflows:

com.coremedia.workflow.WfProcess

The default comparator sorts the workflows in alphabetic order. Own comparators must implement java.util.Comparator

Table 5.31. Comparators for sorting workflows


Search Results

Table Of Contents
warning

Your Internet Explorer is no longer supported.

Please use Mozilla Firefox, Google Chrome, or Microsoft Edge.