Search in sources :

Example 1 with DataBackupService

use of com.axelor.apps.base.service.app.DataBackupService in project axelor-open-suite by axelor.

the class DataBackupController method restoreBackup.

public void restoreBackup(ActionRequest req, ActionResponse res) throws IOException {
    DataBackupService dataBackupService = Beans.get(DataBackupService.class);
    DataBackup dataBackup = req.getContext().asType(DataBackup.class);
    if (dataBackupService.sequencesOrMrpLineTypesExist()) {
        res.setError("Remove all Sequences And MrpLineTypes to restore backup");
    } else {
        dataBackupService.restoreBackUp(dataBackup);
    }
    res.setReload(true);
}
Also used : DataBackupService(com.axelor.apps.base.service.app.DataBackupService) DataBackup(com.axelor.apps.base.db.DataBackup)

Aggregations

DataBackup (com.axelor.apps.base.db.DataBackup)1 DataBackupService (com.axelor.apps.base.service.app.DataBackupService)1