Skip to content

Commit

Permalink
Refactor and add studio add-on
Browse files Browse the repository at this point in the history
  • Loading branch information
jweisman committed Apr 14, 2021
1 parent 68acd3d commit 258b764
Show file tree
Hide file tree
Showing 26 changed files with 11,942 additions and 129 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
4 changes: 3 additions & 1 deletion .npmignore
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
serverless-bibcard
serverless-bibcard
node_modules
primo-studio-lod-author-card
52 changes: 44 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,66 @@ When a full record is displayed, the MMS ID is retrieved and the Alma [JSON-LD L
### Screenshot
![screenshot](primo-explore-lod-author-card.png)

### Live examples
View these live examples:
* [Michelle Obama](https://tr-integration.primo.exlibrisgroup.com/discovery/fulldisplay?docid=alma99503141300561&vid=TR_INTEGRATION_INST:LD)
* [J. K. Rowling](https://tr-integration.primo.exlibrisgroup.com/discovery/fulldisplay?docid=alma99439777500561&vid=TR_INTEGRATION_INST:LD)

## Install
1. Make sure you've installed and configured [primo-explore-devenv](https://github.com/ExLibrisGroup/primo-explore-devenv).
2. Navigate to your template/central package root directory. For example:
2. [Download your customization package](https://knowledge.exlibrisgroup.com/Primo/Product_Documentation/020Primo_VE/Primo_VE_\(English\)/050Display_Configuration/010Configuring_Discovery_Views_for_Primo_VE#Branding_Your_View) and navigate to your template/central package root directory. For example:
```
cd primo-explore/custom/MY_VIEW_ID
cd primo-explore/custom/MY_INST_CODE-MY_VIEW_ID
```
3. If you do not already have a `package.json` file in this directory, create one:
```
npm init -y
```
4. Install this package:
```
npm install primo-explore-lod-author-card --save-dev
npm install primo-explore-appointment-scheduler --save-dev
```
## Usage
Once this package is installed, add `lodAuthorCard` as a dependency for your custom module definition.
It's best to use the `--browserify` build option when using this library. That means placing your customization JavaScript in a separate file such as `main.js`. When building with the `--browserify` option, your code and any dependencies (such as this package) are "minified" and copied into the `custom.js` file which is used by Primo.
In the `main.js` file, import the module and then add `lodAuthorCard` as a dependency for your custom module definition.
```javascript
import 'primo-explore-lod-author-card';
```js
const app = angular.module('viewCustom', ['lodAuthorCard']);
```

Note: If you're using the `--browserify` build option, you will need to first import the module with:
Add the `appointment-scheduler` component to the `prmAccountOverviewAfter` placeholder as follows:
```js
/** Linked Data Author Card */
app.component('prmFullViewAfter', {
bindings: {parentCtrl: '<'},
template: `<lod-author-card-component parent-ctrl="$ctrl.parentCtrl"></lod-author-card-component>`
});
/** END Linked Data Author Card */
```

```javascript
import 'primo-explore-lod-author-card';
Restart your development environment and test the add-on by searching for a record with an author authorized by a Library of Congress authority record.
```
gulp run --view MY_INST_CODE-MY_VIEW_ID --ve --browserify
```

Now you're ready to create your customization package and upload it to your Primo VE view using the View Management screen.
```
gulp create-package --browserify
```

## Development
To build this add-on, use:
```
npm run build
```

To publish:
```
npm publish
```

## Contributions
We welcome contributions to this community-supported add-on.
22 changes: 0 additions & 22 deletions css/lod-author-card.css

This file was deleted.

1 change: 1 addition & 0 deletions dist/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 0 additions & 2 deletions index.js

This file was deleted.

92 changes: 0 additions & 92 deletions js/lod-author-card.module.js

This file was deleted.

Loading

0 comments on commit 258b764

Please sign in to comment.