diff --git a/landingPages/dataProvider/dataProvider.component.ts b/landingPages/dataProvider/dataProvider.component.ts index 6c4b8be0..baebcd09 100644 --- a/landingPages/dataProvider/dataProvider.component.ts +++ b/landingPages/dataProvider/dataProvider.component.ts @@ -394,8 +394,8 @@ export class DataProviderComponent { this.updateUrl(this.canonicalUrl); this.seoService.createLinkForCanonicalURL(this.properties.domain +this.properties.baseLink + this._router.url); if (typeof document !== 'undefined') { - this.getDataProviderAggregationStatus(this.dataProviderInfo.originalId); - // this.getCollectedFulltexts(); + // this.getDataProviderAggregationStatus(this.dataProviderInfo.originalId); + this.getCollectedFulltexts(); this.countResultsWithFundingInfo(); } else { this.aggregationStatusIsInitialized = true; @@ -454,34 +454,34 @@ export class DataProviderComponent { } } - private getDataProviderAggregationStatus(originalId: string) { - this.subscriptions.push(this._dataproviderService.getDataproviderAggregationStatus(originalId, this.properties).subscribe( - data => { - this.dataProviderInfo.aggregationStatus = data; - this.aggregationStatusIsInitialized = true; - }, - err => { - //console.log(err); - this.aggregationStatusIsInitialized = true; - this.handleError("Error getting "+this.getTypeName()+" aggregation status for id: " + this.datasourceId, err); - } - )); - } - - // private getCollectedFulltexts() { - // this.subscriptions.push(this._dataproviderService.getCollectedFulltexts(this.datasourceId).subscribe( - // (data: string) => { - // this.dataProviderInfo.aggregationStatus = {"fulltexts": data}; + // private getDataProviderAggregationStatus(originalId: string) { + // this.subscriptions.push(this._dataproviderService.getDataproviderAggregationStatus(originalId, this.properties).subscribe( + // data => { + // this.dataProviderInfo.aggregationStatus = data; // this.aggregationStatusIsInitialized = true; // }, // err => { // //console.log(err); // this.aggregationStatusIsInitialized = true; - // this.handleError("Error getting "+this.getTypeName()+" collected fulltexts for id: " + this.datasourceId, err); + // this.handleError("Error getting "+this.getTypeName()+" aggregation status for id: " + this.datasourceId, err); // } // )); // } + private getCollectedFulltexts() { + this.subscriptions.push(this._dataproviderService.getCollectedFulltexts(this.datasourceId).subscribe( + (data: string) => { + this.dataProviderInfo.aggregationStatus = {"fulltexts": data}; + this.aggregationStatusIsInitialized = true; + }, + err => { + //console.log(err); + this.aggregationStatusIsInitialized = true; + this.handleError("Error getting "+this.getTypeName()+" collected fulltexts for id: " + this.datasourceId, err); + } + )); + } + private countResultsWithFundingInfo() { this.subscriptions.push(this._searchResearchResultsService.countCollectedResultsWithFundingInfo(this.datasourceId).subscribe( fundedContent => { diff --git a/landingPages/dataProvider/dataProvider.service.ts b/landingPages/dataProvider/dataProvider.service.ts index a80645e8..e62dd935 100644 --- a/landingPages/dataProvider/dataProvider.service.ts +++ b/landingPages/dataProvider/dataProvider.service.ts @@ -83,10 +83,10 @@ export class DataProviderService { .pipe(map(res => this.parseDataproviderAggregationStatus(res))); } - // getCollectedFulltexts(datasourceId: string) { - // return this.http.get(properties.pdfStatisticsAPIURL+"/api/stats/getNumberOfPayloadsForDatasource?datasourceId="+datasourceId) - // .pipe(map(res => res)) - // } + getCollectedFulltexts(datasourceId: string) { + return this.http.get(properties.pdfStatisticsAPIURL+"/stats/getNumberOfPayloadsForDatasource?datasourceId="+datasourceId) + .pipe(map(res => res)) + } private handleError (error: HttpErrorResponse) { // in a real world app, we may send the error to some remote logging infrastructure diff --git a/utils/properties/env-properties.ts b/utils/properties/env-properties.ts index 9f6b6db8..f31bab44 100644 --- a/utils/properties/env-properties.ts +++ b/utils/properties/env-properties.ts @@ -15,6 +15,7 @@ export interface EnvProperties { showAddThis?: boolean; showContent?: boolean; enableEoscDataTransfer?:boolean; + pdfStatisticsAPIURL?: string; statisticsFrameAPIURL?: string; //delete? statisticsFrameNewAPIURL?: string; bipFrameAPIURL?: string; diff --git a/utils/properties/environments/environment.ts b/utils/properties/environments/environment.ts index 60dc03e4..c501777d 100644 --- a/utils/properties/environments/environment.ts +++ b/utils/properties/environments/environment.ts @@ -90,6 +90,7 @@ export let common: EnvProperties = { export let commonDev: EnvProperties = { environment: "development", + pdfStatisticsAPIURL: "https://beta.services.openaire.eu/pdf-stats", statisticsAPIURL: "http://vatopedi.di.uoa.gr:8080/stats/", statisticsFrameAPIURL: "https://beta.openaire.eu/stats/", statisticsFrameNewAPIURL: "https://stats.madgik.di.uoa.gr/stats-api/", @@ -133,6 +134,7 @@ export let commonDev: EnvProperties = { export let commonTest: EnvProperties = { environment: "test", + pdfStatisticsAPIURL: "https://services.openaire.eu/pdf-stats", statisticsAPIURL: "https://beta.services.openaire.eu/stats-api/", statisticsFrameAPIURL: "https://www.openaire.eu/stats/", statisticsFrameNewAPIURL: "https://services.openaire.eu/stats-tool/", @@ -164,6 +166,7 @@ export let commonTest: EnvProperties = { export let commonBeta: EnvProperties = { environment: "beta", + pdfStatisticsAPIURL: "https://beta.services.openaire.eu/pdf-stats", statisticsAPIURL: "https://beta.services.openaire.eu/stats-api/", statisticsFrameAPIURL: "https://beta.openaire.eu/stats/", statisticsFrameNewAPIURL: "https://beta.services.openaire.eu/stats-tool/", @@ -203,6 +206,7 @@ export let commonBeta: EnvProperties = { export let commonProd: EnvProperties = { environment: "production", + pdfStatisticsAPIURL: "https://services.openaire.eu/pdf-stats", statisticsAPIURL: "https://beta.services.openaire.eu/stats-api/", statisticsFrameAPIURL: "https://www.openaire.eu/stats/", statisticsFrameNewAPIURL: "https://services.openaire.eu/stats-tool/",