[develop | DONE | CHANGED]: data sources landing: Get and parse number of collected fulltexts from a new stats api.
1. env-properties.ts: Added property pdfStatisticsAPIURL?: string; 2. environment.ts: Added pdfStatisticsAPIURL property in all environments. 3. dataProvider.service.ts: Uncomment method "getCollectedFulltexts()". 4. dataProvider.component.ts: Call method "getCollectedFulltexts()" instead of "getDataProviderAggregationStatus()".
This commit is contained in:
parent
68c352d3d2
commit
7f9117eccb
|
@ -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 => {
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -15,6 +15,7 @@ export interface EnvProperties {
|
|||
showAddThis?: boolean;
|
||||
showContent?: boolean;
|
||||
enableEoscDataTransfer?:boolean;
|
||||
pdfStatisticsAPIURL?: string;
|
||||
statisticsFrameAPIURL?: string; //delete?
|
||||
statisticsFrameNewAPIURL?: string;
|
||||
bipFrameAPIURL?: string;
|
||||
|
|
|
@ -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/",
|
||||
|
|
Loading…
Reference in New Issue