[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.updateUrl(this.canonicalUrl);
|
||||||
this.seoService.createLinkForCanonicalURL(this.properties.domain +this.properties.baseLink + this._router.url);
|
this.seoService.createLinkForCanonicalURL(this.properties.domain +this.properties.baseLink + this._router.url);
|
||||||
if (typeof document !== 'undefined') {
|
if (typeof document !== 'undefined') {
|
||||||
this.getDataProviderAggregationStatus(this.dataProviderInfo.originalId);
|
// this.getDataProviderAggregationStatus(this.dataProviderInfo.originalId);
|
||||||
// this.getCollectedFulltexts();
|
this.getCollectedFulltexts();
|
||||||
this.countResultsWithFundingInfo();
|
this.countResultsWithFundingInfo();
|
||||||
} else {
|
} else {
|
||||||
this.aggregationStatusIsInitialized = true;
|
this.aggregationStatusIsInitialized = true;
|
||||||
|
@ -454,34 +454,34 @@ export class DataProviderComponent {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private getDataProviderAggregationStatus(originalId: string) {
|
// private getDataProviderAggregationStatus(originalId: string) {
|
||||||
this.subscriptions.push(this._dataproviderService.getDataproviderAggregationStatus(originalId, this.properties).subscribe(
|
// this.subscriptions.push(this._dataproviderService.getDataproviderAggregationStatus(originalId, this.properties).subscribe(
|
||||||
data => {
|
// data => {
|
||||||
this.dataProviderInfo.aggregationStatus = 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};
|
|
||||||
// this.aggregationStatusIsInitialized = true;
|
// this.aggregationStatusIsInitialized = true;
|
||||||
// },
|
// },
|
||||||
// err => {
|
// err => {
|
||||||
// //console.log(err);
|
// //console.log(err);
|
||||||
// this.aggregationStatusIsInitialized = true;
|
// 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() {
|
private countResultsWithFundingInfo() {
|
||||||
this.subscriptions.push(this._searchResearchResultsService.countCollectedResultsWithFundingInfo(this.datasourceId).subscribe(
|
this.subscriptions.push(this._searchResearchResultsService.countCollectedResultsWithFundingInfo(this.datasourceId).subscribe(
|
||||||
fundedContent => {
|
fundedContent => {
|
||||||
|
|
|
@ -83,10 +83,10 @@ export class DataProviderService {
|
||||||
.pipe(map(res => this.parseDataproviderAggregationStatus(res)));
|
.pipe(map(res => this.parseDataproviderAggregationStatus(res)));
|
||||||
}
|
}
|
||||||
|
|
||||||
// getCollectedFulltexts(datasourceId: string) {
|
getCollectedFulltexts(datasourceId: string) {
|
||||||
// return this.http.get(properties.pdfStatisticsAPIURL+"/api/stats/getNumberOfPayloadsForDatasource?datasourceId="+datasourceId)
|
return this.http.get(properties.pdfStatisticsAPIURL+"/stats/getNumberOfPayloadsForDatasource?datasourceId="+datasourceId)
|
||||||
// .pipe(map(res => res))
|
.pipe(map(res => res))
|
||||||
// }
|
}
|
||||||
|
|
||||||
private handleError (error: HttpErrorResponse) {
|
private handleError (error: HttpErrorResponse) {
|
||||||
// in a real world app, we may send the error to some remote logging infrastructure
|
// in a real world app, we may send the error to some remote logging infrastructure
|
||||||
|
|
|
@ -15,6 +15,7 @@ export interface EnvProperties {
|
||||||
showAddThis?: boolean;
|
showAddThis?: boolean;
|
||||||
showContent?: boolean;
|
showContent?: boolean;
|
||||||
enableEoscDataTransfer?:boolean;
|
enableEoscDataTransfer?:boolean;
|
||||||
|
pdfStatisticsAPIURL?: string;
|
||||||
statisticsFrameAPIURL?: string; //delete?
|
statisticsFrameAPIURL?: string; //delete?
|
||||||
statisticsFrameNewAPIURL?: string;
|
statisticsFrameNewAPIURL?: string;
|
||||||
bipFrameAPIURL?: string;
|
bipFrameAPIURL?: string;
|
||||||
|
|
|
@ -90,6 +90,7 @@ export let common: EnvProperties = {
|
||||||
|
|
||||||
export let commonDev: EnvProperties = {
|
export let commonDev: EnvProperties = {
|
||||||
environment: "development",
|
environment: "development",
|
||||||
|
pdfStatisticsAPIURL: "https://beta.services.openaire.eu/pdf-stats",
|
||||||
statisticsAPIURL: "http://vatopedi.di.uoa.gr:8080/stats/",
|
statisticsAPIURL: "http://vatopedi.di.uoa.gr:8080/stats/",
|
||||||
statisticsFrameAPIURL: "https://beta.openaire.eu/stats/",
|
statisticsFrameAPIURL: "https://beta.openaire.eu/stats/",
|
||||||
statisticsFrameNewAPIURL: "https://stats.madgik.di.uoa.gr/stats-api/",
|
statisticsFrameNewAPIURL: "https://stats.madgik.di.uoa.gr/stats-api/",
|
||||||
|
@ -133,6 +134,7 @@ export let commonDev: EnvProperties = {
|
||||||
|
|
||||||
export let commonTest: EnvProperties = {
|
export let commonTest: EnvProperties = {
|
||||||
environment: "test",
|
environment: "test",
|
||||||
|
pdfStatisticsAPIURL: "https://services.openaire.eu/pdf-stats",
|
||||||
statisticsAPIURL: "https://beta.services.openaire.eu/stats-api/",
|
statisticsAPIURL: "https://beta.services.openaire.eu/stats-api/",
|
||||||
statisticsFrameAPIURL: "https://www.openaire.eu/stats/",
|
statisticsFrameAPIURL: "https://www.openaire.eu/stats/",
|
||||||
statisticsFrameNewAPIURL: "https://services.openaire.eu/stats-tool/",
|
statisticsFrameNewAPIURL: "https://services.openaire.eu/stats-tool/",
|
||||||
|
@ -164,6 +166,7 @@ export let commonTest: EnvProperties = {
|
||||||
|
|
||||||
export let commonBeta: EnvProperties = {
|
export let commonBeta: EnvProperties = {
|
||||||
environment: "beta",
|
environment: "beta",
|
||||||
|
pdfStatisticsAPIURL: "https://beta.services.openaire.eu/pdf-stats",
|
||||||
statisticsAPIURL: "https://beta.services.openaire.eu/stats-api/",
|
statisticsAPIURL: "https://beta.services.openaire.eu/stats-api/",
|
||||||
statisticsFrameAPIURL: "https://beta.openaire.eu/stats/",
|
statisticsFrameAPIURL: "https://beta.openaire.eu/stats/",
|
||||||
statisticsFrameNewAPIURL: "https://beta.services.openaire.eu/stats-tool/",
|
statisticsFrameNewAPIURL: "https://beta.services.openaire.eu/stats-tool/",
|
||||||
|
@ -203,6 +206,7 @@ export let commonBeta: EnvProperties = {
|
||||||
|
|
||||||
export let commonProd: EnvProperties = {
|
export let commonProd: EnvProperties = {
|
||||||
environment: "production",
|
environment: "production",
|
||||||
|
pdfStatisticsAPIURL: "https://services.openaire.eu/pdf-stats",
|
||||||
statisticsAPIURL: "https://beta.services.openaire.eu/stats-api/",
|
statisticsAPIURL: "https://beta.services.openaire.eu/stats-api/",
|
||||||
statisticsFrameAPIURL: "https://www.openaire.eu/stats/",
|
statisticsFrameAPIURL: "https://www.openaire.eu/stats/",
|
||||||
statisticsFrameNewAPIURL: "https://services.openaire.eu/stats-tool/",
|
statisticsFrameNewAPIURL: "https://services.openaire.eu/stats-tool/",
|
||||||
|
|
Loading…
Reference in New Issue