-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
BXC-4652 implement index --from-csv (#104)
* implement index --from-csv * fix javadoc, csvFile path, removed unused code, readjust logic, parse generic csv when indexing, fix/add tests, dmrecord field * move force flag to CdmIndexOptions, remove ExportObjectsService from CdmIndexService, remove csv-specific methods, simplify code, rename assertCsvImportExists * remove conditional, add MIGRATION_FIELDS to exportFields in indexAllFromCsv * text primary key not null * text primary key not null if indexing from csv file * text primary key not null, fix test
- Loading branch information
Showing
12 changed files
with
368 additions
and
57 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 0 additions & 2 deletions
2
src/main/java/edu/unc/lib/boxc/migration/cdm/ExportObjectsCommand.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
35 changes: 35 additions & 0 deletions
35
src/main/java/edu/unc/lib/boxc/migration/cdm/options/CdmIndexOptions.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
package edu.unc.lib.boxc.migration.cdm.options; | ||
|
||
import picocli.CommandLine.Option; | ||
|
||
import java.nio.file.Path; | ||
|
||
/** | ||
* Options for indexing object records | ||
* @author krwong | ||
*/ | ||
public class CdmIndexOptions { | ||
@Option(names = {"-c", "--from-csv"}, | ||
description = {"Export objects CSV file used as source for populating sqlite database."}) | ||
private Path csvFile; | ||
|
||
@Option(names = { "-f", "--force"}, | ||
description = "Overwrite index if one already exists") | ||
private boolean force; | ||
|
||
public Path getCsvFile() { | ||
return csvFile; | ||
} | ||
|
||
public void setCsvFile(Path csvFile) { | ||
this.csvFile = csvFile; | ||
} | ||
|
||
public boolean getForce() { | ||
return force; | ||
} | ||
|
||
public void setForce(boolean force) { | ||
this.force = force; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.