[Trunk | Library]:

1. parsingFunctions.class.ts: [ticket #3796] When hostedby name is "Unknown repository" or "other resources" show part or url as name.
2. organization.service.ts & searchOrganizations.service.ts: [ticket #5753] Compatibility limitation in landing page removed | Compatibility "openaire-cris_1.1" added in search organizations.


git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@59124 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2020-07-15 11:25:17 +00:00
parent 2c99a4a657
commit 72eeff6561
3 changed files with 25 additions and 23 deletions

View File

@ -258,26 +258,26 @@ export class ParsingFunctions {
if (instance['hostedby'].name && instance['hostedby'].name != "other resources" && instance['hostedby'].name != "Unknown Repository") {
available.downloadName = instance['hostedby'].name;
} else {
if (data != null && data.hasOwnProperty("source")) {
let downloadName: string;
if (Array.isArray(data.source)) {
if (counter == data.source.length) {
counter--;
}
downloadName = data['source'][counter];
} else {
downloadName = data['source'];
}
if (downloadName) {
counter++;
available.downloadName = downloadName;
}
}
}
if(!available.downloadName) {
// if (data != null && data.hasOwnProperty("source")) {
// let downloadName: string;
// if (Array.isArray(data.source)) {
//
// if (counter == data.source.length) {
// counter--;
// }
// downloadName = data['source'][counter];
// } else {
// downloadName = data['source'];
// }
// if (downloadName) {
// counter++;
// available.downloadName = downloadName;
// }
// }
//
// }
//
// if(!available.downloadName) {
available.downloadName = url.substring(0, 30) + '...'; // substring(from, to);
}

View File

@ -17,12 +17,13 @@ export class OrganizationService {
organizationInfo: OrganizationInfo;
getOrganizationInfo (id: string, properties:EnvProperties):any {
let url = properties.searchAPIURLLAst+'resources?format=json&query=( (oaftype exact organization) and (reldatasourcecompatibilityid=driver or reldatasourcecompatibilityid=driver-openaire2.0 or reldatasourcecompatibilityid=openaire2.0 or reldatasourcecompatibilityid=openaire3.0 or reldatasourcecompatibilityid=openaire4.0 or reldatasourcecompatibilityid=openaire2.0_data or reldatasourcecompatibilityid=hostedBy or relprojectid=* or reldatasourcecompatibilityid = native)) and ( objIdentifier ='+id+')';
let url = properties.searchAPIURLLAst+'organizations/'+id+'?format=json';
//'&query=( (oaftype exact organization) and (reldatasourcecompatibilityid=driver or reldatasourcecompatibilityid=driver-openaire2.0 or reldatasourcecompatibilityid=openaire2.0 or reldatasourcecompatibilityid=openaire3.0 or reldatasourcecompatibilityid=openaire4.0 or reldatasourcecompatibilityid=openaire2.0_data or reldatasourcecompatibilityid=hostedBy or relprojectid=* or reldatasourcecompatibilityid = native)) and ( objIdentifier ='+id+')';
return this.http.get((properties.useCache)? (properties.cacheUrl +encodeURIComponent(url)): url)
//.map(res => <any> res.json())
.pipe(map(res => res['results'][0]))
//.map(res => res[0]['result']['metadata']['oaf:entity']['oaf:organization'])
//.pipe(map(res => res['results']))
//.pipe(map(res => res['result']['metadata']['oaf:entity']['oaf:organization']))
//.map(res => [res, res['rels']['rel']])
.pipe(map(res => this.parseOrganizationInfo(res)));

View File

@ -61,6 +61,7 @@ export class SearchOrganizationsService {
let url = properties.searchAPIURLLAst+"resources2/?format=json";
var basicQuery = "(reldatasourcecompatibilityid exact driver or reldatasourcecompatibilityid exact driver-openaire2.0 or " +
"reldatasourcecompatibilityid exact openaire2.0 or reldatasourcecompatibilityid exact openaire3.0 or reldatasourcecompatibilityid exact openaire4.0 or " +
"reldatasourcecompatibilityid exact openaire-cris_1.1 or " +
"reldatasourcecompatibilityid exact openaire2.0_data or reldatasourcecompatibilityid exact hostedBy or relproject=*)";
url += "&query=";