Compatibility and countries info added in dataproviders search page | countries info added in dataproviders landing page

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@44641 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2016-11-23 12:31:11 +00:00
parent 4e67bfefd5
commit d3e70bbec1
6 changed files with 49 additions and 8 deletions

View File

@ -30,6 +30,8 @@
{{dataProviderInfo.oaiPmhURL}}
</a>
</dd>
<dt *ngIf="dataProviderInfo.countries != undefined && dataProviderInfo.countries.length > 0">Countries: </dt>
<dd *ngIf="dataProviderInfo.countries != undefined">{{dataProviderInfo.countries}}</dd>
</dl>
<tabs [id] = "datasourceId"

View File

@ -106,6 +106,14 @@ import { ErrorCodes} from '../../utils/properties/openaireProperties';
</span>
</div>
<div *ngIf="result['compatibility'] != undefined && result['compatibility'] != ''">
Compatibility: {{result.compatibility}}
</div>
<div *ngIf="result['countries'] != undefined">
Countries: {{result.countries}}
</div>
<hr>
</li>
</ul>

View File

@ -88,10 +88,16 @@ export class DataProviderService {
}
if(data[3] != null) {
let oaiPmhURL: string;
if(Array.isArray(data[3])) {
this.dataProviderInfo.oaiPmhURL = data[3][0];
} else {
this.dataProviderInfo.oaiPmhURL = data[3];
oaiPmhURL = data[3][0];
}
else {
oaiPmhURL = data[3];
}
if(oaiPmhURL != '' && oaiPmhURL != 'unknown') {
this.dataProviderInfo.oaiPmhURL = oaiPmhURL;
}
}

View File

@ -166,17 +166,24 @@ export class SearchDataprovidersService {
result['type'] = resData['datasourcetype'].classname;
}
if(resData['accessinfopackage'] != '') {
if(resData.hasOwnProperty('accessinfopackage')) {
let OAIPMHURL: string;
if(Array.isArray(resData['accessinfopackage'])) {
result['OAIPMHURL'] = resData['accessinfopackage'][0];
OAIPMHURL = resData['accessinfopackage'][0];
} else {
result['OAIPMHURL'] = resData['accessinfopackage'];
OAIPMHURL = resData['accessinfopackage'];
}
if(OAIPMHURL != '' && OAIPMHURL != 'unknown') {
result['OAIPMHURL'] = OAIPMHURL;
}
}
result['websiteURL'] = resData.websiteurl;
if(resData['rels'].hasOwnProperty("rel")) {
let countriesSet: Set<string> = new Set<string>();
let counter = 0;
let relLength = Array.isArray(resData['rels']['rel']) ? resData['rels']['rel'].length : 1;
@ -193,12 +200,28 @@ export class SearchDataprovidersService {
result['organizations'][counter]['name'] = relation.legalname;
result['organizations'][counter]['url'] = OpenaireProperties.getsearchLinkToOrganization()+relation['to'].content;
if(relation.hasOwnProperty('country') &&
relation.country.hasOwnProperty('classname')) {
if(result['countries'] == undefined) {
result['countries'] = [];
}
if(!countriesSet.has(relation.country.classname)) {
countriesSet.add(relation.country.classname);
result['countries'].push(relation.country.classname);
}
}
counter++;
}
}
}
}
if(resData.hasOwnProperty('openairecompatibility')) {
result['compatibility'] = resData['openairecompatibility'].classname;
}
results.push(result);
}

View File

@ -81,7 +81,7 @@ export class SearchPublicationsService {
let results: SearchResult[] = [];
let length = Array.isArray(data) ? data.length : 1;
console.info(Array.isArray(data));
for(let i=0; i<length; i++) {
let resData = Array.isArray(data) ? data[i]['result']['metadata']['oaf:entity']['oaf:result'] : data['result']['metadata']['oaf:entity']['oaf:result'];
@ -101,7 +101,7 @@ export class SearchPublicationsService {
result['title'].url = OpenaireProperties.getsearchLinkToPublication();
result['title'].url += Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
result['id'] = length > 1 ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
result['id'] = Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
if(resData['bestlicense'].hasOwnProperty("classid")) {
result['title'].accessMode = resData['bestlicense'].classid;
}

View File

@ -23,4 +23,6 @@ export class SearchResult {
type: string;
websiteURL: string;
OAIPMHURL: string;
compatibility: string;
countries: string[];
}