eXtensibleCatalog / OAI-Toolkit

Synchronize MARC metadata in most ILSs with XC
5 stars 1 forks source link

Can't execute Importer class as an API #95

Closed patrickzurek closed 8 years ago

patrickzurek commented 8 years ago

JIRA issue created by: fereira Originally opened: 2012-11-06 03:04 PM

Issue body: I am trying to build a application that invokes the Importer class to convert marc documents to marcxml. I've configured a ImportConfiguration class and tried to invoke the importer.execute() method. It fails with a NPE exception at line 147 in the Importer class. From what I can tell, it's attempting to write to the log with the following line:

prglog.info("[PRG] " + dirNameGiver.getInfo());

The problem is that dirNameGiver object is instantiated in the init method (a private method. The init method is called from the main method at line 1021 but, because the dirNameGiver field is also private there doesn't seem to be a way to instantiate an Importer then invoke the exectute() method. Could a setDirNameGiver() method be added to the importer to instantiate the DirectoryNameGiver object?

patrickzurek commented 8 years ago

JIRA Comment by user: Chris Delis (cedelis) JIRA Timestamp: 2012-11-07 11:00 AM

Comment body:

Hello, John:

I just wanted to let you know that I have received your comment and question. I will try to get back to you as soon as I can with some help. In the meantime, if you have a patch or some code you wish to share, I will definitely take a look at it and see if we can incorporate it into the trunk. Thanks, Chris

patrickzurek commented 8 years ago

JIRA Coment by user: fereira JIRA Timestamp: 2012-11-16 07:32 AM

Comment body:

I simply added a public set method:

public void setDirNameGiver(DirNameGiver dirNameGiver) { this.dirNameGiver = dirNameGiver; }

patrickzurek commented 8 years ago

JIRA Comment by user: Chris Delis (cedelis) JIRA Timestamp: 2012-11-19 04:01 PM

Comment body:

Added public method setDirNameGiver.

In trunk, rev. 526