[angular-16-pid-resolver | DONE | CHANGED ] add pidMRPArser in properties, remove call from crossref service

This commit is contained in:
argirok 2024-11-05 13:25:19 +02:00
parent ef987f3c65
commit ee5df3bf8f
4 changed files with 11 additions and 18 deletions

View File

@ -33,7 +33,7 @@
</li>
<li (click)="clickTab('orcid')" [class]="(activeTab == 'orcid')?'uk-active':''"><a>Orcid <span
*ngIf="orcidResultsNum !=null">({{(orcidResultsNum > 0) ? (orcidResultsNum | number) : 0}})</span></a></li>
<li (click)="clickTab('pidResolver')" [class]="(activeTab == 'pidResolver')?'uk-active':''"><a>PID Resolver <span
<li *ngIf="properties.pidResolverParserAPI" (click)="clickTab('pidResolver')" [class]="(activeTab == 'pidResolver')?'uk-active':''"><a>PID Resolver <span
*ngIf="pidResolverResultsNum !=null">({{(pidResolverResultsNum > 0) ? (pidResolverResultsNum | number) : 0}})</span></a></li>
</ul>

View File

@ -12,6 +12,9 @@ import {forkJoin, Observable, Subscriber} from 'rxjs';
import {NewSearchPageComponent} from "../../searchPages/searchUtils/newSearchPage.component";
import {RangeFilter} from "../../utils/rangeFilter/rangeFilterHelperClasses.class";
import {OpenaireEntities, SearchFields} from "../../utils/properties/searchFields";
import {HttpClient} from "@angular/common/http";
import {properties} from "../../../../environments/environment";
import {map} from "rxjs/operators";
@Component({
selector: 'claim-result-search-form',
templateUrl: 'claimResultSearchForm.component.html',
@ -118,7 +121,8 @@ export class ClaimResultSearchFormComponent {
constructor(private _searchDataciteService: SearchDataciteService,
private _searchCrossrefService: SearchCrossrefService,
private _searchOrcidService: SearchOrcidService,
private _searchResearchResultsService: SearchResearchResultsService) {
private _searchResearchResultsService: SearchResearchResultsService,
private http: HttpClient ) {
const myDate = new Date();
this.todayDate = myDate.getFullYear() + "-" + (myDate.getMonth() + 1) + "-" + myDate.getDate();
this.nextDate = (myDate.getFullYear() + 100) + "-" + (myDate.getMonth() + 1) + "-" + myDate.getDate();
@ -294,17 +298,12 @@ export class ClaimResultSearchFormComponent {
private getPidResolverResults(term: string, size: number, page: number) {
this.pidResolverResultsStatus = this.errorCodes.LOADING;
this.subscriptions.push(this._searchCrossrefService.getPidResolverResults(term).subscribe(
this.subscriptions.push(this.http.get<any>(properties.pidResolverParserAPI + encodeURIComponent(term)).subscribe(
data => {
if (data != null) {
this.pidResolverResults = data;
this.pidResolverResultsNum = data.length;
this.pidResolverResults = [data];
this.pidResolverResultsNum = 1;
this.pidResolverResultsStatus = this.errorCodes.DONE;
/*if (this.crossrefResultsNum == 0) {
this.crossrefStatus = this.errorCodes.NONE;
}*/
} else {
this.pidResolverResultsStatus = this.errorCodes.ERROR;
}

View File

@ -12,14 +12,6 @@ export class SearchCrossrefService {
constructor( private http: HttpClient ) {}
getPidResolverResults(pid): any {
let url = "http://scoobydoo.di.uoa.gr:4001/get/" + encodeURIComponent(pid);
return this.http.get( url)
.pipe(map(res => [res]))
//.catch(this.handleError);
}
searchCrossrefResults(term: string, size: number, page: number, properties: EnvProperties, parse: boolean = false): any {
let url = properties.searchCrossrefAPIURL + '?query=' + term + '&rows=' + size + '&offset=' + (size * (page - 1));

View File

@ -162,6 +162,8 @@ export interface EnvProperties {
//connect dashboards
forceCacheReload?:boolean;
pidResolverParserAPI?:string;
}
export function checkPropertyValues(properties:EnvProperties){