use of com.axelor.apps.base.db.ObjectDataConfig 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);
}
use of com.axelor.apps.base.db.ObjectDataConfig in project axelor-open-suite by axelor.
the class ObjectDataExportController method anonymize.
public void anonymize(ActionRequest request, ActionResponse response) throws AxelorException {
Context context = request.getContext();
Long recordId = Long.parseLong(context.get("modelSelectId").toString());
Long objectDataconfigId = Long.parseLong(context.get("objectDataConfigId").toString());
ObjectDataConfig objectDataConfig = Beans.get(ObjectDataConfigRepository.class).find(objectDataconfigId);
Beans.get(ObjectDataAnonymizeService.class).anonymize(objectDataConfig, recordId);
response.setFlash("Data anonymized successfully");
response.setCanClose(true);
}
Aggregations