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:
parent
4e67bfefd5
commit
d3e70bbec1
|
@ -30,6 +30,8 @@
|
||||||
{{dataProviderInfo.oaiPmhURL}}
|
{{dataProviderInfo.oaiPmhURL}}
|
||||||
</a>
|
</a>
|
||||||
</dd>
|
</dd>
|
||||||
|
<dt *ngIf="dataProviderInfo.countries != undefined && dataProviderInfo.countries.length > 0">Countries: </dt>
|
||||||
|
<dd *ngIf="dataProviderInfo.countries != undefined">{{dataProviderInfo.countries}}</dd>
|
||||||
</dl>
|
</dl>
|
||||||
|
|
||||||
<tabs [id] = "datasourceId"
|
<tabs [id] = "datasourceId"
|
||||||
|
|
|
@ -106,6 +106,14 @@ import { ErrorCodes} from '../../utils/properties/openaireProperties';
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="result['compatibility'] != undefined && result['compatibility'] != ''">
|
||||||
|
Compatibility: {{result.compatibility}}
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div *ngIf="result['countries'] != undefined">
|
||||||
|
Countries: {{result.countries}}
|
||||||
|
</div>
|
||||||
|
|
||||||
<hr>
|
<hr>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|
|
@ -88,10 +88,16 @@ export class DataProviderService {
|
||||||
}
|
}
|
||||||
|
|
||||||
if(data[3] != null) {
|
if(data[3] != null) {
|
||||||
|
let oaiPmhURL: string;
|
||||||
if(Array.isArray(data[3])) {
|
if(Array.isArray(data[3])) {
|
||||||
this.dataProviderInfo.oaiPmhURL = data[3][0];
|
oaiPmhURL = data[3][0];
|
||||||
} else {
|
}
|
||||||
this.dataProviderInfo.oaiPmhURL = data[3];
|
else {
|
||||||
|
oaiPmhURL = data[3];
|
||||||
|
}
|
||||||
|
|
||||||
|
if(oaiPmhURL != '' && oaiPmhURL != 'unknown') {
|
||||||
|
this.dataProviderInfo.oaiPmhURL = oaiPmhURL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -166,17 +166,24 @@ export class SearchDataprovidersService {
|
||||||
result['type'] = resData['datasourcetype'].classname;
|
result['type'] = resData['datasourcetype'].classname;
|
||||||
}
|
}
|
||||||
|
|
||||||
if(resData['accessinfopackage'] != '') {
|
if(resData.hasOwnProperty('accessinfopackage')) {
|
||||||
|
let OAIPMHURL: string;
|
||||||
if(Array.isArray(resData['accessinfopackage'])) {
|
if(Array.isArray(resData['accessinfopackage'])) {
|
||||||
result['OAIPMHURL'] = resData['accessinfopackage'][0];
|
OAIPMHURL = resData['accessinfopackage'][0];
|
||||||
} else {
|
} else {
|
||||||
result['OAIPMHURL'] = resData['accessinfopackage'];
|
OAIPMHURL = resData['accessinfopackage'];
|
||||||
|
}
|
||||||
|
|
||||||
|
if(OAIPMHURL != '' && OAIPMHURL != 'unknown') {
|
||||||
|
result['OAIPMHURL'] = OAIPMHURL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
result['websiteURL'] = resData.websiteurl;
|
result['websiteURL'] = resData.websiteurl;
|
||||||
|
|
||||||
if(resData['rels'].hasOwnProperty("rel")) {
|
if(resData['rels'].hasOwnProperty("rel")) {
|
||||||
|
let countriesSet: Set<string> = new Set<string>();
|
||||||
|
|
||||||
let counter = 0;
|
let counter = 0;
|
||||||
let relLength = Array.isArray(resData['rels']['rel']) ? resData['rels']['rel'].length : 1;
|
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]['name'] = relation.legalname;
|
||||||
result['organizations'][counter]['url'] = OpenaireProperties.getsearchLinkToOrganization()+relation['to'].content;
|
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++;
|
counter++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(resData.hasOwnProperty('openairecompatibility')) {
|
||||||
|
result['compatibility'] = resData['openairecompatibility'].classname;
|
||||||
|
}
|
||||||
|
|
||||||
results.push(result);
|
results.push(result);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -81,7 +81,7 @@ export class SearchPublicationsService {
|
||||||
let results: SearchResult[] = [];
|
let results: SearchResult[] = [];
|
||||||
|
|
||||||
let length = Array.isArray(data) ? data.length : 1;
|
let length = Array.isArray(data) ? data.length : 1;
|
||||||
|
console.info(Array.isArray(data));
|
||||||
for(let i=0; i<length; i++) {
|
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'];
|
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 = OpenaireProperties.getsearchLinkToPublication();
|
||||||
result['title'].url += Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
|
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")) {
|
if(resData['bestlicense'].hasOwnProperty("classid")) {
|
||||||
result['title'].accessMode = resData['bestlicense'].classid;
|
result['title'].accessMode = resData['bestlicense'].classid;
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,4 +23,6 @@ export class SearchResult {
|
||||||
type: string;
|
type: string;
|
||||||
websiteURL: string;
|
websiteURL: string;
|
||||||
OAIPMHURL: string;
|
OAIPMHURL: string;
|
||||||
|
compatibility: string;
|
||||||
|
countries: string[];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue