Provides functions to manage the data using properties from af:suggestionsSection
The data is stored in browser's localStorage. The data is organised using a frecency
algorithm (AdfInputSearchScoreUtils)
Method Summary |
public static Object |
add(AdfUIComponent inputSearch, Array newValues, Object suggestionMap)
Invoked on selection of a new suggestion item.
|
private static Object |
_capPreferredSuggestions(Object preferredSuggestionsList, Object displayCount)
Returns the first X suggestion items
|
private static Object |
_findIndex(Object preferredSuggestionsList, Object value)
Returns the index of the suggestion item whose 'key' property matches the 'value' passed
|
public static Object |
get(Object inputSearch)
Reads the suggestions from localStorage and returns the suggestions list
|
private static Object |
_getCacheableSuggestionData(Object suggestionsSection, Object suggestionItem)
|
private static Object |
_getCacheKey(Object inputSearch, Object suggestionsSection)
Returns the REST URL post normalization and as modified by cacheKeyGenerator attribute
|
protected static Object |
InitClass()
|
public static Object |
isDisplayAttributesCacheable(Object inputSearch)
Returns true if the displayAttributes isn't part of dontCache
|
private static Object |
_isSuggestionsTooLess(Object inputSearch, Object totalSuggestionsCount, Object preferredSuggestionsLength)
Determines if the master list length is too small to display the preferred suggestions
|
private static Object |
_read(String storageKey, Number limit, AdfSuggestionMap suggestions)
Looksup the localStorage against the storageKey passed and returns the stored suggestion object.
|
private static Object |
_substituteDontCacheAttributes(AdfRichSuggestionsSection suggestionsSection, Array preferredSuggestionsList)
The dontCache attributes, when needs to be displayed in the UI, should be shown as marker text
represented by AdfPreferredSuggestionsManager._DONT_CACHE_REPLACEMENT_STR.
|
public static Object |
update(AdfUIComponent inputSearch, Boolean isMasterList, AdfSuggestionMap suggestions)
Update the suggestions stored in localStorage on REST call completion
|