Search in sources :

Example 1 with ObjectDataConfigExport

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);
}
Also used : ObjectDataConfigExport(com.axelor.apps.base.db.ObjectDataConfigExport) ObjectDataExportService(com.axelor.apps.base.service.ObjectDataExportService) MetaFile(com.axelor.meta.db.MetaFile) ObjectDataConfigRepository(com.axelor.apps.base.db.repo.ObjectDataConfigRepository) ObjectDataConfig(com.axelor.apps.base.db.ObjectDataConfig)

Aggregations

ObjectDataConfig (com.axelor.apps.base.db.ObjectDataConfig)1 ObjectDataConfigExport (com.axelor.apps.base.db.ObjectDataConfigExport)1 ObjectDataConfigRepository (com.axelor.apps.base.db.repo.ObjectDataConfigRepository)1 ObjectDataExportService (com.axelor.apps.base.service.ObjectDataExportService)1 MetaFile (com.axelor.meta.db.MetaFile)1