Skip to content

Commit

Permalink
Version 1.4.2 which add supports for all Aspace version 1.4.x
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Stevens committed Oct 28, 2015
1 parent 1c5d26f commit 53cd7cd
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
18 changes: 14 additions & 4 deletions src/org/archiviststoolkit/plugin/dbCopyCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ public class dbCopyCLI {
private boolean useTracer = false;
private String tracerDatabase = "";

private int databaseURLIndex = -2;

private int clientThreads = 1;

private boolean continueFromResources = false;
Expand Down Expand Up @@ -124,7 +122,7 @@ public Session getDatabaseSession() {
// see whether to connect to the particular index
if(useTracer) {
databaseType = "MySQL";
atUrl = "jdbc:mysql://tracerdb.cyo37z0ucix8.us-east-1.rds.amazonaws.com/at" + tracerDatabase;
atUrl = "jdbc:mysql://test.archivesspace.org/at" + tracerDatabase;
atUsername = "aspace";
atPassword = "clubfoots37@freakiest";

Expand Down Expand Up @@ -280,7 +278,7 @@ private void startASpaceCopyProcess() {
migrationErrors = ascopy.getSaveErrorMessages() + "\n\nTotal errors: " + errorCount;

// now save the migration log
saveLogFile("migration_log.txt", migrationErrors);
saveLogFile("migration_log-" + getDatabaseNameFromURL(atUrl) + ".txt", migrationErrors);
} catch (Exception e) {
System.out.println("Unrecoverable exception, migration stopped ...\n\n");

Expand Down Expand Up @@ -312,6 +310,16 @@ private void saveLogFile(String logfileName, String logText) {
}
}

/**
* Return only the name of the database so it can be appended to log file
*
* @return
*/
public String getDatabaseNameFromURL(String databaseURL) {
int begin = databaseURL.lastIndexOf("/") + 1;
return databaseURL.substring(begin);
}

/**
* Method to close the rcd connection
*/
Expand Down Expand Up @@ -374,5 +382,7 @@ public static void main(String[] args) {
}
}
}

System.exit(0);
}
}
4 changes: 2 additions & 2 deletions src/org/archiviststoolkit/plugin/dbCopyFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
* @author Nathan Stevens
*/
public class dbCopyFrame extends JFrame {
public static final String VERSION = "Archives Space Data Migrator v1.4.0 (09-29-2015)";
public static final String VERSION = "Archives Space Data Migrator v1.4.2 (10-28-2015)";

// The application when running within the AT
private ApplicationFrame mainFrame = null;
Expand Down Expand Up @@ -857,7 +857,7 @@ private void initComponents() {
}));

//---- apiLabel ----
apiLabel.setText(" Archives Space Version: v1.4.0");
apiLabel.setText(" Archives Space Version: v1.4.x");
apiLabel.setHorizontalTextPosition(SwingConstants.CENTER);
contentPanel.add(apiLabel, cc.xy(1, 1));

Expand Down
2 changes: 1 addition & 1 deletion src/org/archiviststoolkit/plugin/dbCopyFrame.jfd
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
<string>javax.swing.JLabel</string>
<void method="setProperty">
<string>text</string>
<string> Archives Space Version: v1.4.0</string>
<string> Archives Space Version: v1.4.x</string>
</void>
<void method="setProperty">
<string>horizontalTextPosition</string>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
* Utility class for copying data from the AT to Archive Space
*/
public class ASpaceCopyUtil {
public static final String SUPPORTED_ASPACE_VERSION = "v1.3.0,v1.4.0";
public static final String SUPPORTED_ASPACE_VERSION = "v1.3,v1.4";

// used to get session from the source and destination databases
private RemoteDBConnectDialogLight sourceRCD;
Expand Down Expand Up @@ -364,7 +364,9 @@ public boolean getSession() {
private void setASpaceVersion() {
try {
JSONObject infoJS = new JSONObject(aspaceInformation);
aspaceVersion = infoJS.getString("archivesSpaceVersion");
String version = infoJS.getString("archivesSpaceVersion");
int end = version.lastIndexOf(".");
aspaceVersion = version.substring(0, end);
} catch (Exception e) { }
}

Expand Down

0 comments on commit 53cd7cd

Please sign in to comment.