@@ -338,33 +289,24 @@
0">
+ *ngIf="resultLandingInfo.openCitations && resultLandingInfo.openCitations.length > 0">
Open Citations
- ({{publicationInfo.openCitations.length | number}})
+ ({{resultLandingInfo.openCitations.length | number}})
-
pageSize" class="uk-margin-bottom">
-
{{publicationInfo.openCitations.length | number}}
+ pageSize" class="uk-margin-bottom">
+
{{resultLandingInfo.openCitations.length | number}}
open citations, page {{openCitationsPage | number}}
- of {{totalPages(publicationInfo.openCitations.length) | number}}
+ of {{totalPages(resultLandingInfo.openCitations.length) | number}}
@@ -438,23 +367,24 @@
-
-
- Link this publication to...
+
+
+
+ Link this {{title.toLowerCase()}} product to...
0"
[texts]="pageContents['bottom']">
-
-
+
+
diff --git a/landingPages/result/resultLanding.component.ts b/landingPages/result/resultLanding.component.ts
new file mode 100644
index 00000000..7b9b3f73
--- /dev/null
+++ b/landingPages/result/resultLanding.component.ts
@@ -0,0 +1,394 @@
+import {Component, Input, ViewChild} from '@angular/core';
+import {ActivatedRoute, Router} from '@angular/router';
+import {Meta, Title} from '@angular/platform-browser';
+
+import {EnvProperties} from '../../utils/properties/env-properties';
+import {ResultLandingInfo} from '../../utils/entities/resultLandingInfo';
+import {RouterHelper} from '../../utils/routerHelper.class';
+
+import {PiwikService} from '../../utils/piwik/piwik.service';
+import {ResultLandingService} from './resultLanding.service';
+import {SEOService} from '../../sharedComponents/SEO/SEO.service';
+import {HelperFunctions} from '../../utils/HelperFunctions.class';
+import {HelperService} from '../../utils/helper/helper.service';
+
+
+@Component({
+ selector: 'result-landing',
+ templateUrl: 'resultLanding.component.html',
+
+})
+
+export class ResultLandingComponent {
+ @Input() type: string = "publication";
+ @Input() piwikSiteId = null;
+ @Input() communityId = null;
+
+ // Active tab variable for responsiveness
+ @Input() activeTab: string = "References";
+
+ @ViewChild('AlertModalDeletedByInference') alertModalDeletedByInference;
+
+ public resultLandingInfo: ResultLandingInfo;
+ public id: string;
+ public title: string;
+
+ // Links for SEO
+ public linkToLandingPage: string = null;
+ public linkToSearchPage: string = null;
+
+ // APP BOX variables
+ public showAllCollectedFrom: boolean = false;
+ public showAllDownloadFrom: boolean = false;
+
+ public thresholdDescription: number = 270;
+ public showNumDescription: number = 270;
+
+ // Metrics tab variables
+ public metricsClicked: boolean;
+ public viewsFrameUrl: string;
+ public downloadsFrameUrl: string;
+ public totalViews: number;
+ public totalDownloads: number;
+ public pageViews: number;
+
+ // Custom tab paging variables
+ public referencesPage: number = 1;
+ public organizationsPage: number = 1;
+ public softwarePage: number = 1;
+ public bioentitiesPage: number = 1;
+ public openCitationsPage: number = 1;
+ public pageSize: number = 10;
+
+ // Map counting variables
+ public bioentitiesNum: number = 0;
+ public relatedResearchResultsNum: number = 0;
+
+ // Message variables
+ public warningMessage = "";
+ public errorMessage = "";
+ public showLoading: boolean = true;
+
+ public routerHelper: RouterHelper = new RouterHelper();
+
+ private doi: string;
+ public doiURL: string;
+ private result;
+ sub: any;
+ piwiksub: any;
+ infoSub: any;
+ properties: EnvProperties;
+ public pageContents = null;
+ public divContents = null;
+
+ constructor(private _resultLaningService: ResultLandingService,
+ private _piwikService: PiwikService,
+ private route: ActivatedRoute,
+ private router: Router,
+ private _meta: Meta,
+ private _title: Title,
+ private _router: Router,
+ private helper: HelperService,
+ private seoService: SEOService) {
+ }
+
+ ngOnInit() {
+ this.route.data
+ .subscribe((data: { envSpecific: EnvProperties }) => {
+ this.properties = data.envSpecific;
+ //this.getDivContents();
+ this.getPageContents();
+ this.doiURL = this.properties.doiURL;
+ this.updateUrl(data.envSpecific.baseLink + this._router.url);
+
+ this.sub = this.route.queryParams.subscribe(data => {
+ this.resultLandingInfo = null;
+ if(this.type == "publication") {
+ this.updateTitle("Publication");
+ this.linkToLandingPage = this.properties.searchLinkToPublication;
+ this.linkToSearchPage = this.properties.searchLinkToPublications;
+ this.id = data['articleId'];
+ this.title = "Publication";
+ } else if(this.type == "dataset") {
+ this.updateTitle("Dataset");
+ this.linkToLandingPage = this.properties.searchLinkToDataset;
+ this.linkToSearchPage = this.properties.searchLinkToDatasets;
+ this.id = data['datasetId'];
+ this.title = "Research Data";
+ } else if(this.type == "software") {
+ this.updateTitle("Software");
+ this.linkToLandingPage = this.properties.searchLinkToSoftware;
+ this.linkToSearchPage = this.properties.searchLinkToSoftwareLanding;
+ this.id = data['softwareId'];
+ this.title = "Software";
+ } else if(this.type == "orp") {
+ this.updateTitle("Other Research Product");
+ this.linkToLandingPage = this.properties.searchLinkToOrp;
+ this.linkToSearchPage = this.properties.searchLinkToOrps;
+ this.id = data['orpId'];
+ this.title = "Other Research Product";
+ }
+ this.updateDescription("");
+
+ this.metricsClicked = false;
+
+ if (this.id) {
+ this.getResultLandingInfo(this.id);
+ } else {
+ this.showLoading = false;
+
+ this.warningMessage = "No valid ";
+ if(this.type == "publication" || this.type == "software") {
+ this.warningMessage += this.type + " ";
+ } else if(this.type == "dataset") {
+ this.warningMessage += "research data ";
+ } else if(this.type == "orp") {
+ this.warningMessage += "other research product ";
+ }
+ this.warningMessage += "id";
+ }
+
+ this.viewsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"' + this.id + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
+ this.downloadsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoDownloads", "resTitle":"' + this.id + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
+
+ this.scroll();
+ });
+ });
+ }
+
+ private getPageContents() {
+ this.helper.getPageHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
+ this.pageContents = contents;
+ });
+ }
+
+ private getDivContents() {
+ this.helper.getDivHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
+ this.divContents = contents;
+ });
+ }
+
+ ngOnDestroy() {
+ if (this.sub) {
+ this.sub.unsubscribe();
+ }
+ if (this.piwiksub) {
+ this.piwiksub.unsubscribe();
+ }
+ if (this.infoSub) {
+ this.infoSub.unsubscribe();
+ }
+ }
+
+ private getOpenCitations(id: string) {
+ this._resultLaningService.getOpenCitations(this.id, this.properties).subscribe(
+ data => {
+ this.resultLandingInfo.openCitations = data[1];
+ },
+ err => {
+ this.handleError("Error getting open citation for "+this.type+" with id: " + this.id, err);
+ }
+ );
+ }
+
+ private getResultLandingInfo(id: string) {
+ this.warningMessage = '';
+ this.errorMessage = '';
+ this.showLoading = true;
+
+ this.resultLandingInfo = null;
+
+ this.infoSub = this._resultLaningService.getResultLandingInfo(this.id, this.type, this.properties).subscribe(
+ data => {
+ this.resultLandingInfo = data;
+ this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.linkToLandingPage + this.resultLandingInfo.record["result"]["header"]["dri:objIdentifier"]);
+ if ((this.type == "publication") && (this.properties.environment == "beta" || this.properties.environment == "development") && (typeof document !== 'undefined')) {
+ this.getOpenCitations(this.id);
+ }
+
+ if (this.resultLandingInfo.title) {
+ this.updateTitle(this.resultLandingInfo.title);
+ this.updateDescription((this.resultLandingInfo.description ? (this.resultLandingInfo.description) : ("," + this.resultLandingInfo.title)));
+ }
+ if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
+ this.piwiksub = this._piwikService.trackView(this.properties, this.resultLandingInfo.title/*.name*/, this.piwikSiteId).subscribe();
+ }
+
+ let bioentitiesNum = 0;
+ if (this.resultLandingInfo.bioentities != undefined) {
+ this.resultLandingInfo.bioentities.forEach(function (value, key, map) {
+ bioentitiesNum += value.size;
+ });
+ }
+ this.bioentitiesNum = bioentitiesNum;
+
+ let relatedResearchResultsNum = 0;
+ if (this.resultLandingInfo.relatedResearchResults != undefined) {
+ this.resultLandingInfo.relatedResearchResults.forEach(function (value, key, map) {
+ relatedResearchResultsNum += value.length;
+ });
+ }
+ this.relatedResearchResultsNum = relatedResearchResultsNum;
+
+ this.result = {
+ id: this.id,
+ type: this.type,
+ source: "openaire",
+ title: this.resultLandingInfo.title,
+ url: '',
+ result: '',
+ accessRights: this.resultLandingInfo.accessMode,
+ embargoEndDate: ''
+ };
+
+ if (this.resultLandingInfo.identifiers != undefined && this.resultLandingInfo.identifiers.has('doi')) {
+ this.doi = this.resultLandingInfo.identifiers.get('doi')[0];
+ }
+
+ this.showLoading = false;
+
+ if (this.resultLandingInfo.references) {
+ this.activeTab = "References";
+ } else if (this.resultLandingInfo.relatedResearchResults) {
+ this.activeTab = "Related Research Results";
+ } else if (this.resultLandingInfo.similarResearchResults) {
+ this.activeTab = "Similar Research Results";
+ } else if (this.resultLandingInfo.organizations) {
+ this.activeTab = "Related Organizations";
+ } else if (this.resultLandingInfo.bioentities) {
+ this.activeTab = "Bioentities";
+ } else if (this.resultLandingInfo.software) {
+ this.activeTab = "Software";
+ } else {
+ this.activeTab = "Metrics";
+ //this.metricsClicked = true;
+ }
+ },
+ err => {
+ this.handleError("Error getting "+this.type+" for id: " + this.id, err);
+
+ if(this.type == "publication" || this.type == "software") {
+ this.errorMessage = 'No '+this.type+' found';
+ } else if(this.type == "dataset") {
+ this.errorMessage += "No research data found";
+ } else if(this.type == "orp") {
+ this.errorMessage += "No research product found";
+ }
+ this.showLoading = false;
+ this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.linkToSearchPage);
+ }
+ );
+ }
+
+ public metricsResults($event) {
+ this.totalViews = $event.totalViews;
+ this.totalDownloads = $event.totalDownloads;
+ this.pageViews = $event.pageViews;
+ }
+
+ public buildCurationTooltip(): string {
+ let tooltipContent: string = "";
+
+ tooltipContent += "
Record in preview ";
+ tooltipContent += "
Bibliographic record accepted by the system, but not yet processed by OpenAIRE tools for information quality improvement and de-duplication
";
+
+ tooltipContent += "
";
+ return tooltipContent;
+ }
+
+ private updateDescription(description: string) {
+ this._meta.updateTag({content: description}, "name='description'");
+ this._meta.updateTag({content: description}, "property='og:description'");
+ }
+
+ private updateTitle(title: string) {
+ var _prefix = "";
+ if(!this.communityId) {
+ _prefix = "OpenAIRE | ";
+ }
+ var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title);
+ this._title.setTitle(_title);
+ this._meta.updateTag({content: _title}, "property='og:title'");
+ }
+
+ private updateUrl(url: string) {
+ this._meta.updateTag({content: url}, "property='og:url'");
+ }
+
+ public totalPages(totalResults: number): number {
+ let totalPages: any = totalResults / this.pageSize;
+ if (!(Number.isInteger(totalPages))) {
+ totalPages = (parseInt(totalPages, this.pageSize) + 1);
+ }
+ return totalPages;
+ }
+
+ public updateReferencesPage($event) {
+ this.referencesPage = $event.value;
+ }
+
+ public updateOrganizationsPage($event) {
+ this.organizationsPage = $event.value;
+ }
+
+ public updateSoftwarePage($event) {
+ this.softwarePage = $event.value;
+ }
+
+ public updateBioentitiesPage($event) {
+ this.bioentitiesPage = $event.value;
+ }
+
+ public updateOpenCitationsPage($event) {
+ this.openCitationsPage = $event.value;
+ }
+
+ public keysToArray(bioentities: Map): string[] {
+ let keys: string[] = [];
+ bioentities.forEach(function (value, key, map) {
+ keys.push(key);
+ });
+ return keys;
+ }
+
+ public getKeys(map) {
+ return Array.from(map.keys());
+ }
+
+ public scroll() {
+ HelperFunctions.scroll();
+ }
+
+ private handleError(message: string, error) {
+ if(this.type == "publication") {
+ console.error("Publication Landing Page: " + message, error);
+ } else if(this.type == "dataset") {
+ console.error("Research Data Landing Page: " + message, error);
+ } else if(this.type == "software") {
+ console.error("Software Landing Page: " + message, error);
+ } else if(this.type == "orp") {
+ console.error("Other Research Product Landing Page: " + message, error);
+ } else {
+ console.error("Landing Page: " + message, error);
+ }
+ }
+
+ isRouteAvailable(routeToCheck: string) {
+ for (let i = 0; i < this.router.config.length; i++) {
+ let routePath: string = this.router.config[i].path;
+ if (routePath == routeToCheck) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ openDeletedByInference() {
+ this.alertModalDeletedByInference.cancelButton = false;
+ this.alertModalDeletedByInference.okButton = false;
+ this.alertModalDeletedByInference.alertTitle = "Original sources";
+ //this.alertModalDeletedByInference.message = "There was an error in csv downloading. Please try again later.";
+ //this.alertModalDeletedByInference.okButtonText = "OK";
+ this.alertModalDeletedByInference.open();
+ }
+}
diff --git a/landingPages/publication/publication.module.ts b/landingPages/result/resultLanding.module.ts
similarity index 51%
rename from landingPages/publication/publication.module.ts
rename to landingPages/result/resultLanding.module.ts
index 415ae5e9..9257aa63 100644
--- a/landingPages/publication/publication.module.ts
+++ b/landingPages/result/resultLanding.module.ts
@@ -1,13 +1,10 @@
-//import {MaterialModule} from '@angular/material';
import {NgModule} from '@angular/core';
import {CommonModule} from '@angular/common';
import {FormsModule} from '@angular/forms';
import {RouterModule} from '@angular/router';
-// import { PublicationRoutingModule } from './publication-routing.module';
import {SharedModule} from '../../shared/shared.module';
import {MetricsModule} from '../landing-utils/metrics.module';
-import {ResultLandingModule} from '../landing-utils/resultLanding.module';
import {LandingModule} from '../landing-utils/landing.module';
import {CiteThisModule} from '../landing-utils/citeThis/citeThis.module';
import {IFrameModule} from '../../utils/iframe.module';
@@ -15,32 +12,34 @@ import {AltMetricsModule} from '../../utils/altmetrics.module';
import {PagingModule} from '../../utils/paging.module';
import {ConfigurationServiceModule} from '../../utils/configuration/configurationService.module';
-import {FreeGuard} from'../../login/freeGuard.guard';
+import {FreeGuard} from '../../login/freeGuard.guard';
import {IsRouteEnabled} from '../../error/isRouteEnabled.guard';
-import {PublicationService} from './publication.service';
-import {PublicationComponent} from './publication.component';
-import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
-import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
+import {ResultLandingService} from './resultLanding.service';
+import {ResultLandingComponent} from './resultLanding.component';
+import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
+import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
-import {DeletedByInferenceModule} from '../landing-utils/deletedByInference/deletedByInference.module';
-import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module";
-import {HelperModule} from "../../utils/helper/helper.module";
+import {DeletedByInferenceModule} from '../landing-utils/deletedByInference/deletedByInference.module';
+import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module";
+import {HelperModule} from "../../utils/helper/helper.module";
+import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.module";
+import {AlertModalModule} from "../../utils/modal/alertModal.module";
@NgModule({
imports: [
CommonModule, FormsModule, LandingModule, SharedModule, RouterModule,
- CiteThisModule, PagingModule, ResultLandingModule, IFrameModule,
+ CiteThisModule, PagingModule, IFrameModule,
MetricsModule, AltMetricsModule, ConfigurationServiceModule, Schema2jsonldModule, SEOServiceModule,
- DeletedByInferenceModule, ShowAuthorsModule, HelperModule
+ DeletedByInferenceModule, ShowAuthorsModule, HelperModule, ResultLandingUtilsModule, AlertModalModule
],
declarations: [
- PublicationComponent
+ ResultLandingComponent
],
providers: [
- PublicationService, FreeGuard, IsRouteEnabled
+ ResultLandingService, FreeGuard, IsRouteEnabled
],
exports: [
- PublicationComponent
+ ResultLandingComponent
]
})
-export class PublicationModule { }
+export class ResultLandingModule { }
diff --git a/landingPages/result/resultLanding.service.ts b/landingPages/result/resultLanding.service.ts
new file mode 100644
index 00000000..dc35b1df
--- /dev/null
+++ b/landingPages/result/resultLanding.service.ts
@@ -0,0 +1,399 @@
+import {Injectable} from '@angular/core';
+import {HttpClient, HttpErrorResponse} from "@angular/common/http";
+import {throwError} from 'rxjs';
+import {ResultLandingInfo} from '../../utils/entities/resultLandingInfo';
+import {EnvProperties} from '../../utils/properties/env-properties';
+import {ParsingFunctions} from '../landing-utils/parsingFunctions.class';
+import {map} from "rxjs/operators";
+
+@Injectable()
+export class ResultLandingService {
+
+ constructor(private http: HttpClient ) {
+ this.parsingFunctions = new ParsingFunctions();
+ }
+
+ public parsingFunctions: ParsingFunctions;
+ resultLandingInfo: ResultLandingInfo;
+
+ getResultLandingInfo (id: string, type: string, properties: EnvProperties): any {
+ let url = properties.searchAPIURLLAst;
+ if (type === 'publication') {
+ url += 'publications/';
+ } else if (type === 'dataset') {
+ url += 'datasets/';
+ } else if (type === 'software') {
+ url += 'software/';
+ } else if (type === 'orp') {
+ url += 'other/';
+ }
+ url += id + '?format=json';
+
+ return this.http.get((properties.useCache) ? (properties.cacheUrl + encodeURIComponent(url)) : url)
+ .pipe(map(res => [res['result']['header']['dri:status'], res['result']['metadata']['oaf:entity'], res]))
+ .pipe(map(res => [
+ res[1]['oaf:result'], // 0
+ res[1]['oaf:result']['title'], // 1
+ res[1]['oaf:result']['rels']['rel'], // 2
+ res[1]['oaf:result']['children'], // 3
+ res[1]['oaf:result']['pid'], // 4
+ res[1]['oaf:result']['journal'], // 5
+ res[1]['oaf:result']['language'], // 6
+ res[1]['oaf:result']['subject'], // 7
+ res[1]['oaf:result']['context'], // 8
+ res[1]['oaf:result']['creator'], // 9
+ res[1]['oaf:result']['country'] , // 10
+ res[1]['oaf:result']['programmingLanguage'], // 11 - software
+ //res[1]['oaf:result']['resulttype'],
+ (res[1]['extraInfo'] !== undefined && res[1]['extraInfo']['citations'] !== undefined)
+ ? res[1]['extraInfo']['citations']['citation'] : null, // 12
+ res[0], // 13
+ res[2] // 14
+ ]))
+ .pipe(map(res => this.parseResultLandingInfo(res, properties)));
+ }
+
+ private handleError (error: HttpErrorResponse) {
+ // in a real world app, we may send the error to some remote logging infrastructure
+ // instead of just logging it to the console
+ console.log(error);
+ return throwError(error || 'Server error');
+ }
+
+ parseResultLandingInfo (data: any, properties: EnvProperties): any {
+ this.resultLandingInfo = new ResultLandingInfo();
+
+ // res
+ this.resultLandingInfo.record = data[14];
+
+ // res['result']['metadata']['oaf:entity']['oaf:result']
+ if (data[0] != null) {
+ let date: string = (data[0].dateofacceptance) + ''; // transform to string in case it is an integer
+ this.resultLandingInfo.date = (date && (date).indexOf('-') !== -1) ? date.split('-')[0] : date;
+ this.resultLandingInfo.dateofacceptance = data[0].dateofacceptance;
+ this.resultLandingInfo.publisher = data[0].publisher;
+ if(!Array.isArray(data[0].description)) {
+ this.resultLandingInfo.description = String(data[0].description);
+ } else {
+ this.resultLandingInfo.description = String(data[0].description[0]);
+ }
+ this.resultLandingInfo.embargoEndDate = data[0].embargoenddate;
+ }
+
+ if(data[0]['bestaccessright'] && data[0]['bestaccessright'].hasOwnProperty("classid")) {
+ this.resultLandingInfo.accessMode = data[0]['bestaccessright'].classid;
+ }
+
+ // res['result']['metadata']['oaf:entity']['oaf:result']['title']
+ if(data[1] != null) {
+ if(Array.isArray(data[1])) {
+ this.resultLandingInfo.title = String(data[1][0].content);
+ if(data[1][1].classid === 'subtitle') {
+ this.resultLandingInfo.subtitle = String(data[1][1].content);
+ }
+ } else {
+ this.resultLandingInfo.title = String(data[1].content);
+ }
+ }
+
+ // res['result']['metadata']['oaf:entity']['oaf:result']['rels']['rel']
+ if(data[2] != null) {
+ let relation;
+ let length = Array.isArray(data[2]) ? data[2].length : 1;
+
+ for(let i=0; i();
+
+
+ this.resultLandingInfo.types = new Array();
+ let types = new Set();
+
+ let counter = 0;
+ let instance;
+
+ let length = Array.isArray(data[3]['instance']) ? data[3]['instance'].length : 1;
+
+ for(let i=0; i>, { "name": string, "url": string}[]] = this.parseBioentitiesAndSoftware(data[3]);
+ this.resultLandingInfo.bioentities = externalResults[0];
+ this.resultLandingInfo.software = externalResults[1];
+ }
+ }
+
+ // res['result']['metadata']['oaf:entity']['oaf:result']['pid']
+ if(data[4] != null) {
+ this.resultLandingInfo.identifiers = this.parsingFunctions.parseIdentifiers(data[4]);
+ }
+
+ // res['result']['metadata']['oaf:entity']['oaf:result']['journal']
+ if(data[5] != null) {
+ this.resultLandingInfo.journal = {"journal": "", "issn": "", "lissn": "", "eissn": "", "issue": "", "volume": "", "start_page": "", "end_page": ""}
+
+ this.resultLandingInfo.journal['journal'] = data[5].content;
+ this.resultLandingInfo.journal['issn'] = data[5].issn;
+ this.resultLandingInfo.journal['lissn'] = data[5].lissn;
+ this.resultLandingInfo.journal['eissn'] = data[5].eissn;
+ this.resultLandingInfo.journal['issue'] = data[5].iss;
+ this.resultLandingInfo.journal['volume'] = data[5].vol;
+ this.resultLandingInfo.journal['start_page'] = data[5].sp;
+ this.resultLandingInfo.journal['end_page'] = data[5].ep;
+ }
+
+ // res['result']['metadata']['oaf:entity']['oaf:result']['language']
+ if(data[6] != null) {
+ this.resultLandingInfo.languages = this.parsingFunctions.parseLanguages(data[6]);
+ }
+
+ // res['result']['metadata']['oaf:entity']['oaf:result']['country']
+ if(data[10] != null) {
+ this.resultLandingInfo.countries = this.parsingFunctions.parseCountries(data[10]);
+ }
+
+ // res['result']['metadata']['oaf:entity']['oaf:result']['subject']
+ if(data[7] != null) {
+ let subjectResults: [string[], Map, Map] = this.parsingFunctions.parseAllSubjects(data[7]);
+ this.resultLandingInfo.subjects = subjectResults[0];
+ this.resultLandingInfo.otherSubjects = subjectResults[1];
+ this.resultLandingInfo.classifiedSubjects = subjectResults[2];
+ }
+
+ this.resultLandingInfo.hostedBy_collectedFrom = this.parsingFunctions.addPublisherToHostedBy_collectedFrom(
+ this.resultLandingInfo.hostedBy_collectedFrom, this.resultLandingInfo.publisher,
+ this.resultLandingInfo.journal, this.resultLandingInfo.identifiers);
+
+ // res['result']['metadata']['oaf:entity']['oaf:result']['programmingLanguage']
+ if(data[11] != null) {
+ this.resultLandingInfo.programmingLanguages = this.parsingFunctions.parseProgrammingLanguages(data[11]);
+ }
+
+ // res['result']['metadata']['oaf:entity']['extraInfo']['citations']['citation']
+ if(data[12] != null) {
+ this.resultLandingInfo.references = this.parsingFunctions.parseReferences(data[12]);
+ }
+
+ // res['result']['metadata']['oaf:entity']['oaf:result']['context']
+ if(data[8] != null) {
+ this.resultLandingInfo.contexts = this.parsingFunctions.parseContexts(data[8]);
+ }
+
+ // res['result']['header']['dri:status']
+ if(data[13] != null && data[13] == "under curation") {
+ this.resultLandingInfo.underCurationMessage = true;
+ } else {
+ this.resultLandingInfo.underCurationMessage = false;
+ }
+
+ // res['result']['metadata']['oaf:entity']['oaf:result']['creator']
+ if(data[9] != null) {
+ if(this.resultLandingInfo.authors == undefined) {
+ this.resultLandingInfo.authors = new Array<{"fullName": string, "orcid": string}>();
+ }
+
+ let authors = data[9];
+ let length = Array.isArray(authors) ? authors.length : 1;
+
+ for(let i=0; i();
+ }
+
+ let organization: { "name": string, "shortname": string,
+ "id": string, "websiteUrl": string,
+ "country": string, "trust": number
+ } = {
+ "name": "", "shortname": "",
+ "id": "", "websiteUrl": "",
+ "country": "", "trust": null
+ };
+
+ organization.id = relation['to'].content;
+ organization.name = relation.legalname;
+ organization.shortname = relation.legalshortname;
+ organization.websiteUrl = relation.websiteurl;
+ if(relation.country) {
+ organization.country = relation.country.classname;
+ }
+ if(relation.trust) {
+ organization.trust = Math.round(relation.trust*100);
+ }
+
+ organizations.push(organization);
+ return organizations;
+ }
+
+ parseBioentitiesAndSoftware(children: any) : [Map>, { "name": string, "url": string}[]] {
+ let bioentities: Map>;
+ let software: {"name": string, "url": string}[];
+
+ let length = Array.isArray(children['externalreference']) ? children['externalreference'].length : 1;
+
+ let externalreference;
+ for(let i=0; i>();
+ }
+
+ if(!bioentities.has(externalreference.sitename)) {
+ bioentities.set(externalreference.sitename, new Map());
+ }
+ bioentities.get(externalreference.sitename).set(externalreference.refidentifier, externalreference.url);
+
+ } else if(externalreference['qualifier'].classid == "software") {
+
+ if(software == undefined) {
+ software = new Array<{"name": string, "url": string}>();
+ }
+
+ software.push({"name": externalreference.sitename, "url": externalreference.url});
+ }
+ }
+ }
+
+ return [bioentities, software];
+ }
+
+ getOpenCitations(id: string, properties:EnvProperties) {
+ //https://services.openaire.eu/opencitations/getCitations?id=doajarticles::2634200c24772ee8f10232d3e184ec65
+ let url = properties.openCitationsAPIURL+id;// "https://services.openaire.eu/opencitations/getCitations?id=" + id;
+ let key = url;
+
+ //return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
+ return this.http.get(url)
+ .pipe(map(res => [res['total'], this.parseOpenCitations(res['results'])]));
+ }
+
+ parseOpenCitations(openCitations: any): {"url": string, "title": string, "year": string, "doi": string, "authors": string[]}[] {
+ //title, doi, authors
+ let citations = new Array<{"url": string, "title": string, "year": string, "doi": string, "authors": string[]}>();
+
+ let openCitation;
+
+ let length = Array.isArray(openCitations) ? openCitations.length : 1;
+ for(let i=0; i
-
-
-
-
-
-
0" class="uk-alert uk-alert-warning uk-margin-large-top"
- role="alert">{{warningMessage}}
-
0" class="uk-alert uk-alert-danger uk-margin-large-top"
- role="alert">{{errorMessage}}
-
-
0"
- [texts]="pageContents['top']">
-
-
-
-
-
-
-
0"
- class="uk-label custom-label label-software "
- title="Type">{{softwareInfo.types.join(", ")}} {{" "}}
-
0"
- class="uk-label custom-label label-progrLanguage "
- title="Programming Language">{{softwareInfo.programmingLanguages.join(", ")}} {{" "}}
-
0"
- class="uk-label custom-label label-language "
- title="Language">{{softwareInfo.languages.join(", ")}} {{" "}}
-
0"
- class="uk-label custom-label label-country "
- title="Country">{{softwareInfo.countries.join(", ")}} {{" "}}
-
-
{{softwareInfo.accessMode}} {{" "}}
-
-
- Record in preview
-
- {{" "}}
-
-
-
-
- ({{softwareInfo.date}})
-
-
-
-
-
- Embargo end date: {{softwareInfo.embargoEndDate}}
- 0">
-
-
-
-
-
-
-
-
-
-
{{softwareInfo.description.substring(0, showNumDescription)}} thresholdDescription">... thresholdDescription"
- class="uk-text-right">
-
- View more
-
-
-
-
thresholdDescription"
- class="uk-width-1-1 uk-text-right">
-
- View less
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Link this software to...
-
-
-
-
Share - Bookmark
-
-
-
-
-
-
- 0">
-
-
- 0">
-
-
-
- 0 ">
-
- Related to
-
-
- {{item['labelContext']}}
- -> {{item['labelCategory']}}
- : {{item['labelConcept']}}
-
-
- {{item['labelContext']}}
- -> {{item['labelCategory']}}
- : {{item['labelConcept']}}
-
-
-
-
-
-
-
-
-
-
-
-
- Cite this software
-
-
-
-
-
-
-
-
-
-
-
0"
- [texts]="pageContents['bottom']">
-
-
-
-
diff --git a/landingPages/software/software.component.ts b/landingPages/software/software.component.ts
deleted file mode 100644
index 0fd8590c..00000000
--- a/landingPages/software/software.component.ts
+++ /dev/null
@@ -1,249 +0,0 @@
-import {Component, Input} from '@angular/core';
-import {ActivatedRoute, Router} from '@angular/router';
-import {Meta, Title} from '@angular/platform-browser';
-
-import {SoftwareService} from './software.service';
-import {SoftwareInfo} from '../../utils/entities/softwareInfo';
-
-import {RouterHelper} from '../../utils/routerHelper.class';
-import {PiwikService} from '../../utils/piwik/piwik.service';
-import {EnvProperties} from '../../utils/properties/env-properties';
-import {SEOService} from '../../sharedComponents/SEO/SEO.service';
-import {HelperFunctions} from "../../utils/HelperFunctions.class";
-import {HelperService} from "../../utils/helper/helper.service";
-
-@Component({
- selector: 'software',
- templateUrl: 'software.component.html',
-})
-
-export class SoftwareComponent {
- @Input() piwikSiteId = null;
- @Input() communityId = null;
- public softwareInfo: SoftwareInfo;
- public softwareId: string;
-
- // APP BOX variables
- public showAllCollectedFrom: boolean = false;
- public showAllDownloadFrom: boolean = false;
- public showAllPublishedIn: boolean = false;
-
- public thresholdDescription: number = 270;
- public showNumDescription: number = 270;
-
- // Metrics tab variables
- public metricsClicked: boolean;
- public viewsFrameUrl: string;
- public downloadsFrameUrl: string;
- public totalViews: number;
- public totalDownloads: number;
- public pageViews: number;
-
- // Active tab variable for responsiveness
- public activeTab: string = "Related Research Results";
-
- // Map counting variable
- public relatedResearchResultsNum: number = 0;
-
- // Message variables
- public warningMessage = "";
- public errorMessage = "";
- public showLoading: boolean = true;
-
- public routerHelper: RouterHelper = new RouterHelper();
-
- private result;
- sub: any;
- piwiksub: any;
- infoSub: any;
- properties: EnvProperties;
- public pageContents = null;
- public divContents = null;
-
- constructor(private _softwareService: SoftwareService,
- private _piwikService: PiwikService,
- private route: ActivatedRoute,
- private router: Router,
- private _meta: Meta,
- private _title: Title,
- private _router: Router,
- private helper: HelperService,
- private seoService: SEOService) {
- }
-
- ngOnInit() {
- this.route.data
- .subscribe((data: { envSpecific: EnvProperties }) => {
- this.properties = data.envSpecific;
- //this.getDivContents();
- this.getPageContents();
- this.updateUrl(data.envSpecific.baseLink + this._router.url);
-
- });
- this.sub = this.route.queryParams.subscribe(params => {
- this.softwareInfo = null;
- this.updateTitle("Software");
- this.updateDescription("Software, search, open access");
-
- this.softwareId = params['softwareId'];
-
- if (this.softwareId) {
- this.getSoftwareInfo(this.softwareId);
- } else {
- this.showLoading = false;
- this.warningMessage = "No valid software id";
- }
-
- this.metricsClicked = false;
-
- this.viewsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"' + this.softwareId + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
- /*this.viewsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resViewsTimeline", "resTitle":"'+this.softwareId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
- */
-
- this.downloadsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoDownloads", "resTitle":"' + this.softwareId + '", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
- /*this.downloadsFrameUrl = this.properties.framesAPIURL+'merge.php?com=query&data=[{"query":"resRepoDownloadTimeline", "resTitle":"'+this.softwareId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
- */
- this.scroll();
- });
-
- }
-
- private getPageContents() {
- this.helper.getPageHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
- this.pageContents = contents;
- })
- }
-
- private getDivContents() {
- this.helper.getDivHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
- this.divContents = contents;
- })
- }
-
- ngOnDestroy() {
- if (this.sub) {
- this.sub.unsubscribe();
- }
- if (this.piwiksub) {
- this.piwiksub.unsubscribe();
- }
- if (this.infoSub) {
- this.infoSub.unsubscribe();
- }
- }
-
- private getSoftwareInfo(id: string) {
- this.warningMessage = '';
- this.errorMessage = ""
- this.showLoading = true;
-
- this.softwareInfo = null;
-
- this.infoSub = this._softwareService.getSoftwareInfo(id, this.properties).subscribe(
- data => {
- this.softwareInfo = data;
- this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToSoftwareLanding + this.softwareInfo.record["result"]["header"]["dri:objIdentifier"]);
- /*if(this.softwareInfo.title.name != undefined && this.softwareInfo.title.name!= ''){
- this.updateTitle(this.softwareInfo.title.name);
- this.updateDescription("Software, search, repositories, open access,"+this.softwareInfo.title.name);
- }*/
- if (this.softwareInfo.title) {
- this.updateTitle(this.softwareInfo.title);
- this.updateDescription("Software, " + this.softwareInfo.title);
- }
- if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
- this.piwiksub = this._piwikService.trackView(this.properties, this.softwareInfo.title/*.name*/, this.piwikSiteId).subscribe();
- }
-
- this.result = []
- this.result = {
- id: id,
- type: "software",
- source: "openaire",
- title: this.softwareInfo.title,
- url: '',
- result: '',
- accessRights: /*this.softwareInfo.title.accessMode*/this.softwareInfo.accessMode,
- embargoEndDate: ''
- };
-
- let relatedResearchResultsNum = 0;
- if (this.softwareInfo.relatedResearchResults != undefined) {
- this.softwareInfo.relatedResearchResults.forEach(function (value, key, map) {
- relatedResearchResultsNum += value.length;
- });
- }
- this.relatedResearchResultsNum = relatedResearchResultsNum;
-
- this.showLoading = false;
- },
- err => {
- //console.log(err)
- this.handleError("Error getting software for id: " + this.softwareId, err);
- this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToSoftware);
- this.errorMessage = 'No software found';
- this.showLoading = false;
- }
- );
- }
-
- // showChange($event) {
- // this.showAllReferences=$event.value;
- // }
-
- public metricsResults($event) {
- this.totalViews = $event.totalViews;
- this.totalDownloads = $event.totalDownloads;
- this.pageViews = $event.pageViews;
- }
-
- private updateDescription(description: string) {
- this._meta.updateTag({content: description}, "name='description'");
- this._meta.updateTag({content: description}, "property='og:description'");
- }
-
- private updateTitle(title: string) {
- var _prefix = "";
- if(!this.communityId) {
- _prefix = "OpenAIRE | ";
- }
- var _title = _prefix + ((title.length > 50) ? title.substring(0, 50) : title);
- this._title.setTitle(_title);
- this._meta.updateTag({content: _title}, "property='og:title'");
- }
-
- private updateUrl(url: string) {
- this._meta.updateTag({content: url}, "property='og:url'");
- }
-
- public buildCurationTooltip() {
- let tooltipContent: string = "";
-
- tooltipContent += "
Record in preview ";
- tooltipContent += "
Bibliographic record accepted by the system, but not yet processed by OpenAIRE tools for information quality improvement and de-duplication
";
-
- return tooltipContent;
- }
-
- public getKeys(map) {
- return Array.from(map.keys());
- }
-
- public scroll() {
- HelperFunctions.scroll();
- }
-
- private handleError(message: string, error) {
- console.error("Software Landing Page: " + message, error);
- }
-
- isRouteAvailable(routeToCheck: string) {
- for (let i = 0; i < this.router.config.length; i++) {
- let routePath: string = this.router.config[i].path;
- if (routePath == routeToCheck) {
- return true;
- }
- }
- return false;
- }
-}
diff --git a/landingPages/software/software.module.ts b/landingPages/software/software.module.ts
deleted file mode 100644
index 88862795..00000000
--- a/landingPages/software/software.module.ts
+++ /dev/null
@@ -1,42 +0,0 @@
-//import {MaterialModule} from '@angular/material';
-import {NgModule} from '@angular/core';
-import {CommonModule} from '@angular/common';
-import {FormsModule} from '@angular/forms';
-
-import {RouterModule} from '@angular/router';
-
-import {SoftwareService} from './software.service';
-import {SoftwareComponent} from './software.component';
-// import { SoftwareRoutingModule } from './software-routing.module';
-import {MetricsModule} from '../landing-utils/metrics.module';
-import {IFrameModule} from '../../utils/iframe.module';
-import {AltMetricsModule} from '../../utils/altmetrics.module';
-import {CiteThisModule} from '../landing-utils/citeThis/citeThis.module';
-import {PagingModule} from '../../utils/paging.module';
-
-import {ResultLandingModule} from '../landing-utils/resultLanding.module';
-import {LandingModule} from '../landing-utils/landing.module';
-import {FreeGuard} from '../../login/freeGuard.guard';
-import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2jsonld.module';
-import {SEOServiceModule} from '../../sharedComponents/SEO/SEOService.module';
-import {ShowAuthorsModule} from "../../utils/authors/showAuthors.module";
-import {DeletedByInferenceModule} from "../landing-utils/deletedByInference/deletedByInference.module";
-import {HelperModule} from "../../utils/helper/helper.module";
-
-@NgModule({
- imports: [
- CommonModule, FormsModule, LandingModule, RouterModule, CiteThisModule, PagingModule,
- ResultLandingModule, IFrameModule, MetricsModule, AltMetricsModule, Schema2jsonldModule, SEOServiceModule,
- ShowAuthorsModule, DeletedByInferenceModule, HelperModule
- ],
- declarations: [
- SoftwareComponent
- ],
- providers:[
- SoftwareService, FreeGuard
- ],
- exports: [
- SoftwareComponent
- ]
-})
-export class SoftwareModule { }
diff --git a/landingPages/software/software.service.ts b/landingPages/software/software.service.ts
deleted file mode 100644
index a2bb0e5b..00000000
--- a/landingPages/software/software.service.ts
+++ /dev/null
@@ -1,253 +0,0 @@
-import {Injectable} from '@angular/core';
-import {HttpClient, HttpErrorResponse} from "@angular/common/http";
-import {throwError} from 'rxjs';
-import {SoftwareInfo} from '../../utils/entities/softwareInfo';
-import {EnvProperties} from '../../utils/properties/env-properties';
-import {ParsingFunctions} from '../landing-utils/parsingFunctions.class';
-import {map} from "rxjs/operators";
-
-@Injectable()
-export class SoftwareService {
-
- constructor(private http: HttpClient ) {
- this.parsingFunctions = new ParsingFunctions();
- }
-
- public parsingFunctions: ParsingFunctions;
- softwareInfo: SoftwareInfo;
-
- getSoftwareInfo (id: string, properties:EnvProperties):any {
-
- let url = properties.searchAPIURLLAst+'software/'+id+"?format=json";
- let key = url;
-
-
- return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
- //.map(res =>
res.json())
- .pipe(map(res => [res['result']['header']['dri:status'], res['result']['metadata']['oaf:entity']['oaf:result'], res]))
- .pipe(map(res => [res[1],
- res[1]['title'],
- res[1]['rels']['rel'],
- res[1]['children'],
- res[1]['pid'],
- res[1]['subject'],
- res[1]['bestaccessright'],
- res[1]['collectedfrom'],
- res[1]['context'],
- //res[1]['resulttype'],
- res[0],
- res[1]['creator'],
- res[1]['language'],
- res[1]['country'],
- res[1]['programmingLanguage'],
- res[2],
- res[1]['journal'] //15
- ]))
- .pipe(map(res => this.parseSoftwareInfo(res, properties)));
- }
-
- private handleError (error: HttpErrorResponse) {
- // in a real world app, we may send the error to some remote logging infrastructure
- // instead of just logging it to the console
- console.log(error);
- return throwError(error || 'Server error');
- }
-
- parseSoftwareInfo (data: any, properties: EnvProperties):any {
- this.softwareInfo = new SoftwareInfo();
- this.softwareInfo.record = data[14];
- if(data[0] != null) {
- var date:string = (data[0].dateofacceptance)+""; // transform to string in case it is an integer
- this.softwareInfo.date = (date && (date).indexOf('-') !== -1)?date.split('-')[0]:date;
- this.softwareInfo.dateofacceptance = data[0].dateofacceptance;
- this.softwareInfo.publisher = data[0].publisher;
- if(!Array.isArray(data[0].description)) {
- this.softwareInfo.description = String(data[0].description);
- } else {
- this.softwareInfo.description = String(data[0].description[0]);
- }
- this.softwareInfo.embargoEndDate = data[0].embargoenddate;
- }
- /*
- this.softwareInfo.title = {"name": "", "url": "", "accessMode": ""};
- if(data[0]['bestaccessright'] && data[0]['bestaccessright'] && data[0]['bestaccessright'].hasOwnProperty("classid")) {
- this.softwareInfo.title.accessMode = data[0]['bestaccessright'].classid;
- }
- if(data[1] != null) {
- if(Array.isArray(data[1])) {
- this.softwareInfo.title['name'] = data[1][0].content;
- } else {
- this.softwareInfo.title['name'] = data[1].content;
- }
- }
- */
- if(data[0]['bestaccessright'] && data[0]['bestaccessright'] && data[0]['bestaccessright'].hasOwnProperty("classid")) {
- this.softwareInfo.accessMode = data[0]['bestaccessright'].classid;
- }
- if(data[1] != null) {
- if(Array.isArray(data[1])) {
- this.softwareInfo.title = String(data[1][0].content);
- } else {
- this.softwareInfo.title = String(data[1].content);
- }
- }
-
- if(data[2] != null) {
- let relation;
- let length = data[2].length!=undefined ? data[2].length : 1;
-
- for(let i=0; i();
-
- this.softwareInfo.types = new Array();
- let types = new Set();
-
- let counter = 0;
- let instance;
-
- let length = data[3]['instance'].length!=undefined ? data[3]['instance'].length : 1;
-
- for(let i=0; i, Map] = this.parsingFunctions.parseAllSubjects(data[5]);
- this.softwareInfo.subjects = subjectResults[0];
- this.softwareInfo.otherSubjects = subjectResults[1];
- this.softwareInfo.classifiedSubjects = subjectResults[2];
- }
-
- // null argument is for journal
- this.softwareInfo.hostedBy_collectedFrom = this.parsingFunctions.addPublisherToHostedBy_collectedFrom(
- this.softwareInfo.hostedBy_collectedFrom, this.softwareInfo.publisher,
- null, this.softwareInfo.identifiers/*, this.softwareInfo.title*/);
-
- if(data[8] != null) {
- this.softwareInfo.contexts = this.parsingFunctions.parseContexts(data[8]);
- }
-
- // if(data[9] != null && this.softwareInfo.type == undefined) {
- // if(data[9].hasOwnProperty('classname')) {
- // this.softwareInfo.type = data[9].classname;
- // }
- // }
-
- if(data[9] != null && data[9] == "under curation") {
- this.softwareInfo.underCurationMessage = true;
- } else {
- this.softwareInfo.underCurationMessage = false;
- }
-
- if(data[10] != null) {
- if(this.softwareInfo.authors == undefined) {
- this.softwareInfo.authors = new Array<{"fullName": string, "orcid": string}>();
- }
-
- let authors = data[10];
- let length = Array.isArray(authors) ? authors.length : 1;
-
- for(let i=0; i; //key is the classname
+ publisher: string;
+ journal: {"journal": string, "issn": string, "lissn": string, "eissn": string,
+ "issue": string, "volume": string, "start_page": string, "end_page": string};
+ languages: string[];
+ countries: string[];
+ subjects: string[];
+ otherSubjects: Map;
+ classifiedSubjects: Map; //
+ description: string;
+
+ projectsProvenanceVocabulary: { "sysimport:crosswalk:repository": string,
+ "sysimport:crosswalk:entityregistry": string,
+ "sysimport:crosswalk:datasetarchive": string,
+ "iis": string,
+ "sysimport:mining:repository": string,
+ "user:claim:pid": string,
+ "user:claim:search": string,
+ "user:claim:datacite": string
+ } = {
+ "sysimport:crosswalk:repository": "Repository",
+ "sysimport:crosswalk:entityregistry": "Repository",
+ "sysimport:crosswalk:datasetarchive": "Repository",
+ "iis": "OpenAIRE",
+ "sysimport:mining:repository": "OpenAIRE",
+ "user:claim:pid": "User",
+ "user:claim:search": "User",
+ "user:claim:datacite": "User"
+ };
+ fundedByProjects: { "id": string, "acronym": string, "title": string,
+ "funderShortname": string, "funderName": string,
+ "funding": string, "code": string, "provenanceAction": string, "inline": boolean}[];
+
+ researchResultsProvenanceVocabulary: {"iis": string, "sysimport": string, "user": string} =
+ {"iis": "Inferred", "sysimport": "Harvested", "user": "Claimed"};
+
+ // percentage is for trust
+ relatedResearchResults: Map;
+ // percentage is for similarity
+ similarResearchResults: { "name": string, "id": string, "date": string, "percentage": number, "class": string}[];
+
+ contexts: { "labelContext": string, "labelCategory": string, "labelConcept": string, "inline": boolean}[];
+
+ deletedByInferenceIds: string[];
+
+ // PUBLICATION, DATASET, ORP
+ references: { "name": string, "url": string}[];
+
+ // PUBLICATION
+ bioentities: Map>; //>
+ software: { "name": string, "url": string}[]; //>
+ organizations: {"name": string, "shortname":string, "id": string, "websiteUrl": string, "country": string, "trust": number}[];
+ openCitations: {"url": string, "title": string, "year": string, "doi": string, "authors": string[]}[];
+
+ // DATASET
+ subtitle: string;
+
+ // SOFTWARE
+ programmingLanguages: string[];
+}
diff --git a/utils/modal/alert.ts b/utils/modal/alert.ts
index 6f82170b..2a68a50b 100644
--- a/utils/modal/alert.ts
+++ b/utils/modal/alert.ts
@@ -5,7 +5,7 @@ import {Component, ViewEncapsulation, ElementRef, EventEmitter, Output, Input} f
template: `
-
+
{{alertTitle}}
@@ -52,6 +52,7 @@ import {Component, ViewEncapsulation, ElementRef, EventEmitter, Output, Input} f
* API to an open alert window.
*/
export class AlertModal {
+ @Input() classBody: string ="";
/**
* Caption for the title.
*/