diff --git a/src/main/scala/dpla/ingestion3/mappers/providers/MwdlMapping.scala b/src/main/scala/dpla/ingestion3/mappers/providers/MwdlMapping.scala index 4582b14fa..42a21fa74 100644 --- a/src/main/scala/dpla/ingestion3/mappers/providers/MwdlMapping.scala +++ b/src/main/scala/dpla/ingestion3/mappers/providers/MwdlMapping.scala @@ -17,9 +17,6 @@ class MwdlMapping extends XmlMapping with XmlExtractor { override val enforceDuplicateIds: Boolean = false - private val baseIsShownAt = "https://utah-primoprod.hosted.exlibrisgroup.com/primo-explore/fulldisplay?docid=" - private val suffixIsShownAt = "&context=L&vid=MWDL" - val formatBlockList: Set[String] = DigitalSurrogateBlockList.termList ++ FormatTypeValuesBlockList.termList @@ -117,12 +114,18 @@ class MwdlMapping extends XmlMapping with XmlExtractor { .flatMap(extractStrings) .map(URI) - override def isShownAt(data: Document[NodeSeq]): ZeroToMany[EdmWebResource] = - // baseIsShownAt + control\recordid - (data \\ "control" \ "recordid") + override def isShownAt(data: Document[NodeSeq]): ZeroToMany[EdmWebResource] = { + // PrimoNMBib > record > display > identifier. + (data \\ "display" \ "identifier") .flatMap(extractStrings) - .map(baseIsShownAt + _.trim + suffixIsShownAt) .map(stringOnlyWebResource) + } + + override def iiifManifest(data: Document[NodeSeq]): ZeroToMany[URI] = + // links > lln02 + (data \\ "links" \ "lln02") + .flatMap(extractStrings) + .map(URI) override def originalRecord(data: Document[NodeSeq]): ExactlyOne[String] = Utils.formatXml(data) diff --git a/src/test/scala/dpla/ingestion3/mappers/providers/MwdlMappingTest.scala b/src/test/scala/dpla/ingestion3/mappers/providers/MwdlMappingTest.scala index e55413d69..633b28d5d 100644 --- a/src/test/scala/dpla/ingestion3/mappers/providers/MwdlMappingTest.scala +++ b/src/test/scala/dpla/ingestion3/mappers/providers/MwdlMappingTest.scala @@ -72,14 +72,14 @@ class MwdlMappingTest extends FlatSpec with BeforeAndAfter { it should "extract the correct isShownAt" in { val xml: NodeSeq = - - - digcoll_slc_27works_598 - - + + + http://libarchive.slcc.edu/islandora/object/works%3A598 + + - val expected = Seq(uriOnlyWebResource(URI("https://utah-primoprod.hosted.exlibrisgroup.com/primo-explore/fulldisplay?docid=digcoll_slc_27works_598&context=L&vid=MWDL"))) + val expected = Seq(uriOnlyWebResource(URI("http://libarchive.slcc.edu/islandora/object/works%3A598"))) assert(extractor.isShownAt(Document(xml)) === expected) } it should "extract the correct preview" in {