Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use properties file for output dir? #14

Open
ndushay opened this issue Feb 23, 2017 · 1 comment
Open

use properties file for output dir? #14

ndushay opened this issue Feb 23, 2017 · 1 comment

Comments

@ndushay
Copy link
Contributor

ndushay commented Feb 23, 2017

Note that the code (java/src/main/edu/stanford/MarcToXML.java - lines 74 and 160) is looking for a value from an environment variable, LD4P_MARCXML. This is actually a poorly named variable, as it is really the output directory to receive the marcxml files.

The java way is to use a java property that can be set at the command line when executing code and/or via a java properties file.

The code could ship with a default properties file with settings that work in a local (laptop) installation; there should be a shared_config branch for that contains a properties file named something like ld4p-marc21-to-xml that contains appropriate settings for our scripts.

Note that at the time of writing this ticket, we hardcode the value in our only working script:

  • bin/marc21_to_marcxml_local.sh

In fact, there are three FIXME comments in that script and they all pertain to this notion of properties.

@ndushay ndushay changed the title use properties file for output dir use properties file (for output dir, etc.) Feb 23, 2017
@ndushay ndushay changed the title use properties file (for output dir, etc.) use properties file for output dir Feb 23, 2017
@ndushay ndushay changed the title use properties file for output dir use properties file for output dir? Feb 27, 2017
@dazza-codes
Copy link
Contributor

The MarcToXML class accepts command line arguments for this parameter. That is a valid pattern and it is used by the shell scripts that call this class. (It accepts several command line options.)

The default value for an output path is still a concern. An ENV value is used as a fallback position but could be removed or replaced with something else. A hard-coded default value for this in the java code does not make a lot of sense, because it depends entirely on the file system the code runs on. A possible default that might work on any system is to create a temp directory, as the unit tests do. But only use such a default temp directory when no command line arg is given. If all of this is nonsense, then ensure the command line arg is required or raise an exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants