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 git@github.com:BCLibraries/primo-explore-devenv.git

Install dependencies

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.hosted.exlibrisgroup.com:443';

Download BC Primo Customizations

Development will be easier if you download into the parent directory and name the local repo bclib_new, after the repo name

# ~/Projects
git clone git@github.com:BCLibraries/bc-primo-customizations.git bclib_new

Install BC Primo Customization packages

# ~/Projects/bclib_new
npm install

Link BC Primo Customizations to custom view location

# ~/Projects/bclib_new
ln -s ~/Projects/bclib_new ~/Projects/primo-explore-devenv/primo-explore/custom/

Local development

Run a local development server

# ~/Projects/primo-explore-devenv
gulp run --view bclib_new

Viewing the local development instance of Primo

Visit http://localhost:8003/primo-explore/search?vid=bclib_new in your browser.

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 git@github.com:BCLibraries/primo-explore-bc-availability.git

Link to the development environment

# ~/Projects/primo-explore-bc-availability
sudo npm link
# ~/Projects/bclib_new
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 bclib_new

Packaging your customizations

Switch customized packages to remote version

# ~/Projects/bclib_new
rm -rf node_modules/primo-explore-bc-availability
npm install 

Create the package

# ~/Projects/primo-explore-devenv
gulp create-package --view bclib_new
# ~/Projects/primo-explore-devenv/packages/bclib_new.zip

Upload and deploy the package

Visit the Primo Backoffice and navigate to Deploy & Utilities > Customization Manager

  1. Choose bclib_new from the dropdown
  2. Download the current version of bclib_new.zip as a backup in case something goes wrong
  3. Upload the new version of bclib_new.zip
  4. Deploy

screenshot of steps to upload and deploy the package