Daisy Open Source CMS

org.outerj.daisy.repository.schema
Interface SelectionList

All Known Subinterfaces:
HierarchicalQuerySelectionList, LinkQuerySelectionList, ParentLinkedSelectionList, QuerySelectionList, StaticSelectionList

public interface SelectionList

A list of values from which one can be selected by the end-user.

This SelectionList consists of ListItems.

Important for implementations: the equals method should be implemented. Two selection lists are considered equal if their defining data is equals (e.g. in case of a query-based selection list, this means e.g. the queries are the same, not the actual list-items generated from them).


Method Summary
 void addToFieldTypeXml(org.outerx.daisy.x10.SelectionListDocument.SelectionList selectionListXml)
           
 String getItemLabel(Object value, Locale locale)
          Returns the label defined in the selection list for the given value, or null if not available.
 List<? extends ListItem> getItems()
          Gets the selection list items.
 List<? extends ListItem> getItems(long branchId, long languageId, Locale locale)
          Gets the selection list items.
 String getLabel(Object value, Locale locale)
          Deprecated. use getItemLabel(java.lang.Object, java.util.Locale) instead.
 

Method Detail

getItems

List<? extends ListItem> getItems()
Gets the selection list items.

By preference, you should use the method getItems(long, long, java.util.Locale). This method will fail if the selection list implementation requires a branch and language.


getItems

List<? extends ListItem> getItems(long branchId,
                                  long languageId,
                                  Locale locale)
Gets the selection list items.

Some selection list implementations might want to filter the items based on the branch and language of the context in which this selection list is used (= typically the document that is being edited). Therefore, it is important that the branch and language or specified.

Parameters:
branchId - the branch of the document that is being edited
languageId - the language of the document that is being edited

getLabel

String getLabel(Object value,
                Locale locale)
Deprecated. use getItemLabel(java.lang.Object, java.util.Locale) instead.


getItemLabel

String getItemLabel(Object value,
                    Locale locale)
Returns the label defined in the selection list for the given value, or null if not available.


addToFieldTypeXml

void addToFieldTypeXml(org.outerx.daisy.x10.SelectionListDocument.SelectionList selectionListXml)

Daisy Open Source CMS