protected String findTableCode(Report report) { for (ReportTemplate reportTemplate : report.getTemplates()) { if (ReportOutputType.TABLE.equals(reportTemplate.getReportOutputType())) return reportTemplate.getCode(); } return null; }
@Override public com.haulmont.yarg.structure.ReportOutputType getOutputType() { return getReportOutputType() != null ? getReportOutputType().getOutputType() : null; }
protected void setRelevantReferencesToReport(Report entity) { for (ReportValueFormat reportValueFormat : entity.getValuesFormats()) { reportValueFormat.setReport(entity); } for (BandDefinition bandDefinition : entity.getBands()) { bandDefinition.setReport(entity); } for (ReportInputParameter reportInputParameter : entity.getInputParameters()) { reportInputParameter.setReport(entity); } for (ReportScreen reportScreen : entity.getReportScreens()) { reportScreen.setReport(entity); } } }
protected TemplateInfo mapTemplateInfo(ReportTemplate template) { TemplateInfo templateInfo = new TemplateInfo(); templateInfo.code = template.getCode(); templateInfo.outputType = template.getReportOutputType().toString(); return templateInfo; }
@Override protected void afterCommit(Entity entity) { ReportTemplate reportTemplate = (ReportTemplate) entity; ReportTemplate defaultTemplate = getItem().getDefaultTemplate(); if (defaultTemplate != null && defaultTemplate.equals(reportTemplate)) { getItem().setDefaultTemplate(reportTemplate); } } });
protected String getNameForEntityParameter(DataSet dataSet) { String dataSetAlias = null; switch (dataSet.getType()) { case SINGLE: dataSetAlias = dataSet.getEntityParamName(); break; case MULTI: dataSetAlias = dataSet.getListEntitiesParamName(); break; } return dataSetAlias; } }
private Object readResolve() throws ObjectStreamException { return getOutputTypeById(getId()); } }
@Override public BandOrientation getBandOrientation() { return BandOrientation.defaultIfNull(getOrientation() != null ? getOrientation().getBandOrientation(): null); } }
public static Orientation fromBandOrientation(BandOrientation orientation) { for (Orientation type : Orientation.values()) { if (type.getBandOrientation() == orientation) { return type; } } return null; } }
@Override public boolean evaluate(Object object) { BandDefinition band = (BandDefinition) object; return band.getParentBandDefinition() == null; } });
public void setReportOutputType(ReportOutputType reportOutputType) { this.reportOutputType = reportOutputType != null ? reportOutputType.getId() : null; }
public void setCustomDefinedBy(CustomTemplateDefinedBy customDefinedBy) { this.customDefinedBy = CustomTemplateDefinedBy.getId(customDefinedBy); }
public Orientation getOrientation() { return Orientation.fromId(orientation); }
public void setReportType(ReportType reportType) { this.reportType = reportType != null ? reportType.getId() : null; }
public void setType(DataSetType type) { this.type = type != null ? type.getId() : null; }
public JsonSourceType getJsonSourceType() { return jsonSourceType != null ? JsonSourceType.fromId(jsonSourceType) : null; }
public void setOrientation(Orientation orientation) { this.orientation = orientation != null ? orientation.getId() : null; }
public void setPredefinedTransformation(PredefinedTransformation predefinedTransformation) { this.predefinedTransformation = predefinedTransformation != null ? predefinedTransformation.getId() : null; }
public static Integer getId(CustomTemplateDefinedBy definedBy) { return definedBy != null ? definedBy.getId() : null; }