Add support for a new entity in general report

Last modified by sourek on 2020/03/10 14:36

Genral entity report is a tool which enables users to export data tables from CzechIdM. If you want you entity to support this feature, you need to meet these requirements:

  • Entity must support bulk actions
  • Entity must have DTO which extends AbstractDTO
  • Entity must have service which extends ReadWriteDtoService

Enabling general entity report is a matter of extending either of the following two abstract classes

  • AbstractEntityExport - for basic entities
  • AbstractFormableEntityExport - for formable entities (will export entity attributes along with its EAVs)

Here is an example of such implementation for Roles:

@Component
@Enabled(RptModuleDescriptor.MODULE_ID)
public class IdmRoleGeneralEntityExport extends AbstractFormableEntityExport<IdmRoleDto, IdmRoleFilter>{
public IdmRoleGeneralEntityExport(ReadWriteDtoService<IdmRoleDto, IdmRoleFilter> service,
  
RptReportService reportService, AttachmentManager attachmentManager, ObjectMapper mapper, FormService formService) {
super(service, reportService, attachmentManager, mapper, formService);
}
}

 

If you want to further extend the report functionality, you can override method 

protected Map<String, String> tramsformToMap(D dto)

. This method allows you to add additional atributes to result report.