55 lines
1.8 KiB
Java
55 lines
1.8 KiB
Java
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);
|
||
}
|
||
}
|