use of com.axelor.apps.base.db.ObjectDataConfigExport in project axelor-open-suite by axelor.
the class ObjectDataExportController method export.
public void export(ActionRequest request, ActionResponse response) throws AxelorException {
ObjectDataConfigExport objDataConfigExport = request.getContext().asType(ObjectDataConfigExport.class);
Long objectDataconfigId = objDataConfigExport.getObjectDataConfig().getId();
ObjectDataConfig objectDataConfig = Beans.get(ObjectDataConfigRepository.class).find(objectDataconfigId);
MetaFile dataFile = Beans.get(ObjectDataExportService.class).export(objectDataConfig, objDataConfigExport);
if (dataFile != null) {
response.setView(ActionView.define(I18n.get("Data")).add("html", "ws/rest/com.axelor.meta.db.MetaFile/" + dataFile.getId() + "/content/download?v=" + dataFile.getVersion()).param("download", "true").map());
}
response.setCanClose(true);
}
Aggregations