File analyzer component packages - Georgetown-University-Libraries/File-Analyzer GitHub Wiki
The File Analyzer code base is broken into multiple modules containing different levels of functionality.
Core Package - requires only Java
The Core package contains File Test Rules and File Import Rules
- with general applicability to multiple institutions
- that do not depend on libraries other than the core java libraries
Core Utils package
The Core Utils package contains utility classes that my be re-used outside of the FileAnalyzer.
Demo Package
The Demo package is integrated with Apache Tika (for metadata extraction), BagIt, and Marc4j
The Demo package contains File Test Rules and File Import Rules
- that depend on external libraries
- may not have applicability to multiple institutions
- demonstrate how to customize Core code to implement institution-specific business logic
Demo Package Contents Using Marc4j
Bag Utils package
The Bag Utils package contains utility classes that my be re-used outside of the FileAnalyzer. The purpose of this package is to share File Analyzer logic for non-interactive use.
The Bag Utils package uses BagIt and Apache Commons Cli.
DSpace ingestion tasks
DSpace Package - automation ofGeorgetown University has successfully automated a number of DSpace ingest tasks using the File Analyzer.
See DSpace Institutional Repository Ingest for an illustration of these tools
DSpace Tools Overview Presentations
- Why Bulk Ingest Automation is Needed (Prezi)
- Running the Bulk Ingest Process (Prezi)
- Open Repositories Presentation Describing this Process
Custom Packages
An institution can create their own module containing highly customized rules.
Create Your Own File Analyzer
public class GUFileAnalyzer extends DirectoryTable {
public GUFileAnalyzer(File f, boolean modifyAllowed) {
super(f, modifyAllowed);
this.title = "Georgetown University Libraries File Analyzer";
this.message = "File Analyzer customized for use by the Georgetown University Libraries.";
this.refreshTitle();
}
protected ActionRegistry getActionRegistry() {
return new GUActionRegistry(this, modifyAllowed);
}
protected ImporterRegistry getImporterRegistry() {
return new GUImporterRegistry(this);
}
public static void main(String[] args) {
if (args.length > 0)
new GUFileAnalyzer(new File(args[0]), false);
else
new GUFileAnalyzer(null, false);
}
}
File Test Rule classes (and to remove default ones)
Create an ActionRegistry to register your custompublic class GUActionRegistry extends DemoActionRegistry {
private static final long serialVersionUID = 1L;
public GUActionRegistry(FTDriver dt, boolean modifyAllowed) {
super(dt, modifyAllowed);
removeFT(IngestInventory.class);
removeFT(IngestValidate.class);
add(new GUIngestInventory(dt));
add(new GUIngestValidate(dt));
}
}
File Import Rules
Create an ImporterRegistry to register your Custompublic class GUImporterRegistry extends DemoImporterRegistry {
private static final long serialVersionUID = 1L;
public GUImporterRegistry(FTDriver dt) {
super(dt);
add(new OutputToBursar(dt));
}
}