use of de.metas.ui.web.document.filter.DocumentFilterDescriptor in project metasfresh-webui-api by metasfresh.
the class SqlViewFactory method createViewLayout.
private ViewLayout createViewLayout(final SqlViewBindingKey sqlViewBindingKey, final JSONViewDataType viewDataType) {
final ViewLayout viewLayoutOrig = documentDescriptorFactory.getDocumentDescriptor(sqlViewBindingKey.getWindowId()).getViewLayout(viewDataType);
final SqlViewBinding sqlViewBinding = getViewBinding(sqlViewBindingKey);
final Collection<DocumentFilterDescriptor> filters = sqlViewBinding.getViewFilterDescriptors().getAll();
final boolean hasTreeSupport = sqlViewBinding.hasGroupingFields();
final ViewLayout.ChangeBuilder viewLayoutBuilder = viewLayoutOrig.toBuilder().profileId(sqlViewBindingKey.getProfileId()).filters(filters).treeSupport(hasTreeSupport, true, /* treeCollapsible */
ViewLayout.TreeExpandedDepth_AllCollapsed);
final SqlViewCustomizer sqlViewCustomizer = getSqlViewCustomizer(sqlViewBindingKey.getWindowId(), sqlViewBindingKey.getProfileId());
if (sqlViewCustomizer != null) {
sqlViewCustomizer.customizeViewLayout(viewLayoutBuilder);
}
return viewLayoutBuilder.build();
}
use of de.metas.ui.web.document.filter.DocumentFilterDescriptor in project metasfresh-webui-api by metasfresh.
the class JSONDocumentFilter method unwrap.
public static final DocumentFilter unwrap(final JSONDocumentFilter jsonFilter, final DocumentFilterDescriptorsProvider filterDescriptorProvider) {
final String filterId = jsonFilter.getFilterId();
final DocumentFilterDescriptor filterDescriptor = filterDescriptorProvider.getByFilterIdOrNull(filterId);
// Ad-hoc filters (e.g. zoom references)
if (filterDescriptor == null) {
return unwrapAsGenericFilter(jsonFilter);
} else // Filter with descriptor
{
return unwrapUsingDescriptor(jsonFilter, filterDescriptor);
}
}
use of de.metas.ui.web.document.filter.DocumentFilterDescriptor in project metasfresh-webui-api by metasfresh.
the class HUEditorViewFactoryTemplate method createFilterDescriptorsProvider.
@OverridingMethodsMustInvokeSuper
protected DocumentFilterDescriptorsProvider createFilterDescriptorsProvider() {
final DocumentEntityDescriptor huEntityDescriptor = getHUEntityDescriptor();
final Collection<DocumentFilterDescriptor> huStandardFilters = huEntityDescriptor.getFilterDescriptors().getAll();
return ImmutableDocumentFilterDescriptorsProvider.builder().addDescriptors(huStandardFilters).addDescriptor(HUBarcodeSqlDocumentFilterConverter.createDocumentFilterDescriptor()).build();
}
use of de.metas.ui.web.document.filter.DocumentFilterDescriptor in project metasfresh-webui-api by metasfresh.
the class SqlViewFactory method createAutoFilters.
private List<DocumentFilter> createAutoFilters(final SqlViewBindingKey sqlViewBindingKey) {
final SqlViewBinding sqlViewBinding = getViewBinding(sqlViewBindingKey);
final Collection<DocumentFilterDescriptor> filters = sqlViewBinding.getViewFilterDescriptors().getAll();
return filters.stream().filter(DocumentFilterDescriptor::isAutoFilter).map(SqlViewFactory::createAutoFilter).collect(ImmutableList.toImmutableList());
}
Aggregations