This is the University of Oslo local customization package for Primo Explore. It is to be used together with the Bibsys central customization package (which isn't published and documented openly).
-
In
PrmSearchAfterController
, we move the footer defined inhome_xx_xx.html
to a new DOM location. -
Some light style customization, see main.scss for details.
-
For one year we had a session logging service known as Slurp. This was used to produce data for the Dewey mapping project. We eventually removed it, both for the reason of the data minimization principle, but also due to the risk of it failing after an upgrade since it depended on many different directives. It would be much cleaner if the logging service could be self-sustained, but at the moment there isn't an open and documented API for Primo Explore apart from the directive hooks. Primo-expolore-dom is an interesting project trying to provide a simple domain object model, but at the moment it seems to depend on a lot of undocumented things that might change between Primo versions. Would be great if Ex Libris could support the project or provide something similar. See also this Ideas Exchange idea
-
In
PrmSearchBarAfterController
, we used to set the search input field to automatically get focus until Unit included that functionality in their central package.
-
Clone the Primo development environment and install dependencies:
git clone https://github.com/ExLibrisGroup/primo-explore-devenv.git cd primo-explore-devenv npm install
-
Set
PROXY_SERVER
ingulp/config.js
to this value:var PROXY_SERVER = 'https://bibsys-almaprimo.hosted.exlibrisgroup.com:443';
-
Download the central package from Primo Back Office (Primo Utilities > UI customization Package Manager) into
primo-explore/custom
and unzip it. Make sure the folder name isCENTRAL_PACKAGE
. This contains the modifications from Bibsys. Open question: Do they version control it? -
Clone the UiO package into
primo-explore/custom
:git clone https://github.com/uio-library/primo-explore-uio.git primo-explore/custom/UIO
At this point, you should have both primo-explore/custom/CENTRAL_PACKAGE
and primo-explore/custom/UIO
.
We're using scss and browserify, so run
gulp run --view UIO --browserify --useScss
This builds
-
primo-explore/custom/UIO/css/custom1.css
fromprimo-explore/custom/UIO/scss/main.scss
-
primo-explore/custom/UIO/js/custom.js
fromprimo-explore/custom/UIO/js/main.js
Open http://127.0.0.1:8003/primo-explore/?vid=UIO in your browser. Note: Using localhost instead of 127.0.0.1 may cause zero search results in Chrome (due to a CORS issue?)
-
gulp run --view UIO --browserify --useScss
(in theprimo-explore-devenv
directory) to make sure the js and css are updated. -
eslint js
to check that files are ok-ish. -
gulp create-package
and select the UIO package. This createspackages/UIO.zip
. -
Log in to Oria back office
-
Go to Primo Utilities > UI customization Package Manager
-
Select View: UIO (not UBO)
-
Upload using "Upload package forUBO" [sic] and make sure "inherit from central package" is checked.
-
Click "Deploy"
- https://github.com/Det-Kongelige-Bibliotek/primo-explore-rex
- https://github.com/SarahZum/primo-explore-custom-no-results
angular.reloadWithDebugInfo();
q = angular.element(document.getElementsByTagName('prm-search-bar-after'))
q.scope().$ctrl
Modern Angular guide: (Note: currently we're at Angular 1.6)
https://toddmotto.com/angular-1-5-lifecycle-hooks
http://blog.kwintenp.com/the-onchanges-lifecycle-hook/
Watching changes in parent scope: $onChanges
is generally not useful because
it's only called when the whole object is reassigned, there is no deep checking
for changes to elements inside the object. So in general we're left with
$doCheck
and $watch
. Both are evaluated at every digest cycle, so we have
to be careful about implementation to avoid degrading performance!
Suggested reading: