circmod = sort_circmod
alldues = sort_alldues
try:
- # Note: MassLNC requires this, need to add a version
- # value to settings and consider required opensrf to
- # to be installed for any evergreen site.
- #
- # for org, skip1, callnum, skip2, loc, stats in counts:
-
callprefix = ''
callsuffix = ''
if len(callno) == 0:
for key in params.keys():
if key.find('?r') != -1:
bibid = params[key]
+
results = M.marcxml_to_records(I.url_to_marcxml(query))
numhits = len(results)
elif is_barcode:
return E1('open-ils.supercat.record.marcxml.retrieve', bib_id)
def url_to_marcxml(url):
+ EVERGREEN_SERVER = getattr(settings, 'EVERGREEN_SERVER', '')
+
+ # OPAC_URL: the base URL for the OPAC's Web interface.
+ # default: http://your-eg-server/
+ # local_settings variable: EVERGREEN_OPAC_URL
+
+ if hasattr(settings, 'EVERGREEN_OPAC_URL'):
+ OPAC_URL = settings.EVERGREEN_OPAC_URL
+ else:
+ assert EVERGREEN_SERVER
+ OPAC_URL = 'http://%s/' % EVERGREEN_SERVER
+
# this is a hack. Given a opac Title Details url, return marcxml.
- assert support.BASE, 'no EG BASE. Did you call support.initialize()?'
- if url.startswith(support.BASE):
+ if url.startswith(OPAC_URL):
if 'feed/bookbag' in url:
#eg http://concat.ca/opac/extras/feed/bookbag/marcxml-full/60
marc_url = re.sub(r'(.*/bookbag/)(.*?)(/.*)', r'\1marcxml-full\3', url)
if item_id:
marc_url = ("%s/opac/extras/unapi?"
"id=tag:concat.ca,9999:biblio-record_entry/" # FIMXE, concat.ca reference!
- "%s/-&format=marcxml-full" % (support.BASE, item_id))
+ "%s/-&format=marcxml-full" % (OPAC_URL, item_id))
xml = unicode(urllib2.urlopen(marc_url).read(), 'utf-8')
return xml