use of de.symeda.sormas.api.importexport.ExportPropertyMetaInfo in project SORMAS-Project by hzi-braunschweig.
the class ExportConfigurationsGrid method buildButtonLayout.
private HorizontalLayout buildButtonLayout(ExportConfigurationDto config, List<ExportPropertyMetaInfo> availableProperties, boolean canEditOrDelete) {
HorizontalLayout layout = new HorizontalLayout();
layout.setSpacing(true);
Button btnExport;
btnExport = ButtonHelper.createIconButtonWithCaption(config.getUuid() + "-download", null, VaadinIcons.DOWNLOAD, e -> {
if (config.getUuid() != null) {
exportCallback.accept(config);
}
}, ValoTheme.BUTTON_PRIMARY);
layout.addComponent(btnExport);
Button btnEdit = ButtonHelper.createIconButtonWithCaption(config.getUuid() + "-edit", null, VaadinIcons.EDIT, e -> {
if (config.getUuid() != null) {
ControllerProvider.getCustomExportController().openEditExportConfigurationWindow(this, config, availableProperties, I18nProperties.getCaption(Captions.exportEditExportConfiguration));
}
});
btnEdit.setEnabled(canEditOrDelete);
layout.addComponent(btnEdit);
Button btnDelete = ButtonHelper.createIconButtonWithCaption(config.getUuid() + "-delete", null, VaadinIcons.TRASH, e -> {
if (config.getUuid() != null) {
FacadeProvider.getExportFacade().deleteExportConfiguration(config.getUuid());
new Notification(null, I18nProperties.getString(Strings.messageExportConfigurationDeleted), Type.WARNING_MESSAGE, false).show(Page.getCurrent());
reload(false);
}
});
btnDelete.setEnabled(canEditOrDelete);
layout.addComponent(btnDelete);
return layout;
}
use of de.symeda.sormas.api.importexport.ExportPropertyMetaInfo in project SORMAS-Project by hzi-braunschweig.
the class ExportConfigurationEditLayout method buildCheckBoxGroups.
private int buildCheckBoxGroups(List<ExportPropertyMetaInfo> exportExportProperties) {
checkBoxGroups = new HashMap<>();
checkBoxes = new HashMap<>();
int checkBoxCount = 0;
for (ExportPropertyMetaInfo meta : exportExportProperties) {
ExportGroupType groupType = meta.getExportGroupType();
String property = meta.getPropertyId();
if (!checkBoxGroups.containsKey(groupType)) {
checkBoxGroups.put(groupType, new ArrayList<>());
}
String caption = meta.getCaption();
CheckBox cb = new CheckBox(caption);
if (!CollectionUtils.isEmpty(exportConfiguration.getProperties())) {
cb.setValue(exportConfiguration.getProperties().contains(property));
}
checkBoxGroups.get(groupType).add(cb);
checkBoxes.put(cb, property);
checkBoxCount++;
}
return checkBoxCount;
}
use of de.symeda.sormas.api.importexport.ExportPropertyMetaInfo in project SORMAS-Project by hzi-braunschweig.
the class CasesView method buildDetailedExportConfiguration.
private ExportConfigurationDto buildDetailedExportConfiguration() {
ExportConfigurationDto config = ExportConfigurationDto.build(UserProvider.getCurrent().getUserReference(), ExportType.CASE);
config.setProperties(ImportExportUtils.getCaseExportProperties(CaseDownloadUtil::getPropertyCaption, caseFollowUpEnabled, hasClinicalCourseRight, hasTherapyRight, FacadeProvider.getConfigFacade().getCountryLocale()).stream().map(ExportPropertyMetaInfo::getPropertyId).collect(Collectors.toSet()));
return config;
}
use of de.symeda.sormas.api.importexport.ExportPropertyMetaInfo in project SORMAS-Project by hzi-braunschweig.
the class EventsView method buildDetailedExportConfiguration.
private ExportConfigurationDto buildDetailedExportConfiguration() {
ExportConfigurationDto config = ExportConfigurationDto.build(UserProvider.getCurrent().getUserReference(), null);
boolean eventGroupFeatureEnabled = FacadeProvider.getFeatureConfigurationFacade().isFeatureEnabled(FeatureType.EVENT_GROUPS);
config.setProperties(ImportExportUtils.getEventExportProperties(EventDownloadUtil::getPropertyCaption, eventGroupFeatureEnabled, FacadeProvider.getConfigFacade().getCountryLocale()).stream().map(ExportPropertyMetaInfo::getPropertyId).collect(Collectors.toSet()));
return config;
}
Aggregations