use of org.springframework.batch.core.annotation.AfterStep in project RecordManager2 by moravianlibrary.
the class AgrovocConvertorWriter method after.
@AfterStep
protected void after() {
try {
writer = new PrintWriter(filename, "UTF-8");
for (String key : altLabel.keySet()) {
if (!prefLabel.containsKey(key)) {
continue;
}
Record record = factory.newRecord();
record.setLeader(factory.newLeader("-----nz--a22-----n--4500"));
record.addVariableField(factory.newControlField("001", key));
record.addVariableField(factory.newDataField("150", ' ', ' ', "a", prefLabel.get(key).get(0)));
addLabel(record, key, altLabel);
writer.println((new MarcRecordImpl(record)).export(IOFormat.LINE_MARC));
}
writer.close();
} catch (FileNotFoundException | UnsupportedEncodingException e) {
e.printStackTrace();
}
}
Aggregations