Skip to content
This repository has been archived by the owner on Dec 18, 2019. It is now read-only.

Commit

Permalink
Merge branch 'release-v29.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Breedlove committed Jul 17, 2014
2 parents 1ac9da7 + 69caebe commit d33a2b2
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 17 deletions.
8 changes: 4 additions & 4 deletions lib/akamod/primo-to-dpla.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

GEOPROP = None
RECORD = "PrimoNMBib/record/"
LINKS = "LINKS/"
URL = "http://thoth.library.utah.edu:1701/primo_library/libweb/action/dlDisplay.do?vid=MWDL&afterPDS=true&docId="
LINKS = "sear:LINKS/"
URL = "http://utah-primoprod.hosted.exlibrisgroup.com/primo_library/libweb/action/dlDisplay.do?vid=MWDL&afterPDS=true&docId="

#FIXME not format specific, move to generic module
CONTEXT = {
Expand Down Expand Up @@ -81,7 +81,7 @@ def multi_transform(d, key, props, return_format="str"):
RECORD + "display/lds09" : lambda d, p: {"temporal": getprop(d, p)},
RECORD + "facets/rsrctype" : lambda d, p: {"type": getprop(d, p)},
RECORD + "search/lsr03" : lambda d, p: {"stateLocatedIn": getprop(d, p)},
LINKS + "linktorsrc" : lambda d, p: {"identifier": getprop(d, p)}
LINKS + "sear:linktorsrc" : lambda d, p: {"identifier": getprop(d, p)}
}

AGGREGATION_TRANSFORMER = {
Expand All @@ -91,7 +91,7 @@ def multi_transform(d, key, props, return_format="str"):
"ingestType" : lambda d, p: {"ingestType": getprop(d, p)},
"ingestDate" : lambda d, p: {"ingestDate": getprop(d, p)},
RECORD + "control/recordid" : lambda d, p: {"isShownAt": URL + getprop(d, p)},
LINKS + "thumbnail" : lambda d, p: {"object": getprop(d, p)},
LINKS + "sear:thumbnail" : lambda d, p: {"object": getprop(d, p)},
"provider" : lambda d, p: {"provider": getprop(d, p)}
}

Expand Down
7 changes: 5 additions & 2 deletions lib/fetchers/mwdl_fetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ def retry_fetches(self):
def mwdl_extract_records(self, content):
error = None
if not self.total_records:
total_records_prop = "SEGMENTS/JAGROOT/RESULT/DOCSET/TOTALHITS"
total_records_prop = "sear:SEGMENTS/sear:JAGROOT/sear:RESULT" \
"/sear:DOCSET/TOTALHITS"
self.total_records = getprop(content, total_records_prop)
records = getprop(content, "SEGMENTS/JAGROOT/RESULT/DOCSET/DOC")
records = getprop(content, "sear:SEGMENTS/sear:JAGROOT/sear:RESULT"
"/sear:DOCSET/sear:DOC")

if records:
records = iterify(records)
Expand All @@ -40,6 +42,7 @@ def mwdl_extract_records(self, content):
"PrimoNMBib/record/control/recordid")
else:
records = []
# Elements in the error response are not namespaced
error = getprop(content, "SEGMENTS/JAGROOT/RESULT/ERROR/MESSAGE")
if not error:
error = "No records found in MWDL content: %s" % content
Expand Down
7 changes: 4 additions & 3 deletions lib/mappers/digitalnc_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,16 +98,17 @@ def map_description(self):
prop = self.root_key + "note"

if exists(self.provider_data, prop):
description = []
for s in iterify(getprop(self.provider_data, prop)):
try:
if s.get("type") == "content":
self.update_source_resource({"description":
s.get("#text")})
break
description.append(s.get("#text"))
except:
logger.error("Error getting note/type from record %s" %
self.provider_data["_id"])

self.update_source_resource({"description": description})

def map_title(self):
prop = self.root_key + "titleInfo"
_dict = {"title": []}
Expand Down
11 changes: 6 additions & 5 deletions lib/mappers/primo_mapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ def __init__(self, provider_data):
self.root_key = "PrimoNMBib/record/"
else:
self.root_key = ""
self.links_key = "LINKS/"
self.is_shown_at_url = "http://thoth.library.utah.edu:1701/" + \
self.links_key = "sear:LINKS/"
self.is_shown_at_url = "http://utah-primoprod.hosted." + \
"exlibrisgroup.com/" + \
"primo_library/libweb/action/" + \
"dlDisplay.do?vid=MWDL&afterPDS=true&docId="

Expand Down Expand Up @@ -66,7 +67,7 @@ def map_state_located_in(self):

def map_identifier(self):
self._map_source_resource_prop("identifier",
self.links_key + "linktorsrc")
self.links_key + "sear:linktorsrc")

def map_spatial(self):
prop = self.root_key + "display/lds08"
Expand Down Expand Up @@ -109,8 +110,8 @@ def map_is_shown_at(self):
record_id})

def map_object(self):
prop = self.links_key + "thumbnail"
if exists(self.provier_data, prop):
prop = self.links_key + "sear:thumbnail"
if exists(self.provider_data, prop):
self.mapped_data.update({"object":
getprop(self.provider_data, prop)})

Expand Down
3 changes: 2 additions & 1 deletion lib/mapv3.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def array_or_item(obj):
"oneOf": array_or_item({"$ref": "#/definitions/hasView"})
},
"id": {"type": "string"},
"ingestionSequence": {"type": "number"},
"ingestionSequence": {"type": ["number", "null"]},
# do not check ingestDate as the 'date-time' json-schema
# format, since it requires RFC 3339 conformance and not
# ISO 8601 conformance
Expand Down Expand Up @@ -164,6 +164,7 @@ def array_or_item(obj):
"extent": {"$ref": "#/definitions/arrayOrString"},
"format": {"$ref": "#/definitions/arrayOrString"},
"identifier": {"$ref": "#/definitions/arrayOrString"},
"isPartOf": {"$ref": "#/definitions/arrayOrString"},
"language": {
"type": "array",
"items": {
Expand Down
2 changes: 1 addition & 1 deletion profiles/mwdl.pjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "mwdl",
"type": "mwdl",
"endpoint_url": "http://utah-primoprod.hosted.exlibrisgroup.com/PrimoWebServices/xservice/search/brief?institution=MWDL&indx=1&loc=local,scope:%28mw%29&query=facet_tlevel,exact,online_resources&bulkSize=1000&query_exc=facet_rtype,exact,collections",
"endpoint_url": "http://utah-primoprod.hosted.exlibrisgroup.com/PrimoWebServices/xservice/search/brief?institution=MWDL&loc=local,scope:%28mw%29&query=facet_tlevel,exact,online_resources&query_exc=facet_rtype,exact,collections",
"endpoint_url_params": {
"indx": 1,
"bulkSize": 500
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
from distutils.core import setup

setup( name = 'ingestion',
version = '29.1',
version = '29.2',
description='DPLA Ingestion Subsystem',
author='Digital Public Library of America',
author_email='[email protected]',
Expand Down

0 comments on commit d33a2b2

Please sign in to comment.