создание группы из папки.
This commit is contained in:
@@ -1,25 +1,27 @@
|
||||
package Visual_DVM_2021.Passes.All;
|
||||
import Common.Constants;
|
||||
import Common.Current;
|
||||
import Common.Global;
|
||||
import Common.UI.UI;
|
||||
import Common.Utils.Utils;
|
||||
import ProjectData.Project.db_project_info;
|
||||
import TestingSystem.Common.Group.Group;
|
||||
import TestingSystem.Common.Test.Test;
|
||||
import TestingSystem.Common.TestingServer;
|
||||
import Visual_DVM_2021.Passes.PassCode_2021;
|
||||
import Visual_DVM_2021.Passes.Server.PublishServerObject;
|
||||
public class PublishTest extends PublishServerObject<TestingServer, Test> {
|
||||
boolean from_current_project;
|
||||
protected Group group = null;
|
||||
protected int group_id;
|
||||
protected db_project_info project = null;
|
||||
public PublishTest() {
|
||||
super(Global.testingServer, Test.class);
|
||||
}
|
||||
@Override
|
||||
public boolean fillObjectFields() throws Exception {
|
||||
target.description = project.getLocalName() + " " + project.description;
|
||||
target.group_id = group.id;
|
||||
target.description = project.getLocalName();
|
||||
if (!project.description.isEmpty())
|
||||
target.description += " " + project.description;
|
||||
target.group_id = group_id;
|
||||
if (from_current_project) {
|
||||
target.dim = project.testMaxDim;
|
||||
return super.fillObjectFields();
|
||||
@@ -36,19 +38,23 @@ public class PublishTest extends PublishServerObject<TestingServer, Test> {
|
||||
}
|
||||
}
|
||||
@Override
|
||||
protected void performPreparation() throws Exception {
|
||||
target.description = Utils.ReplaceForbiddenSymbols(target.description);
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
group = null;
|
||||
group_id = Constants.Nan;
|
||||
project = null;
|
||||
if (args.length == 0) {
|
||||
from_current_project = true;
|
||||
if (Current.Check(Log, Current.Group, Current.Project) && UI.Question("Добавить текущий проект в глобальную базу тестов")) {
|
||||
project = Current.getProject();
|
||||
group= Current.getGroup();
|
||||
group_id = Current.getGroup().id;
|
||||
}
|
||||
} else {
|
||||
from_current_project = false;
|
||||
project = (db_project_info) args[0];
|
||||
group = (Group) args[1];
|
||||
group_id = (int) args[1];
|
||||
}
|
||||
//--
|
||||
if (project == null)
|
||||
|
||||
Reference in New Issue
Block a user