Skip to main content
ExLibris
  • Subscribe by RSS
  • Ex Libris Knowledge Center

    How to – Useful bookmarklets for Primo New UI troubleshooting

    Created By: Stacey van Groll
    Created on: 9/08/2019



    For those of us who are not developers, this is a compilation of various tools created by customers or provided by Ex Libris.

    I noted acknowledgements against entries when I know (or can remember) them, and take no credit personally except where noted.

    If you have written any more, please share your cleverness with the community!

     

    Converting to bookmarklet

    • Activate the tool with one click on a bookmarklet, rather than adding the text to the end of the URL every time
    • For end of URL: &showPnx=true
    • Base: javascript:document.location=document.location+'CHANGE THIS BIT'
    • Example: javascript:document.location=document.location+'&showPnx=true'

     

    Adding a bookmarklet to your browser

    • Right click on Bookmark toolbar
    • Choose Add page (Chrome) or New bookmark (Firefox)
    • Add a suitable entry into the Name field
    • Paste the javascript into the Location field
    • Click Save (Chrome) or Add (Firefox)

     

    Bookmarklets List

     

    Primo New UI Bookmarklet, developed by the awesome Gabriele Hofler

    • Latest version is May 2018, available here: https://github.com/gabriele-h/PrimoNUIShow
    • Displays the following links in Brief Results and Full Record Display
      • Record ID
        • Displays for Local and PCI records, and on Primo Services Page
        • Also shows Preferred/generic FRBR record text for Local and PCI records, where the resource is in a FRBR group
        • nb Primo Services Page Record ID starts with RS, instead of the usual TN_ for PCI records
      • Show PNX
        • Displays for Local, PCI, Primo Services Page and Primo Newspaper Search
        • Opens new browser tab
        • Primo Services Page via Google Scholar and databases like Scopus will only appear when there is no full text if direct linking is enabled
        • Primo Services Page shows the OpenURL data and technically not true PNX, as the record does not exist in the Primo database but is created dynamically from the source citation data
        • FRBR: Show PNX shows preferred record and Show Source Record shows all source records for the preferred record, with line separation
        • Dedup: Show PNX shows dedupmrg record and Show Source Record shows all source records, with line separation
        • Note for VE: VE does not have a true PNX, with a fundamentally different publishing model from Alma with Primo Back Office, but it does have similar data available as a json representation
      • Show Source Record
        • Local records only, as PCI records do not have a stored source record available to customers
        • Opens new browser tab
        • Display original data, such as MARC for Alma & Dublin Core for OAI
        • Note - this is the Source Record in the Primo Database at the time of last harvest / update, which is then normalized into PNX
        • It is not necessarily an exact replica of the source record at the data source right now, which is yet to be harvested
      • Show RIS
        • Local records only
        • Opens new browser tab
        • Uses Classic UI call, as not yet available for New UI (same data, just different URL)
        • Not currently available for PCI
      • Issues with the latest version
        • Does not display in Full Record overlay panel, but does display in Full Record page if refreshed – use March 2018 version
        • Does not work for Primo VE NZ consortia records – March 2018 version does not work for these records either
        • Does not work for Database Search – use Show PNX and Database Search Record ID (see below)

    Brief Results

    Show PNX

    Show Source Record

    Show RIS

     

    Database Search Record ID

    • Shows the local Alma database Record ID, in the brief results list of the separate Database Search UI for Primo
    • javascript:(function(){var%20h1s=document.querySelectorAll('.item-title');for(let%20h1%20of%20h1s){var%20a=h1.children[0].href;a.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(m,k,v){if(k=='docid'){var%20cd=document.getElementById('SEARCH_RESULT_RECORDID_'+v);var%20pd=cd.parentNode;pd.insertBefore(document.createElement('div').appendChild(document.createTextNode(v)),cd);}});}})()

     

    Show PNX (Ex Libris)

    • If looking at the full record, this bookmarklet will display the PNX for the record in the same browser tab
    • Works for Primo Database Search (as the main combo bookmarklet doesn’t)
    • javascript:document.location=document.location+'&showPnx=true'

     

    Show Directives

    • If looking at a list of brief results, this bookmarklet will display the text for web writing.  Refreshes the same browser tab.
    • javascript:(function(){var script=document.createElement("SCRIPT");script.src='https://ajax.googleapis.com/ajax/lib...entsByTagName("head")[0].appendChild(script);var checkReady=function(callback){if(window.jQuery){callback(jQuery)}else{window.setTimeout(function(){checkReady(callback)},100)}};checkReady(function($){$('primo-explore').find('*[parent-ctrl="$ctrl"]').each(function(){$(this).append('<a href="#" title="'+$(this)[0].outerHTML.replace(/</g,'').replace(/>/g,'').replace(/\//g,'').replace(/"/g,'').replace(/parent-ctrl.*/g,'').replace(/-([a-z])/g,function(m,w){return w.toUpperCase()})+'" style="display:block;height:auto;color:black;">Hover for id</a>')})})})();

     

    Custom JS

    • Show your local custom javascript for Primo Back Office sites aka primo-explore.  Refreshes the same browser tab.
    • javascript:location.href=location.href.replace(/primo-explore.*vid=((.+?)(&|$)).*/,'primo-explore/custom/$2/js/custom.js');

     

    No Custom (Ex Libris 2018)

    • Removes your local custom code to see Primo OTB UI, useful to quickly see if local code is causing a conflict, or if it’s an Ex Libris OTB issue.  Refreshes same browser tab
    • javascript:document.location=document.location+'&noCustomization=true'

     

    Show Performance (Ex Libris webinar 2018)

    • See loading times and assess performance.  Adds block to top of screen after refreshing same browser tab.  Close browser tab to remove.
    • javascript:document.location=document.location+'&show_performance=true'

     

    Change your View by prompt for Primo BO (SvG UQ)

    • Presents a popup box to type in your VID to easily change between views
    • javascript:location.href=location.href.replace(/explore.*/,'explore/search?vid='+prompt('VID?','Your View Code'));

     

    Display results from a specific ‘page’ (SvG UQ)

    • The New UI does not have pages.  The original design was endless scroll (August 2016), but this was changed to a bulk load of 10 results in February 2017
    • If clicking ‘Load more results’ repeatedly is getting you down, you can change the offset parameter in the URL to display results for a specific ‘page’
    • To display the next bulk load of 10 or more, change the offset from &offset=0 to &offset=11, or 101, or 501, or 1001, etc
    • javascript:location.href=location.href.replace(/&offset*/,'&offset='+prompt('offset?','add offset here'));

     

    Display CTO on Primo Back Office (SvG UQ)

    • Right click on the View It or Get It frame
    • Select View frame source
    • javascript:location.href=location.href.replace('openurl?','openurl?svc_dat=CTO&debug=true&')

     

    Display CTO on Primo VE (Ex Libris, in the June 2018 Primo VE Release)

    • Displays In the full record display, after refreshing the page
    • VE has more limited troubleshooting abilities for the OpenURL functionality, with the GetIt not in an iframe, to View frame source
    • Some data is available via the Display CTO option provided by Ex Libris in the June 2018 Primo VE Release
    • javascript:document.location=document.location+'&displayCTO=true'

     

    Suggestions or additions?