Skip to content

Commit

Permalink
Merge pull request #9 from archivesspace/updates
Browse files Browse the repository at this point in the history
Updates
  • Loading branch information
lmcglohon authored Dec 18, 2017
2 parents c163b0a + b22b1a9 commit 55c4e7f
Show file tree
Hide file tree
Showing 16 changed files with 696 additions and 442 deletions.
20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,22 @@ IDE of choice. The current source needs to be compiled with JDK 1.6, or later. T
Note: If you intend to modify user interface code, then you will need to use JFormdesigner to open
the *.jfd files. Consult the JFormDesigner documentation on how to install and use it.

NOTES FOR DEVELOPERS

The majority of development work will probably take place in a few classes, primarily in the package
at-migration\src\org\archiviststoolkit\plugin\utils\aspace
A description of some of the classes is given below.

1. dbCopyFrame is the user interface for the migration tool. It mostly calls methods in ASpaceCopyUtil.
2. dbCopyCLI mainly does the same thing as dbCopyFrame but is for command line mode.
3. ASpaceCopyUtil has a method for copying each record type. Each of these is called by dbCopyFrame/dbCopyCLI. It
gets records from AT, calls on ASpaceMapper to map them to the ASpace model, then calls on ASpaceClient to save
them to ASpace.
4. ASpaceMapper takes AT model records and converts them to the appropriate ASpace JSON model.
5. TopContainerMapper serves the same function as ASpaceMapper but is specialized for top containers, which present
some special challenges.
6. ASpaceClient saves records to ASpace and gets records from ASpace.

NOTES ON TESTING

When writing tests you should always place them in the test directory. To write a test:
Expand All @@ -30,7 +46,7 @@ When writing tests you should always place them in the test directory. To write
2. Import junit.framework.JUnit4TestAdapter, org.junit.Assert, and org.junit.Test.
3. Write tests with annotation @Test in this class.
4. Add the following method:
public static junit.framework.Test suite() {return new JUnit4TestAdapter(*Name of your class here*.class);}
public static junit.framework.Test suite() {return new JUnit4TestAdapter(*Name of your class here*.class);}
5. You can now run your test by calling a constructor for your class from the testing main method then running the
Testing main method.

Expand Down Expand Up @@ -81,7 +97,7 @@ HOW TOP CONTAINER UNIQUENESS IS DETERMINED
Archivist's Toolkit does not include the concept of distinct top containers but rather the same container may
be entered many times for multiple instances. For this reason it was necessary to determine a set of rules for
determining what constitutes a unique top container. For top containers created from instances, they are considered
to be the same if either the repository and barcode match or if the repository, indicator, and container type
to be the same if either the repository and barcode match or if the repository, resource, indicator, and container type
match. As for accessions, no instances exist in Archivist's Toolkit. In stead, a top container is created for each
location the accession is linked to.

Expand Down
Binary file added docs/AT Migration Instructions.docx
Binary file not shown.
Binary file added docs/AT Migration Instructions.pdf
Binary file not shown.
Binary file added docs/ATMappingDocument.xlsx
Binary file not shown.
12 changes: 2 additions & 10 deletions src/org/archiviststoolkit/plugin/ScriptATFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ private void dbCopyButtonActionPerformed() {

private void initComponents() {
// JFormDesigner - Component initialization - DO NOT MODIFY //GEN-BEGIN:initComponents
// Generated using JFormDesigner Evaluation license - Sarah Morrissey
// Generated using JFormDesigner non-commercial license
dialogPane = new JPanel();
contentPanel = new JPanel();
showScriptConsoleButton = new JButton();
Expand All @@ -93,14 +93,6 @@ private void initComponents() {
//======== dialogPane ========
{
dialogPane.setBorder(new EmptyBorder(12, 12, 12, 12));

// JFormDesigner evaluation mark
dialogPane.setBorder(new javax.swing.border.CompoundBorder(
new javax.swing.border.TitledBorder(new javax.swing.border.EmptyBorder(0, 0, 0, 0),
"JFormDesigner Evaluation", javax.swing.border.TitledBorder.CENTER,
javax.swing.border.TitledBorder.BOTTOM, new java.awt.Font("Dialog", java.awt.Font.BOLD, 12),
java.awt.Color.red), dialogPane.getBorder())); dialogPane.addPropertyChangeListener(new java.beans.PropertyChangeListener(){public void propertyChange(java.beans.PropertyChangeEvent e){if("border".equals(e.getPropertyName()))throw new RuntimeException();}});

dialogPane.setLayout(new BorderLayout());

//======== contentPanel ========
Expand Down Expand Up @@ -178,7 +170,7 @@ public void actionPerformed(ActionEvent e) {
}

// JFormDesigner - Variables declaration - DO NOT MODIFY //GEN-BEGIN:variables
// Generated using JFormDesigner Evaluation license - Sarah Morrissey
// Generated using JFormDesigner non-commercial license
private JPanel dialogPane;
private JPanel contentPanel;
private JButton showScriptConsoleButton;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ private void initComponents() {
//---- scriptList ----
scriptList.setSelectionMode(ListSelectionModel.SINGLE_SELECTION);
scriptList.addListSelectionListener(new ListSelectionListener() {
@Override
public void valueChanged(ListSelectionEvent e) {
scriptListValueChanged(e);
}
Expand Down Expand Up @@ -185,6 +186,7 @@ public void valueChanged(ListSelectionEvent e) {
//---- storeButton ----
storeButton.setText("Store/Update");
storeButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
storeButtonActionPerformed();
}
Expand All @@ -196,6 +198,7 @@ public void actionPerformed(ActionEvent e) {
//---- viewButton ----
viewButton.setText("View");
viewButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
viewButtonActionPerformed();
}
Expand All @@ -207,6 +210,7 @@ public void actionPerformed(ActionEvent e) {
//---- deleteButton ----
deleteButton.setText("Delete");
deleteButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
deleteButtonActionPerformed();
}
Expand All @@ -218,6 +222,7 @@ public void actionPerformed(ActionEvent e) {
//---- okButton ----
okButton.setText("OK");
okButton.addActionListener(new ActionListener() {
@Override
public void actionPerformed(ActionEvent e) {
okButtonActionPerformed();
}
Expand Down
20 changes: 6 additions & 14 deletions src/org/archiviststoolkit/plugin/dbCopyCLI.java
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
* A class which allows the migration tool to be run from the command line
*
* Created by IntelliJ IDEA.
* User: nathan
* Date: 4/21/14
* Time: 2:58 PM
* @author nathan
* Updated by Sarah Morrissey 12/17
* @version 2.2
*/
public class dbCopyCLI {
// these fields are read in from the properties file
Expand Down Expand Up @@ -237,16 +237,15 @@ private void startASpaceCopyProcess() {
} else {
System.out.println("Administrator authenticated ...\n");
}
//
// // first load the notes etc types and resource from the destination database
// ascopy.loadRepositories();

// first load the notes etc types and resource from the destination database

if (continueFromURIMaps && ascopy.uriMapFileExist()) {
ascopy.loadURIMaps();
} else {
ascopy.loadRepositories();
}
// if(!copyOnlyResources) {

ascopy.copyLookupList();
ascopy.copyRepositoryRecords();
ascopy.mapRepositoryGroups();
Expand All @@ -259,11 +258,6 @@ private void startASpaceCopyProcess() {
ascopy.copyAccessionRecords();
ascopy.copyDigitalObjectRecords();

// save the record maps for possible future use
// ascopy.saveURIMaps();
// }
// }

// set the number of resources to copy
int numberOfResourcesToCopy = 1000000;

Expand All @@ -274,8 +268,6 @@ private void startASpaceCopyProcess() {

ascopy.copyResourceRecords(numberOfResourcesToCopy, clientThreads);

// ascopy.addContainerData();

ascopy.addAssessments();

// DEBUG code which checks to see that all ISO dates are valid
Expand Down
Loading

0 comments on commit 55c4e7f

Please sign in to comment.