Skip to content

Commit

Permalink
issue #75: add tag 959
Browse files Browse the repository at this point in the history
  • Loading branch information
pkiraly committed Dec 8, 2020
1 parent ec293f2 commit 23951bc
Show file tree
Hide file tree
Showing 5 changed files with 83 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
### Added

- British Library tags: 039, 091, 509, 539, 590, 591, 592, 594, 595, 596, 597, 598, 599,
690, 692, 852$a (code list), 859, 909, 916, 917, 945, 950, 954, 955, 957
690, 692, 852$a (code list), 859, 909, 916, 917, 945, 950, 954, 955, 957, 959
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import de.gwdg.metadataqa.marc.definition.general.validator.RegexValidator;

/**
* Shelving Location
* Acquisitions Data
*/
public class Tag957 extends DataFieldDefinition {

Expand Down Expand Up @@ -50,6 +50,18 @@ private void initialize() {
getSubfield("a")
.setValidator(new RegexValidator("^((\\d{4}|\\d{6}|\\d{8})?(c|CR|d|w|p)?|[A-Z]+)$"))
.setMqTag("acquisition");
// TODO
/*
getSubfield("a")
.setCodes(
"c", "Legal Deposit",
"CR", "Copyright",
"d", "Donation",
"e", "Exchange",
"p", "Purchase"
)
*/

getSubfield("b").setMqTag("supplier");
getSubfield("c").setMqTag("method");
getSubfield("d").setMqTag("cataloguer");
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package de.gwdg.metadataqa.marc.definition.tags.bltags;

import de.gwdg.metadataqa.marc.definition.Cardinality;
import de.gwdg.metadataqa.marc.definition.DataFieldDefinition;
import de.gwdg.metadataqa.marc.definition.Indicator;
import de.gwdg.metadataqa.marc.definition.general.validator.RegexValidator;

/**
* Document Supply Status Flag
*/
public class Tag959 extends DataFieldDefinition {

private static Tag959 uniqueInstance;

private Tag959() {
initialize();
postCreation();
}

public static Tag959 getInstance() {
if (uniqueInstance == null)
uniqueInstance = new Tag959();
return uniqueInstance;
}

private void initialize() {

tag = "959";
label = "Document Supply Status Flag";
mqTag = "documentSupplyStatus";
cardinality = Cardinality.Repeatable;
// descriptionUrl = "https://www.loc.gov/marc/bibliographic/bd037.html";
// setCompilanceLevels("O");

ind1 = new Indicator();

ind2 = new Indicator();

setSubfieldsWithCardinality(
"f", "Document Supply status", "NR"
);

getSubfield("f")
.setMqTag("status");
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package de.gwdg.metadataqa.marc.definition.tags.bltags;

import org.junit.Test;

public class Tag959Test extends BLTagTest {

public Tag959Test() {
super(Tag959.getInstance());
}

@Test
public void testValidFields() {
validField("f", "Held but not currently received");
}

@Test
public void testInvalidFields() {
invalidField("2", "a", "Priority processing");
invalidField("s", "17");
invalidField("e", "Priority processing");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public void testListTag() {
List<Class<? extends DataFieldDefinition>> tags = MarcTagLister.listTags();
assertNotNull(tags);
assertNotEquals(0, tags.size());
assertEquals(347, tags.size());
assertEquals(348, tags.size());
assertEquals("Tag010", tags.get(0).getSimpleName());
Map<String, Integer> versionCounter = new HashMap<>();
Map<MarcVersion, Integer> versionCounter2 = new HashMap<>();
Expand Down

0 comments on commit 23951bc

Please sign in to comment.