|
26 | 26 | */ |
27 | 27 | public class ASpaceCopyUtil { |
28 | 28 |
|
29 | | - public static final String SUPPORTED_ASPACE_VERSION = "v2.1 & v2.2"; |
30 | | - |
31 | 29 | // used to get session from the source and destination databases |
32 | 30 | private RemoteDBConnectDialogLight sourceRCD; |
33 | 31 |
|
@@ -491,7 +489,7 @@ private void setASpaceVersion() { |
491 | 489 | public void setCopyAssessments() { |
492 | 490 | if (aspaceVersion.isEmpty()) { |
493 | 491 | String message = "Cannot determine your version of ArchivesSpace. Do you want to attempt to\n" + |
494 | | - "copy assessments to ArchivesSpace? (This will only work with version 2.2.)"; |
| 492 | + "copy assessments to ArchivesSpace? (This will only work with versions starting with 2.2.)"; |
495 | 493 | while (copyAssessments == null) { |
496 | 494 | int result = JOptionPane.showConfirmDialog(null, message, "Copy assessments?", |
497 | 495 | JOptionPane.YES_NO_OPTION, JOptionPane.QUESTION_MESSAGE); |
@@ -1064,7 +1062,9 @@ public void addAssessments() throws Exception { |
1064 | 1062 | if (!recordsToCopy.contains("Assessments")) return; |
1065 | 1063 |
|
1066 | 1064 | // first figure out if the version of ASpace allows for assessments |
1067 | | - if (aspaceVersion.contains("2.2")) { |
| 1065 | + double aspaceVersionDouble = new Double(aspaceVersion.replaceAll("[^0-9.]", "")); |
| 1066 | + |
| 1067 | + if (aspaceVersionDouble >= 2.2) { |
1068 | 1068 | System.out.println("Copying assessments ..."); |
1069 | 1069 | } else if (aspaceVersion.isEmpty()) { |
1070 | 1070 | if (copyAssessments == null) setCopyAssessments(); |
|
0 commit comments