diff --git a/src/themes/cicba/app/item-page/simple/field-components/usage-stats/cic-usage-stats.component.ts b/src/themes/cicba/app/item-page/simple/field-components/usage-stats/cic-usage-stats.component.ts index 27187eb9900..6cb0c19946c 100644 --- a/src/themes/cicba/app/item-page/simple/field-components/usage-stats/cic-usage-stats.component.ts +++ b/src/themes/cicba/app/item-page/simple/field-components/usage-stats/cic-usage-stats.component.ts @@ -1,4 +1,5 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, Input, OnInit } from '@angular/core'; +import { Item } from '../../../../../../../app/core/shared/item.model'; /** * This component renders the usage-stats badge provided by La Referencia. @@ -9,6 +10,17 @@ import { Component, OnInit } from '@angular/core'; }) export class CicUsageStatsComponent implements OnInit { + + @Input() item!: Item; + @Input() version: string = '1.1.5'; + @Input() baseIdentifierOAI! : string; + @Input() identifierHandle? : string = '/handle/[0-9.]+/([0-9]+)/?'; + @Input() nodoName! : string; + @Input() repositoryName! : string; + @Input() countryCode! : string; + @Input() identifierMetaField? : string; + @Input() nationalSource! : string; + @Input() repositorySource! : string; constructor() { // script @@ -22,7 +34,7 @@ export class CicUsageStatsComponent implements OnInit { js.src = f; js.async = 1; fjs.parentNode.insertBefore(js, fjs); - }(window, document, 'script', 'lrw', 'parameters', 'https://cdn.jsdelivr.net/gh/lareferencia/lrw@1.1.2/dist/lrw.js')); + }(window, document, 'script', 'lrw', 'parameters', 'https://cdn.jsdelivr.net/gh/lareferencia/lrw@'+this.version+'/dist/lrw.js')); } ngOnInit() { @@ -30,8 +42,10 @@ export class CicUsageStatsComponent implements OnInit { if (typeof window['lrw'] === 'function') { window['lrw']({ widget_div_id: 'usage-stats', - identifier_prefix: 'oai:digital.cic.gba.gob.ar:11746/', - identifier_regex: '\/handle\/[0-9\.]+\/([0-9]+)\/?', // build the identifier from the url + //identifier_prefix: 'oai:digital.cic.gba.gob.ar:11746/', + //identifier_regex: '\/handle\/[0-9\.]+\/([0-9]+)\/?', // build the identifier from the url + //identifier_meta_field: 'citation_abstract_html_url', + identifier: this.baseIdentifierOAI +':' + this.item.handle , event_labels: { 'view': 'Vistas', 'download': 'Descargas', @@ -39,12 +53,12 @@ export class CicUsageStatsComponent implements OnInit { }, scope_labels: { 'L': 'LA Referencia', - 'N': 'SNRD', - 'R': 'CIC Digital' + 'N': this.nodoName, + 'R': this.repositoryName }, - country: 'AR', - national_source: 'SITEID::132', - repository_source: 'OPENDOAR::5634' + country: this.countryCode, + national_source: 'SITEID::' + this.nationalSource , + repository_source: 'OPENDOAR::' + this.repositorySource }); } } diff --git a/src/themes/cicba/app/item-page/simple/item-types/untyped-item/untyped-item.component.html b/src/themes/cicba/app/item-page/simple/item-types/untyped-item/untyped-item.component.html index 04341f8b2cc..8f2a6b90edf 100644 --- a/src/themes/cicba/app/item-page/simple/item-types/untyped-item/untyped-item.component.html +++ b/src/themes/cicba/app/item-page/simple/item-types/untyped-item/untyped-item.component.html @@ -173,7 +173,17 @@
[inlineLabel]="true" [authorityUrl]="true"> - + +