Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion metadata_mapper/map_registry_collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ def map_endpoint(url):
'csuci_mets': 'oai.csu_dspace.csuci',
'quartex_oai': 'oai.quartex',
'burbank_islandora': 'oai.islandora.burbank',
'chs_islandora': 'oai.islandora.chs'
'chs_islandora': 'oai.islandora.chs',
'lapl_26096': 'oai.lapl26096'
}

collection_page = url
Expand Down
34 changes: 34 additions & 0 deletions metadata_mapper/mappers/oai/lapl26096_mapper.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from .oai_mapper import OaiRecord, OaiVernacular


class Lapl26096Record(OaiRecord):
BASE_URL = "https://rescarta.lapl.org/ResCarta-Web/"
IMAGE_URL_FORMAT = "%1sservlet/RcWebThumbnail?obj_type=SERIAL_MONOGRAPH&pg_idx=0&obj_id=%2s"

def map_is_shown_at(self):
identifier_path = self.get_identifier_path()
if not identifier_path:
return

return f"{self.BASE_URL}{identifier_path}"

def map_is_shown_by(self):
identifier_path = self.get_identifier_path()
if not identifier_path:
return

object_id = identifier_path[identifier_path.index('=') + 1:]
object_thumb_id = object_id.split('/', 1)[1]
return self.IMAGE_URL_FORMAT % (self.BASE_URL, object_thumb_id)

def get_identifier_path(self):
identifier = self.source_metadata.get('identifier')

if not identifier or 'jsp' not in identifier[0]:
return ''

return identifier[0][identifier.index('jsp'):]


class Lapl26096Vernacular(OaiVernacular):
record_cls = Lapl26096Record