2025-02-18 16:21:20 +03:00
|
|
|
|
package _VisualDVM.ComponentsServer;
|
2025-03-21 01:21:54 +03:00
|
|
|
|
import Common.Database.Database;
|
2024-10-07 00:58:29 +03:00
|
|
|
|
import Common.Database.Objects.DBObject;
|
2024-10-17 17:22:33 +03:00
|
|
|
|
import Common.Database.RepositoryRefuseException;
|
2024-10-11 00:00:30 +03:00
|
|
|
|
import Common.Utils.Utils_;
|
2025-02-18 16:21:20 +03:00
|
|
|
|
import _VisualDVM.ComponentsServer.BugReport.BugReport;
|
|
|
|
|
|
import _VisualDVM.ComponentsServer.BugReport.Json.BugReportAdditionJson;
|
2025-03-27 12:45:55 +03:00
|
|
|
|
import _VisualDVM.ComponentsServer.BugReportSetting.BugReportSetting;
|
2025-02-18 16:21:20 +03:00
|
|
|
|
import _VisualDVM.ComponentsServer.Component.ComponentType;
|
|
|
|
|
|
import _VisualDVM.ComponentsServer.Component.Json.ComponentPublicationInfoJson;
|
|
|
|
|
|
import _VisualDVM.ComponentsServer.Component.Json.ComponentVersionsInfoJson;
|
2025-02-19 01:10:25 +03:00
|
|
|
|
import _VisualDVM.ComponentsServer.UserAccount.AccountRole;
|
2025-02-18 16:21:20 +03:00
|
|
|
|
import _VisualDVM.ComponentsServer.UserAccount.UserAccount;
|
2024-11-27 02:42:26 +03:00
|
|
|
|
import _VisualDVM.Constants;
|
2024-10-07 00:58:29 +03:00
|
|
|
|
import _VisualDVM.Global;
|
2024-10-09 22:21:57 +03:00
|
|
|
|
import _VisualDVM.GlobalData.RemoteFile.RemoteFile;
|
2024-10-14 15:19:13 +03:00
|
|
|
|
import _VisualDVM.Passes.All.ZipFolderPass;
|
2024-10-09 22:21:57 +03:00
|
|
|
|
import _VisualDVM.ProjectData.LanguageName;
|
|
|
|
|
|
import _VisualDVM.Repository.EmailMessage;
|
2025-02-18 16:21:20 +03:00
|
|
|
|
import _VisualDVM.Repository.Server.RepositoryServer;
|
2024-10-14 15:19:13 +03:00
|
|
|
|
import _VisualDVM.Utils;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
import javafx.util.Pair;
|
|
|
|
|
|
import org.apache.commons.io.FileUtils;
|
|
|
|
|
|
|
|
|
|
|
|
import java.io.BufferedWriter;
|
|
|
|
|
|
import java.io.File;
|
|
|
|
|
|
import java.io.FileWriter;
|
2025-02-03 19:53:48 +03:00
|
|
|
|
import java.lang.reflect.Field;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
import java.nio.file.Paths;
|
2025-02-13 20:27:01 +03:00
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
|
import java.util.Date;
|
|
|
|
|
|
import java.util.Vector;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
public class ComponentsServer extends RepositoryServer<BugReportsDatabase> {
|
2025-02-18 16:21:20 +03:00
|
|
|
|
public CredentialsDatabase credentials_db = null;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
public ComponentsServer() {
|
|
|
|
|
|
super(BugReportsDatabase.class);
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
2025-02-13 20:27:01 +03:00
|
|
|
|
public String getServerHomeName() {
|
|
|
|
|
|
return "_sapfor_x64";
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
2023-09-17 22:13:42 +03:00
|
|
|
|
public int getPort() {
|
2025-02-08 19:19:26 +03:00
|
|
|
|
return Constants.ComponentsServerPort;
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
@Override
|
2025-03-08 02:42:21 +03:00
|
|
|
|
protected void extraBackup(File todayBackUp) {
|
2025-03-13 00:32:20 +03:00
|
|
|
|
zip.Do("Bugs", new File(todayBackUp, "Bugs.zip").getAbsolutePath());
|
2025-03-08 02:42:21 +03:00
|
|
|
|
}
|
|
|
|
|
|
@Override
|
2025-03-21 01:21:54 +03:00
|
|
|
|
public Database getDb() {
|
|
|
|
|
|
if (request.arg.equals("credentials"))
|
|
|
|
|
|
return credentials_db;
|
|
|
|
|
|
return super.getDb();
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
2025-02-03 23:50:09 +03:00
|
|
|
|
protected void beforePublishAction(DBObject object) throws Exception {
|
2025-02-13 20:27:01 +03:00
|
|
|
|
if (object instanceof BugReport) {
|
|
|
|
|
|
BugReport bugReport = (BugReport) object;
|
|
|
|
|
|
if (bugReport.packed_archive != null) {
|
|
|
|
|
|
File bugArchive = Utils_.getFile(Utils_.getHomePath(), "Bugs", bugReport.id);
|
|
|
|
|
|
Utils_.bytesToFile(bugReport.packed_archive, bugArchive);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-02-03 23:50:09 +03:00
|
|
|
|
}
|
|
|
|
|
|
@Override
|
2025-03-27 12:45:55 +03:00
|
|
|
|
protected void afterPublishAction(DBObject object) throws Exception {
|
|
|
|
|
|
if (object instanceof BugReport){
|
|
|
|
|
|
BugReport bugReport = (BugReport) object;
|
|
|
|
|
|
if (bugReport.settings!=null){
|
|
|
|
|
|
for (BugReportSetting setting: bugReport.settings){
|
|
|
|
|
|
setting.bugreport_id=bugReport.id;
|
|
|
|
|
|
db.Insert(setting);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
2025-02-13 20:27:01 +03:00
|
|
|
|
protected void afterDeleteAction(DBObject object) throws Exception {
|
2023-09-17 22:13:42 +03:00
|
|
|
|
if (object instanceof BugReport) {
|
|
|
|
|
|
BugReport bugReport = (BugReport) object;
|
2025-02-13 20:27:01 +03:00
|
|
|
|
if (!bugReport.project_version.isEmpty()) Utils_.forceDeleteWithCheck(bugReport.getArchiveFile());
|
2025-03-13 00:32:20 +03:00
|
|
|
|
} else if (object instanceof UserAccount) {
|
2025-02-19 14:34:42 +03:00
|
|
|
|
UserAccount account = (UserAccount) object;
|
|
|
|
|
|
Utils_.forceDeleteWithCheck(account.getServerKeyFile());
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
2025-02-18 23:45:24 +03:00
|
|
|
|
public void ActivateDB() {
|
|
|
|
|
|
super.ActivateDB();
|
2025-02-18 16:21:20 +03:00
|
|
|
|
try {
|
|
|
|
|
|
credentials_db = new CredentialsDatabase();
|
|
|
|
|
|
credentials_db.Activate();
|
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
|
ex.printStackTrace();
|
|
|
|
|
|
}
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
2025-02-13 22:25:54 +03:00
|
|
|
|
//-
|
|
|
|
|
|
void DVMConvertProject() throws Exception {
|
2025-02-13 20:27:01 +03:00
|
|
|
|
String[] args = request.arg.split("\n");
|
|
|
|
|
|
//-
|
|
|
|
|
|
String projectName = args[0];
|
|
|
|
|
|
LanguageName projectLanguage = LanguageName.valueOf(args[1]);
|
|
|
|
|
|
String options = args[2];
|
|
|
|
|
|
Vector<String> filesNames = new Vector<>(Arrays.asList(args).subList(3, args.length));
|
|
|
|
|
|
//-
|
|
|
|
|
|
File workspace = Utils.getTempFileName("convertation");
|
|
|
|
|
|
FileUtils.forceMkdir(workspace);
|
|
|
|
|
|
File archive = new File(workspace, projectName + ".zip");
|
|
|
|
|
|
request.Unpack(archive);
|
|
|
|
|
|
File project = new File(workspace, projectName);
|
|
|
|
|
|
Vector<String> badFiles = new Vector<>();
|
|
|
|
|
|
if (unzip.Do(archive.getAbsolutePath(), workspace.getAbsolutePath()) && project.exists()) {
|
|
|
|
|
|
String output = "";
|
|
|
|
|
|
for (String fileName : filesNames) {
|
|
|
|
|
|
File program = Paths.get(project.getAbsolutePath(), fileName).toFile();
|
|
|
|
|
|
//--
|
|
|
|
|
|
File convertedProgram = Paths.get(program.getParent(), Utils_.getFileNameWithoutExtension(program) + ".DVMH." + (projectLanguage.equals(LanguageName.fortran) ? "f" : "c")).toFile();
|
2025-02-20 15:21:41 +03:00
|
|
|
|
String command = Utils_.DQuotes(Global.componentsServerProperties.default_dvm_drv) + " " + projectLanguage.getDVMCompile() + "dv " + options + " " + Utils_.DQuotes(program.getName());
|
2025-02-13 20:27:01 +03:00
|
|
|
|
//--
|
|
|
|
|
|
File fileWorkspace = program.getParentFile();
|
|
|
|
|
|
Process process = Utils.startScript(workspace, fileWorkspace, Utils_.getDateName("convert_script"), command);
|
|
|
|
|
|
process.waitFor();
|
|
|
|
|
|
String convertationOut = Utils.readAllOutput(process);
|
|
|
|
|
|
convertationOut = convertationOut.replace(program.getName(), fileName); //для учета пути.
|
|
|
|
|
|
if (!convertationOut.isEmpty()) output += convertationOut + "\n";
|
|
|
|
|
|
try {
|
|
|
|
|
|
if (convertedProgram.exists()) {
|
|
|
|
|
|
FileUtils.forceDelete(program);
|
|
|
|
|
|
convertedProgram.renameTo(program);
|
|
|
|
|
|
} else badFiles.add(program.getName());
|
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
|
ex.printStackTrace();
|
|
|
|
|
|
}
|
|
|
|
|
|
//--
|
|
|
|
|
|
}
|
|
|
|
|
|
response.arg = String.join("\n", badFiles) + "|" + output;
|
|
|
|
|
|
File resultArchive = new File(workspace, projectName + "_result.zip");
|
|
|
|
|
|
if (ComponentsServer.zip.Do(project.getAbsolutePath(), resultArchive.getAbsolutePath())) {
|
|
|
|
|
|
response.object = Utils_.fileToBytes(resultArchive);
|
|
|
|
|
|
} else throw new RepositoryRefuseException("Внутренняя ошибка. Не удалось запаковать версию");
|
|
|
|
|
|
//--
|
|
|
|
|
|
} else throw new RepositoryRefuseException("Внутренняя ошибка. Не удалось распаковать проект");
|
|
|
|
|
|
}
|
2025-02-13 22:25:54 +03:00
|
|
|
|
void AppendBugReportField() throws Exception {
|
2025-02-13 20:27:01 +03:00
|
|
|
|
BugReportAdditionJson transport = (BugReportAdditionJson) request.object;
|
2025-03-21 12:56:12 +03:00
|
|
|
|
checkExistense(transport.id, BugReport.class);
|
|
|
|
|
|
BugReport actual = db.bugReports.get(transport.id);
|
|
|
|
|
|
Field field = BugReport.class.getField(transport.fieldName);
|
|
|
|
|
|
field.set(actual, field.get(actual) + "\n" + transport.textAddition);
|
|
|
|
|
|
actual.change_date = new Date().getTime();
|
|
|
|
|
|
db.Update(actual);
|
|
|
|
|
|
response.object = actual;
|
2025-02-13 20:27:01 +03:00
|
|
|
|
}
|
2025-02-14 01:22:50 +03:00
|
|
|
|
void ReceiveAllArchives() throws Exception {
|
|
|
|
|
|
ZipFolderPass zip = new ZipFolderPass();
|
|
|
|
|
|
File archives = new File(Utils_.getDateName("Bugs"));
|
|
|
|
|
|
if (zip.Do("Bugs", archives.getAbsolutePath())) {
|
|
|
|
|
|
response.object = Utils_.fileToBytes(archives);
|
|
|
|
|
|
} else throw new RepositoryRefuseException("Не удалось запаковать архивы");
|
|
|
|
|
|
}
|
2025-02-19 01:10:25 +03:00
|
|
|
|
void ReceiveBugReportsDatabase() throws Exception {
|
2025-02-14 01:22:50 +03:00
|
|
|
|
response.object = Utils_.fileToBytes(db.getFile());
|
2025-02-19 22:47:56 +03:00
|
|
|
|
response.arg = credentials_db.userAccounts.getPackedActiveRecipients();
|
2025-02-14 01:22:50 +03:00
|
|
|
|
}
|
|
|
|
|
|
void ReceiveBugReport() throws Exception {
|
|
|
|
|
|
File bugArchive = Utils_.getFile(Utils_.getHomePath(), "Bugs", request.arg);
|
|
|
|
|
|
response.object = Utils_.fileToBytes(bugArchive);
|
|
|
|
|
|
}
|
|
|
|
|
|
void UpdateBugReport() throws Exception {
|
|
|
|
|
|
BugReport oldBugReport = (BugReport) request.object;
|
2025-03-21 12:56:12 +03:00
|
|
|
|
checkExistense(oldBugReport.id, BugReport.class);
|
|
|
|
|
|
BugReport bugReport = db.bugReports.get(oldBugReport.id);
|
|
|
|
|
|
bugReport.SynchronizeFields(oldBugReport);
|
|
|
|
|
|
bugReport.change_date = new Date().getTime();
|
|
|
|
|
|
db.Update(bugReport);
|
2025-02-14 01:22:50 +03:00
|
|
|
|
}
|
|
|
|
|
|
//--
|
|
|
|
|
|
void GetComponentsBackUps() throws Exception {
|
|
|
|
|
|
File backupsDirectory = Paths.get(Utils_.getHomePath(), "Components", request.arg, "Backups").toFile();
|
|
|
|
|
|
//--
|
|
|
|
|
|
if (backupsDirectory.exists()) {
|
|
|
|
|
|
File[] files = backupsDirectory.listFiles(File::isFile);
|
|
|
|
|
|
if (files != null) {
|
|
|
|
|
|
Vector<RemoteFile> res = new Vector<>();
|
|
|
|
|
|
for (File file : files)
|
|
|
|
|
|
res.add(new RemoteFile(file.getAbsolutePath(), false)); //тут всегда линух.
|
|
|
|
|
|
response.object = res;
|
|
|
|
|
|
} else throw new RepositoryRefuseException("Не удалось получить список предыдущих версий");
|
|
|
|
|
|
} else {
|
|
|
|
|
|
//баги еще не создавались. штатная ситуация.
|
|
|
|
|
|
response.object = new Vector<>();
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
void CheckURLRegistered() throws Exception {
|
|
|
|
|
|
String[] data = request.arg.split("\n");
|
|
|
|
|
|
String email = data[0];
|
|
|
|
|
|
String machineURL = data[1];
|
|
|
|
|
|
String login = data[2];
|
2025-02-19 22:47:56 +03:00
|
|
|
|
response.object = credentials_db.workspaces.findWorkspace(email, machineURL, login);
|
2025-02-14 01:22:50 +03:00
|
|
|
|
}
|
|
|
|
|
|
void GetComponentChangesLog() throws Exception {
|
|
|
|
|
|
response.object = Utils_.fileToBytes(Paths.get(Utils_.getHomePath(), "Components", request.arg, "changes.txt").toFile());
|
|
|
|
|
|
}
|
2025-02-13 22:25:54 +03:00
|
|
|
|
void PublishComponent() throws Exception {
|
2025-02-13 20:27:01 +03:00
|
|
|
|
ComponentPublicationInfoJson info = (ComponentPublicationInfoJson) request.object;
|
|
|
|
|
|
File componentHome = Utils_.getFile(Utils_.getHomePath(), "Components", info.componentType.toString());
|
|
|
|
|
|
File componentFile = new File(componentHome, info.fileName);
|
|
|
|
|
|
File versionFile = new File(componentHome, "version.txt");
|
|
|
|
|
|
File backupsFolder = new File(componentHome, "Backups");
|
|
|
|
|
|
//0 архивация старой версии, если она есть.
|
|
|
|
|
|
if (componentFile.exists()) {
|
|
|
|
|
|
String versionText = "";
|
|
|
|
|
|
if (versionFile.exists()) versionText = Utils.ReadAllText(versionFile);
|
|
|
|
|
|
//---->>
|
|
|
|
|
|
Utils_.CheckDirectory(backupsFolder);
|
|
|
|
|
|
Utils.keepNewFiles(backupsFolder, Global.componentsServerProperties.ComponentsBackUpsCount);
|
|
|
|
|
|
//-->>
|
|
|
|
|
|
File backupFile = new File(backupsFolder, info.componentType + "_" + versionText);
|
|
|
|
|
|
if (backupFile.exists()) Utils_.forceDeleteWithCheck(backupFile);
|
|
|
|
|
|
FileUtils.moveFile(componentFile, backupFile);
|
|
|
|
|
|
}
|
|
|
|
|
|
//1 распаковка компонента
|
|
|
|
|
|
Utils_.bytesToFile((byte[]) info.packedFile, componentFile);
|
|
|
|
|
|
//2 запись версии компонента
|
|
|
|
|
|
FileUtils.writeStringToFile(versionFile, info.versionText);
|
|
|
|
|
|
//3 запись в журнал компонента
|
|
|
|
|
|
File changesLog = new File(componentHome, "changes.txt");
|
|
|
|
|
|
FileWriter writer = new FileWriter(changesLog.getAbsolutePath(), true);
|
|
|
|
|
|
BufferedWriter bufferWriter = new BufferedWriter(writer);
|
|
|
|
|
|
bufferWriter.write(info.changeRecord);
|
|
|
|
|
|
bufferWriter.close();
|
|
|
|
|
|
//-
|
|
|
|
|
|
if (info.needsUpdateMinimalVersion) {
|
|
|
|
|
|
Print("Поднять минимальную версию компонента " + info.componentType);
|
|
|
|
|
|
File minimal_versionFile = new File(componentHome, "minimal_version.txt");
|
|
|
|
|
|
FileUtils.writeStringToFile(minimal_versionFile, info.versionText);
|
|
|
|
|
|
//-
|
|
|
|
|
|
//3 запись в журнал компонента
|
|
|
|
|
|
FileWriter writer_ = new FileWriter(changesLog, true);
|
|
|
|
|
|
BufferedWriter bufferWriter_ = new BufferedWriter(writer_);
|
|
|
|
|
|
bufferWriter_.write("Минимальная версия поднята до " + info.versionText + "\n");
|
|
|
|
|
|
bufferWriter_.close();
|
|
|
|
|
|
}
|
2025-03-09 17:27:35 +03:00
|
|
|
|
//-рассылка об изменениях.
|
2025-03-13 00:32:20 +03:00
|
|
|
|
if (info.needsEmail) {
|
2025-03-09 17:27:35 +03:00
|
|
|
|
String version_mail_header = String.join(" ",
|
|
|
|
|
|
"Опубликована версия",
|
|
|
|
|
|
Utils_.DQuotes(info.versionNumber),
|
|
|
|
|
|
"компонента",
|
|
|
|
|
|
Utils_.DQuotes(info.componentType.getDescription()));
|
|
|
|
|
|
//-
|
|
|
|
|
|
EmailMessage message =
|
|
|
|
|
|
new EmailMessage(version_mail_header,
|
2025-03-13 00:32:20 +03:00
|
|
|
|
info.changeRecord
|
2025-03-09 17:27:35 +03:00
|
|
|
|
);
|
|
|
|
|
|
if (info.needsSendFile)
|
|
|
|
|
|
message.addAttachement(componentFile);
|
|
|
|
|
|
//--
|
2025-03-13 00:32:20 +03:00
|
|
|
|
for (String address : credentials_db.userAccounts.getActiveMails()) {
|
|
|
|
|
|
EmailMessagesQueue.add(new Pair<>(address, message));
|
2025-03-09 17:27:35 +03:00
|
|
|
|
}
|
|
|
|
|
|
}
|
2025-02-13 20:27:01 +03:00
|
|
|
|
}
|
2025-02-14 01:22:50 +03:00
|
|
|
|
void GetComponentsVersionsInfo() throws Exception {
|
|
|
|
|
|
Vector<String> types = (Vector<String>) request.object;
|
|
|
|
|
|
Vector<ComponentVersionsInfoJson> res = new Vector<>();
|
|
|
|
|
|
for (String sType : types) {
|
|
|
|
|
|
ComponentType componentType = ComponentType.valueOf(sType);
|
|
|
|
|
|
File actualVersionFile = Paths.get(Utils_.getHomePath(), "Components", sType, "version.txt").toFile();
|
|
|
|
|
|
File minimalVersionFile = Paths.get(Utils_.getHomePath(), "Components", sType, "minimal_version.txt").toFile();
|
|
|
|
|
|
ComponentVersionsInfoJson info = new ComponentVersionsInfoJson(componentType);
|
|
|
|
|
|
info.actual_version = Utils_.removeCharacters(Utils.ReadAllText(actualVersionFile), "\n", "\r");
|
|
|
|
|
|
info.minimal_version = Utils_.removeCharacters(Utils.ReadAllText(minimalVersionFile), "\n", "\r");
|
|
|
|
|
|
res.add(info);
|
2025-02-13 22:25:54 +03:00
|
|
|
|
}
|
2025-02-14 01:22:50 +03:00
|
|
|
|
response.object = res;
|
2025-02-13 22:25:54 +03:00
|
|
|
|
}
|
|
|
|
|
|
void ReceiveComponent() throws Exception {
|
|
|
|
|
|
String[] packed1 = request.arg.split("\n");
|
|
|
|
|
|
//тип/имя файла
|
|
|
|
|
|
File componentFile1 = Paths.get(Utils_.getHomePath(), "Components", packed1[0], packed1[1]).toFile();
|
|
|
|
|
|
Print("Получить компонент " + packed1[0]);
|
|
|
|
|
|
response.object = Utils_.fileToBytes(componentFile1);
|
|
|
|
|
|
}
|
2025-02-18 16:21:20 +03:00
|
|
|
|
void GetUserAccountByKey() throws Exception {
|
|
|
|
|
|
UserAccount account = credentials_db.userAccounts.getByKey(request.arg);
|
2025-02-19 01:10:25 +03:00
|
|
|
|
response.object = account == null ? null : account;
|
2025-02-18 16:21:20 +03:00
|
|
|
|
}
|
|
|
|
|
|
void GetUserAccountByEmail() throws Exception {
|
|
|
|
|
|
UserAccount account_info = (UserAccount) request.object;
|
|
|
|
|
|
UserAccount account = credentials_db.userAccounts.getByEmail(account_info.email);
|
2025-02-19 01:10:25 +03:00
|
|
|
|
if (account == null) {
|
2025-02-18 16:21:20 +03:00
|
|
|
|
account = new UserAccount(account_info);
|
2025-02-19 01:10:25 +03:00
|
|
|
|
account.role = Constants.admins_mails.contains(account.email) ? AccountRole.Admin : AccountRole.User;
|
2025-02-18 16:21:20 +03:00
|
|
|
|
credentials_db.Insert(account);
|
2025-02-19 02:05:07 +03:00
|
|
|
|
account.generateKey();
|
2025-02-18 16:21:20 +03:00
|
|
|
|
}
|
|
|
|
|
|
response.object = account;
|
2025-02-19 01:10:25 +03:00
|
|
|
|
response.arg = FileUtils.readFileToString(account.getServerKeyFile());
|
2025-02-18 16:21:20 +03:00
|
|
|
|
}
|
2025-02-19 01:10:25 +03:00
|
|
|
|
void ReceiveCredentialsDatabase() throws Exception {
|
2025-02-18 23:45:24 +03:00
|
|
|
|
response.object = Utils_.fileToBytes(credentials_db.getFile());
|
|
|
|
|
|
}
|
2025-02-13 20:27:01 +03:00
|
|
|
|
//--
|
|
|
|
|
|
@Override
|
2025-02-14 02:09:55 +03:00
|
|
|
|
protected void UnsafeSession() throws Exception {
|
2025-01-18 01:36:02 +03:00
|
|
|
|
switch (code) {
|
2025-02-18 16:21:20 +03:00
|
|
|
|
case GetUserAccountByKey:
|
|
|
|
|
|
GetUserAccountByKey();
|
|
|
|
|
|
break;
|
|
|
|
|
|
case GetUserAccountByEmail:
|
|
|
|
|
|
GetUserAccountByEmail();
|
|
|
|
|
|
break;
|
2025-01-18 01:36:02 +03:00
|
|
|
|
case GetComponentsBackups:
|
2025-02-13 22:25:54 +03:00
|
|
|
|
GetComponentsBackUps();
|
2025-01-18 01:36:02 +03:00
|
|
|
|
break;
|
2025-02-03 23:04:40 +03:00
|
|
|
|
case UpdateComponent:
|
2025-02-25 14:17:23 +03:00
|
|
|
|
//zip
|
2025-02-13 22:25:54 +03:00
|
|
|
|
PublishComponent();
|
2025-02-03 23:04:40 +03:00
|
|
|
|
break;
|
2025-01-18 01:36:02 +03:00
|
|
|
|
case ReceiveComponent:
|
2025-02-13 22:25:54 +03:00
|
|
|
|
ReceiveComponent();
|
|
|
|
|
|
break;
|
2025-02-03 20:31:34 +03:00
|
|
|
|
case GetComponentsVersionsInfo:
|
|
|
|
|
|
GetComponentsVersionsInfo();
|
|
|
|
|
|
break;
|
2025-01-18 01:36:02 +03:00
|
|
|
|
case GetComponentChangesLog:
|
2025-02-13 22:25:54 +03:00
|
|
|
|
GetComponentChangesLog();
|
2025-01-18 01:36:02 +03:00
|
|
|
|
break;
|
2025-02-14 02:09:55 +03:00
|
|
|
|
default:
|
|
|
|
|
|
throw new RepositoryRefuseException("Неподдерживаемый код: " + code);
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
|
|
|
protected void Session() throws Exception {
|
|
|
|
|
|
switch (code) {
|
2025-02-18 23:45:24 +03:00
|
|
|
|
case ReceiveCredentialsDatabase:
|
|
|
|
|
|
ReceiveCredentialsDatabase();
|
|
|
|
|
|
break;
|
2025-02-13 22:25:54 +03:00
|
|
|
|
case ReceiveAllArchives:
|
|
|
|
|
|
ReceiveAllArchives();
|
|
|
|
|
|
break;
|
|
|
|
|
|
case UpdateBugReport:
|
|
|
|
|
|
UpdateBugReport();
|
|
|
|
|
|
break;
|
|
|
|
|
|
case AppendBugReportTextField:
|
|
|
|
|
|
AppendBugReportField();
|
|
|
|
|
|
break;
|
|
|
|
|
|
case ReceiveBugReportsDatabase:
|
|
|
|
|
|
ReceiveBugReportsDatabase();
|
|
|
|
|
|
break;
|
|
|
|
|
|
case ReceiveBugReport:
|
|
|
|
|
|
ReceiveBugReport();
|
2025-01-18 01:36:02 +03:00
|
|
|
|
break;
|
|
|
|
|
|
case DVMConvertProject:
|
2025-02-13 20:27:01 +03:00
|
|
|
|
DVMConvertProject();
|
2025-01-18 01:36:02 +03:00
|
|
|
|
break;
|
2025-02-19 22:47:56 +03:00
|
|
|
|
case CheckURLRegistered:
|
|
|
|
|
|
CheckURLRegistered();
|
|
|
|
|
|
break;
|
2025-02-13 22:25:54 +03:00
|
|
|
|
default:
|
|
|
|
|
|
throw new RepositoryRefuseException("Неподдерживаемый код: " + code);
|
2025-01-18 01:36:02 +03:00
|
|
|
|
}
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|
2025-03-27 12:45:55 +03:00
|
|
|
|
@Override
|
|
|
|
|
|
public void StartAction() throws Exception {
|
|
|
|
|
|
super.StartAction();
|
|
|
|
|
|
// db.Patch();
|
|
|
|
|
|
}
|
2023-09-17 22:13:42 +03:00
|
|
|
|
}
|