From 3b849c78d6b979257d20b14ea773f5226c2da87c Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Thu, 5 Sep 2019 08:49:33 +0000 Subject: [PATCH] [Trunk | Library]: Merging branch "mergeResultLandingPages" into Trunk 56883:56968 git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@56969 d315682c-612b-4755-9ff5-7f18f6832af3 --- app-routing.module.ts | 13 +- app.module.ts | 8 +- .../dataset/dataset-routing.module.ts | 18 - landingPages/dataset/dataset.component.html | 342 -------------- landingPages/dataset/dataset.component.ts | 268 ----------- landingPages/dataset/dataset.module.ts | 48 -- landingPages/dataset/dataset.service.ts | 271 ----------- .../deletedByInference.component.ts | 2 +- .../deletedByInference.module.ts | 4 +- ...module.ts => resultLandingUtils.module.ts} | 2 +- .../landing-utils/showTitle.component.ts | 59 +-- landingPages/orp/orp.component.html | 278 ------------ landingPages/orp/orp.component.ts | 254 ----------- landingPages/orp/orp.module.ts | 48 -- landingPages/orp/orp.service.ts | 233 ---------- landingPages/project/project.component.html | 2 +- .../publication/publication-routing.module.ts | 18 - .../publication/publication.component.ts | 408 ----------------- .../publication/publication.service.ts | 423 ------------------ .../resultLanding.component.html} | 324 ++++++-------- .../result/resultLanding.component.ts | 394 ++++++++++++++++ .../resultLanding.module.ts} | 33 +- landingPages/result/resultLanding.service.ts | 399 +++++++++++++++++ .../software/software-routing.module.ts | 15 - landingPages/software/software.component.html | 347 -------------- landingPages/software/software.component.ts | 249 ----------- landingPages/software/software.module.ts | 42 -- landingPages/software/software.service.ts | 253 ----------- utils/entities/resultLandingInfo.ts | 78 ++++ utils/modal/alert.ts | 3 +- 30 files changed, 1064 insertions(+), 3772 deletions(-) delete mode 100644 landingPages/dataset/dataset-routing.module.ts delete mode 100644 landingPages/dataset/dataset.component.html delete mode 100644 landingPages/dataset/dataset.component.ts delete mode 100644 landingPages/dataset/dataset.module.ts delete mode 100644 landingPages/dataset/dataset.service.ts rename landingPages/landing-utils/{resultLanding.module.ts => resultLandingUtils.module.ts} (97%) delete mode 100644 landingPages/orp/orp.component.html delete mode 100644 landingPages/orp/orp.component.ts delete mode 100644 landingPages/orp/orp.module.ts delete mode 100644 landingPages/orp/orp.service.ts delete mode 100644 landingPages/publication/publication-routing.module.ts delete mode 100644 landingPages/publication/publication.component.ts delete mode 100644 landingPages/publication/publication.service.ts rename landingPages/{publication/publication.component.html => result/resultLanding.component.html} (56%) create mode 100644 landingPages/result/resultLanding.component.ts rename landingPages/{publication/publication.module.ts => result/resultLanding.module.ts} (51%) create mode 100644 landingPages/result/resultLanding.service.ts delete mode 100644 landingPages/software/software-routing.module.ts delete mode 100644 landingPages/software/software.component.html delete mode 100644 landingPages/software/software.component.ts delete mode 100644 landingPages/software/software.module.ts delete mode 100644 landingPages/software/software.service.ts create mode 100644 utils/entities/resultLandingInfo.ts diff --git a/app-routing.module.ts b/app-routing.module.ts index 41facfa7..c909bb53 100644 --- a/app-routing.module.ts +++ b/app-routing.module.ts @@ -9,10 +9,7 @@ import { EnvironmentSpecificService } from './utils/properties/environment-speci import { ErrorPageComponent } from './error/errorPage.component'; import {SearchComponent} from './searchPages/find/search.component'; -import {PublicationComponent} from './landingPages/publication/publication.component'; -import {DatasetComponent} from './landingPages/dataset/dataset.component'; -import {SoftwareComponent} from './landingPages/software/software.component'; -import {OrpComponent} from './landingPages/orp/orp.component'; +import {ResultLandingComponent} from "./landingPages/result/resultLanding.component"; import {DataProviderComponent} from './landingPages/dataProvider/dataProvider.component'; import {ProjectComponent} from './landingPages/project/project.component'; import {OrganizationComponent} from './landingPages/organization/organization.component'; @@ -60,10 +57,10 @@ const routes: Routes = [ { path: '', component: SearchComponent, resolve: { envSpecific: EnvironmentSpecificResolver }, canActivate: [ ]}, { path: 'home', component: SearchComponent, resolve: { envSpecific: EnvironmentSpecificResolver } }, - { path: 'search/publication', component: PublicationComponent , resolve: { envSpecific: EnvironmentSpecificResolver } }, - { path: 'search/dataset', component: DatasetComponent, resolve: { envSpecific: EnvironmentSpecificResolver } }, - { path: 'search/software', component: SoftwareComponent, resolve: { envSpecific: EnvironmentSpecificResolver } }, - { path: 'search/other', component: OrpComponent, resolve: { envSpecific: EnvironmentSpecificResolver }}, + { path: 'search/publication', component: ResultLandingComponent , resolve: { envSpecific: EnvironmentSpecificResolver } }, + { path: 'search/dataset', component: ResultLandingComponent, resolve: { envSpecific: EnvironmentSpecificResolver } }, + { path: 'search/software', component: ResultLandingComponent, resolve: { envSpecific: EnvironmentSpecificResolver } }, + { path: 'search/other', component: ResultLandingComponent, resolve: { envSpecific: EnvironmentSpecificResolver }}, { path: 'search/project', component: ProjectComponent , resolve: { envSpecific: EnvironmentSpecificResolver } }, { path: 'search/dataprovider', component: DataProviderComponent , resolve: { envSpecific: EnvironmentSpecificResolver } }, { path: 'search/organization', component: OrganizationComponent , resolve: { envSpecific: EnvironmentSpecificResolver } }, diff --git a/app.module.ts b/app.module.ts index 8a253a93..1e5f8471 100755 --- a/app.module.ts +++ b/app.module.ts @@ -13,10 +13,8 @@ import { BottomModule } from './sharedComponents/bottom.module'; // import { ErrorModule } from './error/error.module'; import { ConfigurationService } from './utils/configuration/configuration.service'; import {MainSearchModule} from './searchPages/find/mainSearch.module'; -import {PublicationModule} from './landingPages/publication/publication.module'; -import {DatasetModule} from './landingPages/dataset/dataset.module'; -import {SoftwareModule} from './landingPages/software/software.module'; -import {OrpModule} from './landingPages/orp/orp.module'; + +import {ResultLandingModule} from "./landingPages/result/resultLanding.module"; import {DataProviderModule} from './landingPages/dataProvider/dataProvider.module'; import {ProjectModule} from './landingPages/project/project.module'; import {OrganizationModule} from './landingPages/organization/organization.module'; @@ -78,7 +76,7 @@ import { AppRoutingModule } from './app-routing.module'; DepositDatasetsModule,DepositDatasetsResultsModule, DepositBySubjectResultsModule,DepositPublicationsModule , DepositPublicationsResultsModule, SearchPublicationsModule,SearchDatasetsModule, SearchSoftwareModule, SearchOrpsModule, SearchDataProvidersModule, SearchProjectsModule, SearchOrganizationsModule, AdvancedSearchPublicationsModule,AdvancedSearchDatasetsModule, AdvancedSearchSoftwareModule, AdvancedSearchOrpsModule, AdvancedSearchDataProvidersModule, AdvancedSearchProjectsModule, AdvancedSearchOrganizationsModule, - PublicationModule, DatasetModule, DataProviderModule, OrganizationModule, ProjectModule, SoftwareModule, OrpModule, + ResultLandingModule, DataProviderModule, OrganizationModule, ProjectModule, EntityRegistriesModule, CompatibleDataProvidersModule, JournalsModule, JournalsTableModule, EntityRegistriesTableModule, CompatibleDataProvidersTableModule, ClaimsAdminModule, MyClaimsModule, ClaimsByTokenModule, LinkingGenericModule, DirectLinkingModule, diff --git a/landingPages/dataset/dataset-routing.module.ts b/landingPages/dataset/dataset-routing.module.ts deleted file mode 100644 index 4b9372a4..00000000 --- a/landingPages/dataset/dataset-routing.module.ts +++ /dev/null @@ -1,18 +0,0 @@ -// import { NgModule } from '@angular/core'; -// import { RouterModule } from '@angular/router'; -// -// import { DatasetComponent } from './dataset.component'; -// import {FreeGuard} from'../../login/freeGuard.guard'; -// import {PreviousRouteRecorder} from'../../utils/piwik/previousRouteRecorder.guard'; -// import {IsRouteEnabled} from '../../error/isRouteEnabled.guard'; -// -// @NgModule({ -// imports: [ -// RouterModule.forChild([ -// { path: '', component: DatasetComponent, canActivate: [FreeGuard, IsRouteEnabled], data: { -// redirect: '/error' -// },canDeactivate: [PreviousRouteRecorder] } -// ]) -// ] -// }) -// export class DatasetRoutingModule { } diff --git a/landingPages/dataset/dataset.component.html b/landingPages/dataset/dataset.component.html deleted file mode 100644 index e85dfbec..00000000 --- a/landingPages/dataset/dataset.component.html +++ /dev/null @@ -1,342 +0,0 @@ -
- -
-
-
- - - - -
- - -
- - -

- -

- {{datasetInfo.types.join(", ")}}{{" "}} - {{datasetInfo.languages.join(", ")}}{{" "}} - {{datasetInfo.countries.join(", ")}}{{" "}} - - - {{datasetInfo.accessMode}}{{" "}} - {{" "}} - - Record in preview - - - - -
- - ({{datasetInfo.date}}) -
- -
    - -
  • Embargo end date: {{datasetInfo.embargoEndDate}}
  • -
  • - -
  • -
  • - - -
  • -
-
-
- {{datasetInfo.description.substring(0, showNumDescription)}}... - - View more - - -
- - - - -
- -
- -
-
Share - Bookmark
- - -
- - - - - -
    - -
  • - -
  • -
  • - -
  • - -
  • -
    -
    Related to
    -
    - - {{item['labelContext']}} - -> {{item['labelCategory']}} - : {{item['labelConcept']}} - - - {{item['labelContext']}} - -> {{item['labelCategory']}} - : {{item['labelConcept']}} - -
    - -
    - -
  • - - - -
  • - -
    - Cite this research data -
    -
    - -
    - -
  • - -
- - - - -
-
-
-
- -
- - -
diff --git a/landingPages/dataset/dataset.component.ts b/landingPages/dataset/dataset.component.ts deleted file mode 100644 index 6d85e18c..00000000 --- a/landingPages/dataset/dataset.component.ts +++ /dev/null @@ -1,268 +0,0 @@ -import {Component, Input} from '@angular/core'; -import {ActivatedRoute, Router} from '@angular/router'; -import {Meta, Title} from '@angular/platform-browser'; - -import {DatasetInfo} from '../../utils/entities/datasetInfo'; -import {EnvProperties} from '../../utils/properties/env-properties'; -import {RouterHelper} from '../../utils/routerHelper.class'; - -import {DatasetService} from './dataset.service'; -import {PiwikService} from '../../utils/piwik/piwik.service'; -import {SEOService} from '../../sharedComponents/SEO/SEO.service'; -import {HelperFunctions} from "../../utils/HelperFunctions.class"; -import {HelperService} from "../../utils/helper/helper.service"; - - -@Component({ - selector: 'dataset', - templateUrl: 'dataset.component.html', -}) - -export class DatasetComponent { - @Input() piwikSiteId = null; - @Input() communityId = null; - public datasetInfo: DatasetInfo; - public datasetId: 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; - - // Custom tab paging variables - public referencesPage: number = 1; - public pageSize: number = 10; - - // Active tab variable for responsiveness - public activeTab: string = "References"; - - // Map counting variable - public relatedResearchResultsNum: number = 0; - - // Message variables - public warningMessage = ""; - public errorMessage = ""; - public showLoading: boolean = true; - public pageContents = null; - public divContents = null; - - public routerHelper: RouterHelper = new RouterHelper(); - - private result; - sub: any; - piwiksub: any; - infoSub: any; - properties: EnvProperties; - - constructor(private _datasetService: DatasetService, - private _piwikService: PiwikService, - private route: ActivatedRoute, - private router: Router, - private _meta: Meta, - private _title: Title, - private _router: Router, - private seoService: SEOService, - private helper: HelperService) { - } - - 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.datasetInfo = null; - this.updateTitle("Dataset"); - this.updateDescription(""); - - this.datasetId = params['datasetId']; - - if (this.datasetId) { - this.getDatasetInfo(this.datasetId); - } else { - this.showLoading = false; - this.warningMessage = "No valid research data id"; - } - - this.metricsClicked = false; - - this.viewsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"' + this.datasetId + '", "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.datasetId+'", "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.datasetId + '", "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.datasetId+'", "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 getDatasetInfo(id: string) { - this.warningMessage = ''; - this.errorMessage = "" - this.showLoading = true; - - this.datasetInfo = null; - - this.infoSub = this._datasetService.getDatasetInfo(id, this.properties).subscribe( - data => { - this.datasetInfo = data; - this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToDataset + this.datasetInfo.record["result"]["header"]["dri:objIdentifier"]); - /* - if(this.datasetInfo.title.name != undefined && this.datasetInfo.title.name!= ''){ - this.updateTitle(this.datasetInfo.title.name); - this.updateDescription("Dataset, search, repositories, open access,"+this.datasetInfo.title.name); - } - */ - if (this.datasetInfo.title) { - this.updateTitle(this.datasetInfo.title); - this.updateDescription((this.datasetInfo.description ? (this.datasetInfo.description) : ("," + this.datasetInfo.title))); - } - if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) { - this.piwiksub = this._piwikService.trackView(this.properties, this.datasetInfo.title/*.name*/, this.piwikSiteId).subscribe(); - } - - this.result = [] - this.result = { - id: id, - type: "dataset", - source: "openaire", - title: this.datasetInfo.title, - url: '', - result: '', - accessRights: /*this.datasetInfo.title.accessMode*/ this.datasetInfo.accessMode, - embargoEndDate: '' - }; - - let relatedResearchResultsNum = 0; - if (this.datasetInfo.relatedResearchResults != undefined) { - this.datasetInfo.relatedResearchResults.forEach(function (value, key, map) { - relatedResearchResultsNum += value.length; - }); - } - this.relatedResearchResultsNum = relatedResearchResultsNum; - - this.showLoading = false; - }, - err => { - //console.log(err) - this.handleError("Error getting research data for id: " + this.datasetId, err); - this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToDatasets); - this.errorMessage = 'No research data 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()); - } - - private handleError(message: string, error) { - console.error("Research Data Landing Page: " + message, error); - } - - public updateReferencesPage($event) { - this.referencesPage = $event.value; - } - - public totalPages(totalResults: number): number { - let totalPages: any = totalResults / this.pageSize; - if (!(Number.isInteger(totalPages))) { - totalPages = (parseInt(totalPages, this.pageSize) + 1); - } - return totalPages; - } - - public scroll() { - HelperFunctions.scroll(); - } - - 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/dataset/dataset.module.ts b/landingPages/dataset/dataset.module.ts deleted file mode 100644 index 767ded56..00000000 --- a/landingPages/dataset/dataset.module.ts +++ /dev/null @@ -1,48 +0,0 @@ -import {NgModule} from '@angular/core'; -import {CommonModule} from '@angular/common'; -import {FormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; - -import {SharedModule} from '../../shared/shared.module'; - -import {DatasetComponent} from './dataset.component'; - -import {CiteThisModule} from '../landing-utils/citeThis/citeThis.module';; -import {LandingModule} from '../landing-utils/landing.module'; -import {ResultLandingModule} from '../landing-utils/resultLanding.module'; -import {MetricsModule} from '../landing-utils/metrics.module'; -import {AltMetricsModule} from '../../utils/altmetrics.module'; -import {ConfigurationServiceModule} from '../../utils/configuration/configurationService.module'; -import {IFrameModule} from '../../utils/iframe.module'; -import {PagingModule} from '../../utils/paging.module'; - -import {DatasetService} from './dataset.service'; - -import {FreeGuard} from '../../login/freeGuard.guard'; -import {IsRouteEnabled} from '../../error/isRouteEnabled.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, SharedModule, RouterModule, LandingModule, - CiteThisModule, ResultLandingModule, MetricsModule, IFrameModule, PagingModule, - AltMetricsModule, ConfigurationServiceModule, Schema2jsonldModule, SEOServiceModule, - ShowAuthorsModule, DeletedByInferenceModule, HelperModule - ], - declarations: [ - DatasetComponent - ], - providers:[ - DatasetService, FreeGuard, IsRouteEnabled - ], - exports: [ - DatasetComponent - ] -}) - -export class DatasetModule { } diff --git a/landingPages/dataset/dataset.service.ts b/landingPages/dataset/dataset.service.ts deleted file mode 100644 index 5ea5a77e..00000000 --- a/landingPages/dataset/dataset.service.ts +++ /dev/null @@ -1,271 +0,0 @@ -import {Injectable} from '@angular/core'; -import {Http, Response} from '@angular/http'; -import {HttpClient, HttpErrorResponse} from "@angular/common/http"; -import {Observable, throwError} from 'rxjs'; -import {DatasetInfo} from '../../utils/entities/datasetInfo'; - - - -import{EnvProperties} from '../../utils/properties/env-properties'; - -import { ParsingFunctions } from '../landing-utils/parsingFunctions.class'; -import {map} from "rxjs/operators"; - -@Injectable() -export class DatasetService { - - constructor(private http: HttpClient ) { - this.parsingFunctions = new ParsingFunctions(); - } - - public parsingFunctions: ParsingFunctions; - datasetInfo: DatasetInfo; - - getDatasetInfo (id: string, properties:EnvProperties):any { - - let url = properties.searchAPIURLLAst+'datasets/'+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], //0 - res[1]['title'], //1 - res[1]['rels']['rel'], //2 - res[1]['children'], //3 - res[1]['pid'], //4 - res[1]['subject'], //5 - res[1]['bestaccessright'], //6 - res[1]['collectedfrom'], //7 - res[1]['context'], //8 - //res[1]['resulttype'], - res[0], //9 - res[1]['creator'], //10 - res[1]['language'], //11 - res[1]['country'], //12 - res[2], //13 - (res[1]['extraInfo']!= undefined && res[1]['extraInfo']['citations']!= undefined)? res[1]['extraInfo']['citations']['citation']:null, //14 - res[1]['journal'] //15 - ])) - .pipe(map(res => this.parseDatasetInfo(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'); - } - - parseDatasetInfo (data: any, properties: EnvProperties):any { - this.datasetInfo = new DatasetInfo(); - this.datasetInfo.record = data[13]; - // ['result']['metadata']['oaf:entity']['oaf:result'] - if(data[0] != null) { - var date:string = (data[0].dateofacceptance)+""; // transform to string in case it is an integer - this.datasetInfo.date = (date && (date).indexOf('-') !== -1)?date.split('-')[0]:date; - this.datasetInfo.dateofacceptance = data[0].dateofacceptance; - this.datasetInfo.publisher = data[0].publisher; - if(!Array.isArray(data[0].description)) { - this.datasetInfo.description = String(data[0].description); - } else { - this.datasetInfo.description = String(data[0].description[0]); - } - this.datasetInfo.embargoEndDate = data[0].embargoenddate; - } - /*this.datasetInfo.title = {"name": "", "url": "", "accessMode": ""}; - if(data[0]['bestaccessright'] && data[0]['bestaccessright'].hasOwnProperty("classid")) { - this.datasetInfo.title.accessMode = data[0]['bestaccessright'].classid; - } - if(data[1] != null) { - if(Array.isArray(data[1])) { - this.datasetInfo.title['name'] = data[1][0].content; - } else { - this.datasetInfo.title['name'] = data[1].content; - } - }*/ - if(data[0]['bestaccessright'] && data[0]['bestaccessright'].hasOwnProperty("classid")) { - this.datasetInfo.accessMode = data[0]['bestaccessright'].classid; - } - // ['result']['metadata']['oaf:entity']['oaf:result']['title'] - if(data[1] != null) { - if(Array.isArray(data[1])) { - this.datasetInfo.title = String(data[1][0].content); - if(data[1][1].classid == "subtitle") { - this.datasetInfo.subtitle = String(data[1][1].content); - } - } else { - this.datasetInfo.title = String(data[1].content); - } - } - - // ['result']['metadata']['oaf:entity']['oaf:result']['rels']['rel'] - if(data[2] != null) { - let relation; - let length = data[2].length!=undefined ? data[2].length : 1; - - for(let i=0; i(); - - this.datasetInfo.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.datasetInfo.subjects = subjectResults[0]; - this.datasetInfo.otherSubjects = subjectResults[1]; - this.datasetInfo.classifiedSubjects = subjectResults[2]; - } - - this.datasetInfo.hostedBy_collectedFrom = this.parsingFunctions.addPublisherToHostedBy_collectedFrom( - this.datasetInfo.hostedBy_collectedFrom, this.datasetInfo.publisher, - null, this.datasetInfo.identifiers/*, this.datasetInfo.title*/); - - // ['result']['metadata']['oaf:entity']['oaf:result']['context'] - if(data[8] != null) { - this.datasetInfo.contexts = this.parsingFunctions.parseContexts(data[8]); - } - - // if(data[9] != null && this.datasetInfo.type == undefined) { - // if(data[9].hasOwnProperty('classname')) { - // this.datasetInfo.type = data[9].classname; - // } - // } - - // ['result']['header']['dri:status'] - if(data[9] != null && data[9] == "under curation") { - this.datasetInfo.underCurationMessage = true; - } else { - this.datasetInfo.underCurationMessage = false; - } - - // ['result']['metadata']['oaf:entity']['oaf:result']['creator'] - if(data[10] != null) { - if(this.datasetInfo.authors == undefined) { - this.datasetInfo.authors = new Array<{"fullName": string, "orcid": string}>(); - } - - let authors = data[10]; - let length = Array.isArray(authors) ? authors.length : 1; - - for(let i=0; i - - - - - - [no title available] - - - - - - [no title available] - - -

- -

-

- [no title available] +

+
+ + + + + + [no title available] + + + + + + [no title available] + +
+
+ +
+
+ [no title available] +

` @@ -41,6 +43,7 @@ export class ShowTitleComponent { @Input() titleName: string; @Input() title: { [key: string]: string }; @Input() iconClass:string; + @Input() classNames: string = ""; sub: any; diff --git a/landingPages/orp/orp.component.html b/landingPages/orp/orp.component.html deleted file mode 100644 index 09efeea1..00000000 --- a/landingPages/orp/orp.component.html +++ /dev/null @@ -1,278 +0,0 @@ -
-
-
-
- - - - -
-
- - - {{orpInfo.types.join(", ")}}{{" "}} - {{orpInfo.languages.join(", ")}}{{" "}} - {{orpInfo.countries.join(", ")}}{{" "}} - {{orpInfo.accessMode}}{{" "}} - - - Record in preview - - - {{" "}} - -
- - ({{orpInfo.date}}) -
- -
    - -
  • Embargo end date: {{orpInfo.embargoEndDate}}
  • -
  • - -
  • -
  • - - -
  • -
-
-
- {{orpInfo.description.substring(0, showNumDescription)}}... - - View more - - -
- - - -
- -
-
- - -
-
Share - Bookmark
- -
- - -
    -
  • - -
  • -
  • - -
  • -
  • -
    -
    Related to
    -
    - - {{item['labelContext']}} - -> {{item['labelCategory']}} - : {{item['labelConcept']}} - - - {{item['labelContext']}} - -> {{item['labelCategory']}} - : {{item['labelConcept']}} - -
    -
    -
  • -
  • - -
    - Cite this research product -
    -
    - -
    - -
  • -
-
- -
-
- - -
- -
-
-
- - diff --git a/landingPages/orp/orp.component.ts b/landingPages/orp/orp.component.ts deleted file mode 100644 index 939e4ff2..00000000 --- a/landingPages/orp/orp.component.ts +++ /dev/null @@ -1,254 +0,0 @@ -import {Component, Input} from '@angular/core'; -import {ActivatedRoute, Router} from '@angular/router'; -import {Meta, Title} from '@angular/platform-browser'; - -import {OrpInfo} from '../../utils/entities/orpInfo'; -import {EnvProperties} from '../../utils/properties/env-properties'; -import {RouterHelper} from '../../utils/routerHelper.class'; - -import {OrpService} from './orp.service'; -import {PiwikService} from '../../utils/piwik/piwik.service'; -import {SEOService} from '../../sharedComponents/SEO/SEO.service'; -import {HelperFunctions} from "../../utils/HelperFunctions.class"; -import {HelperService} from "../../utils/helper/helper.service"; - - -@Component({ - selector: 'orp', - templateUrl: 'orp.component.html', -}) - -export class OrpComponent { - @Input() piwikSiteId = null; - @Input() communityId = null; - public orpInfo: OrpInfo; - public orpId: 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; - - // Custom tab paging variables - public referencesPage: number = 1; - public pageSize: number = 10; - - // Active tab variable for responsiveness - public activeTab: string = "References"; - - // Map counting variable - public relatedResearchResultsNum: number = 0; - - // Message variables - public warningMessage = ""; - public errorMessage = ""; - public showLoading: boolean = true; - public pageContents = null; - public divContents = null; - - public routerHelper: RouterHelper = new RouterHelper(); - - private result; - sub: any; - piwiksub: any; - infoSub: any; - properties: EnvProperties; - - constructor(private _orpService: OrpService, - 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.orpInfo = null; - this.updateTitle("Other Research Product"); - this.updateDescription(""); - this.orpId = params['orpId']; - - if (this.orpId) { - this.getOrpInfo(this.orpId); - } else { - this.showLoading = false; - this.warningMessage = "No valid research product id"; - } - - this.metricsClicked = false; - - this.viewsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"' + this.orpId + '", "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.orpId + '", "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 getOrpInfo(id: string) { - this.warningMessage = ''; - this.errorMessage = "" - this.showLoading = true; - - this.orpInfo = null; - - this.infoSub = this._orpService.getOrpInfo(id, this.properties).subscribe( - data => { - this.orpInfo = data; - this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToOrp + this.orpInfo.record["result"]["header"]["dri:objIdentifier"]); - if (this.orpInfo.title) { - this.updateTitle(this.orpInfo.title); - this.updateDescription((this.orpInfo.description ? (this.orpInfo.description) : ("," + this.orpInfo.title))); - } - if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) { - this.piwiksub = this._piwikService.trackView(this.properties, this.orpInfo.title, this.piwikSiteId).subscribe(); - } - - this.result = [] - this.result = { - id: id, - type: "orp", - source: "openaire", - title: this.orpInfo.title, - url: '', - result: '', - accessRights: this.orpInfo.accessMode, - embargoEndDate: '' - }; - - let relatedResearchResultsNum = 0; - if (this.orpInfo.relatedResearchResults != undefined) { - this.orpInfo.relatedResearchResults.forEach(function (value, key, map) { - relatedResearchResultsNum += value.length; - }); - } - this.relatedResearchResultsNum = relatedResearchResultsNum; - - this.showLoading = false; - }, - err => { - //console.log(err) - this.handleError("Error getting other research product for id: " + this.orpId, err); - this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToOrps); - this.errorMessage = 'No research product found'; - this.showLoading = false; - } - ); - } - - 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("Other Research Product Landing Page: " + message, error); - } - - public updateReferencesPage($event) { - this.referencesPage = $event.value; - } - - public totalPages(totalResults: number): number { - let totalPages: any = totalResults / this.pageSize; - if (!(Number.isInteger(totalPages))) { - totalPages = (parseInt(totalPages, this.pageSize) + 1); - } - return totalPages; - } - - 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/orp/orp.module.ts b/landingPages/orp/orp.module.ts deleted file mode 100644 index 30f136c0..00000000 --- a/landingPages/orp/orp.module.ts +++ /dev/null @@ -1,48 +0,0 @@ -import {NgModule} from '@angular/core'; -import {CommonModule} from '@angular/common'; -import {FormsModule} from '@angular/forms'; -import {RouterModule} from '@angular/router'; - -import {SharedModule} from '../../shared/shared.module'; - -import {OrpComponent} from './orp.component'; - -import {CiteThisModule} from '../landing-utils/citeThis/citeThis.module'; -import {LandingModule} from '../landing-utils/landing.module'; -import {ResultLandingModule} from '../landing-utils/resultLanding.module'; -import {MetricsModule} from '../landing-utils/metrics.module'; -import {AltMetricsModule} from '../../utils/altmetrics.module'; -import {ConfigurationServiceModule} from '../../utils/configuration/configurationService.module'; -import {IFrameModule} from '../../utils/iframe.module'; -import {PagingModule} from '../../utils/paging.module'; - -import {OrpService} from './orp.service'; - -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, SharedModule, RouterModule, LandingModule, - CiteThisModule, ResultLandingModule, MetricsModule, IFrameModule, PagingModule, - AltMetricsModule, ConfigurationServiceModule, Schema2jsonldModule, SEOServiceModule, - ShowAuthorsModule, DeletedByInferenceModule, HelperModule - ], - declarations: [ - OrpComponent - ], - providers: [ - OrpService, FreeGuard - ], - exports: [ - OrpComponent - ] -}) - -export class OrpModule { -} diff --git a/landingPages/orp/orp.service.ts b/landingPages/orp/orp.service.ts deleted file mode 100644 index 8429c0d7..00000000 --- a/landingPages/orp/orp.service.ts +++ /dev/null @@ -1,233 +0,0 @@ -import {Injectable} from '@angular/core'; -import {HttpClient, HttpErrorResponse} from "@angular/common/http"; -import {throwError} from 'rxjs'; -import {OrpInfo} from '../../utils/entities/orpInfo'; -import {EnvProperties} from '../../utils/properties/env-properties'; -import {ParsingFunctions} from '../landing-utils/parsingFunctions.class'; -import {map} from "rxjs/operators"; - -@Injectable() -export class OrpService { - - constructor(private http: HttpClient ) { - this.parsingFunctions = new ParsingFunctions(); - } - - public parsingFunctions: ParsingFunctions; - orpInfo: OrpInfo; - - getOrpInfo (id: string, properties:EnvProperties):any { - - let url = properties.searchAPIURLLAst+'other/'+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'],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']['subject'], //5 - res[1]['oaf:result']['bestaccessright'], //6 - res[1]['oaf:result']['collectedfrom'], //7 - res[1]['oaf:result']['context'], //8 - res[0], //9 - res[1]['oaf:result']['creator'], //10 - res[1]['oaf:result']['language'], //11 - res[1]['oaf:result']['country'], //12 - res[2], //13 - (res[1]['extraInfo']!= undefined && res[1]['extraInfo']['citations']!= undefined)? res[1]['extraInfo']['citations']['citation']:null, //14 - res[1]['oaf:result']['journal'] //15 - ])) - .pipe(map(res => this.parseOrpInfo(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'); - } - - parseOrpInfo (data: any, properties: EnvProperties):any { - this.orpInfo = new OrpInfo(); - this.orpInfo.record = data[13]; - if(data[0] != null) { - var date:string = (data[0].dateofacceptance)+""; // transform to string in case it is an integer - this.orpInfo.date = (date && (date).indexOf('-') !== -1)?date.split('-')[0]:date; - this.orpInfo.dateofacceptance = data[0].dateofacceptance; - this.orpInfo.publisher = data[0].publisher; - if(!Array.isArray(data[0].description)) { - this.orpInfo.description = String(data[0].description); - } else { - this.orpInfo.description = String(data[0].description[0]); - } - this.orpInfo.embargoEndDate = data[0].embargoenddate; - } - - if(data[0]['bestaccessright'] && data[0]['bestaccessright'].hasOwnProperty("classid")) { - this.orpInfo.accessMode = data[0]['bestaccessright'].classid; - } - if(data[1] != null) { - if(Array.isArray(data[1])) { - this.orpInfo.title = String(data[1][0].content); - } else { - this.orpInfo.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.orpInfo.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.orpInfo.subjects = subjectResults[0]; - this.orpInfo.otherSubjects = subjectResults[1]; - this.orpInfo.classifiedSubjects = subjectResults[2]; - } - - this.orpInfo.hostedBy_collectedFrom = this.parsingFunctions.addPublisherToHostedBy_collectedFrom( - this.orpInfo.hostedBy_collectedFrom, this.orpInfo.publisher, - null, this.orpInfo.identifiers/*, this.orpInfo.title*/); - - if(data[8] != null) { - this.orpInfo.contexts = this.parsingFunctions.parseContexts(data[8]); - } - - if(data[9] != null && data[9] == "under curation") { - this.orpInfo.underCurationMessage = true; - } else { - this.orpInfo.underCurationMessage = false; - } - - if(data[10] != null) { - if(this.orpInfo.authors == undefined) { - this.orpInfo.authors = new Array<{"fullName": string, "orcid": string}>(); - } - - let authors = data[10]; - let length = Array.isArray(authors) ? authors.length : 1; - - for(let i=0; i
- diff --git a/landingPages/publication/publication-routing.module.ts b/landingPages/publication/publication-routing.module.ts deleted file mode 100644 index 034f01c3..00000000 --- a/landingPages/publication/publication-routing.module.ts +++ /dev/null @@ -1,18 +0,0 @@ -// import { NgModule } from '@angular/core'; -// import { RouterModule } from '@angular/router'; -// -// import { PublicationComponent } from './publication.component'; -// import {FreeGuard} from'../../login/freeGuard.guard'; -// import {PreviousRouteRecorder} from'../../utils/piwik/previousRouteRecorder.guard'; -// import {IsRouteEnabled} from '../../error/isRouteEnabled.guard'; -// -// @NgModule({ -// imports: [ -// RouterModule.forChild([ -// { path: '', component: PublicationComponent, canActivate: [FreeGuard, IsRouteEnabled], data: { -// redirect: '/error' -// },canDeactivate: [PreviousRouteRecorder] } -// ]) -// ] -// }) -// export class PublicationRoutingModule { } diff --git a/landingPages/publication/publication.component.ts b/landingPages/publication/publication.component.ts deleted file mode 100644 index 80157ebf..00000000 --- a/landingPages/publication/publication.component.ts +++ /dev/null @@ -1,408 +0,0 @@ -import {Component, Input} from '@angular/core'; -import {ActivatedRoute, Router} from '@angular/router'; -import {Meta, Title} from '@angular/platform-browser'; - -import {EnvProperties} from '../../utils/properties/env-properties'; -import {PublicationInfo} from '../../utils/entities/publicationInfo'; -import {RouterHelper} from '../../utils/routerHelper.class'; - -import {PiwikService} from '../../utils/piwik/piwik.service'; -import {PublicationService} from './publication.service'; -import {SEOService} from '../../sharedComponents/SEO/SEO.service'; -import {HelperFunctions} from "../../utils/HelperFunctions.class"; -import {HelperService} from "../../utils/helper/helper.service"; - - -@Component({ - selector: 'publication', - templateUrl: 'publication.component.html', - -}) - -export class PublicationComponent { - @Input() piwikSiteId = null; - @Input() communityId = null; - public publicationInfo: PublicationInfo; - public articleId: string; - - // 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; - /* - public startt: number = 0; - public stopp: number = 0; - */ - - // Active tab variable for responsiveness - public activeTab: string = "References"; - - // 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 _publicationService: PublicationService, - 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.publicationInfo = null; - this.updateTitle("Publication"); - this.updateDescription(""); - this.articleId = data['articleId']; - - this.metricsClicked = false; - - if (this.articleId) { - - this.getPublicationInfo(this.articleId); - // if (typeof document !== 'undefined') { - // switcher(UIkit); - // } - } else { - this.showLoading = false; - this.warningMessage = "No valid publication id"; - } - - this.viewsFrameUrl = this.properties.framesAPIURL + 'merge.php?com=query&data=[{"query":"resRepoViews", "resTitle":"' + this.articleId + '", "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.articleId + '", "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._publicationService.getOpenCitations(this.articleId, this.properties).subscribe( - data => { - this.publicationInfo.openCitations = data[1]; - }, - err => { - //console.log(err); - this.handleError("Error getting open citation for publication with id: " + this.articleId, err); - } - ); - } - - private getPublicationInfo(id: string) { - this.warningMessage = ''; - this.errorMessage = "" - this.showLoading = true; - - this.publicationInfo = null; - - this.infoSub = this._publicationService.getPublicationInfo(this.articleId, this.properties).subscribe( - data => { - this.publicationInfo = data; - this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToPublication + this.publicationInfo.record["result"]["header"]["dri:objIdentifier"]); - if ((this.properties.environment == "beta" || this.properties.environment == "development") && (typeof document !== 'undefined')) { - this.getOpenCitations(this.articleId); - } - - // this.result = [] - // this.result = {id: id, type :"dataset", source : "openaire", title: this.publicationInfo.title,url: '', result: '', accessRights: this.publicationInfo.bestaccessright, embargoEndDate: ''}; - /*if(this.publicationInfo.title.name != undefined && this.publicationInfo.title.name!= ''){ - this.updateTitle(this.publicationInfo.title.name); - this.updateDescription("Dataset, search, repositories, open access,"+this.publicationInfo.title.name); - }*/ - if (this.publicationInfo.title) { - this.updateTitle(this.publicationInfo.title); - this.updateDescription((this.publicationInfo.description ? (this.publicationInfo.description) : ("," + this.publicationInfo.title))); - } - if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) { - this.piwiksub = this._piwikService.trackView(this.properties, this.publicationInfo.title/*.name*/, this.piwikSiteId).subscribe(); - } - - let bioentitiesNum = 0; - if (this.publicationInfo.bioentities != undefined) { - this.publicationInfo.bioentities.forEach(function (value, key, map) { - bioentitiesNum += value.size; - }); - } - this.bioentitiesNum = bioentitiesNum; - - let relatedResearchResultsNum = 0; - if (this.publicationInfo.relatedResearchResults != undefined) { - this.publicationInfo.relatedResearchResults.forEach(function (value, key, map) { - relatedResearchResultsNum += value.length; - }); - } - this.relatedResearchResultsNum = relatedResearchResultsNum; - - this.result = { - id: this.articleId, - type: "publication", - source: "openaire", - title: this.publicationInfo.title, - url: '', - result: '', - accessRights: /*this.publicationInfo.title.accessMode*/this.publicationInfo.accessMode, - embargoEndDate: '' - }; - // this.result.push(result_); - - if (this.publicationInfo.identifiers != undefined && this.publicationInfo.identifiers.has('doi')) { - this.doi = this.publicationInfo.identifiers.get('doi')[0]; - } - - this.showLoading = false; - - if (this.publicationInfo.references) { - this.activeTab = "References"; - } else if (this.publicationInfo.relatedResearchResults) { - this.activeTab = "Related Research Results"; - } else if (this.publicationInfo.similarResearchResults) { - this.activeTab = "Similar Research Results"; - } else if (this.publicationInfo.organizations) { - this.activeTab = "Related Organizations"; - } else if (this.publicationInfo.bioentities) { - this.activeTab = "bioentities"; - } else if (this.publicationInfo.software) { - this.activeTab = "Software"; - } else { - this.activeTab = "Metrics"; - this.metricsClicked = true; - } - }, - err => { - //console.log(err); - this.handleError("Error getting publication for id: " + this.articleId, err); - - this.errorMessage = 'No publication found'; - this.showLoading = false; - this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToPublications); - } - ); - } - - public metricsResults($event) { - this.totalViews = $event.totalViews; - this.totalDownloads = $event.totalDownloads; - this.pageViews = $event.pageViews; - } - - 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 += "
"; - } - - 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(); - } - - /* - start(i: number, bioentitiesPage: number) { - let sum = 0; - let index=0; - let retValue = 0; - let valuesToPage = this.pageSize*bioentitiesPage; - let valuesToPreviousPage = valuesToPage - this.pageSize; - - if(bioentitiesPage == 1) { - return 0; - } - - this.publicationInfo.bioentities.forEach(function (value, key, map) { - sum += map.get(key).size; - - if(index == i) { - if(sum <= valuesToPreviousPage) { - retValue = 0; - } else if((sum-map.get(key).size) >= valuesToPage){ - retValue = 0; - } else { - if(map.get(key).size < (sum - valuesToPreviousPage)) { - retValue = 0; - } else { - retValue = map.get(key).size - (sum - valuesToPreviousPage); - } - } - } - index++; - }); - this.startt = retValue; - return retValue; - } - - stop(i: number, bioentitiesPage: number) { - let sum = 0; - let index=0; - let retValue = 0; - let valuesToPage = this.pageSize*bioentitiesPage; - let valuesToPreviousPage = valuesToPage - this.pageSize; - - this.publicationInfo.bioentities.forEach(function (value, key, map) { - sum += map.get(key).size; - if(index == i) { - if(sum <= valuesToPreviousPage) { - retValue = 0; - } else if((sum - map.get(key).size) >= valuesToPage){ - retValue = 0; - } else { - if(sum < valuesToPage) { - retValue = map.get(key).size; - } else { - retValue = map.get(key).size - (sum - valuesToPage); - } - } - } - index++; - }); - this.stopp = retValue; - return retValue; - } - */ - - private handleError(message: string, error) { - console.error("Publication 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/publication/publication.service.ts b/landingPages/publication/publication.service.ts deleted file mode 100644 index f4836b84..00000000 --- a/landingPages/publication/publication.service.ts +++ /dev/null @@ -1,423 +0,0 @@ -import {Injectable} from '@angular/core'; -import {HttpClient, HttpErrorResponse} from "@angular/common/http"; -import {throwError} from 'rxjs'; -import {PublicationInfo} from '../../utils/entities/publicationInfo'; -import {EnvProperties} from '../../utils/properties/env-properties'; -import {ParsingFunctions} from '../landing-utils/parsingFunctions.class'; -import {map} from "rxjs/operators"; - -@Injectable() -export class PublicationService { - - constructor(private http: HttpClient ) { - this.parsingFunctions = new ParsingFunctions(); - } - - public parsingFunctions: ParsingFunctions; - publicationInfo: PublicationInfo; - - getPublicationInfo (id: string, properties:EnvProperties):any { - let url = properties.searchAPIURLLAst + 'publications/' +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'], 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']['bestaccessright'], //8 - res[1]['oaf:result']['collectedfrom'], //9 - (res[1]['extraInfo']!= undefined && res[1]['extraInfo']['citations']!= undefined)? res[1]['extraInfo']['citations']['citation']:null, //10 - res[1]['oaf:result']['context'], //11 - res[0], //12 - res[1]['oaf:result']['creator'], //13 - res[2], //14 - res[1]['oaf:result']['country'] //15 - ])) - .pipe(map(res => this.parsePublicationInfo(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'); - } - - parsePublicationInfo (data: any, properties: EnvProperties):any { - this.publicationInfo = new PublicationInfo(); - this.publicationInfo.record = data[14]; - if(data[0] != null) { - var date:string = (data[0].dateofacceptance)+""; // transform to string in case it is an integer - this.publicationInfo.date = (date && (date).indexOf('-') !== -1)?date.split('-')[0]:date; - this.publicationInfo.dateofacceptance = data[0].dateofacceptance; - this.publicationInfo.publisher = data[0].publisher; - if(!Array.isArray(data[0].description)) { - this.publicationInfo.description = String(data[0].description); - } else { - this.publicationInfo.description = String(data[0].description[0]); - } - this.publicationInfo.embargoEndDate = data[0].embargoenddate; - } - -/* - this.publicationInfo.title = {"name": "", "url": "", "accessMode": ""}; - if(data[0]['bestaccessright'] && data[0]['bestaccessright'].hasOwnProperty("classid")) { - this.publicationInfo.title.accessMode = data[0]['bestaccessright'].classid; - } - - if(data[1] != null) { - if(Array.isArray(data[1])) { - this.publicationInfo.title['name'] = data[1][0].content; - } else { - this.publicationInfo.title['name'] = data[1].content; - } - } -*/ - if(data[0]['bestaccessright'] && data[0]['bestaccessright'].hasOwnProperty("classid")) { - this.publicationInfo.accessMode = data[0]['bestaccessright'].classid; - } - if(data[1] != null) { - if(Array.isArray(data[1])) { - this.publicationInfo.title = String(data[1][0].content); - } else { - this.publicationInfo.title = String(data[1].content); - } - } - - if(data[2] != null) { - let relation; - let length = Array.isArray(data[2]) ? data[2].length : 1; - - for(let i=0; i(); - //this.publicationInfo.downloadFrom = new Map(); - //this.publicationInfo.publishedIn = new Map(); - - - this.publicationInfo.hostedBy_collectedFrom = new Array<{"downloadName": string, "downloadUrl": string[], "collectedName": string, "collectedId": string, "accessMode": string[], "bestAccessMode": string, "type": string, "year":string}>(); - - - this.publicationInfo.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.publicationInfo.bioentities = externalResults[0]; - this.publicationInfo.software = externalResults[1]; - } - } - - if(data[4] != null) { - this.publicationInfo.identifiers = this.parsingFunctions.parseIdentifiers(data[4]); - } - - if(data[5] != null) { - this.publicationInfo.journal = {"journal": "", "issn": "", "lissn": "", "eissn": "", "issue": "", "volume": "", "start_page": "", "end_page": ""} - - this.publicationInfo.journal['journal'] = data[5].content; - this.publicationInfo.journal['issn'] = data[5].issn; - this.publicationInfo.journal['lissn'] = data[5].lissn; - this.publicationInfo.journal['eissn'] = data[5].eissn; - this.publicationInfo.journal['issue'] = data[5].iss; - this.publicationInfo.journal['volume'] = data[5].vol; - this.publicationInfo.journal['start_page'] = data[5].sp; - this.publicationInfo.journal['end_page'] = data[5].ep; - } - - if(data[6] != null) { - this.publicationInfo.languages = this.parsingFunctions.parseLanguages(data[6]); - } - if(data[15] != null) { - this.publicationInfo.countries = this.parsingFunctions.parseCountries(data[15]); - } - - if(data[7] != null) { - let subjectResults: [string[], Map, Map] = this.parsingFunctions.parseAllSubjects(data[7]); - this.publicationInfo.subjects = subjectResults[0]; - this.publicationInfo.otherSubjects = subjectResults[1]; - this.publicationInfo.classifiedSubjects = subjectResults[2]; - } - - // if(data[8] != null) { - // this.publicationInfo.bestaccessright = data[8].classid; - // } - - // if(data[9] != null) { - // this.publicationInfo.collectedFrom = this.parsingFunctions.parseCollectedFrom(data[9]); - // } - - this.publicationInfo.hostedBy_collectedFrom = this.parsingFunctions.addPublisherToHostedBy_collectedFrom( - this.publicationInfo.hostedBy_collectedFrom, this.publicationInfo.publisher, - this.publicationInfo.journal, this.publicationInfo.identifiers/*, - this.publicationInfo.title*/); - - if(data[10] != null) { - this.publicationInfo.references = this.parsingFunctions.parseReferences(data[10]); - } - - if(data[11] != null) { - this.publicationInfo.contexts = this.parsingFunctions.parseContexts(data[11]); - } - - if(data[12] != null && data[12] == "under curation") { - this.publicationInfo.underCurationMessage = true; - } else { - this.publicationInfo.underCurationMessage = false; - } - - if(data[13] != null) { - if(this.publicationInfo.authors == undefined) { - this.publicationInfo.authors = new Array<{"fullName": string, "orcid": string}>(); - } - - let authors = data[13]; - 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]; - } -/* - parseReferences(citations: any): {"name": string, "url": string}[] { - let references = new Array<{"name": string, "url": string}>(); - - let citation; - let length = Array.isArray(citations) ? citations.length : 1; - for(let i=0; i(); - - let openCitation; - - let length = Array.isArray(openCitations) ? openCitations.length : 1; - for(let i=0; i
-
@@ -12,27 +11,38 @@ class="loading-gif uk-align-center">
-
+
- - - + +
+ The following information is result of merging + Original sources ({{resultLandingInfo.deletedByInferenceIds.length}}) +
+

+ +

+ {{publicationInfo.types.join(", ")}}{{" "}} - {{resultLandingInfo.types.join(", ")}}{{" "}} + {{resultLandingInfo.programmingLanguages.join(", ")}}{{" "}} + {{publicationInfo.languages.join(", ")}}{{" "}} - {{resultLandingInfo.languages.join(", ")}}{{" "}} + {{publicationInfo.countries.join(", ")}}{{" "}} - - {{publicationInfo.accessMode}}{{" "}} + title="Country">{{resultLandingInfo.countries.join(", ")}}
{{" "}} + + {{resultLandingInfo.accessMode}}{{" "}} - + Record in preview @@ -41,46 +51,41 @@
- - ({{publicationInfo.date}}) + + ({{resultLandingInfo.date}})
    - -
  • Embargo end date: {{publicationInfo.embargoEndDate}}
  • -
  • - + +
  • Embargo end date: {{resultLandingInfo.embargoEndDate}}
  • +
  • +
  • - + *ngIf="resultLandingInfo"> +
-
-
+
- {{publicationInfo.description.substring(0, showNumDescription)}}...{{resultLandingInfo.description.substring(0, showNumDescription)}}... - + View more
-
@@ -91,35 +96,24 @@