IGELU DevDay 2022 presentation.

Overview

PrimoVE development

Yarn is prefered as package manager. But any will do.

Directory structure

.
├── README.md                       This file
├── dist                            Your build folder
│   └── 11INST-VIEW
│       └── js
│           ├── custom.js
│           └── custom.js.map
├── make_package.js                 Packaging code
├── package                         Alma ready. Packaged build
├── package.json                    Environment configuration
├── resources                       Resources
│   ├── 11INST-VIEW                 Institution and ViewID specific files
│   │   ├── img
│   │   ├── html
│   │   └── js
│   └── general                     These files will be added to all Institution and Views
│       ├── img
│       ├── html
│       └── js
├── src                             Source code
│   ├── components                  Component definitions
│   │   └── dotTest
│   │       └── index.js
│   ├── modules                     Module definitions
│   │   ├── interceptors
│   │   └── pubSubInterceptor.js
│   ├── sass                        Style sheets
│   │   ├── base
│   │   ├── layout
│   │   └── style.scss            
│   ├── index.js                    Entry point to custom.js
│   └── loader.js                   Components loader
├── webpack.config.js               Webpack configuration
└── yarn.lock                       yarn.lock file

Resources

general

All static non view specific html, img and js files
CSS files are not stored here since SASS is used to generate them.
If you need to reference an html file from another html file the base path = '/discovery'.
for example: ./custom/11INST-VIEW/hello.html or /discovery/custom/11INST-VIEW /world.html

[INSTITUTION-VIEWID] like 11INST-VIEW

All static view specific css, html, img and js files

package.json

Is used to configure and setup the environment

  "primo": {
    "url": "https://test.primo.exlibrisgroup.com",       #base url of primo
    "institution": "11INST",                             #institution id
    "vidId": "VIEW",                                     #view id to use with `yarn start`
    "build": {                                           #list of views to build
      "views": [
        "VIEW"
      ],
      "dist": "./dist",                                  #build folder
      "resources": "./resources",                        #resource folder
      "package": "./package",                            #packages folder
      "tmp": "./tmpPackage"                              #temp package folder
    }
  }

Usage

Start a preview in the browser

yarn start

Build a custom.js file. Will be written to ./dist/[INSTITUTION:VID] folder

yarn build

Watch for changes in the ./src folder and rebuild the custom.js file that will trigger a browser reload.

yarn watch

Package the ./dist folder into something that can be uploaded to Alma

yarn package

Best way to develop.

Run yarn inside the project directory to install all dependencies and possible updates

When using Visual Studio Code open a terminal and run

yarn watch

Open another terminal and run

yarn start

Everytime you update a component it will trigger a rebuild every rebuild will trigger a reload in the browser.

Creating a new component.

Component skeleton

Creates a green dot on screen

class DotTestController {
    constructor() {
        console.log('test component');
    }
}

export let dotTestComponent = {
    name: 'dot-test',
    config: {
        bindings: {parentCtrl: '<'},
        controller: DotTestController,
        template: "<div style='position:fixed;right: 0;top: 0;color:#009991;opacity:0.5;z-index: 100000;font-size: 10em;'>.</div>"
    },
    enabled: true,
    appendTo: 'prm-top-bar-before',
    enableInView: '.*'
}
  • name: name of the component.
  • config: see AngularJS
  • enabled: if component enabled in configuration
  • appendTo: a before or after hook to attach your component. If value is NULL then the component can be used anywhere like for example the home page. Get a list of hooks. This varies depending on context.
Array.from(document.getElementsByTagName('*')).filter(f => /before|after/.test(f.localName))
  • enabledInView: a RegEx to restrict a component to a view

Interceptors

An interceptor can modify the request and response of an API call.
Interceptors use a publish/subscribe mechanism. It is possible to intercept a request 'before' it is executed or 'after' is was executed and before the UI receives it.

Adding interceptors

Interceptors are stored in the src/modules/pubSubInterceptor/interceptors directory. It is possible to group interceptors in a sub directory. Every "before" interceptor calls the subscribed callback function with a request parameter. Every "after" interceptor calls the subscribed callback method with a response parameter.

For example:

document.addEventListener('pubSubInterceptorsReady', (e) => {    
    pubSub.subscribe('before-pnxBaseURL', (reqRes) => {
        //modify request here
        return reqRes;
    });

    pubSub.subscribe('after-pnxBaseURL', (reqRes) => {
        //modify response here
        return reqRes;
    });    
});

A topic name is constructed by a prefix(after-, before-) and a rest base url as defined by PrimoVE. All restBaseURLs can be queries for using the pubSub object.

pubSub.restBaseURLs

List of before-topics

pubSub.listBeforeTopics

List of after-topics

pubSub.listAfterTopics

List all events

pubSub.listEvents
You might also like...

PancakeSwap Prediction Bot [2022]. Make gains passively while running this bot for PancakeSwap or CandleGenie.

PancakeSwap Prediction Bot [2022]. Make gains passively while running this bot for PancakeSwap or CandleGenie.

🥞 PancakeSwap Prediction v2 – 2022 Update 🥞 This bot wins the majority of rounds on PancakeSwap & CandleGenie based. This bot survived the beta and

Sep 4, 2022

Application built following the Udemy course "React Front To Back 2022"

Application built following the Udemy course

Github finder app This project was built based on "React Front To Back 2022" course on Udemy. General information The "Github finder" application uses

Feb 19, 2022

A simple CLI to patch the Fitbit OS Simulator with the new SSL certificate - March 2022

patch-fitbit-simulator Only for Mac OS currently A simple CLI to patch the Fitbit OS Simulator certificate with the new SSL certificate for the Device

Mar 28, 2022

A script for defending the Canadian flag on r/place 2022

ca-place-script A script for defending the Canadian flag on r/place 2022. This script will automate your tile placements to defend the grey outline an

Apr 4, 2022

Reddit Place Tracer is a browser based userscript for the 2022 Reddit /r/Place project

Reddit Place Tracer is a browser based userscript for the 2022 Reddit /r/Place project

Reddit Place Tracer is a browser based userscript for the 2022 Reddit /r/Place project which adds a transparent image on top of the canvas to aid communities with drawing the same image. It shows how the canvas should look, where each pixel goes, and what color. The user must manually click on these spots. It is not an automated bot and does not break any rules.

Apr 3, 2022

Overlay dos brasileiros, a partir do Discord, no r/place 2022

[Instruction available in English below] - Instruções de uso do overlay do r/brasil no r/place 2022 INSTRUÇÕES PARA USAR O OVERLAY: Instale o TamperMo

Sep 20, 2022

Collaborative /r/place 2022 template userscript

Collaborative /r/place 2022 template userscript

[inactive] /r/Place 2022 collaborative minimap userscript Help /r/MyLittlePony get a pony on /r/place! Help /r/ainbowroad build a rainbow road on /r/p

Aug 26, 2022

This work is an overnight with 84436, an overlay code forked from Osu! community but for ``flag of Vietnam`` in r/place 2022

This work is an overnight with 84436, an overlay code forked from Osu! community but for ``flag of Vietnam`` in r/place 2022

flag-of-vietnam-rplace2022 This work is a overnight with 84436, an overlay code forked from Osu! community but for flag of Vietnam Installation Xài Ta

Nov 2, 2022

Analysing and storing r/Place 2022 event

Caching r/Place 2022 This project is live at place.thatguyalex.com. Running scraper locally Install Python and all dependencies from scraper.py import

Dec 16, 2022
Owner
Mehmet Celik
Mehmet Celik
Shower HTML presentation engine

Shower Presentation Template Shower ['ʃəuə] noun. A person or thing that shows. Built on HTML, CSS and vanilla JavaScript. Works in all modern browser

Shower 4.8k Dec 28, 2022
DIY Presentation Micro-Framework

Bespoke.js DIY Presentation Micro-Framework Bespoke.js is a super minimal (1KB min'd and gzipped), modular presentation library for modern browsers, d

Bespoke.js 4.7k Dec 18, 2022
An example of implementation of the Veriifiable Presentation Generation Service specification.

Verifiable Presentation Generation Service A plugin-based service that allows issuers to render verifiable presentations from templates, and store it

Verifiable Presentation Generation 5 Nov 16, 2022
Some of my Genuary peices - starting 2022

Genuary-Projects Some of my Genuary pieces - starting 2022 2022 ... Genuary-2022 1st 2nd 3rd ... 1st Draw 10,000 of something. (credit: Michael Lowe)

Magnogen 1 Jan 7, 2022
Base-mock-api - Repo to storage my fake api's to use in my 2022 projects.

Base Mock API's Project made 100% with JavaScript, with the objective of creating endpoints to use in projects. Prerequisites Before you begin, ensure

Arthur Cabral 0 Nov 20, 2022
Registrasi LTMPT Otomatis 2022

Registrasi LTMPT Otomatis 2022 Harap ketahui! Repository ini ditujukan untuk membantu mereka yang frustrasi akibat API Kemdikbud error terus / kuota p

Nathan Adhitya 1 Sep 10, 2022
A complete template for 2022 focused on around React, Postgres and various web3 integrations.

A complete template for 2022 focused on around React, Postgres and various web3 integrations. You can use the template to make a website, a web application, a hybrid decentralized web application, or even a DAO.

jim 45 Dec 22, 2022
Shopify Backend Developer Intern Challenge - Summer 2022

Shopify-Backend-Developer-Intern-Challenge Shopify Backend Developer Intern Challenge - Summer 2022 Application Features User can add products. User c

Dhrumil Shah 1 May 14, 2022
An IoT bottle that tracks water consumption. Winner of Best Health Hack, MLH's Best Hardware Hack, and QB3's Best Big Data for the Improvement of Health Care Winner at CruzHacks 2022.

An IoT bottle that tracks water consumption. Winner of Best Health Hack, MLH's Best Hardware Hack, and QB3's Best Big Data for the Improvement of Health Care Winner at CruzHacks 2022.

Nathanael Garza 2 Jan 21, 2022
NFT Marketplace 2022 - OpenSea

NFT MARKETPLACE - 2022 ?? iv7.dev for a coffee : 0xBE95c56Fe1956804B2E7aD858978A90aF20eeB16 (Nets : BSC, Polygon, ETH) This project was bootstrapped w

Iv7.software 2 Feb 4, 2022