use of de.metas.ui.web.document.filter.provider.DocumentFilterDescriptorsProvider in project metasfresh-webui-api by metasfresh.
the class MaterialCockpitViewFactory method createView.
@Override
public IView createView(@NonNull final CreateViewRequest request) {
assertWindowIdOfRequestIsCorrect(request);
final DocumentFilterDescriptorsProvider filterDescriptors = materialCockpitFilters.getFilterDescriptors();
final DocumentFilterList requestFilters = materialCockpitFilters.extractDocumentFilters(request);
final DocumentFilterList filtersToUse = request.isUseAutoFilters() ? materialCockpitFilters.createAutoFilters() : requestFilters;
final MaterialCockpitView view = MaterialCockpitView.builder().viewId(request.getViewId()).description(TranslatableStrings.empty()).filters(filtersToUse).filterDescriptors(filterDescriptors).rowsData(materialCockpitRowRepository.createRowsData(filtersToUse)).relatedProcessDescriptor(createProcessDescriptor(MD_Cockpit_DocumentDetail_Display.class)).relatedProcessDescriptor(createProcessDescriptor(MD_Cockpit_PricingConditions.class)).relatedProcessDescriptor(createProcessDescriptor(MD_Cockpit_ShowStockDetails.class)).build();
return view;
}
use of de.metas.ui.web.document.filter.provider.DocumentFilterDescriptorsProvider in project metasfresh-webui-api by metasfresh.
the class SqlViewBindingFactory method createViewBinding.
private SqlViewBinding createViewBinding(@NonNull final SqlViewBindingKey key) {
final WindowId windowId = key.getWindowId();
final DocumentEntityDescriptor entityDescriptor = documentDescriptorFactory.getDocumentEntityDescriptor(windowId);
final Set<String> displayFieldNames = entityDescriptor.getFieldNamesWithCharacteristic(key.getRequiredFieldCharacteristic());
final SqlDocumentEntityDataBindingDescriptor entityBinding = SqlDocumentEntityDataBindingDescriptor.cast(entityDescriptor.getDataBinding());
final DocumentFilterDescriptorsProvider filterDescriptors = entityDescriptor.getFilterDescriptors();
final SqlViewBinding.Builder builder = createBuilderForEntityBindingAndFieldNames(entityBinding, displayFieldNames).filterDescriptors(filterDescriptors).refreshViewOnChangeEvents(entityDescriptor.isRefreshViewOnChangeEvents()).viewInvalidationAdvisor(getViewInvalidationAdvisor(windowId));
if (windowId2SqlDocumentFilterConverterDecorator.containsKey(windowId)) {
builder.filterConverterDecorator(windowId2SqlDocumentFilterConverterDecorator.get(windowId));
}
final SqlViewCustomizer sqlViewCustomizer = viewCustomizers.getOrNull(windowId, key.getProfileId());
if (sqlViewCustomizer != null) {
final ViewRowCustomizer rowCustomizer = sqlViewCustomizer;
builder.rowCustomizer(rowCustomizer);
sqlViewCustomizer.customizeSqlViewBinding(builder);
}
return builder.build();
}
Aggregations