Search in sources :

Example 6 with DocumentFilterDescriptorsProvider

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;
}
Also used : MD_Cockpit_PricingConditions(de.metas.ui.web.material.cockpit.process.MD_Cockpit_PricingConditions) DocumentFilterList(de.metas.ui.web.document.filter.DocumentFilterList) DocumentFilterDescriptorsProvider(de.metas.ui.web.document.filter.provider.DocumentFilterDescriptorsProvider)

Example 7 with DocumentFilterDescriptorsProvider

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();
}
Also used : SqlViewCustomizer(de.metas.ui.web.view.SqlViewCustomizer) WindowId(de.metas.ui.web.window.datatypes.WindowId) ViewRowCustomizer(de.metas.ui.web.view.ViewRowCustomizer) SqlDocumentEntityDataBindingDescriptor(de.metas.ui.web.window.descriptor.sql.SqlDocumentEntityDataBindingDescriptor) DocumentEntityDescriptor(de.metas.ui.web.window.descriptor.DocumentEntityDescriptor) DocumentFilterDescriptorsProvider(de.metas.ui.web.document.filter.provider.DocumentFilterDescriptorsProvider)

Aggregations

DocumentFilterDescriptorsProvider (de.metas.ui.web.document.filter.provider.DocumentFilterDescriptorsProvider)7 DocumentFilterList (de.metas.ui.web.document.filter.DocumentFilterList)4 ViewId (de.metas.ui.web.view.ViewId)3 ImmutableList (com.google.common.collect.ImmutableList)2 WindowId (de.metas.ui.web.window.datatypes.WindowId)2 DocumentEntityDescriptor (de.metas.ui.web.window.descriptor.DocumentEntityDescriptor)2 ImmutableListMultimap (com.google.common.collect.ImmutableListMultimap)1 ImmutableMap (com.google.common.collect.ImmutableMap)1 ImmutableSet (com.google.common.collect.ImmutableSet)1 CCache (de.metas.cache.CCache)1 HuId (de.metas.handlingunits.HuId)1 IHandlingUnitsBL (de.metas.handlingunits.IHandlingUnitsBL)1 IHandlingUnitsDAO (de.metas.handlingunits.IHandlingUnitsDAO)1 HUAttributeConstants (de.metas.handlingunits.attribute.HUAttributeConstants)1 I_M_HU (de.metas.handlingunits.model.I_M_HU)1 HUReservationService (de.metas.handlingunits.reservation.HUReservationService)1 IMsgBL (de.metas.i18n.IMsgBL)1 ITranslatableString (de.metas.i18n.ITranslatableString)1 LogManager (de.metas.logging.LogManager)1 PickingSlotQuery (de.metas.picking.api.PickingSlotQuery)1