Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
primo-explore-unpaywall
Advanced tools
Add 'Open Access available via unpaywall' link to search-result-avaliability-line-after in Primo New UI
primo-explore-unpaywall
Add 'Open Access available via unpaywall' link to search-result-availability-line-after
in Primo New UI
On Item Display... /primo-explore/fulldisplay
On Results List (optionally)... /primo-explore/search
oa
unpaywall
API usagehttps://api.oadoi.org/v2/{doi}?email={email}"
).showOnResultsPage
to false
. [see 'Additional Customization']primo-explore-oadoi-link
alliance-pcsg
's
primo-explore-oadoi-link
customization, and owes very
much to their great work.npm
package allows us to make changes more quicklyfull-view-service-container-after
vs search-result-availability-line-after
)app.module
anyway.Wherever a <prm-search-result-availability-after>
tag appears (/primo-explore/search, /primo-explore/fulldisplay), we...
prmSearchResultAvailability
) for the item info contained in it's result
variabledoi
) in there and it's not already marked as open access (oa
)* use it to make a call to
the afore-mentioned unpaywall api.successResponse.data.best_oa_location
)note: (*) you can override this OA check (so that a call is made wherever a DOI is found) by setting overrideOACheck
in your unpaywallConfig
primo-explore
run the following command from within your view's main directory to add it as a dependency.
$ npm install --save-dev primo-explore-unpaywall
this should add the following line to your package.json
file...
"primo-explore-unpaywall": "^1.3.2"
and add the contents of this repository (at that npm version) into a node_modules/primo-explore-unpaywall
directory for your current view. the presence of this package should mean that the package was successfully
installed and added to your project.
from here you'll have to edit your main.js
(or config.module.js
) file to import the package, and
add bulibUnpaywall
to the dependencies inside of your 'viewCustom' module.
import 'primo-explore-unpaywall';
angular.module('viewCustom', ['angularLoad', 'bulibUnpaywall']);
to protect against the situation in which you already have a component for prmSearchResultAvailabilityLineAfter
,
you'll also have to add a <bulib-unpaywall></bulib-unpaywall>
component as such:
app.component('prmSearchResultAvailabilityLineAfter', {
template: '<bulib-unpaywall></bulib-unpaywall>'
});
note: an example of the setup for this can be seen in the .main.js
file
unpaywallConfiguration
to afford you with as much control as possible (and since we needed you to add your email for the unpaywall API call to work anyway), we've added some configuration options that you'll need to set up in order to run the package effectively
our package attempts to read its options as variables within a constant
object attached to the primo angular module (app
).
to get this packaged to work, simply create a new constant with the name unpaywallConfig
, specifying the email
you'd
like us to append to your unpaywall request:
// main.js
app.constant('unpaywallConfig', { "email":"<your_username>@<your_institution>.edu" });
the following table describes describes some additional configuration options that are currently afforded to
you by the package. an example implementation of this section can be found within this repo at src/.main.js
:
name | default | description |
---|---|---|
logEvent | see example | here's an opportunity to hook in whatever event tracking you have, (we use google analytics) |
showOnResultsPage | true | determine whether the link is added to each item in the list of results |
overrideOACheck | false | disable the addata.oa check so that the unpaywall check runs on all items with an available DOI |
showVersionLabel | true | sometimes the unpaywall OA response qualifies the stage of publication the work was OA-available in (Submitted , Published , Accepted ) |
logToConsole | true | controls whether or not messages about what's going on in the component are console.log() -ed (visible in inspector) |
showDebugTable | false | the debug table is a quick way to see unpaywall response data for the record in context a really ugly way (used to help troubleshoot, not meant for end users) |
publishEvents | false | we use this variable within our sample implementation to ensure only real traffic is tracked (not us debugging/developing/testing) |
labelText | see above | Text/copy for the main call-to-action |
imageUrl | null | Alternative image to display with unpaywall link |
imageStyle | see example | CSS tweaking to style whatever image you've chosen |
note: the default for logEvent
can be found within this repo at src/.main.js
. it assumes you're using google analytics and calls it via window.ga
You're more than welcome to fork this repository, make some changes, and contribute it back by creating a pull request.
If you have any issues with this package or ideas for how to make it better, don't hesitate to let us know by submitting a new issue.
In both of these cases, it would help us if you make sure to add on the appropriate
labels (including especially unpaywall
) so that we
can keep track of what your pull request or issue relates to.
If you get stuck, send us a message on our gitter, and we'll try to help you out.
FAQs
Add 'Open Access available via unpaywall' link to search-result-avaliability-line-after in Primo New UI
The npm package primo-explore-unpaywall receives a total of 8 weekly downloads. As such, primo-explore-unpaywall popularity was classified as not popular.
We found that primo-explore-unpaywall demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.