use of io.jmix.uidata.entity.FilterConfiguration in project jmix by jmix-framework.
the class UiDataFilterSupport method createFilterConfigurationFragment.
@Override
public ScreenFragment createFilterConfigurationFragment(FrameOwner owner, boolean isNewConfiguration, Filter.Configuration currentConfiguration) {
FilterConfiguration configurationModel = loadFilterConfigurationModel(isNewConfiguration, currentConfiguration);
boolean defaultForMeFieldVisible = isDefaultForMeFieldVisible(currentConfiguration, configurationModel);
registerConfigurationDc(configurationModel, owner);
Fragments fragments = UiControllerUtils.getScreenContext(owner).getFragments();
UiDataFilterConfigurationModelFragment fragment = fragments.create(owner, UiDataFilterConfigurationModelFragment.class);
fragment.setDefaultForMeFieldVisible(defaultForMeFieldVisible);
return fragment;
}
use of io.jmix.uidata.entity.FilterConfiguration in project jmix by jmix-framework.
the class UiDataFilterSupport method getConfigurationsMap.
@Override
public Map<Filter.Configuration, Boolean> getConfigurationsMap(Filter filter) {
Map<Filter.Configuration, Boolean> map = new TreeMap<>();
List<FilterConfiguration> configurationModels = loadFilterConfigurationModels(filter);
for (FilterConfiguration configurationModel : configurationModels) {
Filter.Configuration configuration = filterConfigurationConverter.toConfiguration(configurationModel, filter);
map.put(configuration, configurationModel.getDefaultForAll());
}
return map;
}
use of io.jmix.uidata.entity.FilterConfiguration in project jmix by jmix-framework.
the class UiDataFilterSupport method saveCurrentFilterConfiguration.
@Override
public Filter.Configuration saveCurrentFilterConfiguration(Filter.Configuration configuration, boolean isNewConfiguration, LogicalFilterComponent rootFilterComponent, ScreenFragment configurationFragment) {
FilterConfiguration configurationModel = getFragmentFilterConfigurationModel(configuration, configurationFragment);
Filter.Configuration resultConfiguration = initFilterConfiguration(configurationModel.getConfigurationId(), configurationModel.getName(), configuration, isNewConfiguration, rootFilterComponent);
saveConfigurationModel(resultConfiguration, configurationModel);
return resultConfiguration;
}
use of io.jmix.uidata.entity.FilterConfiguration in project jmix by jmix-framework.
the class UiDataFilterSupport method createFilterConfigurationModel.
protected FilterConfiguration createFilterConfigurationModel(Filter.Configuration configuration) {
FilterConfiguration configurationModel = metadata.create(FilterConfiguration.class);
configurationModel.setConfigurationId(configuration.getId());
configurationModel.setName(configuration.getName());
configurationModel.setUsername(currentAuthentication.getUser().getUsername());
return configurationModel;
}
use of io.jmix.uidata.entity.FilterConfiguration in project jmix by jmix-framework.
the class UiDataFilterSupport method loadFilterConfigurationModel.
protected FilterConfiguration loadFilterConfigurationModel(boolean isNewConfiguration, Filter.Configuration currentConfiguration) {
FilterConfiguration configurationModel = null;
if (!isNewConfiguration) {
configurationModel = loadFilterConfigurationModel(currentConfiguration.getOwner(), currentConfiguration.getId());
}
if (configurationModel == null) {
configurationModel = metadata.create(FilterConfiguration.class);
configurationModel.setUsername(currentAuthentication.getUser().getUsername());
}
return configurationModel;
}
Aggregations