промежуточный. начал дерево отображения пакета версий

This commit is contained in:
2023-10-27 02:07:13 +03:00
parent a1b7bec282
commit 0fbd239112
9 changed files with 121 additions and 43 deletions

View File

@@ -1,18 +1,17 @@
package Visual_DVM_2021.Passes.All;
import Common.Constants;
import Common.Current;
import Common.Global;
import Common.Utils.Utils;
import Repository.Server.ServerCode;
import Repository.Server.ServerExchangeUnit_2021;
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackageInterface;
import TestingSystem.TasksPackage.TasksPackageState;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.TestingSystemPass;
import org.apache.commons.io.FileUtils;
import java.io.File;
import java.nio.file.Paths;
import java.util.Date;
public class DownloadSapforTasksPackage extends TestingSystemPass<SapforTasksPackage> {
@Override
@@ -24,24 +23,25 @@ public class DownloadSapforTasksPackage extends TestingSystemPass<SapforTasksPac
return "";
}
File tmpArchive = null;
File getLoaded() {
return Paths.get(Global.SapforPackagesDirectory.getAbsolutePath(), target.id, Constants.LOADED).toFile();
}
@Override
protected boolean canStart(Object... args) throws Exception {
if (Current.Check(Log, Current.SapforTasksPackage)) {
target = Current.getSapforTasksPackage();
if (!target.state.equals(TasksPackageState.Done)) {
Log.Writeln_("Пакет не завершен.");
return false;
}
if (getLoaded().exists()) {
System.out.println("Пакет уже загружен");
return false;
}
return true;
if (args.length > 0) {
target = (SapforTasksPackage) args[0];
} else {
if (Current.Check(Log, Current.SapforTasksPackage))
target = Current.getSapforTasksPackage();
else return false;
}
return false;
//-
if (!target.state.equals(TasksPackageState.Done)) {
Log.Writeln_("Пакет не завершен.");
return false;
}
if (SapforTasksPackageInterface.isLoaded(target)) {
System.out.println("Пакет уже загружен");
return false;
}
return true;
}
@Override
protected void ServerAction() throws Exception {
@@ -61,8 +61,7 @@ public class DownloadSapforTasksPackage extends TestingSystemPass<SapforTasksPac
tmpArchive.getAbsolutePath(),
Global.SapforPackagesDirectory.getAbsolutePath(), false
)) {
System.out.println("LOADED=" + Utils.Brackets(getLoaded().getAbsolutePath()));
FileUtils.writeStringToFile(getLoaded(), new Date().toString());
FileUtils.writeStringToFile(SapforTasksPackageInterface.getLoadedSign(target), new Date().toString());
}
}
}

View File

@@ -2,7 +2,9 @@ package Visual_DVM_2021.Passes.All;
import Common.Current;
import Common.UI.UI;
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackageInterface;
import TestingSystem.TasksPackage.TasksPackageState;
import Visual_DVM_2021.Passes.PassCode_2021;
import Visual_DVM_2021.Passes.Pass_2021;
public class ShowSapforTaskPackage extends Pass_2021<SapforTasksPackage> {
@Override
@@ -19,8 +21,9 @@ public class ShowSapforTaskPackage extends Pass_2021<SapforTasksPackage> {
target = Current.getSapforTasksPackage();
if (!target.state.equals(TasksPackageState.Done)) {
Log.Writeln_("Пакет не завершен!");
} else
return true;
return false;
}
return SapforTasksPackageInterface.isLoaded(target) || passes.get(PassCode_2021.DownloadSapforTasksPackage).Do(target);
}
return false;
}

View File

@@ -17,6 +17,7 @@ public class SapforPackageFields implements DialogFields, FormWithSplitters {
public JPanel getContent() {
return content;
}
public JPanel getTreePanel(){return treePanel;}
public SapforPackageFields(){
}

View File

@@ -4,6 +4,8 @@ import Common.UI.Windows.Dialog.Dialog;
import Common.UI.Windows.FormType;
import GlobalData.FormsParams.DBForm;
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackage;
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackageInterface;
import SapforTestingSystem.SapforTasksPackage.SapforTasksPackageTree;
public class SapforPackageForm extends Dialog<SapforTasksPackage, SapforPackageFields> {
SapforTasksPackage sapforTasksPackage = null;
@@ -22,6 +24,7 @@ public class SapforPackageForm extends Dialog<SapforTasksPackage, SapforPackageF
public void Init(Object... params) {
sapforTasksPackage = (SapforTasksPackage) params[0];
fields.lObjectName.setText(sapforTasksPackage.id);
fields.getTreePanel().add(new SapforTasksPackageTree(SapforTasksPackageInterface.getTree(sapforTasksPackage)));
/*
if (Global.db.sapforProfiles.size() > 0) {
for (Object key : Global.db.sapforProfiles.Data.keySet()) {