промежуточный. перевод хранимых настроек багов из джсона в таблицу. рефакторинг публикации, был лишний проход

This commit is contained in:
2025-03-27 12:55:56 +03:00
parent fb296a02ee
commit c7a618dd25
4 changed files with 14 additions and 59 deletions

18
.idea/workspace.xml generated
View File

@@ -7,23 +7,9 @@
</component>
<component name="ChangeListManager">
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReportSetting/BugReportSetting.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReportSetting/BugReportSettingsDBTable.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/properties" beforeDir="false" afterPath="$PROJECT_DIR$/properties" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Common/Database/Objects/nDBObject.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Database/Objects/nDBObject.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Common/Database/Objects/rDBObject.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Database/Objects/rDBObject.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Common/Properties.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Common/Properties.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReport/BugReport.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReport/BugReport.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReport/BugReportsDBTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReport/BugReportsDBTable.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReportsDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReportsDatabase.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Component/Sapfor/Sapfor.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Component/Sapfor/Sapfor.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/ComponentsServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/ComponentsServer.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Constants.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/ApplyBugReportSettings.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/ApplyBugReportSettings.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishBugReport.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishBugReport.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/SapforProperties.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ProjectData/SapforData/SapforProperties.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/CallbackForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/CallbackForm.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SendBugReport.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/PassCode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/PassCode.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />

View File

@@ -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();
}
}

View File

@@ -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;
}
}

View File

@@ -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: