Files
VisualSapfor/src/Visual_DVM_2021/Passes/All/DeleteSapforScenario.java
2023-10-06 21:01:52 +03:00

55 lines
1.8 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
package Visual_DVM_2021.Passes.All;
import Common.Database.Database;
import Common.Global;
import Common.Utils.Utils;
import Repository.Server.ServerCode;
import Repository.Server.ServerExchangeUnit_2021;
import SapforTestingSystem.SapforScenario.SapforScenario;
import Visual_DVM_2021.Passes.DeleteObjectPass;
import Visual_DVM_2021.Passes.Pass_2021;
import Visual_DVM_2021.Passes.TestingSystemPass;
import java.io.File;
public class DeleteSapforScenario extends DeleteObjectPass<SapforScenario> {
public DeleteSapforScenario() {
super(SapforScenario.class);
}
@Override
protected Database getDb() {
return Global.testingServer.db;
}
@Override
protected void performPreparation() throws Exception {
/*
if (Current.hasUI()&&Current.HasSapforTasksPackage()) {
UI.getMainWindow().getTestingWindow().RemoveSapforPackageFromComparison();
}
*/
}
@Override
protected void body() throws Exception {
super.body();
Utils.delete_with_check(new File(target.workspace));
}
@Override
protected void performDone() throws Exception {
super.performDone();
Pass_2021 serverPass = new TestingSystemPass<SapforScenario>() {
@Override
public String getDescription() {
return "Удаление сценария задач SAPFOR с сервера";
}
@Override
protected boolean canStart(Object... args) throws Exception {
target = (SapforScenario) args[0];
return true;
}
@Override
protected void ServerAction() throws Exception {
Command(new ServerExchangeUnit_2021(ServerCode.DeleteObject, "", target));
}
};
serverPass.Do(target);
}
}