Check what is inserted in Bioentites Tab in Publication landing page | Create Software Tab in Publication landing page

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@44342 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2016-10-26 13:24:04 +00:00
parent 5b62ed7715
commit e633b7e234
3 changed files with 49 additions and 5 deletions

View File

@ -78,6 +78,12 @@
<span class="badge">{{bioentitiesNum}}</span>
</a>
</li>
<li role="presentation" *ngIf="publicationInfo.software != undefined">
<a data-toggle="tab" href="#softwareTab">
Software
<span class="badge">{{publicationInfo.software.length}}</span>
</a>
</li>
</ul>
<div class="tab-content">
@ -178,6 +184,28 @@
</tbody>
</table>
</div>
<div *ngIf="publicationInfo.software != undefined" id="softwareTab" class="tab-pane fade panel-body">
<p>
The results below are discovered through our pilot algorithms.
<a href="mailto:">Let us know how we are doing!</a>
</p>
<table id="softwareTable" class="table table-striped">
<thead>
<tr>
<th class="text-center">Site Name</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of publicationInfo.software">
<td class="text-center">
<a href="{{item.url}}" target="_blank">
{{item.name}}
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="col-xs-12 col-sm-3" *ngIf="publicationInfo != null">

View File

@ -323,18 +323,33 @@ export class PublicationService {
}
if(data[3].hasOwnProperty("externalreference")) {
this.publicationInfo.bioentities = new Map<string, Map<string, string>>();
let length = Array.isArray(data[3]['externalreference']) ? data[3]['externalreference'].length : 1;
let mydata;
for(let i=0; i<length; i++) {
mydata = Array.isArray(data[3]['externalreference']) ? data[3]['externalreference'][i] : data[3]['externalreference'];
if(!this.publicationInfo.bioentities.has(mydata.sitename)) {
this.publicationInfo.bioentities.set(mydata.sitename, new Map<string, string>());
if(mydata.hasOwnProperty("qualifier")) {
if(mydata['qualifier'].classid == "accessionNumber") {
if(this.publicationInfo.bioentities == undefined) {
this.publicationInfo.bioentities = new Map<string, Map<string, string>>();
}
if(!this.publicationInfo.bioentities.has(mydata.sitename)) {
this.publicationInfo.bioentities.set(mydata.sitename, new Map<string, string>());
}
this.publicationInfo.bioentities.get(mydata.sitename).set(mydata.refidentifier, mydata.url);
} else if(mydata['qualifier'].classid == "software") {
if(this.publicationInfo.software == undefined) {
this.publicationInfo.software = new Array<{"name": string, "url": string}>();
}
this.publicationInfo.software.push({"name": mydata.sitename, "url": mydata.url});
}
}
this.publicationInfo.bioentities.get(mydata.sitename).set(mydata.refidentifier, mydata.url);
}
}
}

View File

@ -7,6 +7,7 @@ export class PublicationInfo {
downloadFrom: Map<string, {"url": string[], "accessMode": string[]}>; //key is name
publishedIn: Map<string, {"url": string[], "accessMode": string[]}>; //key is name
bioentities: Map<string, Map<string, string>>; //<site name, <>>
software: { "name": string, "url": string}[]; //<site name, <>>
identifiers: Map<string, string[]>; //key is the classname
publisher: string;
journal: {"journal": string, "issn": string, "lissn": string};