промежуточный. загрузка адресатов для багов без наличия их в бд.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -76,9 +76,11 @@ public class AppendBugReportField extends ComponentsServerPass<BugReport> {
|
||||
message_header + " " + Utils_.Brackets(Global.mainModule.getAccount().name),
|
||||
message_text
|
||||
);
|
||||
/*
|
||||
Global.mainModule.getPass(PassCode.Email).Do(
|
||||
message,
|
||||
Global.componentsServer.db.subscribers.checkRecipients(target.getRecipients())
|
||||
);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -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("Неверный код активации.\nПовторите попытку.");
|
||||
}
|
||||
} 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());
|
||||
//это не регистрация. только заполнение почты в своей бд и ее подтверждение на реальность.
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
@@ -43,7 +43,7 @@ public class PublishBugReport extends Pass<BugReport> {
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
// 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();
|
||||
Global.componentsServer.db.Update(target);
|
||||
target.state = BugReportState.active;
|
||||
@@ -67,10 +67,12 @@ public class PublishBugReport extends Pass<BugReport> {
|
||||
message.addAttachement(screen);
|
||||
}
|
||||
}
|
||||
/*
|
||||
Global.mainModule.getPass(PassCode.Email).Do(
|
||||
message,
|
||||
Global.componentsServer.db.subscribers.checkRecipients(target.getRecipients())
|
||||
);
|
||||
*/
|
||||
}
|
||||
@Override
|
||||
protected void showDone() throws Exception {
|
||||
|
||||
@@ -100,7 +100,7 @@ public class PublishComponent extends ComponentsServerPass<Component> {
|
||||
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()) {
|
||||
Global.mainModule.getUI().getMainWindow().FocusTesting();
|
||||
|
||||
@@ -11,9 +11,12 @@ public class SaveBugReportExecutor extends UpdateBugReportField {
|
||||
}
|
||||
@Override
|
||||
protected boolean canStart(Object... args) throws Exception {
|
||||
return false;
|
||||
/*
|
||||
return Global.componentsServer.db.subscribers.getUI().CheckCurrent(Log) &&
|
||||
super.canStart("executor", Global.componentsServer.db.subscribers.getUI().getCurrent().name,
|
||||
"executor_address", Global.componentsServer.db.subscribers.getUI().getCurrent().address
|
||||
);
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,7 @@ public class SaveBugReportRecipients extends UpdateBugReportField {
|
||||
}
|
||||
@Override
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,8 @@
|
||||
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.Passes.Server.ComponentsServerPass;
|
||||
import _VisualDVM.Repository.Server.ServerCode;
|
||||
@@ -22,6 +26,7 @@ public class SynchronizeBugReports extends ComponentsServerPass<Object> {
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
request.server_response.Unpack(new_db_file = Utils.getTempFileName("bdb"));
|
||||
Global.componentsServer.db.recipients.Unpack(request.server_response.arg);
|
||||
}
|
||||
@Override
|
||||
protected void performDone() throws Exception {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package _VisualDVM.Passes.All;
|
||||
import Common.Passes.Pass;
|
||||
import _VisualDVM.Global;
|
||||
|
||||
import java.io.BufferedReader;
|
||||
import java.io.File;
|
||||
@@ -40,6 +41,7 @@ public class TestPass extends Pass {
|
||||
}
|
||||
@Override
|
||||
protected void body() throws Exception {
|
||||
System.out.println(Global.componentsServer.credentials_db.userAccounts.getPackedActiveRecipients());
|
||||
// String cpuId = getMotherboardSN();
|
||||
// UI.Info(cpuId);
|
||||
/*
|
||||
|
||||
@@ -124,10 +124,12 @@ public class UpdateBugReportField extends ComponentsServerPass<BugReport> {
|
||||
message_header + " " + Utils_.Brackets(Global.mainModule.getAccount().name),
|
||||
message_text
|
||||
);
|
||||
/*
|
||||
Global.mainModule.getPass(PassCode.Email).Do(
|
||||
message,
|
||||
getServer().db.subscribers.checkRecipients(target.getRecipients())
|
||||
);
|
||||
*/
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user