use of cz.mzk.recordmanager.server.scripting.marc.MarcFunctionContext in project RecordManager2 by moravianlibrary.
the class MzkFormatFunctionsTest method physicalObjectFormat.
public void physicalObjectFormat() throws Exception {
List<String> data = new ArrayList<String>();
data.add("000 -----nrm-a22-----2a-4500");
String format = formatFunctions.getMZKFormat(new MarcFunctionContext(MarcRecordFactory.recordFactory(data)));
Assert.assertEquals(format, "PhysicalObject");
}
use of cz.mzk.recordmanager.server.scripting.marc.MarcFunctionContext in project RecordManager2 by moravianlibrary.
the class MzkFormatFunctionsTest method eletronicFormat.
public void eletronicFormat() throws Exception {
List<String> data = new ArrayList<String>();
data.add("245 $honline [electronic resource]");
String format = formatFunctions.getMZKFormat(new MarcFunctionContext(MarcRecordFactory.recordFactory(data)));
Assert.assertEquals(format, "Electronic");
}
use of cz.mzk.recordmanager.server.scripting.marc.MarcFunctionContext in project RecordManager2 by moravianlibrary.
the class MzkFormatFunctionsTest method unknownFormat.
public void unknownFormat() throws Exception {
List<String> data = new ArrayList<String>();
data.add("000 -----------------2a-4500");
MarcRecordImpl record = MarcRecordFactory.recordFactory(data);
String format = formatFunctions.getMZKFormat(new MarcFunctionContext(record));
Assert.assertEquals(format, "Unknown");
}
use of cz.mzk.recordmanager.server.scripting.marc.MarcFunctionContext in project RecordManager2 by moravianlibrary.
the class MzkStatusFunctionsTest method presentStatus.
public void presentStatus() throws Exception {
List<String> data = new ArrayList<String>();
data.add("996 $b2610651530 $c4-1355.961 $lMZK $rSklad / do 1 hodiny $n0$p p.v. $w001533248 $u000010$a1 $eBOA001 $jMZK50 $sP");
Set<String> statuses = statusFunctions.getMZKStatuses(new MarcFunctionContext(MarcRecordFactory.recordFactory(data)));
Assert.assertEquals(statuses, ImmutableSet.<String>of("present"));
}
use of cz.mzk.recordmanager.server.scripting.marc.MarcFunctionContext in project RecordManager2 by moravianlibrary.
the class MarcSolrRecordMapper method parseAsLocalRecord.
protected Map<String, Object> parseAsLocalRecord(HarvestedRecord record) {
InputStream is = new ByteArrayInputStream(record.getRawRecord());
MarcRecord rec = marcXmlParser.parseRecord(is);
MarcFunctionContext ctx = new MarcFunctionContext(rec, record, metadataRecordFactory.getMetadataRecord(record));
return getHarvestedMappingScript(record).parse(ctx);
}
Aggregations