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

    How to - Display Open Access and Restricted Access indicators in Primo VE

    Created By: François Renaville
    Created on: 5/01/2020



    Next to the existing Open Access indicator displayed for CDI and Alma records, libraries may be interested in displaying:

    • the same indicator for external data sources (harvested sources);
    • a similar indicator for records in Restricted Access coming from external data sources.

    Example:

     

    Step 1: Create a new local field

    For the Restricted Access indicator, you have to create a local field under Alma Configuration > Discovery > Display Configuration > Manage display and local fields.

    Ours is local_field_44 and is called RestrictedAccess.

    Check option “Use the parallel Local Field 01/50 from the Dublin Core record”.

    In our environment, we have associated local_field_44 to the 925 Marc21 field.

    Check options “Enable field for search”, “Enable field for facet” and “Use Translations” if you need them. More info at “Managing Display and Local Fields for Primo VE

    Remark: We have noticed in our Sandbox that “Use Translations” option did not work in the Brief Display: the value was not translated. Originally, we thought we could have displayed the value in different languages (ENG: restricted access; FRE: Accès restreint; GER: Eingeschränkter Zugang) according to the language of the Primo UI. Since it did not work, we decided to keep “Restricted Access” everywhere.

     

    Step 2: Create your Normalization Rules

    For both Open Access and Restricted Access indicators, create a Normalization Rule that will set the expected value in the dc field according to the Access Level of the available file(s). Rights statements are often contained in the rights tag. Access Level is for example mandatory in the OpenAIRE project. Commonly encountered values are:

    • info:eu-repo/semantics/closedAccess
    • info:eu-repo/semantics/embargoedAccess
    • info:eu-repo/semantics/restrictedAccess
    • info:eu-repo/semantics/openAccess
    • public
    • intranet
    • restricted
    • embargo

    Open Access Indicator

    The Open Access indicator for DC records is based on whether the dcterms.accessRights parameter contains value “Unrestricted online access”. For externally managed data that is loaded into Primo, you have just to write a normalization rule that adds this value to each record; display of the OA indicator is automatically done by Primo.

    Examples of DC and XML Normalization Rules:

    DC:

      rule "Add Open Access indicator"
      when
        true
      then
        set "Unrestricted online access" in "dcterms"."accessRights"
      end

      rule "Add Open Access indicator"
      when
        "dc"."rights" equals "public"
      then
        set "Unrestricted online access" in "dcterms"."accessRights"
      end

     

    XML:

      rule "Add Open Access indicator"
      when
        exist "//*[local-name()='rights'][contains(.,'info:eu-repo/semantics/openAccess')]"
      then
        set "Unrestricted online access" in "dcterms"."accessRights"
      end

     

    Restricted Access Indicator

    The Restricted Access indicator is not managed by default by the system. This is why you need a specific local field for this.

    Create a normalization rule to set “Restricted Access” in the local field that you have previously created.

    Examples of DC and XML Normalization Rules:

    DC:

      rule "Add Restricted Access indicator"
      when
        "dc"."rights" equals "intranet"
      then
        set "Restricted Access" in "discovery"."local44"
      end

    XML:

      rule "Add Restricted Access indicator"
      when
        exist "//*[local-name()='rights'][contains(.,'info:eu-repo/semantics/restrictedAccess')]"
      then
        set "Restricted Access" in "discovery"."local44"
      end

      rule "Add Restricted Access indicator"
      when
        exist "//*[local-name()='rights'][contains(.,restrictedAccess') or contains(.,'embargoedAccess')]"
      then
        set "Restricted Access" in "discovery"."local44"
      end

    Test your rules and run an update of your local external data with your Discovery Import Profile.

     

    Step 3: Display the Restricted Access Indicator

    As earlier said, no action has to be taken for the Open Access indicator: it will automatically be displayed in Primo.

    The Restricted Access indicator has now to be added in the Brief Record.

    Go to Alma Configuration > Discovery > Display Configuration > Configure Views, select your view and go to tab “Brief Record Display”. Add local field “RestrictedAccess”. In our scenario, we have added it on line 4, next to the Creation date. No separator is needed.

    At this stage, a brief record from your external data source with access level "Restricted Access" should now display like this:

     

    Step 4: Add an icon

    Copy an icon for the Restricted Access indicator in your /img folder of the Customization Package.

    We use this one:

    and it is called logo_restrictedaccess.png in our case.

     

    Step 5: Customize the Restricted Access indicator

    (a) Add the following javascript lines to your custom.js file. Make sure to set your own institution and view codes in the icon URL.

        app.controller('BriefResultAfterController', ['$scope', function ($scope) {
            var vm = this;
            var objetKey = [];
            vm.$onInit = function () //wait for all the bindings to be initialised
            {
                try {
                    if (isThere("Restricted Access", vm.parentCtrl.lines, objetKey)) {
                        vm.restricted_access = 'Restricted Access';
                        var rev = objetKey.reverse();
                        console.log(vm.parentCtrl.lines);
                        vm.parentCtrl.lines[rev[0]][rev[1]].splice(rev[2], 1);
                    }
                } catch (e) {
                    return;
                }
            }
        }]);

        app.component('prmBriefResultAfter', {
            bindings: { parentCtrl: '<' },
            controller: 'BriefResultAfterController',
            template: `<div ng-if="$ctrl.restricted_access" class="restricted_access"><img style="max-width:17px;vertical-align: bottom;margin: 0 5px;" src="../discovery/custom/<INSTITUTION_CODE>-<VIEW_CODE>/img/logo_restrictedaccess.png" alt="Restricted Access Logo">Restricted Access</div>`
        });

        function isThere(a_string, in_this_object, objetKey) {
            if (typeof a_string != 'string') {
                return false;
            }
            for (var key in in_this_object) {
                if (typeof in_this_object[key] == 'object' || typeof in_this_object[key] == 'array') {
                    if (isThere(a_string, in_this_object[key], objetKey)) {
                        objetKey.push(key);
                        return true;
                    }
                }
                else if (typeof in_this_object[key] == 'string') {
                    if (a_string == in_this_object[key]) {
                        in_this_object[key] = "<span class='restricted_access'>Restricted Access</span>";
                        objetKey.push(key);
                        return true;
                    }
                }
            }
            return false;
        }

    [Javascript code by Sylvain Danhieux <S.Danhieux@uliege.be>]

     

    (b) Add the following lines to your customs1.css file:

    div.restricted_access {
        font-size: 12px;
        text-transform: uppercase;
        font-weight: 600;
    }

     

    Step 6: Upload your Customization Package

    Zip your Customization Package folder, upload it, save. Clear your cache. Your Restricted Access indicator is similar to the Open Access one.

     

    Contact: François Renaville <francois.renaville@uliege.be>