Class StatusAwareDataProvider<C extends Containerable>
java.lang.Object
org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider<T,String>
com.evolveum.midpoint.gui.impl.component.data.provider.BaseSortableDataProvider<T>
com.evolveum.midpoint.gui.impl.component.data.provider.BaseSearchDataProvider<C,PrismContainerValueWrapper<C>>
com.evolveum.midpoint.gui.impl.component.data.provider.MultivalueContainerListDataProvider<C>
com.evolveum.midpoint.gui.impl.component.data.provider.suggestion.StatusAwareDataProvider<C>
- Type Parameters:
C- type of container values this provider supplies
- All Implemented Interfaces:
ISelectableDataProvider<PrismContainerValueWrapper<C>>,IterativeExportSupport<PrismContainerValueWrapper<C>>,Serializable,org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortStateLocator<String>,org.apache.wicket.extensions.markup.html.repeater.data.table.ISortableDataProvider<PrismContainerValueWrapper<C>,,String> org.apache.wicket.markup.repeater.data.IDataProvider<PrismContainerValueWrapper<C>>,org.apache.wicket.model.IDetachable,org.apache.wicket.util.io.IClusterable
public class StatusAwareDataProvider<C extends Containerable>
extends MultivalueContainerListDataProvider<C>
Data provider that augments
MultivalueContainerListDataProvider
with awareness of StatusInfo for each wrapped value.
It maintains two caches:
tokenByWrapper– maps eachPrismContainerValueWrapperto the status token it belongs tostatusByToken– maps a token string to the correspondingStatusInfo
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.evolveum.midpoint.gui.impl.component.data.provider.BaseSortableDataProvider
BaseSortableDataProvider.CachedSize -
Field Summary
FieldsModifier and TypeFieldDescriptionCache of status information keyed by token.protected final Map<PrismContainerValueWrapper<C>,String> Cache of wrappers mapped to their status token (identity-based). -
Constructor Summary
ConstructorsConstructorDescriptionStatusAwareDataProvider(@NotNull org.apache.wicket.Component component, @NotNull org.apache.wicket.model.IModel<Search<C>> search, StatusAwareDataFactory.SuggestionsModelDto<C> suggestionsModelDto, @NotNull Class<?> resultClass, boolean sortable) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidConfigures the initial sort state for this data provider.voidvoiddetach()intprotected String@Nullable com.evolveum.midpoint.smart.api.info.StatusInfo<?>Returns the currentStatusInfofor the given value wrapper.protected voidpostProcessWrapper(@NotNull PrismContainerValueWrapper<C> vw) voidOptionally warm the cache for all rows (not just current page).Methods inherited from class com.evolveum.midpoint.gui.impl.component.data.provider.MultivalueContainerListDataProvider
getModel, getPropertyValue, handleNotSuccessOrHandledErrorInIterator, internalIterator, internalSize, matchItems, searchThroughList, sortMethods inherited from class com.evolveum.midpoint.gui.impl.component.data.provider.BaseSearchDataProvider
addQueryVariables, exportIterative, getCompiledObjectCollectionView, getCustomizeContentQuery, getQuery, getSearchModel, getType, getVariables, setCompiledObjectCollectionView, setupUserFriendlyMessage, size, supportsIterativeExportMethods inherited from class com.evolveum.midpoint.gui.impl.component.data.provider.BaseSortableDataProvider
addCachedSize, checkOrderingSettings, createObjectOrderings, createPaging, getAuditService, getAvailableData, getCachedSize, getDefaultOptionsBuilder, getDefaultSortOrder, getDefaultSortParam, getDistinctRelatedOptions, getDistinctRelatedOptionsBuilder, getModelInteractionService, getModelService, getOperationOptionsBuilder, getOperationOptionsBuilder, getPageBase, getPrismContext, getRelationRegistry, getSchemaService, getTaskManager, isDistinct, isOrderingDisabled, isSizeAvailableModel, isUseCache, iterator, model, setExportSize, setQueryMethods inherited from class org.apache.wicket.extensions.markup.html.repeater.util.SortableDataProvider
getSort, getSortState, setSort, setSortMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.wicket.markup.repeater.data.IDataProvider
iterator, model, sizeMethods inherited from interface com.evolveum.midpoint.gui.api.component.data.provider.ISelectableDataProvider
setQueryMethods inherited from interface org.apache.wicket.extensions.markup.html.repeater.data.sort.ISortStateLocator
getSortState
-
Field Details
-
statusByToken
Cache of status information keyed by token. -
tokenByWrapper
Cache of wrappers mapped to their status token (identity-based).
-
-
Constructor Details
-
StatusAwareDataProvider
public StatusAwareDataProvider(@NotNull @NotNull org.apache.wicket.Component component, @NotNull @NotNull org.apache.wicket.model.IModel<Search<C>> search, @NotNull StatusAwareDataFactory.SuggestionsModelDto<C> suggestionsModelDto, @NotNull @NotNull Class<?> resultClass, boolean sortable)
-
-
Method Details
-
postProcessWrapper
- Overrides:
postProcessWrapperin classMultivalueContainerListDataProvider<C extends Containerable>
-
getSuggestionInfo
@Nullable public @Nullable com.evolveum.midpoint.smart.api.info.StatusInfo<?> getSuggestionInfo(PrismContainerValueWrapper<C> vw) Returns the currentStatusInfofor the given value wrapper.If the wrapper is not yet cached, the
suggestionResolveris applied, and the token/status are stored. The status is then refreshed using theSmartIntegrationService, ensuring up-to-date information.- Parameters:
vw- wrapper whose suggestion status should be resolved- Returns:
- the latest
StatusInfo, ornullif none is available
-
getResourceOid
-
clearCache
public void clearCache()- Overrides:
clearCachein classMultivalueContainerListDataProvider<C extends Containerable>
-
detach
public void detach()- Specified by:
detachin interfaceorg.apache.wicket.markup.repeater.data.IDataProvider<C extends Containerable>- Specified by:
detachin interfaceorg.apache.wicket.model.IDetachable- Overrides:
detachin classBaseSearchDataProvider<C extends Containerable,PrismContainerValueWrapper<C extends Containerable>>
-
primeSuggestionCacheForAll
public void primeSuggestionCacheForAll()Optionally warm the cache for all rows (not just current page). -
getAllSelected
-
applyInitialSorting
protected void applyInitialSorting()Configures the initial sort state for this data provider.By default, no explicit sorting is applied (
setSort(null)), meaning items are presented in their natural or source-defined order.
Subclasses may override this method to define a custom default sort, for example to prioritize suggested or existing mappings:@Override protected void applyInitialSorting() { // Sort by "name" property in ascending order setSort(new SortParam<>("name", true)); }In the context of mapping tables, different item types (e.g. suggestions vs. existing mappings) may define distinct default sorting strategies.
-
getPageSuggestionCount
public int getPageSuggestionCount()
-