Skip to content

Commit

Permalink
3.2.1 Revert fixes for data format
Browse files Browse the repository at this point in the history
Revert fixes for data format
  • Loading branch information
ChrisdeG committed Mar 18, 2021
1 parent cae0da6 commit f51c2b0
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 13 deletions.
Binary file modified out/MendixBackupRestoreTool.exe
Binary file not shown.
Binary file modified out/MendixBackupRestoreTool.jar
Binary file not shown.
2 changes: 0 additions & 2 deletions src/main/java/com/ccdg/app/MendixBackupRestoreTool.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
import org.eclipse.swt.widgets.Shell;
import org.eclipse.swt.widgets.Button;

import java.util.Locale;

import org.eclipse.swt.SWT;
import org.eclipse.swt.widgets.List;
import org.eclipse.swt.events.SelectionAdapter;
Expand Down
19 changes: 12 additions & 7 deletions src/main/java/com/ccdg/app/MendixUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -631,7 +631,8 @@ public boolean GetBackupList(int selectionCount, String environment ) {
for (int i = 0; i < backups.length(); i++) {
// if a backup is being created createdon is null
if (!backups.getJSONObject(i).isNull(CREATED_ON)) {
backuplist.add(dt1.format(parser.parse(backups.getJSONObject(i).getString(CREATED_ON))));
backuplist.add(dt1.format(new Date(backups.getJSONObject(i).getLong(CREATED_ON))));
//backuplist.add(dt1.format(parser.parse(backups.getJSONObject(i).getString(CREATED_ON))));
}
}
return backups.length() > 0;
Expand Down Expand Up @@ -674,13 +675,16 @@ public void run()
if (apps != null) {
String appid = "";
String backupid = "";
Date createdOn = null;
//Date createdOn = null;
Long createdOn = 0L;
try {
appid = apps.getJSONObject(AppIndexByListIndex(selectedAppIndex)).getString(APP_ID);
backupid = backups.getJSONObject(selectedBackupIndex).getString(SNAPSHOT_ID);
// if a backup is being created createdon is null
if (!backups.getJSONObject(selectedBackupIndex).isNull(CREATED_ON)) {
createdOn = parseJSONDate(backups.getJSONObject(selectedBackupIndex).getString(CREATED_ON));
//createdOn = parseJSONDate(backups.getJSONObject(selectedBackupIndex).getString(CREATED_ON));
createdOn = backups.getJSONObject(selectedBackupIndex).getLong(CREATED_ON);

}
} catch (Exception exp) {
consoleWrite("Error getting list " + exp.getMessage());
Expand Down Expand Up @@ -713,7 +717,7 @@ public void run()
return;
}
dbname = appid + backupid;
dbname = getTargetDatabaseName(appid, environment, createdOn);
dbname = getTargetDatabaseName(appid, environment, new Date(createdOn));
}
if (doRestore) {
try {
Expand Down Expand Up @@ -864,10 +868,11 @@ public void run()
if (apps != null) {
String appid = apps.getJSONObject(AppIndexByListIndex(selectedAppIndex)).getString(APP_ID);
String backupid = backups.getJSONObject(selectedBackupIndex).getString(SNAPSHOT_ID);
Date createdOn = null;
Long createdOn = 0L;
// if a backup is being created createdon is null
if (!backups.getJSONObject(selectedBackupIndex).isNull(CREATED_ON)) {
createdOn = parseJSONDate(backups.getJSONObject(selectedBackupIndex).getString(CREATED_ON));
createdOn = backups.getJSONObject(selectedBackupIndex).getLong(CREATED_ON);
//createdOn = parseJSONDate(backups.getJSONObject(selectedBackupIndex).getString(CREATED_ON));
}
OkHttpClient client = getClient(60);

Expand Down Expand Up @@ -897,7 +902,7 @@ public void run()
return;
}
dbname = appid + backupid;
dbname = getTargetDatabaseName(appid, environment, createdOn);
dbname = getTargetDatabaseName(appid, environment, new Date(createdOn));
}
if (doRestore) {
try {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/com/ccdg/app/SettingsDialog.java
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public void widgetSelected(SelectionEvent e) {
Label lblCopyrightChrisDe = new Label(shlSettings, SWT.NONE);
lblCopyrightChrisDe.setToolTipText("");
lblCopyrightChrisDe.setBounds(18, 341, 221, 23);
lblCopyrightChrisDe.setText("V 3.2 - Chris de Gelder");
lblCopyrightChrisDe.setText("V 3.2.1 - Chris de Gelder");

lblPostgresDirectory = new Label(shlSettings, SWT.NONE);
lblPostgresDirectory.setText("Postgres directory (no bin)");
Expand Down
3 changes: 1 addition & 2 deletions target/classes/.gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
/main/
/images/
/META-INF/
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#Generated by Maven Integration for Eclipse
#Wed Mar 03 11:19:14 CET 2021
#Sat Mar 06 18:46:22 CET 2021
m2e.projectLocation=C\:\\Users\\Chris de Gelder\\Documents\\GitHub\\BackupRestoreTool\\MendixBackupRestore
m2e.projectName=MendixBackupRestoreTool
groupId=com.ccdg.app
Expand Down
Binary file added target/classes/images/mendix.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit f51c2b0

Please sign in to comment.