@@ -281,17 +281,25 @@ public Map<String,ButtonPresentation> getButtonDataByBibId(String catalogName, S
281
281
currentLocation = itemData .get ("tempLocationCode" );
282
282
} else if (itemData .containsKey ("permLocationCode" )) {
283
283
currentLocation = itemData .get ("permLocationCode" );
284
+ } else if (itemData .containsKey ("locationCode" )) {
285
+ currentLocation = itemData .get ("locationCode" );
284
286
} else {
285
287
currentLocation = holding .getFallbackLocationCode ();
286
288
}
289
+
287
290
logger .debug ("Current Location is: " + currentLocation );
288
291
//check if the global override blocks buttons for this item
289
292
if (!skipAllButtons (currentLocation , itemData )) {
290
293
// check all registered button for each item
291
294
for (GetItForMeButton button : this .getRegisteredButtons (catalogName )) {
292
295
logger .debug ("Analyzing: " + button .toString ());
293
296
294
- String itemStatusCode = itemData .containsKey ("itemStatusCode" ) ? itemData .get ("itemStatusCode" ):null ;
297
+ String itemStatusCode = null ;
298
+ if (itemData .containsKey ("itemStatusCode" )) {
299
+ itemStatusCode = itemData .get ("itemStatusCode" );
300
+ } else if (itemData .containsKey ("status" )) {
301
+ itemStatusCode = itemData .get ("status" );
302
+ }
295
303
296
304
logger .debug ("Location: " + currentLocation + ": "
297
305
+ button .fitsLocation (currentLocation ));
@@ -313,8 +321,9 @@ public Map<String,ButtonPresentation> getButtonDataByBibId(String catalogName, S
313
321
314
322
for (String parameterKey : parameterKeys ) {
315
323
if (parameterKey .equals ("sid" )) {
316
- parameters .put (parameterKey , getCatalogConfigurationByName (catalogName ).get ("sidPrefix" )
317
- + ":" + button .getSID ());
324
+ String fullSid = (getCatalogConfigurationByName (catalogName ) != null ? getCatalogConfigurationByName (catalogName ).get ("sidPrefix" )
325
+ + ":" :"" ) + button .getSID ();
326
+ parameters .put (parameterKey , fullSid );
318
327
} else {
319
328
parameters .put (parameterKey , itemData .get (parameterKey ));
320
329
}
@@ -327,7 +336,7 @@ public Map<String,ButtonPresentation> getButtonDataByBibId(String catalogName, S
327
336
Map <String , String > buttonContent = new HashMap <String ,String >();
328
337
if (holding .isMultiVolume ()) {
329
338
logger .debug ("Generating a multi volume button" );
330
- parameters .put ("edition" , itemData .get ("enumeration" ) + " " + itemData .get ("chron" ));
339
+ parameters .put ("edition" , itemData .getOrDefault ("enumeration" , "" ) + " " + itemData .getOrDefault ("chron" , " " ));
331
340
buttonContent = ButtonLinkPresentation .buildMultiVolumeButtonProperties (parameters , button );
332
341
} else {
333
342
logger .debug ("Generating a single item button" );
0 commit comments