Skip to content

BCLibraries/bc-primo-customizations

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

BC Primo Customizations

Setting up the primo development environment

Download the Primo Development Environment

# ~/Projects
git clone [email protected]:BCLibraries/primo-explore-devenv.git

Install dependencies

  • node v.10.x
  • npm
  • gulp

Install node modules

# ~/Projects/primo-explore-devenv
npm install

Configure the proxy server

The local development environment connects to our production or staging instance of Primo via proxy.

// primo-explore-devenv/gulp/config.js
var PROXY_SERVER = 'https://bc.primo.exlibrisgroup.com:443';

Download BC Primo Customizations

Development will be easier if you download into the parent directory and name the local repo 01BC_INST-bclib, after the view name

# ~/Projects
git clone [email protected]:BCLibraries/bc-primo-customizations.git 01BC_INST-bclib

Install BC Primo Customization packages

# ~/Projects/01BC_INST-bclib
npm install

Link BC Primo Customizations to custom view location

# ~/Projects/01BC_INST-bclib
ln -s ~/Projects/01BC_INST-bclib ~/Projects/primo-explore-devenv/primo-explore/custom/

Local development

Run a local development server

# ~/Projects/primo-explore-devenv
gulp run --view 01BC_INST-bclib --ve

Viewing the local development instance of Primo

Visit http://localhost:8003/discovery/search?vid=01BC_INST:bclib in your browser.

Note that the view in the URL uses a colon, while the customization folder uses a hyphen.

Making changes to the view

Basic styles and templates can be changed in bc-primo-customizations. Customization that changes or adds functionality is contained in separate packages. A feature can be added or removed by editing js/aaa_bootstrap.js and installing or removing the npm package.

Making changes to a custom package

Download the package

# ~/Projects
git clone [email protected]:BCLibraries/primo-explore-bc-availability.git

Link to the development environment

# ~/Projects/primo-explore-bc-availability
sudo npm link
# ~/Projects/01BC_INST-bclib
rm -rf node_modules/primo-explore-bc-availability
npm link primo-explore-bc-availability

Running tests

Run tests

# ~/Projects/primo-explore-bc-availability
gulp run-tests --view 01BC_INST-bclib --ve

Packaging your customizations

Switch customized packages to remote version

# ~/Projects/01BC_INST-bclib
rm -rf node_modules/primo-explore-bc-availability
npm install 

Create the package

# ~/Projects/primo-explore-devenv
gulp create-package --view 01BC_INST-bclib --ve
# ~/Projects/primo-explore-devenv/packages/01BC_INST-bclib.zip

Upload and deploy the package

  1. In Alma, navigate to Configuration > Discovery > Display Configuration > Configure Views
  2. Choose Edit from the action menu (three dots) and then select the Manage Customization Package tab
  3. Download the Current View Customization Package of 01BC_INST-bclib.zip as a backup
  4. Upload the new version of 01BC_INST-bclib.zip
  5. Press the Save button in the upper right to deploy

screenshot of steps to upload and deploy the package