use of io.jmix.emailtemplates.dto.ReportWithParams in project jmix by jmix-framework.
the class EmailTemplateParametersFragment method collectParameters.
public List<ReportWithParams> collectParameters() {
List<ReportWithParams> reportDataList = new ArrayList<>();
for (ReportWithParamField fieldValue : parameterComponents) {
ReportWithParams reportData = new ReportWithParams(fieldValue.getReport());
for (String paramName : fieldValue.getFields().keySet()) {
Field parameterField = fieldValue.getFields().get(paramName);
Object value = parameterField.getValue();
reportData.put(paramName, value);
}
reportDataList.add(reportData);
}
return reportDataList;
}
use of io.jmix.emailtemplates.dto.ReportWithParams in project jmix by jmix-framework.
the class EmailTemplateBuilderImpl method setAttachmentParameters.
@Override
public EmailTemplateBuilder setAttachmentParameters(Collection<ReportWithParams> reportsWithParams) {
TemplateReport emailBodyReport = emailTemplate.getEmailBodyReport();
ReportWithParams reportWithParams = reportParams.stream().filter(e -> e.getReport().equals(emailBodyReport.getReport())).findFirst().orElse(null);
reportParams.clear();
if (reportWithParams != null) {
reportParams.add(reportWithParams);
}
reportParams.addAll(reportsWithParams);
return this;
}
use of io.jmix.emailtemplates.dto.ReportWithParams in project jmix by jmix-framework.
the class EmailTemplateBuilderImpl method setAttachmentParameters.
@Override
public EmailTemplateBuilder setAttachmentParameters(Report report, Map<String, Object> params) {
ReportWithParams reportWithParams = new ReportWithParams(report);
reportWithParams.setParams(params);
setAttachmentParameters(reportWithParams);
return this;
}
use of io.jmix.emailtemplates.dto.ReportWithParams in project jmix by jmix-framework.
the class EmailTemplateBuilderImpl method setAttachmentParameter.
@Override
public EmailTemplateBuilder setAttachmentParameter(Report report, String key, Object value) {
ReportWithParams reportWithParams = reportParams.stream().filter(e -> e.getReport().equals(report)).findFirst().orElse(null);
if (reportWithParams == null) {
reportWithParams = new ReportWithParams(report);
reportParams.add(reportWithParams);
}
reportWithParams.put(key, value);
return this;
}
use of io.jmix.emailtemplates.dto.ReportWithParams in project jmix by jmix-framework.
the class EmailTemplateBuilderImpl method setBodyParameter.
@Override
public EmailTemplateBuilder setBodyParameter(String key, Object value) {
TemplateReport emailBodyReport = emailTemplate.getEmailBodyReport();
ReportWithParams reportWithParams = reportParams.stream().filter(e -> e.getReport().equals(emailBodyReport.getReport())).findFirst().orElse(null);
if (reportWithParams == null) {
reportWithParams = new ReportWithParams(emailBodyReport.getReport());
reportParams.add(reportWithParams);
}
reportWithParams.put(key, value);
return this;
}
Aggregations