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

This commit is contained in:
2025-02-19 22:47:56 +03:00
parent 7a9c70f396
commit 4e3597ba7a
40 changed files with 234 additions and 530 deletions

40
.idea/workspace.xml generated
View File

@@ -7,12 +7,46 @@
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment=""> <list default="true" id="e42177c3-2328-4b27-8a01-35779b2beb99" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/DeleteUserAccount.java" afterDir="false" /> <change afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Recipient/Json/RecipientJson.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Recipient/Json/RecipientsJson.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Recipient/Recipient.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Recipient/RecipientsDataSet.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Recipient/UI/RecipientsForm.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" 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/_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/Json/RecipientsJson.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/BugReport/Json/RecipientsJson.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/ComponentsServer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/ComponentsServer.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/ComponentsServer/UserAccount/UI/UserAccountsForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/UI/UserAccountsForm.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/CredentialsDatabase.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/CredentialsDatabase.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/SubscriberWorkspace/UI/SubscriberWorkspacesForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/SubscriberWorkspace/UI/SubscriberWorkspacesForm.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/Subscriber.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/SubsribersDBTable.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/UI/SubscriberDialog.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/UI/SubscriberFields.form" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/UI/SubscriberFields.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/Subscribes/UI/SubsribersForm.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/UI/UserAccountDialog.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/UI/UserAccountDialog.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/UserAccountsDBTable.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/ComponentsServer/UserAccount/UserAccountsDBTable.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/MainModule.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/MainModule.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/AddSubscriber.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/AppendBugReportField.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/AppendBugReportField.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/DeleteSubscriber.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/DeleteSubscriberWorkspace.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/EditAccount.java" beforeDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/EditSubscriber.java" beforeDir="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/Passes/All/PublishComponent.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/PublishComponent.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SaveBugReportExecutor.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SaveBugReportExecutor.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SaveBugReportRecipients.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SaveBugReportRecipients.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SynchronizeBugReports.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/SynchronizeBugReports.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/TestPass.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/TestPass.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/UpdateBugReportField.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/All/UpdateBugReportField.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/PassCode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/PassCode.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/_VisualDVM/Passes/PassCode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Passes/PassCode.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/ServerCode.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Repository/Server/ServerCode.java" afterDir="false" /> <change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Interface/CallbackWindow.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Interface/CallbackWindow.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/AdministrationForm.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/AdministrationForm.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/CallbackForm.form" beforeDir="false" afterPath="$PROJECT_DIR$/src/_VisualDVM/Visual/Windows/CallbackForm.form" 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" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />

View File

@@ -25,9 +25,9 @@
"CheckTestingIntervalSeconds": 10, "CheckTestingIntervalSeconds": 10,
"AutoCheckTesting": true, "AutoCheckTesting": true,
"EmailOnTestingProgress": true, "EmailOnTestingProgress": true,
"lastMachineId": 28, "lastMachineId": 13,
"lastUserId": 36, "lastUserId": 24,
"lastCompilerId": 109, "lastCompilerId": 52,
"RegisterOn": false, "RegisterOn": false,
"SpacesOn": false, "SpacesOn": false,
"EmptyLinesOn": false, "EmptyLinesOn": false,

View File

@@ -8,7 +8,6 @@ import _VisualDVM.ComponentsServer.BugReport.Json.RecipientJson;
import _VisualDVM.ComponentsServer.BugReport.Json.RecipientsJson; import _VisualDVM.ComponentsServer.BugReport.Json.RecipientsJson;
import _VisualDVM.ComponentsServer.BugReport.Json.VisualiserSettingsJson; import _VisualDVM.ComponentsServer.BugReport.Json.VisualiserSettingsJson;
import _VisualDVM.ComponentsServer.Component.ComponentType; import _VisualDVM.ComponentsServer.Component.ComponentType;
import _VisualDVM.ComponentsServer.Subscribes.Subscriber;
import _VisualDVM.ComponentsServer.UserAccount.UserAccount; import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
import _VisualDVM.Constants; import _VisualDVM.Constants;
import _VisualDVM.Global; import _VisualDVM.Global;
@@ -155,13 +154,16 @@ public class BugReport extends rDBObject {
return project_version.isEmpty(); return project_version.isEmpty();
} }
//---> //--->
public void CheckSubscribers() { public void CheckSubscribers() {
for (Subscriber subscriber : Global.componentsServer.db.subscribers.Data.values()) // for (Subscriber subscriber : Global.componentsServer.db.subscribers.Data.values())
subscriber.Select(packedRecipientsJson.contains(subscriber.address)); // subscriber.Select(packedRecipientsJson.contains(subscriber.address));
} }
/*
public void saveRecipientsAsJson(Vector<Subscriber> subscribers) { public void saveRecipientsAsJson(Vector<Subscriber> subscribers) {
packedRecipientsJson = Utils_.gson.toJson(new RecipientsJson(subscribers)); packedRecipientsJson = Utils_.gson.toJson(new RecipientsJson(subscribers));
} }
*/
public Vector<String> getRecipients() { public Vector<String> getRecipients() {
Vector<String> res = new Vector<>(); Vector<String> res = new Vector<>();
if (packedRecipientsJson.isEmpty()) return res; if (packedRecipientsJson.isEmpty()) return res;

View File

@@ -1,5 +1,4 @@
package _VisualDVM.ComponentsServer.BugReport.Json; package _VisualDVM.ComponentsServer.BugReport.Json;
import _VisualDVM.ComponentsServer.Subscribes.Subscriber;
import com.google.gson.annotations.Expose; import com.google.gson.annotations.Expose;
import java.util.List; import java.util.List;
@@ -10,9 +9,11 @@ public class RecipientsJson {
public RecipientsJson() { public RecipientsJson() {
} }
//при создании пакета. //при создании пакета.
/*
public RecipientsJson(Vector<? extends Subscriber> subscribers) { public RecipientsJson(Vector<? extends Subscriber> subscribers) {
array = new Vector<>(); array = new Vector<>();
for (Subscriber subscriber : subscribers) for (Subscriber subscriber : subscribers)
array.add(new RecipientJson(subscriber.address)); array.add(new RecipientJson(subscriber.address));
} }
*/
} }

View File

@@ -2,24 +2,21 @@ package _VisualDVM.ComponentsServer;
import Common.Database.SQLITE.SQLiteDatabase; import Common.Database.SQLITE.SQLiteDatabase;
import _VisualDVM.ComponentsServer.BugReport.BugReport; import _VisualDVM.ComponentsServer.BugReport.BugReport;
import _VisualDVM.ComponentsServer.BugReport.BugReportsDBTable; import _VisualDVM.ComponentsServer.BugReport.BugReportsDBTable;
import _VisualDVM.ComponentsServer.Recipient.RecipientsDataSet;
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspaceDBTable; import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspaceDBTable;
import _VisualDVM.ComponentsServer.Subscribes.SubsribersDBTable;
import _VisualDVM.Passes.PassCode; import _VisualDVM.Passes.PassCode;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.Vector; import java.util.Vector;
public class BugReportsDatabase extends SQLiteDatabase { public class BugReportsDatabase extends SQLiteDatabase {
public BugReportsDBTable bugReports; public BugReportsDBTable bugReports;
public SubsribersDBTable subscribers; public RecipientsDataSet recipients = new RecipientsDataSet();
public SubscriberWorkspaceDBTable workspaces; //рабочие пространства для машин.
public BugReportsDatabase() { public BugReportsDatabase() {
super(Paths.get(System.getProperty("user.dir"), "Data", "bug_reports.sqlite").toFile()); super(Paths.get(System.getProperty("user.dir"), "Data", "bug_reports.sqlite").toFile());
} }
@Override @Override
protected void initAllTables() throws Exception { protected void initAllTables() throws Exception {
addTable(bugReports = new BugReportsDBTable()); addTable(bugReports = new BugReportsDBTable());
addTable(subscribers = new SubsribersDBTable());
addTable(workspaces = new SubscriberWorkspaceDBTable());
} }
@Override @Override
public void Init() throws Exception { public void Init() throws Exception {
@@ -38,12 +35,12 @@ public class BugReportsDatabase extends SQLiteDatabase {
public void DropUI() { public void DropUI() {
super.DropUI(); super.DropUI();
bugReports.ClearUI(); bugReports.ClearUI();
subscribers.ClearUI(); recipients.ClearUI();
workspaces.ClearUI();
} }
@Override @Override
public void ResetUI() { public void ResetUI() {
bugReports.ShowUI(); bugReports.ShowUI();
recipients.ShowUI(); //todo временно.
super.ResetUI(); super.ResetUI();
} }
} }

View File

@@ -226,6 +226,7 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
} }
void ReceiveBugReportsDatabase() throws Exception { void ReceiveBugReportsDatabase() throws Exception {
response.object = Utils_.fileToBytes(db.getFile()); response.object = Utils_.fileToBytes(db.getFile());
response.arg = credentials_db.userAccounts.getPackedActiveRecipients();
} }
void ReceiveBugReport() throws Exception { void ReceiveBugReport() throws Exception {
File bugArchive = Utils_.getFile(Utils_.getHomePath(), "Bugs", request.arg); File bugArchive = Utils_.getFile(Utils_.getHomePath(), "Bugs", request.arg);
@@ -263,7 +264,7 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
String email = data[0]; String email = data[0];
String machineURL = data[1]; String machineURL = data[1];
String login = data[2]; String login = data[2];
response.object = db.workspaces.findWorkspace(email, machineURL, login); response.object = credentials_db.workspaces.findWorkspace(email, machineURL, login);
} }
void GetComponentChangesLog() throws Exception { void GetComponentChangesLog() throws Exception {
response.object = Utils_.fileToBytes(Paths.get(Utils_.getHomePath(), "Components", request.arg, "changes.txt").toFile()); response.object = Utils_.fileToBytes(Paths.get(Utils_.getHomePath(), "Components", request.arg, "changes.txt").toFile());
@@ -382,9 +383,6 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
case ReceiveComponent: case ReceiveComponent:
ReceiveComponent(); ReceiveComponent();
break; break;
case CheckURLRegistered:
CheckURLRegistered();
break;
case GetComponentsVersionsInfo: case GetComponentsVersionsInfo:
GetComponentsVersionsInfo(); GetComponentsVersionsInfo();
break; break;
@@ -428,6 +426,9 @@ public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
case DeleteUserAccount: case DeleteUserAccount:
DeleteUserAccount(); DeleteUserAccount();
break; break;
case CheckURLRegistered:
CheckURLRegistered();
break;
default: default:
throw new RepositoryRefuseException("Неподдерживаемый код: " + code); throw new RepositoryRefuseException("Неподдерживаемый код: " + code);
} }

View File

@@ -1,18 +1,27 @@
package _VisualDVM.ComponentsServer; package _VisualDVM.ComponentsServer;
import Common.Database.Objects.DBObject;
import Common.Database.SQLITE.SQLiteDatabase; import Common.Database.SQLITE.SQLiteDatabase;
import Common.Database.Tables.FKBehaviour;
import Common.Database.Tables.FKCurrentObjectBehaviuor;
import Common.Database.Tables.FKDataBehaviour;
import Common.Passes.PassCode_; import Common.Passes.PassCode_;
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspace;
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspaceDBTable;
import _VisualDVM.ComponentsServer.UserAccount.UserAccountsDBTable; import _VisualDVM.ComponentsServer.UserAccount.UserAccountsDBTable;
import _VisualDVM.Passes.PassCode; import _VisualDVM.Passes.PassCode;
import java.nio.file.Paths; import java.nio.file.Paths;
import java.util.LinkedHashMap;
public class CredentialsDatabase extends SQLiteDatabase { public class CredentialsDatabase extends SQLiteDatabase {
public UserAccountsDBTable userAccounts; public UserAccountsDBTable userAccounts;
public SubscriberWorkspaceDBTable workspaces;
public CredentialsDatabase() { public CredentialsDatabase() {
super(Paths.get(System.getProperty("user.dir"), "Data", "credentials.sqlite").toFile()); super(Paths.get(System.getProperty("user.dir"), "Data", "credentials.sqlite").toFile());
} }
@Override @Override
protected void initAllTables() throws Exception { protected void initAllTables() throws Exception {
addTable(userAccounts = new UserAccountsDBTable()); addTable(userAccounts = new UserAccountsDBTable());
addTable(workspaces = new SubscriberWorkspaceDBTable());
} }
@Override @Override
public PassCode_ getSynchronizePassCode() { public PassCode_ getSynchronizePassCode() {
@@ -22,10 +31,12 @@ public class CredentialsDatabase extends SQLiteDatabase {
public void DropUI() { public void DropUI() {
super.DropUI(); super.DropUI();
userAccounts.ClearUI(); userAccounts.ClearUI();
workspaces.ClearUI();
} }
@Override @Override
public void ResetUI() { public void ResetUI() {
userAccounts.ShowUI(); userAccounts.ShowUI();
super.ResetUI(); super.ResetUI();
} }
} }

View File

@@ -0,0 +1,12 @@
package _VisualDVM.ComponentsServer.Recipient.Json;
import com.google.gson.annotations.Expose;
public class RecipientJson {
@Expose
public String email;
@Expose
public String name;
public RecipientJson(String email_in, String name_in){
email = email_in;
name = name_in;
}
}

View File

@@ -0,0 +1,9 @@
package _VisualDVM.ComponentsServer.Recipient.Json;
import com.google.gson.annotations.Expose;
import java.util.List;
import java.util.Vector;
public class RecipientsJson {
@Expose
public List<RecipientJson> values = new Vector<>();
}

View File

@@ -0,0 +1,24 @@
package _VisualDVM.ComponentsServer.Recipient;
import Common.Database.Objects.DBObject;
import _VisualDVM.ComponentsServer.Recipient.Json.RecipientJson;
public class Recipient extends DBObject {
public String email = "";
public String name = "";
@Override
public Object getPK() {
return email;
}
@Override
public void SynchronizeFields(DBObject src) {
super.SynchronizeFields(src);
Recipient src_ = (Recipient) src;
email = src_.email;
name = src_.name;
}
public Recipient() {
}
public Recipient(RecipientJson json) {
email = json.email;
name = json.name;
}
}

View File

@@ -0,0 +1,35 @@
package _VisualDVM.ComponentsServer.Recipient;
import Common.Database.Tables.DataSet;
import Common.Utils.Utils_;
import Common.Visual.DataSetControlForm;
import _VisualDVM.ComponentsServer.Recipient.Json.RecipientJson;
import _VisualDVM.ComponentsServer.Recipient.Json.RecipientsJson;
import _VisualDVM.ComponentsServer.Recipient.UI.RecipientsForm;
import _VisualDVM.Global;
import javax.swing.*;
public class RecipientsDataSet extends DataSet<String, Recipient> {
public RecipientsDataSet() {
super(String.class, Recipient.class);
}
public void Unpack(String packed){
System.out.println(Utils_.Brackets(packed));
clear();
RecipientsJson jsons = Utils_.gson.fromJson(packed, RecipientsJson.class);
for (RecipientJson json: jsons.values){
Global.componentsServer.db.recipients.put(json.email, new Recipient(json));
}
}
@Override
protected DataSetControlForm createUI(JPanel mountPanel) {
return new RecipientsForm(this,mountPanel);
}
@Override
public String getPluralDescription() {
return "адресаты";
}
@Override
public String getSingleDescription() {
return "адресат";
}
}

View File

@@ -0,0 +1,24 @@
package _VisualDVM.ComponentsServer.Recipient.UI;
import Common.Database.Tables.DataSet;
import Common.Visual.DataSetControlForm;
import Common.Visual.Tables.ColumnInfo;
import _VisualDVM.ComponentsServer.Recipient.Recipient;
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
import javax.swing.*;
public class RecipientsForm extends DataSetControlForm<Recipient> {
public RecipientsForm(DataSet<?, Recipient> dataSource_in, JPanel mountPanel_in) {
super(dataSource_in, mountPanel_in);
}
@Override
protected void createColumns() {
AddColumns(
new ColumnInfo<Recipient>("Имя") {
@Override
public Object getFieldAt(Recipient object) {
return object.name;
}
}
);
}
}

View File

@@ -5,7 +5,7 @@ import Common.Visual.DataSetControlForm;
import Common.Visual.Menus.DataMenuBar; import Common.Visual.Menus.DataMenuBar;
import Common.Visual.Tables.ColumnInfo; import Common.Visual.Tables.ColumnInfo;
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspace; import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspace;
import _VisualDVM.ComponentsServer.Subscribes.Subscriber; import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
import _VisualDVM.Global; import _VisualDVM.Global;
import _VisualDVM.Passes.PassCode; import _VisualDVM.Passes.PassCode;
@@ -46,17 +46,13 @@ public class SubscriberWorkspacesForm extends DataSetControlForm<SubscriberWorks
); );
} }
@Override @Override
public PassCode_ getDeletePassCode() {
return PassCode.DeleteSubscriberWorkspace;
}
@Override
public DataMenuBar createMenuBar() { public DataMenuBar createMenuBar() {
return new DataMenuBar(dataSource.getPluralDescription(), PassCode.DeleteSubscriberWorkspace); return new DataMenuBar(dataSource.getPluralDescription());
} }
@Override @Override
public boolean isObjectVisible(SubscriberWorkspace object) { public boolean isObjectVisible(SubscriberWorkspace object) {
Subscriber subscriber = Global.componentsServer.db.subscribers.getUI().getCurrent(); UserAccount account = Global.componentsServer.credentials_db.userAccounts.getUI().getCurrent();
return super.isObjectVisible(object) && (subscriber != null) && subscriber.address.equals(object.email) && return super.isObjectVisible(object) && (account != null) && account.email.equals(object.email) &&
(Global.mainModule.getAccount().isAdmin() || Global.mainModule.getAccount().email.equals(subscriber.address)); (Global.mainModule.getAccount().isAdmin() || Global.mainModule.getAccount().email.equals(account.email));
} }
} }

View File

@@ -1,40 +0,0 @@
package _VisualDVM.ComponentsServer.Subscribes;
import Common.Database.Objects.DBObject;
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
import com.sun.org.glassfish.gmbal.Description;
public class Subscriber extends DBObject {
//todo скорее всего вывести.ибо дублер UserAccount
@Description("PRIMARY KEY, UNIQUE")
public String address = "";
@Description("DEFAULT ''")
public String name = "";
@Description("DEFAULT 'User'")
public AccountRole role = AccountRole.User; //права доступа
@Description("DEFAULT 1")
public int mailOn = 1;
//---
public Subscriber() {
}
public Subscriber(String address_in) {
address = address_in;
}
@Override
public Object getPK() {
return address;
}
@Override
public void SynchronizeFields(DBObject src) {
super.SynchronizeFields(src);
Subscriber s = (Subscriber) src;
name = s.name;
role = s.role;
mailOn = s.mailOn;
}
//как объект будут называть по внешним ключам.
public String getFKName() {
return "email";
}
public Object getEmptyFK() {
return "";
}
}

View File

@@ -1,68 +0,0 @@
package _VisualDVM.ComponentsServer.Subscribes;
import Common.Database.Objects.DBObject;
import Common.Database.Tables.DBTable;
import Common.Database.Tables.FKBehaviour;
import Common.Database.Tables.FKCurrentObjectBehaviuor;
import Common.Database.Tables.FKDataBehaviour;
import Common.Visual.DataSetControlForm;
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspace;
import _VisualDVM.ComponentsServer.Subscribes.UI.SubsribersForm;
import _VisualDVM.Constants;
import _VisualDVM.Global;
import javax.swing.*;
import java.util.LinkedHashMap;
import java.util.Vector;
public class SubsribersDBTable extends DBTable<String, Subscriber> {
public SubsribersDBTable() {
super(String.class, Subscriber.class);
}
@Override
public String getSingleDescription() {
return "адресат";
}
@Override
public String getPluralDescription() {
return "адресаты";
}
@Override
protected DataSetControlForm createUI(JPanel mountPanel) {
return new SubsribersForm(this, mountPanel);
}
@Override
public LinkedHashMap<Class<? extends DBObject>, FKBehaviour> getFKDependencies() {
LinkedHashMap<Class<? extends DBObject>, FKBehaviour> res = new LinkedHashMap<>();
//-
res.put(SubscriberWorkspace.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
return res;
}
public Vector<String> getActiveSubscribers(){
Vector<String> res = new Vector<>();
for (Subscriber subscriber : Data.values()) {
if ((subscriber.mailOn != 0) && !res.contains(subscriber.address))
res.add(subscriber.address);
}
for (String admin_mail : Constants.admins_mails) {
if (!res.contains(admin_mail))
res.add(admin_mail);
}
return res;
}
public Vector<String> checkRecipients(Vector<String> recipients){
Vector<String> res = new Vector<>();
for (String address: recipients){
if (this.containsKey(address) && get(address).mailOn!=0){
res.add(address);
}
}
//--
if (!res.contains(Global.mainModule.getAccount().email))
res.add(Global.mainModule.getAccount().email);
//--
for (String admin_mail : Constants.admins_mails) {
if (!res.contains(admin_mail))
res.add(admin_mail);
}
return res;
}
}

View File

@@ -1,53 +0,0 @@
package _VisualDVM.ComponentsServer.Subscribes.UI;
import Common.Utils.Utils_;
import Common.Visual.UI;
import Common.Visual.Windows.Dialog.DBObjectDialog;
import _VisualDVM.ComponentsServer.Subscribes.Subscriber;
import _VisualDVM.Global;
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
public class SubscriberDialog extends DBObjectDialog<Subscriber, SubscriberFields> {
public SubscriberDialog() {
super(SubscriberFields.class);
}
@Override
public int getDefaultHeight() {
return 250;
}
@Override
public int getDefaultWidth() {
return 450;
}
@Override
public void validateFields() {
if (fields.tfName.getText().isEmpty())
Log.Writeln("Имя учётной записи не может быть пустым");
Utils_.validateEmail(fields.tfAddress.getText(), Log);
if (fields.tfAddress.getText().isEmpty())
Log.Writeln_("Адрес электронной почты не может быть пустым");
if (!title_text.equals("Регистрация") && (fields.tfAddress.isEditable() && Global.componentsServer.db.subscribers.Data.containsKey(fields.tfAddress.getText()))) {
Log.Writeln_("Адрес электронной почты " + Utils_.Brackets(fields.tfAddress.getText()) + " уже есть в списке.");
}
}
@Override
public void fillFields() {
fields.tfName.setText(Result.name);
fields.tfAddress.setText(Result.address);
fields.cbMail.setSelected(Result.mailOn != 0);
UI.TrySelect(fields.cbRole, Result.role);
}
@Override
public void SetEditLimits() {
fields.tfAddress.setEditable(false);
}
private AccountRole getSelectedRole() {
return (AccountRole) fields.cbRole.getSelectedItem();
}
@Override
public void ProcessResult() {
Result.name = fields.tfName.getText();
Result.address = fields.tfAddress.getText();
Result.mailOn = fields.cbMail.isSelected() ? 1 : 0;
Result.role = getSelectedRole();
}
};

View File

@@ -1,89 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<form xmlns="http://www.intellij.com/uidesigner/form/" version="1" bind-to-class="_VisualDVM.ComponentsServer.Subscribes.UI.SubscriberFields">
<grid id="27dc6" binding="content" layout-manager="GridLayoutManager" row-count="5" column-count="2" same-size-horizontally="false" same-size-vertically="false" hgap="-1" vgap="-1">
<margin top="0" left="0" bottom="0" right="0"/>
<constraints>
<xy x="20" y="20" width="500" height="400"/>
</constraints>
<properties/>
<border type="none"/>
<children>
<component id="81c98" class="javax.swing.JLabel">
<constraints>
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<text value="имя"/>
</properties>
</component>
<vspacer id="8f1c6">
<constraints>
<grid row="4" column="0" row-span="1" col-span="1" vsize-policy="6" hsize-policy="1" anchor="0" fill="2" indent="0" use-parent-layout="false"/>
</constraints>
</vspacer>
<component id="4c488" class="javax.swing.JLabel">
<constraints>
<grid row="1" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<text value="адрес"/>
</properties>
</component>
<component id="675ad" class="javax.swing.JTextField" binding="tfName" custom-create="true">
<constraints>
<grid row="0" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="a96c1" class="javax.swing.JTextField" binding="tfAddress" custom-create="true">
<constraints>
<grid row="1" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="6" anchor="8" fill="1" indent="0" use-parent-layout="false">
<preferred-size width="150" height="-1"/>
</grid>
</constraints>
<properties/>
</component>
<component id="1c24b" class="javax.swing.JLabel">
<constraints>
<grid row="3" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<text value="роль"/>
</properties>
</component>
<component id="81d94" class="javax.swing.JComboBox" binding="cbRole" custom-create="true">
<constraints>
<grid row="3" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="2" anchor="8" fill="1" indent="0" use-parent-layout="false"/>
</constraints>
<properties/>
</component>
<component id="fe07e" class="javax.swing.JLabel">
<constraints>
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="2" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<text value="рассылка"/>
</properties>
</component>
<component id="e0879" class="javax.swing.JCheckBox" binding="cbMail">
<constraints>
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="3" hsize-policy="3" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
</constraints>
<properties>
<font name="Times New Roman" size="16" style="2"/>
<horizontalAlignment value="0"/>
<icon value="Common/icons/NotPick.png"/>
<selectedIcon value="Common/icons/Pick.png"/>
<text value=""/>
<toolTipText value="Будет ли включена рассылка для этого пользователя"/>
</properties>
</component>
</children>
</grid>
</form>

View File

@@ -1,27 +0,0 @@
package _VisualDVM.ComponentsServer.Subscribes.UI;
import Common.Visual.TextField.StyledTextField;
import Common.Visual.Windows.Dialog.DialogFields;
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
import javax.swing.*;
import java.awt.*;
public class SubscriberFields implements DialogFields {
public JTextField tfName;
public JTextField tfAddress;
public JComboBox<AccountRole> cbRole;
public JCheckBox cbMail;
private JPanel content;
@Override
public Component getContent() {
return content;
}
private void createUIComponents() {
// TODO: place custom component creation code here
tfName = new StyledTextField();
tfAddress = new StyledTextField();
cbRole = new JComboBox<>();
cbRole.addItem(AccountRole.User);
cbRole.addItem(AccountRole.Developer);
cbRole.addItem(AccountRole.Admin);
}
}

View File

@@ -1,80 +0,0 @@
package _VisualDVM.ComponentsServer.Subscribes.UI;
import Common.Database.Tables.DataSet;
import Common.Passes.PassCode_;
import Common.Visual.DataSetControlForm;
import Common.Visual.Menus.DataMenuBar;
import Common.Visual.Tables.ColumnInfo;
import Common.Visual.Windows.Dialog.DBObjectDialog;
import Common.Visual.Windows.Dialog.DialogFields;
import _VisualDVM.ComponentsServer.Subscribes.Subscriber;
import _VisualDVM.Global;
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
import _VisualDVM.Passes.PassCode;
import javax.swing.*;
public class SubsribersForm extends DataSetControlForm<Subscriber> {
public SubsribersForm(DataSet<?, Subscriber> dataSource_in, JPanel mountPanel_in) {
super(dataSource_in, mountPanel_in);
}
@Override
protected ColumnInfo<Subscriber> createPKColumn() {
return new ColumnInfo<Subscriber>(dataSource.getPKName()) {
@Override
public Object getFieldAt(Subscriber object) {
return object.getPK();
}
@Override
public boolean isVisible() {
return Global.mainModule.getAccount().role.equals(AccountRole.Admin);
}
};
}
@Override
protected void createColumns() {
AddColumns(
new ColumnInfo<Subscriber>("Имя") {
@Override
public Object getFieldAt(Subscriber object) {
return object.name;
}
},
new ColumnInfo<Subscriber>("Роль") {
@Override
public Object getFieldAt(Subscriber object) {
return object.role.getDescription();
}
@Override
public boolean isVisible() {
return Global.mainModule.getAccount().role.equals(AccountRole.Admin);
}
},
new ColumnInfo<Subscriber>("Рассылка") {
@Override
public Object getFieldAt(Subscriber object) {
return (object.mailOn == 0) ? "выключена" : "включена";
}
@Override
public boolean isVisible() {
return Global.mainModule.getAccount().role.equals(AccountRole.Admin);
}
}
);
}
@Override
public PassCode_ getDeletePassCode() {
return PassCode.DeleteSubscriber;
}
@Override
public DataMenuBar createMenuBar() {
return new DataMenuBar(dataSource.getPluralDescription(),
PassCode.SaveBugReportExecutor,
PassCode.SaveBugReportRecipients,
PassCode.AddSubscriber,
PassCode.EditSubscriber,
PassCode.DeleteSubscriber);
}
@Override
protected DBObjectDialog<Subscriber, ? extends DialogFields> getDialog() {
return new SubscriberDialog();
}
}

View File

@@ -24,7 +24,7 @@ public class UserAccountDialog extends DBObjectDialog<UserAccount, UserAccountFi
Utils_.validateEmail(fields.tfAddress.getText(), Log); Utils_.validateEmail(fields.tfAddress.getText(), Log);
if (fields.tfAddress.getText().isEmpty()) if (fields.tfAddress.getText().isEmpty())
Log.Writeln_("Адрес электронной почты не может быть пустым"); Log.Writeln_("Адрес электронной почты не может быть пустым");
if (!title_text.equals("Регистрация") && (fields.tfAddress.isEditable() && Global.componentsServer.db.subscribers.Data.containsKey(fields.tfAddress.getText()))) { if (!title_text.equals("Регистрация") && (fields.tfAddress.isEditable() && Global.componentsServer.credentials_db.userAccounts.Data.containsKey(fields.tfAddress.getText()))) {
Log.Writeln_("Адрес электронной почты " + Utils_.Brackets(fields.tfAddress.getText()) + " уже есть в списке."); Log.Writeln_("Адрес электронной почты " + Utils_.Brackets(fields.tfAddress.getText()) + " уже есть в списке.");
} }
} }

View File

@@ -1,9 +1,19 @@
package _VisualDVM.ComponentsServer.UserAccount; package _VisualDVM.ComponentsServer.UserAccount;
import Common.Database.Objects.DBObject;
import Common.Database.Tables.FKBehaviour;
import Common.Database.Tables.FKCurrentObjectBehaviuor;
import Common.Database.Tables.FKDataBehaviour;
import Common.Database.Tables.iDBTable; import Common.Database.Tables.iDBTable;
import Common.Utils.Utils_;
import Common.Visual.DataSetControlForm; import Common.Visual.DataSetControlForm;
import _VisualDVM.ComponentsServer.Recipient.Json.RecipientJson;
import _VisualDVM.ComponentsServer.Recipient.Json.RecipientsJson;
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspace;
import _VisualDVM.ComponentsServer.UserAccount.UI.UserAccountsForm; import _VisualDVM.ComponentsServer.UserAccount.UI.UserAccountsForm;
import javax.swing.*; import javax.swing.*;
import java.util.LinkedHashMap;
import java.util.Vector;
public class UserAccountsDBTable extends iDBTable<UserAccount> { public class UserAccountsDBTable extends iDBTable<UserAccount> {
public UserAccountsDBTable() { public UserAccountsDBTable() {
super(UserAccount.class); super(UserAccount.class);
@@ -34,4 +44,23 @@ public class UserAccountsDBTable extends iDBTable<UserAccount> {
public String getPluralDescription() { public String getPluralDescription() {
return "учётные записи"; return "учётные записи";
} }
@Override
public LinkedHashMap<Class<? extends DBObject>, FKBehaviour> getFKDependencies() {
LinkedHashMap<Class<? extends DBObject>, FKBehaviour> res = new LinkedHashMap<>();
//-
res.put(SubscriberWorkspace.class, new FKBehaviour(FKDataBehaviour.DELETE, FKCurrentObjectBehaviuor.ACTIVE));
return res;
}
public String getPackedActiveRecipients(){
RecipientsJson res = new RecipientsJson();
Vector<String> active = new Vector<>();
for (UserAccount userAccount: Data.values()){
if ((userAccount.subscribe_active!=0) && !active.contains(userAccount.email)){
active.add(userAccount.email);
res.values.add(new RecipientJson(userAccount.email, userAccount.name));
}
}
return Utils_.gson.toJson(res);
}
} }

View File

@@ -19,10 +19,6 @@ public class MainModule extends MainModule_<GlobalDatabase, MainUI> {
UserAccount account = null; UserAccount account = null;
//-- //--
Vector<PassCode> accountRoleDependentPasses = new Vector_<>( Vector<PassCode> accountRoleDependentPasses = new Vector_<>(
PassCode.AddSubscriber,
PassCode.EditSubscriber,
PassCode.DeleteSubscriber,
PassCode.DeleteSubscriberWorkspace,
//-- //--
PassCode.DownloadAllBugReportsArchives, PassCode.DownloadAllBugReportsArchives,
//-- //--

View File

@@ -1,10 +0,0 @@
package _VisualDVM.Passes.All;
import _VisualDVM.ComponentsServer.ComponentsServer;
import _VisualDVM.ComponentsServer.Subscribes.Subscriber;
import _VisualDVM.Global;
import _VisualDVM.Passes.Server.PublishServerObject;
public class AddSubscriber extends PublishServerObject<ComponentsServer, Subscriber> {
public AddSubscriber() {
super(Global.componentsServer, Subscriber.class);
}
}

View File

@@ -76,9 +76,11 @@ public class AppendBugReportField extends ComponentsServerPass<BugReport> {
message_header + " " + Utils_.Brackets(Global.mainModule.getAccount().name), message_header + " " + Utils_.Brackets(Global.mainModule.getAccount().name),
message_text message_text
); );
/*
Global.mainModule.getPass(PassCode.Email).Do( Global.mainModule.getPass(PassCode.Email).Do(
message, message,
Global.componentsServer.db.subscribers.checkRecipients(target.getRecipients()) Global.componentsServer.db.subscribers.checkRecipients(target.getRecipients())
); );
*/
} }
} }

View File

@@ -1,10 +0,0 @@
package _VisualDVM.Passes.All;
import _VisualDVM.ComponentsServer.ComponentsServer;
import _VisualDVM.ComponentsServer.Subscribes.Subscriber;
import _VisualDVM.Global;
import _VisualDVM.Passes.Server.DeleteServerObject;
public class DeleteSubscriber extends DeleteServerObject<ComponentsServer, Subscriber> {
public DeleteSubscriber() {
super(Global.componentsServer, Subscriber.class);
}
}

View File

@@ -1,10 +0,0 @@
package _VisualDVM.Passes.All;
import _VisualDVM.ComponentsServer.ComponentsServer;
import _VisualDVM.ComponentsServer.SubscriberWorkspace.SubscriberWorkspace;
import _VisualDVM.Global;
import _VisualDVM.Passes.Server.DeleteServerObject;
public class DeleteSubscriberWorkspace extends DeleteServerObject<ComponentsServer, SubscriberWorkspace> {
public DeleteSubscriberWorkspace() {
super(Global.componentsServer, SubscriberWorkspace.class);
}
}

View File

@@ -1,72 +0,0 @@
package _VisualDVM.Passes.All;
import Common.Utils.Utils_;
import Common.Visual.UI;
import _VisualDVM.ComponentsServer.Subscribes.Subscriber;
import _VisualDVM.ComponentsServer.Subscribes.UI.SubscriberDialog;
import _VisualDVM.Global;
import _VisualDVM.Repository.EmailMessage;
import javax.swing.*;
public class EditAccount extends Email {
public String name;
public String email;
String password;
SubscriberDialog f = new SubscriberDialog() {
{
fields.cbRole.setEnabled(false);
}
};
public static int getRandomIntegerBetweenRange(int min, int max) {
return (int) ((Math.random() * ((max - min) + 1)) + min);
}
@Override
protected boolean isSafe() {
return false;
}
@Override
protected boolean canStart(Object... args) throws Exception {
Subscriber res = new Subscriber(); // объект для заполнения полей.не более.
if (f.ShowDialog("Регистрация", res)) {
if (!Utils_.validateEmail(res.address, Log)) {
return false;
}
name = res.name;
email = res.address;
password = String.valueOf(getRandomIntegerBetweenRange(1111, 9999));
return super.canStart(
new EmailMessage("Код подтверждения визуализатора для: " + Utils_.Brackets(name), password),
email
);
}
return false;
}
@Override
protected boolean validate() {
String attempt = null;
do {
attempt = JOptionPane.showInputDialog(null,
new String[]{"Введите код активации, полученный по почте"},
"Подтверждение адреса почты",
JOptionPane.INFORMATION_MESSAGE);
if (attempt != null) {
if (attempt.equals(password)) {
UI.Info("Почта успешно подтверждена!");
return true;
} else {
UI.Error("Неверный код активации.\овторите попытку.");
}
} else {
UI.Info("Подтверждение почты отменено");
return false;
}
} while (true);
}
@Override
protected void performDone() throws Exception {
super.performDone();
Global.mainModule.getAccount().name = name;
Global.mainModule.getAccount().email = email;
Global.mainModule.getDb().Update(Global.mainModule.getAccount());
//это не регистрация. только заполнение почты в своей бд и ее подтверждение на реальность.
}
}

View File

@@ -1,10 +0,0 @@
package _VisualDVM.Passes.All;
import _VisualDVM.ComponentsServer.ComponentsServer;
import _VisualDVM.ComponentsServer.Subscribes.Subscriber;
import _VisualDVM.Global;
import _VisualDVM.Passes.Server.EditServerObject;
public class EditSubscriber extends EditServerObject<ComponentsServer, Subscriber> {
public EditSubscriber() {
super(Global.componentsServer, Subscriber.class);
}
}

View File

@@ -43,7 +43,7 @@ public class PublishBugReport extends Pass<BugReport> {
@Override @Override
protected void body() throws Exception { protected void body() throws Exception {
// target.targets = BugReport.getPackedTargets(); // target.targets = BugReport.getPackedTargets();
target.saveRecipientsAsJson(Global.componentsServer.db.subscribers.getUI().getSelectedItems()); // target.saveRecipientsAsJson(Global.componentsServer.db.subscribers.getUI().getSelectedItems());
target.change_date = new Date().getTime(); target.change_date = new Date().getTime();
Global.componentsServer.db.Update(target); Global.componentsServer.db.Update(target);
target.state = BugReportState.active; target.state = BugReportState.active;
@@ -67,10 +67,12 @@ public class PublishBugReport extends Pass<BugReport> {
message.addAttachement(screen); message.addAttachement(screen);
} }
} }
/*
Global.mainModule.getPass(PassCode.Email).Do( Global.mainModule.getPass(PassCode.Email).Do(
message, message,
Global.componentsServer.db.subscribers.checkRecipients(target.getRecipients()) Global.componentsServer.db.subscribers.checkRecipients(target.getRecipients())
); );
*/
} }
@Override @Override
protected void showDone() throws Exception { protected void showDone() throws Exception {

View File

@@ -100,7 +100,7 @@ public class PublishComponent extends ComponentsServerPass<Component> {
return false; return false;
} }
}; };
unsafeEmail.Do(message, Global.componentsServer.db.subscribers.getActiveSubscribers()); // unsafeEmail.Do(message, Global.componentsServer.db.subscribers.getActiveSubscribers());
//--- //---
if (target.getComponentType().equals(ComponentType.Sapfor_F) && f.fields.cbAssemblyOnServer.isSelected()) { if (target.getComponentType().equals(ComponentType.Sapfor_F) && f.fields.cbAssemblyOnServer.isSelected()) {
Global.mainModule.getUI().getMainWindow().FocusTesting(); Global.mainModule.getUI().getMainWindow().FocusTesting();

View File

@@ -11,9 +11,12 @@ public class SaveBugReportExecutor extends UpdateBugReportField {
} }
@Override @Override
protected boolean canStart(Object... args) throws Exception { protected boolean canStart(Object... args) throws Exception {
return false;
/*
return Global.componentsServer.db.subscribers.getUI().CheckCurrent(Log) && return Global.componentsServer.db.subscribers.getUI().CheckCurrent(Log) &&
super.canStart("executor", Global.componentsServer.db.subscribers.getUI().getCurrent().name, super.canStart("executor", Global.componentsServer.db.subscribers.getUI().getCurrent().name,
"executor_address", Global.componentsServer.db.subscribers.getUI().getCurrent().address "executor_address", Global.componentsServer.db.subscribers.getUI().getCurrent().address
); );
*/
} }
} }

View File

@@ -13,6 +13,7 @@ public class SaveBugReportRecipients extends UpdateBugReportField {
} }
@Override @Override
protected boolean canStart(Object... args) throws Exception { protected boolean canStart(Object... args) throws Exception {
return super.canStart("packedRecipientsJson", Utils_.gson.toJson(new RecipientsJson(Global.componentsServer.db.subscribers.getUI().getSelectedItems()))); //return super.canStart("packedRecipientsJson", Utils_.gson.toJson(new RecipientsJson(Global.componentsServer.db.subscribers.getUI().getSelectedItems())));
return false;
} }
} }

View File

@@ -1,4 +1,8 @@
package _VisualDVM.Passes.All; package _VisualDVM.Passes.All;
import Common.Utils.Utils_;
import _VisualDVM.ComponentsServer.Recipient.Json.RecipientJson;
import _VisualDVM.ComponentsServer.Recipient.Json.RecipientsJson;
import _VisualDVM.ComponentsServer.Recipient.Recipient;
import _VisualDVM.Global; import _VisualDVM.Global;
import _VisualDVM.Passes.Server.ComponentsServerPass; import _VisualDVM.Passes.Server.ComponentsServerPass;
import _VisualDVM.Repository.Server.ServerCode; import _VisualDVM.Repository.Server.ServerCode;
@@ -22,6 +26,7 @@ public class SynchronizeBugReports extends ComponentsServerPass<Object> {
@Override @Override
protected void body() throws Exception { protected void body() throws Exception {
request.server_response.Unpack(new_db_file = Utils.getTempFileName("bdb")); request.server_response.Unpack(new_db_file = Utils.getTempFileName("bdb"));
Global.componentsServer.db.recipients.Unpack(request.server_response.arg);
} }
@Override @Override
protected void performDone() throws Exception { protected void performDone() throws Exception {

View File

@@ -1,5 +1,6 @@
package _VisualDVM.Passes.All; package _VisualDVM.Passes.All;
import Common.Passes.Pass; import Common.Passes.Pass;
import _VisualDVM.Global;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.File; import java.io.File;
@@ -40,6 +41,7 @@ public class TestPass extends Pass {
} }
@Override @Override
protected void body() throws Exception { protected void body() throws Exception {
System.out.println(Global.componentsServer.credentials_db.userAccounts.getPackedActiveRecipients());
// String cpuId = getMotherboardSN(); // String cpuId = getMotherboardSN();
// UI.Info(cpuId); // UI.Info(cpuId);
/* /*

View File

@@ -124,10 +124,12 @@ public class UpdateBugReportField extends ComponentsServerPass<BugReport> {
message_header + " " + Utils_.Brackets(Global.mainModule.getAccount().name), message_header + " " + Utils_.Brackets(Global.mainModule.getAccount().name),
message_text message_text
); );
/*
Global.mainModule.getPass(PassCode.Email).Do( Global.mainModule.getPass(PassCode.Email).Do(
message, message,
getServer().db.subscribers.checkRecipients(target.getRecipients()) getServer().db.subscribers.checkRecipients(target.getRecipients())
); );
*/
} }
} }
} }

View File

@@ -15,10 +15,6 @@ public enum PassCode implements PassCode_ {
DeleteProfile, DeleteProfile,
//- //-
CheckAccount, CheckAccount,
EditAccount,
AddSubscriber,
EditSubscriber,
DeleteSubscriber,
//---- //----
SetSelectedFilesLanguage, SetSelectedFilesLanguage,
SetSelectedFilesStyle, SetSelectedFilesStyle,
@@ -288,7 +284,6 @@ public enum PassCode implements PassCode_ {
CreateTestFromFile, CreateTestFromFile,
CreateTestsFromFiles, CreateTestsFromFiles,
CreateGroupFromFiles, CreateGroupFromFiles,
DeleteSubscriberWorkspace,
ExportDVMPackageToExcel, ExportDVMPackageToExcel,
//-> //->
ActualizeDVMPackages, ActualizeDVMPackages,

View File

@@ -4,8 +4,6 @@ public interface CallbackWindow extends VisualizerForm {
void ShowAccount(); void ShowAccount();
void ShowBugReports(); void ShowBugReports();
void ShowNoBugReports(); void ShowNoBugReports();
void ShowSubscribers();
void ShowNoSubscribers();
void ShowCurrentBugReport(); void ShowCurrentBugReport();
void ShowNoCurrentBugReport(); void ShowNoCurrentBugReport();
void ShowSubscription(); void ShowSubscription();
@@ -14,7 +12,6 @@ public interface CallbackWindow extends VisualizerForm {
ShowAccount(); ShowAccount();
ShowSubscription(); ShowSubscription();
ShowBugReports(); ShowBugReports();
ShowSubscribers();
} }
String getBugReportDescriptionText(); String getBugReportDescriptionText();
String getBugReportDescriptionAdditionText(); String getBugReportDescriptionAdditionText();

View File

@@ -16,6 +16,7 @@ public class AdministrationForm implements FormWithSplitters, AdministrationWind
public AdministrationForm(){ public AdministrationForm(){
LoadSplitters(); LoadSplitters();
Global.componentsServer.credentials_db.userAccounts.mountUI(userAccountsPanel); Global.componentsServer.credentials_db.userAccounts.mountUI(userAccountsPanel);
Global.componentsServer.credentials_db.workspaces.mountUI(workspacesPanel);
} }
@Override @Override
public void ShowAll() { public void ShowAll() {

View File

@@ -418,7 +418,7 @@
</properties> </properties>
<border type="none"/> <border type="none"/>
<children> <children>
<grid id="bd1dc" binding="subscribersPanel" layout-manager="BorderLayout" hgap="0" vgap="0"> <grid id="bd1dc" binding="recipientsPanel" layout-manager="BorderLayout" hgap="0" vgap="0">
<constraints border-constraint="Center"/> <constraints border-constraint="Center"/>
<properties/> <properties/>
<border type="none"/> <border type="none"/>

View File

@@ -101,7 +101,7 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
private JPanel accountPanel; private JPanel accountPanel;
private JPanel bugReportsPanel; private JPanel bugReportsPanel;
private JPanel filterFormPanel; private JPanel filterFormPanel;
private JPanel subscribersPanel; private JPanel recipientsPanel;
private JTabbedPane currentBugReportTabs; private JTabbedPane currentBugReportTabs;
private JScrollPane bugSettingsScroll; private JScrollPane bugSettingsScroll;
private JCheckBox BugReportsMyOnlyFilter; private JCheckBox BugReportsMyOnlyFilter;
@@ -153,8 +153,7 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
SwitchScreen(Global.normalProperties.SmallScreen); SwitchScreen(Global.normalProperties.SmallScreen);
//- //-
Global.componentsServer.db.bugReports.mountUI(bugReportsPanel); Global.componentsServer.db.bugReports.mountUI(bugReportsPanel);
Global.componentsServer.db.subscribers.mountUI(subscribersPanel); Global.componentsServer.db.recipients.mountUI(recipientsPanel);
// Global.componentsServer.db.workspaces.mountUI(workspacesPanel);
//- //-
if (!Global.mainModule.getPass(PassCode.CheckAccount).isDone()) { if (!Global.mainModule.getPass(PassCode.CheckAccount).isDone()) {
accountTools.add(Global.mainModule.getPass(PassCode.CheckAccount).createButton()); accountTools.add(Global.mainModule.getPass(PassCode.CheckAccount).createButton());
@@ -457,19 +456,12 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
@Override @Override
public void ShowBugReports() { public void ShowBugReports() {
Global.componentsServer.db.bugReports.ShowUI(); Global.componentsServer.db.bugReports.ShowUI();
Global.componentsServer.db.recipients.ShowUI();
} }
@Override @Override
public void ShowNoBugReports() { public void ShowNoBugReports() {
Global.componentsServer.db.bugReports.ClearUI(); Global.componentsServer.db.bugReports.ClearUI();
} }
@Override
public void ShowSubscribers() {
Global.componentsServer.db.subscribers.ShowUI();
}
@Override
public void ShowNoSubscribers() {
Global.componentsServer.db.subscribers.ClearUI();
}
private void ShowDraft() { private void ShowDraft() {
Global.mainModule.setPassesControlsVisible(true, Global.mainModule.setPassesControlsVisible(true,
PassCode.PublishBugReport, PassCode.PublishBugReport,
@@ -545,8 +537,8 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
SwitchListeners(false); SwitchListeners(false);
// currentBugReportTabs.setSelectedIndex(0); // currentBugReportTabs.setSelectedIndex(0);
BugReport target = Global.componentsServer.db.bugReports.getUI().getCurrent(); BugReport target = Global.componentsServer.db.bugReports.getUI().getCurrent();
target.CheckSubscribers(); // target.CheckSubscribers();
Global.componentsServer.db.subscribers.ShowUI(); // Global.componentsServer.db.subscribers.ShowUI();
//- //-
BugReportDescription.setText(target.description); BugReportDescription.setText(target.description);
BugReportDescription.ShowBegin(); BugReportDescription.ShowBegin();
@@ -582,7 +574,7 @@ public class CallbackForm implements FormWithSplitters, CallbackWindow {
@Override @Override
public void ShowNoCurrentBugReport() { public void ShowNoCurrentBugReport() {
SwitchListeners(false); SwitchListeners(false);
Global.componentsServer.db.subscribers.ShowUI(); // Global.componentsServer.db.subscribers.ShowUI();
//- //-
BugReportDescription.setText(""); BugReportDescription.setText("");
BugReportComment.setText(""); BugReportComment.setText("");