промежуточный. перевод хранимых настроек багов из джсона в таблицу. рефакторинг публикации, был лишний проход
This commit is contained in:
@@ -4,23 +4,24 @@ import Common.Utils.Utils_;
|
||||
import Common.Visual.UI;
|
||||
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
||||
import _VisualDVM.ComponentsServer.BugReport.BugReportState;
|
||||
import _VisualDVM.ComponentsServer.ComponentsServer;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.PassCode;
|
||||
import _VisualDVM.Passes.Server.PublishServerObject;
|
||||
import _VisualDVM.Repository.EmailMessage;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.Date;
|
||||
public class PublishBugReport extends Pass<BugReport> {
|
||||
public class PublishBugReport extends PublishServerObject<ComponentsServer, BugReport> {
|
||||
public PublishBugReport() {
|
||||
super(Global.componentsServer, BugReport.class);
|
||||
}
|
||||
@Override
|
||||
public String getIconPath() {
|
||||
return "/Common/icons/Publish.png";
|
||||
}
|
||||
@Override
|
||||
public String getButtonText() {
|
||||
return "";
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) {
|
||||
protected boolean canStart(Object... args) throws Exception{
|
||||
if (Global.componentsServer.db.bugReports.getUI().CheckCurrent(Log)) {
|
||||
target = Global.componentsServer.db.bugReports.getUI().getCurrent();
|
||||
if (!target.state.equals(BugReportState.draft)) {
|
||||
@@ -36,21 +37,17 @@ public class PublishBugReport extends Pass<BugReport> {
|
||||
&& (target.CheckDraft(Log))) {
|
||||
return false;
|
||||
}
|
||||
if (!target.project_version.isEmpty()) {
|
||||
target.packed_archive = Utils_.fileToBytes(target.getArchiveFile());
|
||||
}
|
||||
target.change_date = new Date().getTime();
|
||||
target.state = BugReportState.active;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
target.change_date = new Date().getTime();
|
||||
Global.componentsServer.db.Update(target);
|
||||
target.state = BugReportState.active;
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
//2 - Отправка на сервер, с активным состоянием?
|
||||
Global.mainModule.getPass(PassCode.SendBugReport).Do();
|
||||
Global.componentsServer.db.Update(target);
|
||||
//3- рассылка
|
||||
EmailMessage message = new EmailMessage(
|
||||
"Обнаружена ошибка " + Utils_.Brackets(target.id),
|
||||
@@ -71,9 +68,4 @@ public class PublishBugReport extends Pass<BugReport> {
|
||||
Global.componentsServer.db.recipients.getSelectedMails());
|
||||
*/
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
Global.componentsServer.db.bugReports.getUI().RedrawControl();
|
||||
Global.mainModule.getUI().getMainWindow().getCallbackWindow().ShowCurrentBugReport();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Utils.Utils_;
|
||||
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
||||
import _VisualDVM.ComponentsServer.BugReport.BugReportState;
|
||||
import _VisualDVM.Global;
|
||||
import _VisualDVM.Passes.Server.ComponentsServerPass;
|
||||
import _VisualDVM.Repository.Server.ServerCode;
|
||||
public class SendBugReport extends ComponentsServerPass<BugReport> {
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
target = Global.componentsServer.db.bugReports.getUI().getCurrent();
|
||||
if (!target.project_version.isEmpty())
|
||||
target.packed_archive = Utils_.fileToBytes(target.getArchiveFile());
|
||||
return SendRequest(ServerCode.PublishObject, "", target);
|
||||
}
|
||||
@Override
|
||||
protected void performFail() throws Exception {
|
||||
target.state = BugReportState.draft;
|
||||
}
|
||||
}
|
||||
@@ -116,7 +116,6 @@ public enum PassCode implements PassCode_ {
|
||||
DeleteBugReport,
|
||||
DeleteBugReportFromServer,
|
||||
PublishBugReport,
|
||||
SendBugReport,
|
||||
DeleteDownloadedBugReports,
|
||||
ExtractRecipients,
|
||||
Email,
|
||||
@@ -781,8 +780,6 @@ public enum PassCode implements PassCode_ {
|
||||
return "Удаление отчёта об ошибке с сервера";
|
||||
case PublishBugReport:
|
||||
return "Публикация отчёта об ошибке";
|
||||
case SendBugReport:
|
||||
return "Отправка отчёта об ошибке на сервер";
|
||||
case ExtractRecipients:
|
||||
return "Извлечение адресатов";
|
||||
case GetComponentsActualVersions:
|
||||
|
||||
Reference in New Issue
Block a user