[Library | Trunk]: 1. Merge from landing redesign. 2. Close modal on show Authors.
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-library/trunk/ng-openaire-library/src/app@58275 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
3917ea8bb7
commit
276e467b4f
|
@ -30,7 +30,7 @@ import {ResultLandingInfo} from "../../utils/entities/resultLandingInfo";
|
|||
Annotate
|
||||
</button>
|
||||
</form>
|
||||
<div [class.uk-hidden@s]="!visible" class="widget-container">
|
||||
<div [class.uk-hidden]="!visible" class="widget-container">
|
||||
<!--Close button, should be bound to hide the widget-->
|
||||
<button type="button" class="close" aria-label="Close" (click)="toggleAnnotation($event)">
|
||||
<span aria-hidden="true">×</span>
|
||||
|
|
|
@ -1,8 +1,25 @@
|
|||
<div id="tm-main" class=" uk-section uk-padding-remove-top uk-margin-small-top tm-middle" >
|
||||
<div uk-grid>
|
||||
<ng-template #search_box let-fetch="fetch" let-type="type" let-typeName="typeName"
|
||||
let-searchLinkToAdvancedPage="searchLinkToAdvancedPage" let-params="params">
|
||||
<!-- *ngIf="fetch.searchUtils.totalResults > 0"-->
|
||||
<div *ngIf="fetch.searchUtils.totalResults > 0">
|
||||
<div class="uk-position-relative">
|
||||
<a [queryParams]="params"
|
||||
[routerLink]="searchLinkToAdvancedPage">
|
||||
<div class="header target uk-text-bold">{{typeName}}</div>
|
||||
<div class="icon uk-position-center" uk-icon="icon: search;"></div>
|
||||
<div class="footer target uk-position-relative">
|
||||
<span class="uk-text-bold uk-position-center">{{fetch.searchUtils.totalResults | number}}</span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</ng-template>
|
||||
|
||||
<div id="tm-main" class="landing uk-section uk-padding-remove-top uk-margin-small-top tm-middle">
|
||||
<div *ngIf="!showFeedback" uk-grid>
|
||||
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
|
||||
|
||||
<div class="uk-container datasource">
|
||||
<div id="datasource" class="uk-container uk-container-large datasource">
|
||||
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
|
||||
role="alert">{{warningMessage}}</div>
|
||||
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top"
|
||||
|
@ -28,279 +45,575 @@
|
|||
type="datasource"
|
||||
[otherURL]="(dataProviderInfo.openDoarId)?(properties.openDoarURL+dataProviderInfo.openDoarId):((dataProviderInfo.r3DataId)?properties.r3DataURL+dataProviderInfo.r3DataId:nul)"></schema2jsonld>
|
||||
|
||||
<showTitle [title]="dataProviderInfo.title"></showTitle>
|
||||
<div class="uk-text-large "
|
||||
*ngIf="dataProviderInfo.officialName && this.dataProviderInfo.title.name != dataProviderInfo.officialName ">{{dataProviderInfo.officialName}}</div>
|
||||
|
||||
<span *ngIf="dataProviderInfo.type" class="uk-label custom-label label-type label-dataprovider "
|
||||
title="Type">{{dataProviderInfo.type}}</span>{{" "}}
|
||||
<span *ngIf="dataProviderInfo.compatibility" class="uk-label custom-label label-compatibility "
|
||||
title="Compatibility">
|
||||
<a *ngIf="!dataProviderInfo.compatibility.name && dataProviderInfo.compatibility.id"
|
||||
[queryParams]="{datasourceId: dataProviderInfo.compatibility.id}" routerLinkActive="router-link-active"
|
||||
routerLink="/search/dataprovider">
|
||||
{{dataProviderInfo.compatibility.info}}
|
||||
</a>
|
||||
<span *ngIf="dataProviderInfo.compatibility.name || !dataProviderInfo.compatibility.id">
|
||||
{{dataProviderInfo.compatibility.info}}
|
||||
</span>
|
||||
<a *ngIf="dataProviderInfo.compatibility.name && dataProviderInfo.compatibility.id"
|
||||
[queryParams]="{datasourceId: dataProviderInfo.compatibility.id}" routerLinkActive="router-link-active"
|
||||
routerLink="/search/dataprovider">
|
||||
{{dataProviderInfo.compatibility.name}}
|
||||
</a>
|
||||
<span *ngIf="dataProviderInfo.compatibility.name && !dataProviderInfo.compatibility.id">
|
||||
{{dataProviderInfo.compatibility.name}}
|
||||
</span>
|
||||
</span>{{" "}}
|
||||
<span *ngIf="dataProviderInfo.aggregationStatus && dataProviderInfo.aggregationStatus.fulltexts && dataProviderInfo.aggregationStatus.fulltexts > 0"
|
||||
class="uk-label custom-label label-type label-dataprovider ">OpenAIRE Text Mining</span>{{" "}}
|
||||
<!-- <showTitle [title]="dataProviderInfo.title"></showTitle>-->
|
||||
<landing-header [properties]="properties" [title]="dataProviderInfo.title.name"
|
||||
[subTitle]="(dataProviderInfo.officialName
|
||||
&& dataProviderInfo.title.name !== dataProviderInfo.officialName)?dataProviderInfo.officialName:null"
|
||||
[entityType]="'content provider'"
|
||||
[types]="dataProviderInfo.type ? [dataProviderInfo.type] : null">
|
||||
</landing-header>
|
||||
|
||||
<!-- Web Page -->
|
||||
<div class="uk-margin-top uk-margin-bottom">
|
||||
<div *ngIf="dataProviderInfo.title && dataProviderInfo.title.url">
|
||||
<span class="uk-text-muted">Web page: </span>
|
||||
<a [href]="dataProviderInfo.title.url">
|
||||
<span>{{dataProviderInfo.title.url}}</span>
|
||||
<span class="custom-external custom-icon space"></span>
|
||||
</a>
|
||||
</div>
|
||||
<!-- Labels -->
|
||||
<div class="uk-margin-small-top">
|
||||
<span *ngIf="dataProviderInfo.compatibility" class="uk-label custom-label label-compatibility"
|
||||
title="Compatibility">
|
||||
<a *ngIf="!dataProviderInfo.compatibility.name && dataProviderInfo.compatibility.id"
|
||||
[queryParams]="{datasourceId: dataProviderInfo.compatibility.id}" routerLinkActive="router-link-active"
|
||||
routerLink="/search/dataprovider">
|
||||
{{dataProviderInfo.compatibility.info}}
|
||||
</a>
|
||||
<span *ngIf="dataProviderInfo.compatibility.name || !dataProviderInfo.compatibility.id">
|
||||
{{dataProviderInfo.compatibility.info}}
|
||||
</span>
|
||||
<a *ngIf="dataProviderInfo.compatibility.name && dataProviderInfo.compatibility.id"
|
||||
[queryParams]="{datasourceId: dataProviderInfo.compatibility.id}" routerLinkActive="router-link-active"
|
||||
routerLink="/search/dataprovider">
|
||||
{{dataProviderInfo.compatibility.name}}
|
||||
</a>
|
||||
<span *ngIf="dataProviderInfo.compatibility.name && !dataProviderInfo.compatibility.id">
|
||||
{{dataProviderInfo.compatibility.name}}
|
||||
</span>
|
||||
</span>{{" "}}
|
||||
<span *ngIf="dataProviderInfo.aggregationStatus && dataProviderInfo.aggregationStatus.fulltexts && dataProviderInfo.aggregationStatus.fulltexts > 0"
|
||||
class="uk-label custom-label label-dataprovider ">OpenAIRE Text Mining
|
||||
</span>{{" "}}
|
||||
<span
|
||||
*ngIf="properties.environment !== 'production' && dataProviderInfo.countries && dataProviderInfo.countries.length > 0">
|
||||
<ng-container *ngFor="let country of dataProviderInfo.countries">
|
||||
<span class="uk-label custom-label label-country" title="Country">{{country}}</span>
|
||||
{{' '}}
|
||||
</ng-container>
|
||||
</span>
|
||||
<span *ngIf="properties.environment === 'production' && dataProviderInfo.countries &&
|
||||
removeUnknown(dataProviderInfo.countries).length > 0">
|
||||
<ng-container *ngFor="let country of removeUnknown(dataProviderInfo.countries)">
|
||||
<span class="uk-label custom-label label-country" title="Country">{{country}}</span>
|
||||
{{' '}}
|
||||
</ng-container>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<ul class="uk-list">
|
||||
<showPublisher [properties]="properties"
|
||||
[journal]="dataProviderInfo.journal"></showPublisher>
|
||||
<li
|
||||
*ngIf="dataProviderInfo.aggregationStatus && dataProviderInfo.aggregationStatus.fundedContent && dataProviderInfo.aggregationStatus.fundedContent != -1">
|
||||
<span class="uk-text-bold">Results with funding information: </span>
|
||||
{{dataProviderInfo.aggregationStatus.fundedContent | number}}
|
||||
<showPublisher [journal]="dataProviderInfo.journal" [properties]="properties"></showPublisher>
|
||||
<li *ngIf="dataProviderInfo.aggregationStatus" class="uk-animation-fade uk-animation-fast">
|
||||
<span *ngIf="dataProviderInfo.aggregationStatus.fulltexts && dataProviderInfo.aggregationStatus.fulltexts != -1"
|
||||
class="uk-margin-right">
|
||||
<span class="uk-text-muted">Collected full-texts: </span>
|
||||
{{dataProviderInfo.aggregationStatus.fulltexts | number}}
|
||||
</span>
|
||||
<span *ngIf="dataProviderInfo.aggregationStatus.fundedContent && dataProviderInfo.aggregationStatus.fundedContent != -1"
|
||||
class="uk-display-inline-block">
|
||||
<span class="uk-text-muted">Results with funding information: </span>
|
||||
{{dataProviderInfo.aggregationStatus.fundedContent | number}}
|
||||
</span>
|
||||
<span *ngIf="dataProviderInfo.aggregationStatus.lastUpdateDate && dataProviderInfo.aggregationStatus.lastUpdateDate != null"
|
||||
class="uk-display-inline-block">
|
||||
<span class="uk-text-muted">Latest data aggregation: </span>
|
||||
{{dataProviderInfo.aggregationStatus.lastUpdateDate | date}}
|
||||
</span>
|
||||
</li>
|
||||
<li
|
||||
*ngIf="dataProviderInfo.aggregationStatus && dataProviderInfo.aggregationStatus.fulltexts && dataProviderInfo.aggregationStatus.fulltexts != -1">
|
||||
<span class="uk-text-bold">Collected full-texts: </span>
|
||||
{{dataProviderInfo.aggregationStatus.fulltexts | number}}
|
||||
<!-- Organizations -->
|
||||
<li *ngIf="dataProviderInfo.organizations && dataProviderInfo.organizations.length > 0" class="uk-margin-small-bottom">
|
||||
<div class="uk-height-max-medium uk-overflow-auto">
|
||||
<span class="uk-text-muted">Organizations: </span>
|
||||
<span *ngFor="let organization of dataProviderInfo.organizations.slice(0, showNumOrganizations) let i=index">
|
||||
<a *ngIf="organization.id"
|
||||
[queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active"
|
||||
routerLink="/search/organization">
|
||||
<u>{{organization.name}}</u>
|
||||
</a>
|
||||
<span *ngIf="!organization.id">
|
||||
<span>{{organization.name}}</span>
|
||||
<span *ngIf="(i < dataProviderInfo.organizations.length-1)">,</span>
|
||||
</span>
|
||||
<span *ngIf="(i < dataProviderInfo.organizations.length-1)">, </span>
|
||||
</span>
|
||||
<span *ngIf="showNumOrganizations == thresholdOrganizations && dataProviderInfo.organizations.length > thresholdOrganizations"> ... </span>
|
||||
</div>
|
||||
<div *ngIf="showNumOrganizations == thresholdOrganizations && dataProviderInfo.organizations.length > thresholdOrganizations"
|
||||
class="uk-width-1-1 uk-text-right">
|
||||
<a (click)="showNumOrganizations = dataProviderInfo.organizations.length;">
|
||||
View all {{dataProviderInfo.organizations.length | number}} organizations
|
||||
</a>
|
||||
</div>
|
||||
<div *ngIf="showNumOrganizations > thresholdOrganizations" class="uk-width-1-1 uk-text-right">
|
||||
<a (click)="showNumOrganizations = thresholdOrganizations;">View less organizations</a>
|
||||
</div>
|
||||
</li>
|
||||
<li
|
||||
*ngIf="dataProviderInfo.aggregationStatus && dataProviderInfo.aggregationStatus.lastUpdateDate && dataProviderInfo.aggregationStatus.lastUpdateDate != null">
|
||||
<span class="uk-text-bold">Last update of records in OpenAIRE: </span>
|
||||
{{dataProviderInfo.aggregationStatus.lastUpdateDate | date}}
|
||||
<li *ngIf="dataProviderInfo.oaiPmhURL || dataProviderInfo.openDoarId || dataProviderInfo.r3DataId">
|
||||
<span *ngIf="dataProviderInfo.oaiPmhURL" class="uk-margin-right">
|
||||
<span class="uk-text-muted">OAI-PMH: </span>
|
||||
<a target="_blank" href="{{dataProviderInfo.oaiPmhURL}}">
|
||||
{{dataProviderInfo.oaiPmhURL}}
|
||||
<span class="custom-external custom-icon space"></span>
|
||||
</a>
|
||||
</span>
|
||||
<span *ngIf="dataProviderInfo.openDoarId" class="uk-display-inline-block">
|
||||
<span class="uk-text-muted">Detailed content provider information at </span>
|
||||
<a target="_blank" href="{{properties.openDoarURL+dataProviderInfo.openDoarId}}">
|
||||
OpenDOAR
|
||||
<span class="custom-external custom-icon space"></span>
|
||||
</a>
|
||||
</span>
|
||||
<span *ngIf="dataProviderInfo.r3DataId" class="uk-display-inline-block">
|
||||
<span class="uk-text-muted">Detailed content provider information at </span>
|
||||
<a target="_blank" href="{{properties.r3DataURL+dataProviderInfo.r3DataId}}">
|
||||
re3data.org
|
||||
<span class="custom-external custom-icon space"></span>
|
||||
</a>
|
||||
</span>
|
||||
</li>
|
||||
<li *ngIf="dataProviderInfo.oaiPmhURL"><span class="uk-text-bold">OAI-PMH: </span>
|
||||
<span class="uk-button-text">
|
||||
<a target="_blank" href="{{dataProviderInfo.oaiPmhURL}}">
|
||||
{{dataProviderInfo.oaiPmhURL}}
|
||||
</a>
|
||||
</span>
|
||||
|
||||
<li *ngIf="dataProviderInfo.countries != undefined && dataProviderInfo.countries.length > 0">
|
||||
<span class="uk-text-muted">Countries:</span>
|
||||
{{dataProviderInfo.countries.join(", ")}}
|
||||
</li>
|
||||
<li *ngIf="dataProviderInfo.openDoarId">
|
||||
<span class="uk-button-text">
|
||||
<a target="_blank" href="{{properties.openDoarURL+dataProviderInfo.openDoarId}}">
|
||||
Detailed content provider information (OpenDOAR)
|
||||
</a>
|
||||
</span>
|
||||
|
||||
</li>
|
||||
<li *ngIf="dataProviderInfo.r3DataId">
|
||||
<span class="uk-button-text">
|
||||
<a target="_blank" href="{{properties.r3DataURL+dataProviderInfo.r3DataId}}">
|
||||
Detailed content provider information (Re3data)
|
||||
</a>
|
||||
</span>
|
||||
|
||||
</li>
|
||||
|
||||
<li *ngIf="dataProviderInfo.countries != undefined && dataProviderInfo.countries.length > 0"><span
|
||||
class="uk-text-bold">Countries: </span>{{dataProviderInfo.countries.join(", ")}}</li>
|
||||
</ul>
|
||||
|
||||
<div *ngIf="showTabs">
|
||||
<ul class="custom-accordion" uk-accordion *ngIf="dataProviderInfo.tabs2 != undefined">
|
||||
|
||||
<li *ngIf="dataProviderInfo.tabs2.indexOf('Publications') != -1"
|
||||
(click)="search('publicationsTab', 1, 10); activeTab='Publications'">
|
||||
<a class="uk-accordion-title" href="#">Publications
|
||||
<!-- <span class="uk-badge uk-badge-notification"> -->
|
||||
({{fetchPublications.searchUtils.totalResults | number}})
|
||||
<!-- </span> -->
|
||||
</a>
|
||||
<div class="uk-accordion-content">
|
||||
<publicationsTab *ngIf="activeTab=='Publications'"
|
||||
[paramsForSearchLink]="paramsForSearchLink"
|
||||
[fetchPublications]="fetchPublications" [(properties)]=properties>
|
||||
</publicationsTab>
|
||||
</div>
|
||||
</li>
|
||||
<li *ngIf="dataProviderInfo.tabs2.indexOf('Research Data') != -1"
|
||||
(click)="search('datasetsTab', 1, 10); activeTab='Research Data'">
|
||||
<a class="uk-accordion-title" href="#">Research Data
|
||||
<!-- <span class="uk-badge uk-badge-notification"> -->
|
||||
({{fetchDatasets.searchUtils.totalResults | number}})
|
||||
<!-- </span> -->
|
||||
</a>
|
||||
<div class="uk-accordion-content">
|
||||
<p>
|
||||
<datasetsTab *ngIf="activeTab=='Research Data'"
|
||||
[paramsForSearchLink]="paramsForSearchLink"
|
||||
[fetchDatasets]="fetchDatasets" [(properties)]=properties>
|
||||
</datasetsTab>
|
||||
</p>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li *ngIf="dataProviderInfo.tabs2.indexOf('Software') != -1"
|
||||
(click)="search('softwareTab', 1, 10); activeTab='Software'">
|
||||
<a class="uk-accordion-title" href="#">Software
|
||||
<!-- <span class="uk-badge uk-badge-notification"> -->
|
||||
({{fetchSoftware.searchUtils.totalResults | number}})
|
||||
<!-- </span> -->
|
||||
</a>
|
||||
<div class="uk-accordion-content">
|
||||
<softwareTab *ngIf="activeTab=='Software'"
|
||||
[paramsForSearchLink]="paramsForSearchLink"
|
||||
[fetchSoftware]="fetchSoftware" [(properties)]=properties>
|
||||
</softwareTab>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li *ngIf="dataProviderInfo.tabs2.indexOf('Other Research Products') != -1"
|
||||
(click)="search('orpsTab', 1, 10); activeTab='Other Research Products'">
|
||||
<a class="uk-accordion-title" href="#">Other Research Products
|
||||
<!-- <span class="uk-badge uk-badge-notification"> -->
|
||||
({{fetchOrps.searchUtils.totalResults | number}})
|
||||
<!-- </span> -->
|
||||
</a>
|
||||
<div class="uk-accordion-content">
|
||||
<orpsTab *ngIf="activeTab=='Other Research Products'"
|
||||
[paramsForSearchLink]="paramsForSearchLink"
|
||||
[fetchOrps]="fetchOrps" [(properties)]=properties>
|
||||
</orpsTab>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li *ngIf="dataProviderInfo.tabs2.indexOf('Projects') != -1"
|
||||
(click)="search('projectsTab', 1, 10); activeTab='Projects'">
|
||||
<a class="uk-accordion-title" href="#">Projects
|
||||
<!-- <span class="uk-badge uk-badge-notification"> -->
|
||||
({{fetchProjects.searchUtils.totalResults | number}})
|
||||
<!-- </span> -->
|
||||
</a>
|
||||
<div class="uk-accordion-content">
|
||||
<projectsTab *ngIf="activeTab=='Projects'"
|
||||
[paramsForSearchLink]="paramsForSearchLink"
|
||||
[fetchProjects]="fetchProjects" [(properties)]=properties>
|
||||
</projectsTab>
|
||||
</div>
|
||||
</li>
|
||||
<li *ngIf="dataProviderInfo.tabs2.indexOf('Content Providers') != -1"
|
||||
(click)="search('datasourcesTab', 1, 10); activeTab='Content Providers'">
|
||||
<a class="uk-accordion-title" href="#">Content Providers
|
||||
<!-- <span class="uk-badge uk-badge-notification"> -->
|
||||
({{fetchDataproviders.searchUtils.totalResults | number}})
|
||||
<!-- </span> -->
|
||||
</a>
|
||||
<div class="uk-accordion-content">
|
||||
<datasourcesTab *ngIf="activeTab=='Content Providers'"
|
||||
[paramsForSearchLink]="paramsForSearchLink"
|
||||
[fetchDataproviders]="fetchDataproviders" [(properties)]=properties>
|
||||
</datasourcesTab>
|
||||
</div>
|
||||
</li>
|
||||
<li *ngIf="dataProviderInfo.tabs2.indexOf('Organizations') != -1"
|
||||
(click)="search('organizationsTab', 1, 10); activeTab='Organizations'">
|
||||
<a class="uk-accordion-title" href="#">Organizations
|
||||
<!-- <span class="uk-badge uk-badge-notification"> -->
|
||||
({{dataProviderInfo.organizations.length | number}})
|
||||
<!-- </span> -->
|
||||
</a>
|
||||
<div class="uk-accordion-content">
|
||||
<organizationsTab *ngIf="activeTab=='Organizations'"
|
||||
[organizations]="dataProviderInfo.organizations">
|
||||
</organizationsTab>
|
||||
</div>
|
||||
</li>
|
||||
<li *ngIf="dataProviderInfo.tabs2.indexOf('Related Content Providers') != -1"
|
||||
(click)="search('relatedDatasourcesTab', 1, 10); activeTab='Related Content Providers'">
|
||||
<a class="uk-accordion-title" href="#">Related Content Providers</a>
|
||||
<div class="uk-accordion-content">
|
||||
<relatedDatasourcesTab *ngIf="activeTab=='Related Content Providers'"
|
||||
[dataproviderId]="datasourceId"
|
||||
[results]="dataProviderInfo.relatedDatasources"
|
||||
[loading]="loadingRelatedDatasources"
|
||||
[fetchPublications]="fetchAggregatorsPublications"
|
||||
[fetchDatasets]="fetchAggregatorsDatasets"
|
||||
[fetchSoftware]="fetchAggregatorsSoftware"
|
||||
[fetchOrps]="fetchAggregatorsOrps"
|
||||
[(properties)]=properties>
|
||||
</relatedDatasourcesTab>
|
||||
</div>
|
||||
</li>
|
||||
<li *ngIf="dataProviderInfo.tabs2.indexOf('Statistics') != -1"
|
||||
(click)="search('statisticsTab', 1, 10); activeTab='Statistics'">
|
||||
<a class="uk-accordion-title" href="#">Statistics</a>
|
||||
<div class="uk-accordion-content">
|
||||
<div *ngIf="activeTab=='Statistics' && statsClicked">
|
||||
|
||||
<!-- <errorMessages [status]="[fetchPublications.searchUtils.status, fetchDatasets.searchUtils.status]" [type]="'statistics'" tab_error_class=true></errorMessages>
|
||||
|
||||
<div *ngIf="(fetchPublications.searchUtils.status == errorCodes.DONE || fetchDatasets.searchUtils.status == errorCodes.DONE)">
|
||||
<p class="uk-text-bold">Latest Research Result Timeline</p>
|
||||
<i-frame [url]=docsTimelineUrl width="100%" height="350"></i-frame>
|
||||
<p class="uk-text-bold">Research Result Types</p>
|
||||
<i-frame [url]=docsTypesUrl width="100%" height="350"></i-frame>
|
||||
</div>
|
||||
|
||||
|
||||
<div *ngIf="fetchPublications.searchUtils.totalResults > 0 || (fetchDatasets.searchUtils.totalResults > 0)">
|
||||
|
||||
<p class="uk-text-bold">Funders in Research Results of content provider</p>
|
||||
<i-frame [url]=docsFunderUrl width="100%" height="350"></i-frame>
|
||||
|
||||
</div>
|
||||
<div *ngIf="fetchPublications.searchUtils.totalResults > 0 ">
|
||||
<p class="uk-text-bold">Projects with most Publications</p>
|
||||
<i-frame [url]=pubsProjectsUrl width="100%" height="350"></i-frame>
|
||||
</div>
|
||||
<div *ngIf="(fetchDatasets.searchUtils.totalResults > 0)">
|
||||
<div>
|
||||
<p class="uk-text-bold">Projects with most Research Data</p>
|
||||
<i-frame [url]=dataProjectsUrl width="100%" height="350"></i-frame>
|
||||
</div>
|
||||
</div> -->
|
||||
<statisticsTab [fetchPublications]="fetchPublications" [fetchDatasets]="fetchDatasets"
|
||||
[datasourceId]="datasourceId"></statisticsTab>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
||||
<li *ngIf="dataProviderInfo.tabs2.indexOf('Metrics') != -1"
|
||||
(click)="search('metricsTab', 1, 10); activeTab='Metrics'">
|
||||
<a class="uk-accordion-title" href="#">Metrics</a>
|
||||
<div class="uk-accordion-content">
|
||||
<metrics *ngIf="activeTab=='Metrics'" [pageViews]="pageViews"
|
||||
[id]="datasourceId" [entityType]="'datasources'" [entity]="'Content Provider'"
|
||||
(metricsResults)="metricsResults($event)" [(properties)]=properties>
|
||||
</metrics>
|
||||
<i-frame *ngIf="activeTab=='Metrics' && metricsClicked && totalViews > 0"
|
||||
[url]=viewsFrameUrl width="100%" height="250">
|
||||
</i-frame>
|
||||
<i-frame *ngIf="activeTab=='Metrics' && metricsClicked && totalDownloads > 0"
|
||||
[url]=downloadsFrameUrl width="100%" height="250">
|
||||
</i-frame>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
<!-- Description -->
|
||||
<div *ngIf="dataProviderInfo.description" class="uk-margin-bottom">
|
||||
<div class="uk-text-justify uk-text-small uk-height-max-medium uk-overflow-auto">
|
||||
<span class="uk-text-muted">Description: </span>
|
||||
<span>{{dataProviderInfo.description.substring(0, showNumDescription)}}</span>
|
||||
<span *ngIf="showNumDescription == thresholdDescription &&
|
||||
dataProviderInfo.description.length > thresholdDescription">...</span>
|
||||
</div>
|
||||
<div *ngIf="showNumDescription == thresholdDescription &&
|
||||
dataProviderInfo.description.length > thresholdDescription" class="uk-text-right">
|
||||
<a (click)="showNumDescription = dataProviderInfo.description.length;">
|
||||
View more
|
||||
</a>
|
||||
</div>
|
||||
<div *ngIf="dataProviderInfo.description && showNumDescription > thresholdDescription"
|
||||
class="uk-text-right">
|
||||
<a (click)="showNumDescription = thresholdDescription;">
|
||||
View less
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Subjects -->
|
||||
<div *ngIf="dataProviderInfo.subjects && dataProviderInfo.subjects.length > 0" class="uk-margin-bottom">
|
||||
<div class="uk-text-small uk-height-max-medium uk-overflow-auto">
|
||||
<span class="uk-text-muted">Subjects: </span>
|
||||
<!-- {{dataProviderInfo.countries.join(", ")}}-->
|
||||
<span *ngFor="let subject of dataProviderInfo.subjects.slice(0, showNumSubjects) let i=index">
|
||||
<span>{{subject}}</span>
|
||||
<span *ngIf="(i < dataProviderInfo.subjects.length-1)">, </span>
|
||||
</span>
|
||||
<span *ngIf="showNumSubjects == thresholdSubjects && dataProviderInfo.organizations.length > thresholdSubjects"> ... </span>
|
||||
</div>
|
||||
<div *ngIf="showNumSubjects == thresholdSubjects && dataProviderInfo.organizations.length > thresholdSubjects"
|
||||
class="uk-width-1-1 uk-text-right">
|
||||
<a (click)="showNumSubjects = dataProviderInfo.subjects.length;">
|
||||
View all {{dataProviderInfo.subjects.length | number}} subjects
|
||||
</a>
|
||||
</div>
|
||||
<div *ngIf="showNumSubjects > thresholdSubjects" class="uk-width-1-1 uk-text-right">
|
||||
<a (click)="showNumSubjects = thresholdSubjects;">View less subjects</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <span *ngIf="dataProviderInfo.type" class="uk-label custom-label label-type label-dataprovider "-->
|
||||
<!-- title="Type">{{dataProviderInfo.type}}</span>{{" "}}-->
|
||||
<!-- <span *ngIf="dataProviderInfo.compatibility" class="uk-label custom-label label-compatibility "-->
|
||||
<!-- title="Compatibility">-->
|
||||
<!-- <a *ngIf="!dataProviderInfo.compatibility.name && dataProviderInfo.compatibility.id"-->
|
||||
<!-- [queryParams]="{datasourceId: dataProviderInfo.compatibility.id}" routerLinkActive="router-link-active"-->
|
||||
<!-- routerLink="/search/dataprovider">-->
|
||||
<!-- {{dataProviderInfo.compatibility.info}}-->
|
||||
<!-- </a>-->
|
||||
<!-- <span *ngIf="dataProviderInfo.compatibility.name || !dataProviderInfo.compatibility.id">-->
|
||||
<!-- {{dataProviderInfo.compatibility.info}}-->
|
||||
<!-- </span>-->
|
||||
<!-- <a *ngIf="dataProviderInfo.compatibility.name && dataProviderInfo.compatibility.id"-->
|
||||
<!-- [queryParams]="{datasourceId: dataProviderInfo.compatibility.id}" routerLinkActive="router-link-active"-->
|
||||
<!-- routerLink="/search/dataprovider">-->
|
||||
<!-- {{dataProviderInfo.compatibility.name}}-->
|
||||
<!-- </a>-->
|
||||
<!-- <span *ngIf="dataProviderInfo.compatibility.name && !dataProviderInfo.compatibility.id">-->
|
||||
<!-- {{dataProviderInfo.compatibility.name}}-->
|
||||
<!-- </span>-->
|
||||
<!-- </span>{{" "}}-->
|
||||
<!-- <span *ngIf="dataProviderInfo.aggregationStatus && dataProviderInfo.aggregationStatus.fulltexts && dataProviderInfo.aggregationStatus.fulltexts > 0"-->
|
||||
<!-- class="uk-label custom-label label-type label-dataprovider ">OpenAIRE Text Mining</span>{{" "}}-->
|
||||
|
||||
<!-- <ul class="uk-list">-->
|
||||
<!-- <showPublisher [properties]="properties"-->
|
||||
<!-- [journal]="dataProviderInfo.journal"></showPublisher>-->
|
||||
<!-- <li-->
|
||||
<!-- *ngIf="dataProviderInfo.aggregationStatus && dataProviderInfo.aggregationStatus.fundedContent && dataProviderInfo.aggregationStatus.fundedContent != -1">-->
|
||||
<!-- <span class="uk-text-bold">Results with funding information: </span>-->
|
||||
<!-- {{dataProviderInfo.aggregationStatus.fundedContent | number}}-->
|
||||
<!-- </li>-->
|
||||
<!-- <li-->
|
||||
<!-- *ngIf="dataProviderInfo.aggregationStatus && dataProviderInfo.aggregationStatus.fulltexts && dataProviderInfo.aggregationStatus.fulltexts != -1">-->
|
||||
<!-- <span class="uk-text-bold">Collected full-texts: </span>-->
|
||||
<!-- {{dataProviderInfo.aggregationStatus.fulltexts | number}}-->
|
||||
<!-- </li>-->
|
||||
<!-- <li-->
|
||||
<!-- *ngIf="dataProviderInfo.aggregationStatus && dataProviderInfo.aggregationStatus.lastUpdateDate && dataProviderInfo.aggregationStatus.lastUpdateDate != null">-->
|
||||
<!-- <span class="uk-text-bold">Last update of records in OpenAIRE: </span>-->
|
||||
<!-- {{dataProviderInfo.aggregationStatus.lastUpdateDate | date}}-->
|
||||
<!-- </li>-->
|
||||
<!-- <li *ngIf="dataProviderInfo.oaiPmhURL"><span class="uk-text-bold">OAI-PMH: </span>-->
|
||||
<!-- <span class="uk-button-text">-->
|
||||
<!-- <a target="_blank" href="{{dataProviderInfo.oaiPmhURL}}">-->
|
||||
<!-- {{dataProviderInfo.oaiPmhURL}}-->
|
||||
<!-- </a>-->
|
||||
<!-- </span>-->
|
||||
|
||||
<!-- </li>-->
|
||||
<!-- <li *ngIf="dataProviderInfo.openDoarId">-->
|
||||
<!-- <span class="uk-button-text">-->
|
||||
<!-- <a target="_blank" href="{{properties.openDoarURL+dataProviderInfo.openDoarId}}">-->
|
||||
<!-- Detailed content provider information (OpenDOAR)-->
|
||||
<!-- </a>-->
|
||||
<!-- </span>-->
|
||||
|
||||
<!-- </li>-->
|
||||
<!-- <li *ngIf="dataProviderInfo.r3DataId">-->
|
||||
<!-- <span class="uk-button-text">-->
|
||||
<!-- <a target="_blank" href="{{properties.r3DataURL+dataProviderInfo.r3DataId}}">-->
|
||||
<!-- Detailed content provider information (Re3data)-->
|
||||
<!-- </a>-->
|
||||
<!-- </span>-->
|
||||
|
||||
<!-- </li>-->
|
||||
|
||||
<!-- <li *ngIf="dataProviderInfo.countries != undefined && dataProviderInfo.countries.length > 0"><span-->
|
||||
<!-- class="uk-text-bold">Countries: </span>{{dataProviderInfo.countries.join(", ")}}</li>-->
|
||||
<!-- </ul>-->
|
||||
|
||||
<!-- && dataProviderInfo.tabs2 && dataProviderInfo.tabs2.length > 0-->
|
||||
<div *ngIf="showTabs"
|
||||
class="uk-margin-medium-top">
|
||||
<!-- *ngIf="dataProviderInfo.tabs2.indexOf('Statistics') != -1 || dataProviderInfo.tabs2.indexOf('Related Content Providers') != -1"-->
|
||||
<div
|
||||
class="uk-margin-top simple-buttons uk-flex uk-flex-middle">
|
||||
<!-- *ngIf="dataProviderInfo.tabs2.indexOf('Related Content Providers') != -1"-->
|
||||
<div
|
||||
(click)="openRelatedDatasources()" class="clickable uk-margin-right">
|
||||
<span class="uk-text-middle">Related Content Providers</span>
|
||||
</div>
|
||||
<!-- *ngIf="dataProviderInfo.tabs2.indexOf('Statistics') != -1"-->
|
||||
<div
|
||||
(click)="openStatistics()" class="clickable uk-margin-right">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" height="24" viewBox="0 0 24 24" width="24">
|
||||
<path d="M0 0h24v24H0z" fill="none"></path>
|
||||
<path id="statistics-bars" d="M10 20h4V4h-4v16zm-6 0h4v-8H4v8zM16 9v11h4V9h-4z"></path>
|
||||
</svg>
|
||||
<span class="uk-text-middle space">View statistics</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ||-->
|
||||
<!-- dataProviderInfo.tabs2.indexOf('Related Content Providers') != -1-->
|
||||
|
||||
<!-- *ngIf="dataProviderInfo.tabs2.indexOf('Publications') != -1 ||-->
|
||||
<!-- dataProviderInfo.tabs2.indexOf('Research Data') != -1 ||-->
|
||||
<!-- dataProviderInfo.tabs2.indexOf('Software') != -1 ||-->
|
||||
<!-- dataProviderInfo.tabs2.indexOf('Other Research Products') != -1 ||-->
|
||||
<!-- dataProviderInfo.tabs2.indexOf('Projects') != -1 ||-->
|
||||
<!-- dataProviderInfo.tabs2.indexOf('Content Providers') != -1 "-->
|
||||
<div
|
||||
class="uk-margin-top advanced-buttons uk-grid-small uk-child-width-1-4@s uk-child-width-1-2"
|
||||
uk-height-match="target: .target; row: false"
|
||||
uk-grid>
|
||||
<!-- && dataProviderInfo.relatedDatasources && dataProviderInfo.relatedDatasources.size > 0-->
|
||||
<!-- <div *ngIf="dataProviderInfo.tabs2.indexOf('Related Content Providers') != -1-->
|
||||
<!-- ">-->
|
||||
<!-- <div class="clickable" (click)="openRelatedDatasources()">-->
|
||||
<!-- <div class="header target uk-text-bold">Related Content Providers</div>-->
|
||||
<!-- <div class="footer target uk-position-relative">-->
|
||||
<!--<!– <span class="uk-text-bold uk-position-center">–>-->
|
||||
<!--<!– {{dataProviderInfo.relatedDatasources?.size | number}}–>-->
|
||||
<!--<!– </span>–>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<!-- <ng-container *ngIf="dataProviderInfo.tabs2.indexOf('Publications') != -1">-->
|
||||
<ng-container *ngTemplateOutlet="search_box;
|
||||
context: { fetch: fetchPublications, type: 'publications', typeName: 'Publications',
|
||||
searchLinkToAdvancedPage: properties.searchLinkToAdvancedResults, params: getParamsForSearchLink('publications')}">
|
||||
</ng-container>
|
||||
<!-- <a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf'], ['relprojectid', projectId, type, 'false'])"-->
|
||||
<!-- [routerLink]="properties.searchLinkToAdvancedResults">-->
|
||||
<!-- </ng-container>-->
|
||||
<!-- <ng-container *ngIf="dataProviderInfo.tabs2.indexOf('Research Data') != -1">-->
|
||||
<ng-container *ngTemplateOutlet="search_box;
|
||||
context: { fetch: fetchDatasets, type: 'datasets', typeName: 'Research Data',
|
||||
searchLinkToAdvancedPage: properties.searchLinkToAdvancedResults, params: getParamsForSearchLink('datasets')}">
|
||||
</ng-container>
|
||||
<!-- </ng-container>-->
|
||||
<!-- <ng-container *ngIf="dataProviderInfo.tabs2.indexOf('Software') != -1">-->
|
||||
<ng-container *ngTemplateOutlet="search_box;
|
||||
context: { fetch: fetchSoftware, type: 'software', typeName: 'Software',
|
||||
searchLinkToAdvancedPage: properties.searchLinkToAdvancedResults, params: getParamsForSearchLink('software')}">
|
||||
</ng-container>
|
||||
<!-- </ng-container>-->
|
||||
<!-- <ng-container *ngIf="dataProviderInfo.tabs2.indexOf('Other Research Products') != -1">-->
|
||||
<ng-container *ngTemplateOutlet="search_box;
|
||||
context: { fetch: fetchOrps, type: 'other', typeName: 'Other Research Products',
|
||||
searchLinkToAdvancedPage: properties.searchLinkToAdvancedResults, params: getParamsForSearchLink('other')}">
|
||||
</ng-container>
|
||||
<!-- </ng-container>-->
|
||||
<!-- <ng-container *ngIf="dataProviderInfo.tabs2.indexOf('Projects') != -1">-->
|
||||
<ng-container *ngTemplateOutlet="search_box;
|
||||
context: { fetch: fetchProjects, type: 'project', typeName: 'Projects',
|
||||
searchLinkToAdvancedPage: properties.searchLinkToAdvancedProjects, params: getParamsForSearchLink()}">
|
||||
</ng-container>
|
||||
<!-- </ng-container>-->
|
||||
<!-- <ng-container *ngIf="dataProviderInfo.tabs2.indexOf('Content Providers') != -1">-->
|
||||
<ng-container *ngTemplateOutlet="search_box;
|
||||
context: { fetch: fetchDataproviders, type: 'other', typeName: 'Content Providers',
|
||||
searchLinkToAdvancedPage: properties.searchLinkToAdvancedDataProviders, params: getParamsForSearchLink()}">
|
||||
</ng-container>
|
||||
<!-- </ng-container>-->
|
||||
</div>
|
||||
</div>
|
||||
<div class="uk-margin-small-top uk-flex uk-flex-bottom">
|
||||
<img src="assets/common-assets/graph.svg" style="opacity: 0.4">
|
||||
<span class="uk-margin-small-left uk-text-small uk-text-baseline uk-text-muted">
|
||||
Powered by OpenAIRE Open Research Graph
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div *ngIf="showTabs">-->
|
||||
<!-- <ul class="custom-accordion" uk-accordion *ngIf="dataProviderInfo.tabs2 != undefined">-->
|
||||
|
||||
<!-- <li *ngIf="dataProviderInfo.tabs2.indexOf('Publications') != -1"-->
|
||||
<!-- (click)="search('publicationsTab', 1, 10); activeTab='Publications'">-->
|
||||
<!-- <a class="uk-accordion-title" href="#">Publications-->
|
||||
<!-- <!– <span class="uk-badge uk-badge-notification"> –>-->
|
||||
<!-- ({{fetchPublications.searchUtils.totalResults | number}})-->
|
||||
<!-- <!– </span> –>-->
|
||||
<!-- </a>-->
|
||||
<!-- <div class="uk-accordion-content">-->
|
||||
<!-- <publicationsTab *ngIf="activeTab=='Publications'"-->
|
||||
<!-- [paramsForSearchLink]="paramsForSearchLink"-->
|
||||
<!-- [fetchPublications]="fetchPublications" [(properties)]=properties>-->
|
||||
<!-- </publicationsTab>-->
|
||||
<!-- </div>-->
|
||||
<!-- </li>-->
|
||||
<!-- <li *ngIf="dataProviderInfo.tabs2.indexOf('Research Data') != -1"-->
|
||||
<!-- (click)="search('datasetsTab', 1, 10); activeTab='Research Data'">-->
|
||||
<!-- <a class="uk-accordion-title" href="#">Research Data-->
|
||||
<!-- <!– <span class="uk-badge uk-badge-notification"> –>-->
|
||||
<!-- ({{fetchDatasets.searchUtils.totalResults | number}})-->
|
||||
<!-- <!– </span> –>-->
|
||||
<!-- </a>-->
|
||||
<!-- <div class="uk-accordion-content">-->
|
||||
<!-- <p>-->
|
||||
<!-- <datasetsTab *ngIf="activeTab=='Research Data'"-->
|
||||
<!-- [paramsForSearchLink]="paramsForSearchLink"-->
|
||||
<!-- [fetchDatasets]="fetchDatasets" [(properties)]=properties>-->
|
||||
<!-- </datasetsTab>-->
|
||||
<!-- </p>-->
|
||||
<!-- </div>-->
|
||||
<!-- </li>-->
|
||||
|
||||
<!-- <li *ngIf="dataProviderInfo.tabs2.indexOf('Software') != -1"-->
|
||||
<!-- (click)="search('softwareTab', 1, 10); activeTab='Software'">-->
|
||||
<!-- <a class="uk-accordion-title" href="#">Software-->
|
||||
<!-- <!– <span class="uk-badge uk-badge-notification"> –>-->
|
||||
<!-- ({{fetchSoftware.searchUtils.totalResults | number}})-->
|
||||
<!-- <!– </span> –>-->
|
||||
<!-- </a>-->
|
||||
<!-- <div class="uk-accordion-content">-->
|
||||
<!-- <softwareTab *ngIf="activeTab=='Software'"-->
|
||||
<!-- [paramsForSearchLink]="paramsForSearchLink"-->
|
||||
<!-- [fetchSoftware]="fetchSoftware" [(properties)]=properties>-->
|
||||
<!-- </softwareTab>-->
|
||||
<!-- </div>-->
|
||||
<!-- </li>-->
|
||||
|
||||
<!-- <li *ngIf="dataProviderInfo.tabs2.indexOf('Other Research Products') != -1"-->
|
||||
<!-- (click)="search('orpsTab', 1, 10); activeTab='Other Research Products'">-->
|
||||
<!-- <a class="uk-accordion-title" href="#">Other Research Products-->
|
||||
<!-- <!– <span class="uk-badge uk-badge-notification"> –>-->
|
||||
<!-- ({{fetchOrps.searchUtils.totalResults | number}})-->
|
||||
<!-- <!– </span> –>-->
|
||||
<!-- </a>-->
|
||||
<!-- <div class="uk-accordion-content">-->
|
||||
<!-- <orpsTab *ngIf="activeTab=='Other Research Products'"-->
|
||||
<!-- [paramsForSearchLink]="paramsForSearchLink"-->
|
||||
<!-- [fetchOrps]="fetchOrps" [(properties)]=properties>-->
|
||||
<!-- </orpsTab>-->
|
||||
<!-- </div>-->
|
||||
<!-- </li>-->
|
||||
|
||||
<!-- <li *ngIf="dataProviderInfo.tabs2.indexOf('Projects') != -1"-->
|
||||
<!-- (click)="search('projectsTab', 1, 10); activeTab='Projects'">-->
|
||||
<!-- <a class="uk-accordion-title" href="#">Projects-->
|
||||
<!-- <!– <span class="uk-badge uk-badge-notification"> –>-->
|
||||
<!-- ({{fetchProjects.searchUtils.totalResults | number}})-->
|
||||
<!-- <!– </span> –>-->
|
||||
<!-- </a>-->
|
||||
<!-- <div class="uk-accordion-content">-->
|
||||
<!-- <projectsTab *ngIf="activeTab=='Projects'"-->
|
||||
<!-- [paramsForSearchLink]="paramsForSearchLink"-->
|
||||
<!-- [fetchProjects]="fetchProjects" [(properties)]=properties>-->
|
||||
<!-- </projectsTab>-->
|
||||
<!-- </div>-->
|
||||
<!-- </li>-->
|
||||
<!-- <li *ngIf="dataProviderInfo.tabs2.indexOf('Content Providers') != -1"-->
|
||||
<!-- (click)="search('datasourcesTab', 1, 10); activeTab='Content Providers'">-->
|
||||
<!-- <a class="uk-accordion-title" href="#">Content Providers-->
|
||||
<!-- <!– <span class="uk-badge uk-badge-notification"> –>-->
|
||||
<!-- ({{fetchDataproviders.searchUtils.totalResults | number}})-->
|
||||
<!-- <!– </span> –>-->
|
||||
<!-- </a>-->
|
||||
<!-- <div class="uk-accordion-content">-->
|
||||
<!-- <datasourcesTab *ngIf="activeTab=='Content Providers'"-->
|
||||
<!-- [paramsForSearchLink]="paramsForSearchLink"-->
|
||||
<!-- [fetchDataproviders]="fetchDataproviders" [(properties)]=properties>-->
|
||||
<!-- </datasourcesTab>-->
|
||||
<!-- </div>-->
|
||||
<!-- </li>-->
|
||||
<!-- <li *ngIf="dataProviderInfo.tabs2.indexOf('Organizations') != -1"-->
|
||||
<!-- (click)="search('organizationsTab', 1, 10); activeTab='Organizations'">-->
|
||||
<!-- <a class="uk-accordion-title" href="#">Organizations-->
|
||||
<!-- <!– <span class="uk-badge uk-badge-notification"> –>-->
|
||||
<!-- ({{dataProviderInfo.organizations.length | number}})-->
|
||||
<!-- <!– </span> –>-->
|
||||
<!-- </a>-->
|
||||
<!-- <div class="uk-accordion-content">-->
|
||||
<!-- <organizationsTab *ngIf="activeTab=='Organizations'"-->
|
||||
<!-- [organizations]="dataProviderInfo.organizations">-->
|
||||
<!-- </organizationsTab>-->
|
||||
<!-- </div>-->
|
||||
<!-- </li>-->
|
||||
<!-- <li *ngIf="dataProviderInfo.tabs2.indexOf('Related Content Providers') != -1"-->
|
||||
<!-- (click)="search('relatedDatasourcesTab', 1, 10); activeTab='Related Content Providers'">-->
|
||||
<!-- <a class="uk-accordion-title" href="#">Related Content Providers</a>-->
|
||||
<!-- <div class="uk-accordion-content">-->
|
||||
<!-- <relatedDatasourcesTab *ngIf="activeTab=='Related Content Providers'"-->
|
||||
<!-- [dataproviderId]="datasourceId"-->
|
||||
<!-- [results]="dataProviderInfo.relatedDatasources"-->
|
||||
<!-- [loading]="loadingRelatedDatasources"-->
|
||||
<!-- [fetchPublications]="fetchAggregatorsPublications"-->
|
||||
<!-- [fetchDatasets]="fetchAggregatorsDatasets"-->
|
||||
<!-- [fetchSoftware]="fetchAggregatorsSoftware"-->
|
||||
<!-- [fetchOrps]="fetchAggregatorsOrps"-->
|
||||
<!-- [(properties)]=properties>-->
|
||||
<!-- </relatedDatasourcesTab>-->
|
||||
<!-- </div>-->
|
||||
<!-- </li>-->
|
||||
<!-- <li *ngIf="dataProviderInfo.tabs2.indexOf('Statistics') != -1"-->
|
||||
<!-- (click)="search('statisticsTab', 1, 10); activeTab='Statistics'">-->
|
||||
<!-- <a class="uk-accordion-title" href="#">Statistics</a>-->
|
||||
<!-- <div class="uk-accordion-content">-->
|
||||
<!-- <div *ngIf="activeTab=='Statistics' && statsClicked">-->
|
||||
<!-- <statisticsTab [fetchPublications]="fetchPublications" [fetchDatasets]="fetchDatasets"-->
|
||||
<!-- [datasourceId]="datasourceId"></statisticsTab>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </li>-->
|
||||
|
||||
|
||||
<!-- <li *ngIf="dataProviderInfo.tabs2.indexOf('Metrics') != -1"-->
|
||||
<!-- (click)="search('metricsTab', 1, 10); activeTab='Metrics'">-->
|
||||
<!-- <a class="uk-accordion-title" href="#">Metrics</a>-->
|
||||
<!-- <div class="uk-accordion-content">-->
|
||||
<!-- <metrics *ngIf="activeTab=='Metrics'" [pageViews]="pageViews"-->
|
||||
<!-- [id]="datasourceId" [entityType]="'datasources'" [entity]="'Content Provider'"-->
|
||||
<!-- (metricsResults)="metricsResults($event)" [(properties)]=properties>-->
|
||||
<!-- </metrics>-->
|
||||
<!-- <i-frame *ngIf="activeTab=='Metrics' && metricsClicked && totalViews > 0"-->
|
||||
<!-- [url]=viewsFrameUrl width="100%" height="250">-->
|
||||
<!-- </i-frame>-->
|
||||
<!-- <i-frame *ngIf="activeTab=='Metrics' && metricsClicked && totalDownloads > 0"-->
|
||||
<!-- [url]=downloadsFrameUrl width="100%" height="250">-->
|
||||
<!-- </i-frame>-->
|
||||
<!-- </div>-->
|
||||
<!-- </li>-->
|
||||
|
||||
<!-- </ul>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<div class=" uk-width-1-3@m uk-width-1-1@s">
|
||||
<div class="uk-card uk-card-default uk-padding-small">
|
||||
<div>
|
||||
<div class="sideInfoTitle uk-margin-small-bottom uk-margin-small-top">Share - Bookmark</div>
|
||||
<addThis></addThis>
|
||||
</div>
|
||||
<metrics [pageViews]="pageViews" shortView=true
|
||||
[id]="datasourceId" [entityType]="'datasources'" [entity]="'Content Provider'"
|
||||
(metricsResults)="metricsResults($event)" [(properties)]=properties>
|
||||
</metrics>
|
||||
<!-- <metrics [pageViews]="pageViews" shortView=true-->
|
||||
<!-- [id]="datasourceId" [entityType]="'datasources'" [entity]="'Content Provider'"-->
|
||||
<!-- (metricsResults)="metricsResults($event)" [properties]=properties>-->
|
||||
<!-- </metrics>-->
|
||||
<!-- Metrics -->
|
||||
<!-- <div class="uk-margin-top">-->
|
||||
<!-- <div class="sideInfoTitle uk-margin-small-bottom">Metrics</div>-->
|
||||
<!-- <div uk-grid class="uk-child-width-1-3 uk-text-center uk-flex uk-flex-middle">-->
|
||||
<!-- <div></div><!– OpenAIRE Metrics –>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<div class="uk-margin-small-top uk-text-muted uk-text-small uk-text-right">
|
||||
Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
|
||||
[texts]="pageContents['bottom']"></helper>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<feedback *ngIf="dataProviderInfo && properties.environment === 'development'" [dataProviderInfo]="dataProviderInfo"
|
||||
[properties]="properties" [entityType]="'content provider'" [fields]="feedbackFields"
|
||||
[showForm]="showFeedback" (show)="showFeedback = $event"></feedback>
|
||||
<!-- Statistics -->
|
||||
<modal-alert *ngIf="dataProviderInfo && dataProviderInfo.tabs2 && dataProviderInfo.tabs2.indexOf('Statistics') != -1"
|
||||
classBody="uk-width-xxlarge uk-padding-remove-right" #statisticsModal>
|
||||
<landing-header [properties]="properties" [title]="dataProviderInfo.title.name"
|
||||
[subTitle]="(dataProviderInfo.officialName
|
||||
&& dataProviderInfo.title.name !== dataProviderInfo.officialName)?dataProviderInfo.officialName:null"
|
||||
[entityType]="'content provider'"
|
||||
[types]="dataProviderInfo.type ? [dataProviderInfo.type] : null">
|
||||
</landing-header>
|
||||
<div *ngIf="statsClicked" class="uk-margin-medium-top uk-margin-medium-right">
|
||||
<statisticsTab [fetchPublications]="fetchPublications" [fetchDatasets]="fetchDatasets"
|
||||
[datasourceId]="datasourceId"></statisticsTab>
|
||||
</div>
|
||||
</modal-alert>
|
||||
|
||||
<!-- Related Content Providers -->
|
||||
<!-- && dataProviderInfo.relatedDatasources && dataProviderInfo.relatedDatasources.size > 0-->
|
||||
|
||||
<!-- && dataProviderInfo.tabs2 && dataProviderInfo.tabs2.indexOf('Related Content Providers') != -1-->
|
||||
<modal-alert *ngIf="dataProviderInfo"
|
||||
classBody="uk-width-xxlarge uk-padding-remove-right" #relatedDatasourcesModal>
|
||||
<landing-header [properties]="properties" [title]="dataProviderInfo.title.name"
|
||||
[subTitle]="(dataProviderInfo.officialName
|
||||
&& dataProviderInfo.title.name !== dataProviderInfo.officialName)?dataProviderInfo.officialName:null"
|
||||
[entityType]="'content provider'"
|
||||
[types]="dataProviderInfo.type ? [dataProviderInfo.type] : null">
|
||||
</landing-header>
|
||||
<div class="uk-margin-medium-top uk-margin-medium-right">
|
||||
<!-- [fetchPublications]="fetchAggregatorsPublications"-->
|
||||
<!-- [fetchDatasets]="fetchAggregatorsDatasets"-->
|
||||
<!-- [fetchSoftware]="fetchAggregatorsSoftware"-->
|
||||
<!-- [fetchOrps]="fetchAggregatorsOrps"-->
|
||||
<relatedDatasourcesTab
|
||||
[dataproviderId]="datasourceId"
|
||||
[results]="dataProviderInfo.relatedDatasources"
|
||||
[loading]="loadingRelatedDatasources"
|
||||
[fetchResults]="fetchAggregatorsResults"
|
||||
[collectedFromName]="dataProviderInfo.title.name"
|
||||
[properties]=properties
|
||||
[modal]="relatedDatasourcesModal">
|
||||
</relatedDatasourcesTab>
|
||||
</div>
|
||||
</modal-alert>
|
||||
</div>
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import {merge as observableMerge} from 'rxjs';
|
||||
import {Component, Input} from '@angular/core';
|
||||
import {Component, Input, ViewChild} from '@angular/core';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {Meta, Title} from '@angular/platform-browser';
|
||||
|
||||
|
@ -41,6 +41,7 @@ export class DataProviderComponent {
|
|||
|
||||
// Variable to specify requests with either collectedFrom or hostedBy
|
||||
public paramsForSearchLink = {};
|
||||
public resultParamsForSearchLink = {};
|
||||
|
||||
// Metrics tab variables
|
||||
public metricsClicked: boolean;
|
||||
|
@ -58,6 +59,9 @@ export class DataProviderComponent {
|
|||
public dataProjectsUrl: string;
|
||||
public pubsProjectsUrl: string;
|
||||
|
||||
@ViewChild('statisticsModal') statisticsModal;
|
||||
@ViewChild('relatedDatasourcesModal') relatedDatasourcesModal;
|
||||
|
||||
// Variables for publications, research data, projects, content providers, related content providers tabs
|
||||
public fetchPublications: FetchResearchResults;
|
||||
public fetchDatasets: FetchResearchResults;
|
||||
|
@ -69,6 +73,7 @@ export class DataProviderComponent {
|
|||
public fetchAggregatorsDatasets: FetchResearchResults;
|
||||
public fetchAggregatorsSoftware: FetchResearchResults;
|
||||
public fetchAggregatorsOrps: FetchResearchResults;
|
||||
public fetchAggregatorsResults: FetchResearchResults;
|
||||
|
||||
public loadingRelatedDatasources: boolean = true;
|
||||
|
||||
|
@ -90,6 +95,22 @@ export class DataProviderComponent {
|
|||
private reloadDataproviders: boolean = true;
|
||||
private reloadRelatedDatasources: boolean = true;
|
||||
|
||||
// Organizations variables for view more/less functionality
|
||||
public thresholdOrganizations: number = 10;
|
||||
public showNumOrganizations: number = 10;
|
||||
|
||||
// Subjects variables for view more/less functionality
|
||||
public thresholdSubjects: number = 20;
|
||||
public showNumSubjects: number = 20;
|
||||
|
||||
// Description variables for view more/less functionality
|
||||
public thresholdDescription: number = 670;
|
||||
public showNumDescription: number = 670;
|
||||
|
||||
public indexUpdateDate: Date;
|
||||
public showFeedback: boolean = false;
|
||||
public feedbackFields: string [] = ['Name', 'Organizations','Country', 'Other'];
|
||||
|
||||
sub: any;
|
||||
piwiksub: any;
|
||||
subInfo: any;
|
||||
|
@ -121,6 +142,9 @@ export class DataProviderComponent {
|
|||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
if(this.properties.lastIndexUpdate) {
|
||||
this.indexUpdateDate = new Date(this.properties.lastIndexUpdate);
|
||||
}
|
||||
//this.getDivContents();
|
||||
this.getPageContents();
|
||||
this.updateUrl(data.envSpecific.baseLink + this._router.url);
|
||||
|
@ -171,7 +195,7 @@ export class DataProviderComponent {
|
|||
|
||||
private getDataProviderInfo(id: string) {
|
||||
this.warningMessage = '';
|
||||
this.errorMessage = ""
|
||||
this.errorMessage = "";
|
||||
this.showLoading = true;
|
||||
|
||||
this.dataProviderInfo = null;
|
||||
|
@ -284,22 +308,41 @@ export class DataProviderComponent {
|
|||
// return tab.name === 'Publications';
|
||||
//})) {
|
||||
// this.relatedDataprovidersResultsType = 'publications';
|
||||
this.fetchAggregatorsPublications = new FetchResearchResults(this._searchResearchResultsService);
|
||||
//} else {
|
||||
// this.relatedDataprovidersResultsType = 'datasets';
|
||||
this.fetchAggregatorsDatasets = new FetchResearchResults(this._searchResearchResultsService);
|
||||
//}
|
||||
this.fetchAggregatorsSoftware = new FetchResearchResults(this._searchResearchResultsService);
|
||||
this.fetchAggregatorsOrps = new FetchResearchResults(this._searchResearchResultsService);
|
||||
}
|
||||
if (this.dataProviderInfo.resultsBy == "collectedFrom") {
|
||||
//this.paramsForSearchLink = "?collectedFrom="+this.datasourceId+"&co=and";
|
||||
this.paramsForSearchLink = this.routerHelper.createQueryParams(['collectedFrom', 'cl'], [this.datasourceId, 'and']);
|
||||
} else if (this.dataProviderInfo.resultsBy == "hostedBy") {
|
||||
//this.paramsForSearchLink = "?hostedBy="+this.datasourceId+"&ho=and";
|
||||
this.paramsForSearchLink = this.routerHelper.createQueryParams(['hostedBy', 'hs'], [this.datasourceId, 'and']);
|
||||
}
|
||||
|
||||
// this.fetchAggregatorsPublications = new FetchResearchResults(this._searchResearchResultsService);
|
||||
// //} else {
|
||||
// // this.relatedDataprovidersResultsType = 'datasets';
|
||||
// this.fetchAggregatorsDatasets = new FetchResearchResults(this._searchResearchResultsService);
|
||||
// //}
|
||||
// this.fetchAggregatorsSoftware = new FetchResearchResults(this._searchResearchResultsService);
|
||||
// this.fetchAggregatorsOrps = new FetchResearchResults(this._searchResearchResultsService);
|
||||
this.fetchAggregatorsResults = new FetchResearchResults(this._searchResearchResultsService);
|
||||
}
|
||||
// if (this.dataProviderInfo.resultsBy == "collectedFrom") {
|
||||
// //this.paramsForSearchLink = "?collectedFrom="+this.datasourceId+"&co=and";
|
||||
// this.paramsForSearchLink = this.routerHelper.createQueryParams(['f0', 'fv0'], ["collectedfromdatasourceid", this.datasourceId]);
|
||||
// this.resultParamsForSearchLink = this.routerHelper.createQueryParams(['collectedFrom', 'cl', 'qf'], [this.datasourceId, 'and', 'false']);
|
||||
// } else if (this.dataProviderInfo.resultsBy == "hostedBy") {
|
||||
// //this.paramsForSearchLink = "?hostedBy="+this.datasourceId+"&ho=and";
|
||||
// this.paramsForSearchLink = this.routerHelper.createQueryParams(['f0', 'fv0'], ["resulthostingdatasourceid", this.datasourceId]);
|
||||
// this.resultParamsForSearchLink = this.routerHelper.createQueryParams(['hostedBy', 'hs', 'qf'], [this.datasourceId, 'and', 'false']);
|
||||
// }
|
||||
|
||||
}
|
||||
|
||||
public getParamsForSearchLink(type: string = "") {
|
||||
let resultsBy: string = "";
|
||||
// if(this.dataProviderInfo.resultsBy == "collectedFrom") {
|
||||
// resultsBy = "collectedfromdatasourceid"
|
||||
// } else if (this.dataProviderInfo.resultsBy == "hostedBy") {
|
||||
// resultsBy = "resulthostingdatasourceid";
|
||||
// }
|
||||
|
||||
if(type) {
|
||||
return this.routerHelper.createQueryParams(['f0', 'fv0', 'f1', 'fv1', 'type', 'qf'], ["collectedfromdatasourceid", this.datasourceId, "resulthostingdatasourceid,or", this.datasourceId, type, "false"]);
|
||||
} else {
|
||||
return this.routerHelper.createQueryParams(['f0', 'fv0', 'f1', 'fv1'], ["collectedfromdatasourceid", this.datasourceId, "resulthostingdatasourceid,or", this.datasourceId]);
|
||||
}
|
||||
}
|
||||
|
||||
private count(page: number, size: number) {
|
||||
|
@ -427,33 +470,49 @@ export class DataProviderComponent {
|
|||
private searchRelatedDatasources(page: number, size: number) {
|
||||
// Currently no counting is done for this tab. Following condition is always false
|
||||
|
||||
// if (this.reloadRelatedDatasources &&
|
||||
// (this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.LOADING ||
|
||||
// this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.DONE)
|
||||
// &&
|
||||
// (this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.LOADING ||
|
||||
// this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.DONE)
|
||||
// &&
|
||||
// (this.fetchAggregatorsSoftware.searchUtils.status == this.errorCodes.LOADING ||
|
||||
// this.fetchAggregatorsSoftware.searchUtils.status == this.errorCodes.DONE)
|
||||
// &&
|
||||
// (this.fetchAggregatorsOrps.searchUtils.status == this.errorCodes.LOADING ||
|
||||
// this.fetchAggregatorsOrps.searchUtils.status == this.errorCodes.DONE)
|
||||
// ) {
|
||||
// this.relatedDatasourcesSub = observableMerge(this.fetchAggregatorsPublications.requestComplete, this.fetchAggregatorsDatasets.requestComplete, this.fetchAggregatorsSoftware.requestComplete, this.fetchAggregatorsOrps.requestComplete)
|
||||
// .subscribe(
|
||||
// data => {
|
||||
// },
|
||||
// err => {
|
||||
// },
|
||||
// () => {
|
||||
// this.preprocessRelatedDatasources();
|
||||
// }
|
||||
// );
|
||||
//
|
||||
// this.fetchAggregatorsPublications.getAggregatorResults("publication", this.datasourceId, page, size, this.properties);
|
||||
// this.fetchAggregatorsDatasets.getAggregatorResults("dataset", this.datasourceId, page, size, this.properties);
|
||||
// this.fetchAggregatorsSoftware.getAggregatorResults("software", this.datasourceId, page, size, this.properties);
|
||||
// this.fetchAggregatorsOrps.getAggregatorResults("other", this.datasourceId, page, size, this.properties);
|
||||
if (this.reloadRelatedDatasources &&
|
||||
(this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.LOADING ||
|
||||
this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.DONE)
|
||||
&&
|
||||
(this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.LOADING ||
|
||||
this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.DONE)
|
||||
&&
|
||||
(this.fetchAggregatorsSoftware.searchUtils.status == this.errorCodes.LOADING ||
|
||||
this.fetchAggregatorsSoftware.searchUtils.status == this.errorCodes.DONE)
|
||||
&&
|
||||
(this.fetchAggregatorsOrps.searchUtils.status == this.errorCodes.LOADING ||
|
||||
this.fetchAggregatorsOrps.searchUtils.status == this.errorCodes.DONE)) {
|
||||
this.relatedDatasourcesSub = observableMerge(this.fetchAggregatorsPublications.requestComplete, this.fetchAggregatorsDatasets.requestComplete, this.fetchAggregatorsSoftware.requestComplete, this.fetchAggregatorsOrps.requestComplete)
|
||||
.subscribe(
|
||||
data => {
|
||||
},
|
||||
err => {
|
||||
},
|
||||
() => {
|
||||
this.preprocessRelatedDatasources();
|
||||
}
|
||||
)
|
||||
(this.fetchAggregatorsResults.searchUtils.status == this.errorCodes.LOADING ||
|
||||
this.fetchAggregatorsResults.searchUtils.status == this.errorCodes.DONE)
|
||||
) {
|
||||
this.relatedDatasourcesSub = this.fetchAggregatorsResults.requestComplete.subscribe(
|
||||
data => {},
|
||||
err => {},
|
||||
() => {
|
||||
//this.preprocessRelatedDatasources();
|
||||
this.dataProviderInfo.relatedDatasources = this.fetchAggregatorsResults.results;
|
||||
this.loadingRelatedDatasources = false;
|
||||
}
|
||||
);
|
||||
|
||||
this.fetchAggregatorsPublications.getAggregatorResults("publication", this.datasourceId, page, size, this.properties);
|
||||
this.fetchAggregatorsDatasets.getAggregatorResults("dataset", this.datasourceId, page, size, this.properties);
|
||||
this.fetchAggregatorsSoftware.getAggregatorResults("software", this.datasourceId, page, size, this.properties);
|
||||
this.fetchAggregatorsOrps.getAggregatorResults("other", this.datasourceId, page, size, this.properties);
|
||||
this.fetchAggregatorsResults.getAggregatorResults("results", this.datasourceId, page, size, this.properties);
|
||||
} else {
|
||||
this.loadingRelatedDatasources = false;
|
||||
}
|
||||
|
@ -463,77 +522,78 @@ export class DataProviderComponent {
|
|||
}
|
||||
|
||||
private countRelatedDatasources(page: number, size: number) {
|
||||
this.fetchAggregatorsPublications.getAggregatorResults("publication", this.datasourceId, page, size, this.properties);
|
||||
this.fetchAggregatorsDatasets.getAggregatorResults("dataset", this.datasourceId, page, size, this.properties);
|
||||
this.fetchAggregatorsSoftware.getAggregatorResults("software", this.datasourceId, page, size, this.properties);
|
||||
this.fetchAggregatorsOrps.getAggregatorResults("other", this.datasourceId, page, size, this.properties);
|
||||
// this.fetchAggregatorsPublications.getAggregatorResults("publication", this.datasourceId, page, size, this.properties);
|
||||
// this.fetchAggregatorsDatasets.getAggregatorResults("dataset", this.datasourceId, page, size, this.properties);
|
||||
// this.fetchAggregatorsSoftware.getAggregatorResults("software", this.datasourceId, page, size, this.properties);
|
||||
// this.fetchAggregatorsOrps.getAggregatorResults("other", this.datasourceId, page, size, this.properties);
|
||||
this.fetchAggregatorsResults.getAggregatorResults("results", this.datasourceId, page, size, this.properties);
|
||||
}
|
||||
|
||||
|
||||
private preprocessRelatedDatasources() {
|
||||
if (this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.DONE ||
|
||||
this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.DONE ||
|
||||
this.fetchAggregatorsSoftware.searchUtils.status == this.errorCodes.DONE ||
|
||||
this.fetchAggregatorsOrps.searchUtils.status == this.errorCodes.DONE) {
|
||||
this.dataProviderInfo.relatedDatasources = new Map<string, { "name": string, "countPublications": string, "countDatasets": string, "countSoftware": string, "countOrps": string }>();
|
||||
}
|
||||
for (let result of this.fetchAggregatorsPublications.results) {
|
||||
if (!this.dataProviderInfo.relatedDatasources.has(result.id)) {
|
||||
this.dataProviderInfo.relatedDatasources.set(result.id, {
|
||||
"name": result.name,
|
||||
"countPublications": result.count,
|
||||
"countDatasets": "0",
|
||||
"countSoftware": "0",
|
||||
"countOrps": "0"
|
||||
});
|
||||
} else {
|
||||
this.dataProviderInfo.relatedDatasources.get(result.id).countPublications = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countPublications + result.count) + "";
|
||||
}
|
||||
}
|
||||
|
||||
for (let result of this.fetchAggregatorsDatasets.results) {
|
||||
if (!this.dataProviderInfo.relatedDatasources.has(result.id)) {
|
||||
this.dataProviderInfo.relatedDatasources.set(result.id, {
|
||||
"name": result.name,
|
||||
"countPublications": "0",
|
||||
"countDatasets": result.count,
|
||||
"countSoftware": "0",
|
||||
"countOrps": "0"
|
||||
});
|
||||
} else {
|
||||
this.dataProviderInfo.relatedDatasources.get(result.id).countDatasets = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countDatasets + result.count) + "";
|
||||
}
|
||||
}
|
||||
|
||||
for (let result of this.fetchAggregatorsSoftware.results) {
|
||||
if (!this.dataProviderInfo.relatedDatasources.has(result.id)) {
|
||||
this.dataProviderInfo.relatedDatasources.set(result.id, {
|
||||
"name": result.name,
|
||||
"countPublications": "0",
|
||||
"countDatasets": "0",
|
||||
"countSoftware": result.count,
|
||||
"countOrps": "0"
|
||||
});
|
||||
} else {
|
||||
this.dataProviderInfo.relatedDatasources.get(result.id).countSoftware = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countSoftware + result.count) + "";
|
||||
}
|
||||
}
|
||||
|
||||
for (let result of this.fetchAggregatorsOrps.results) {
|
||||
if (!this.dataProviderInfo.relatedDatasources.has(result.id)) {
|
||||
this.dataProviderInfo.relatedDatasources.set(result.id, {
|
||||
"name": result.name,
|
||||
"countPublications": "0",
|
||||
"countDatasets": "0",
|
||||
"countSoftware": "0",
|
||||
"countOrps": result.count
|
||||
});
|
||||
} else {
|
||||
this.dataProviderInfo.relatedDatasources.get(result.id).countOrps = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countOrps + result.count) + "";
|
||||
}
|
||||
}
|
||||
this.loadingRelatedDatasources = false;
|
||||
}
|
||||
// private preprocessRelatedDatasources() {
|
||||
// if (this.fetchAggregatorsPublications.searchUtils.status == this.errorCodes.DONE ||
|
||||
// this.fetchAggregatorsDatasets.searchUtils.status == this.errorCodes.DONE ||
|
||||
// this.fetchAggregatorsSoftware.searchUtils.status == this.errorCodes.DONE ||
|
||||
// this.fetchAggregatorsOrps.searchUtils.status == this.errorCodes.DONE) {
|
||||
// this.dataProviderInfo.relatedDatasources = new Map<string, { "name": string, "countPublications": string, "countDatasets": string, "countSoftware": string, "countOrps": string }>();
|
||||
// }
|
||||
// for (let result of this.fetchAggregatorsPublications.results) {
|
||||
// if (!this.dataProviderInfo.relatedDatasources.has(result.id)) {
|
||||
// this.dataProviderInfo.relatedDatasources.set(result.id, {
|
||||
// "name": result.name,
|
||||
// "countPublications": result.count,
|
||||
// "countDatasets": "0",
|
||||
// "countSoftware": "0",
|
||||
// "countOrps": "0"
|
||||
// });
|
||||
// } else {
|
||||
// this.dataProviderInfo.relatedDatasources.get(result.id).countPublications = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countPublications + result.count) + "";
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// for (let result of this.fetchAggregatorsDatasets.results) {
|
||||
// if (!this.dataProviderInfo.relatedDatasources.has(result.id)) {
|
||||
// this.dataProviderInfo.relatedDatasources.set(result.id, {
|
||||
// "name": result.name,
|
||||
// "countPublications": "0",
|
||||
// "countDatasets": result.count,
|
||||
// "countSoftware": "0",
|
||||
// "countOrps": "0"
|
||||
// });
|
||||
// } else {
|
||||
// this.dataProviderInfo.relatedDatasources.get(result.id).countDatasets = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countDatasets + result.count) + "";
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// for (let result of this.fetchAggregatorsSoftware.results) {
|
||||
// if (!this.dataProviderInfo.relatedDatasources.has(result.id)) {
|
||||
// this.dataProviderInfo.relatedDatasources.set(result.id, {
|
||||
// "name": result.name,
|
||||
// "countPublications": "0",
|
||||
// "countDatasets": "0",
|
||||
// "countSoftware": result.count,
|
||||
// "countOrps": "0"
|
||||
// });
|
||||
// } else {
|
||||
// this.dataProviderInfo.relatedDatasources.get(result.id).countSoftware = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countSoftware + result.count) + "";
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// for (let result of this.fetchAggregatorsOrps.results) {
|
||||
// if (!this.dataProviderInfo.relatedDatasources.has(result.id)) {
|
||||
// this.dataProviderInfo.relatedDatasources.set(result.id, {
|
||||
// "name": result.name,
|
||||
// "countPublications": "0",
|
||||
// "countDatasets": "0",
|
||||
// "countSoftware": "0",
|
||||
// "countOrps": result.count
|
||||
// });
|
||||
// } else {
|
||||
// this.dataProviderInfo.relatedDatasources.get(result.id).countOrps = parseInt(this.dataProviderInfo.relatedDatasources.get(result.id).countOrps + result.count) + "";
|
||||
// }
|
||||
// }
|
||||
// this.loadingRelatedDatasources = false;
|
||||
// }
|
||||
|
||||
public metricsResults($event) {
|
||||
this.totalViews = $event.totalViews;
|
||||
|
@ -541,6 +601,26 @@ export class DataProviderComponent {
|
|||
this.pageViews = $event.pageViews;
|
||||
}
|
||||
|
||||
public openStatistics() {
|
||||
this.statsClicked = true;
|
||||
this.statisticsModal.cancelButton = false;
|
||||
this.statisticsModal.okButton = false;
|
||||
this.statisticsModal.alertTitle = "Statistics of";
|
||||
this.statisticsModal.open();
|
||||
}
|
||||
|
||||
public openRelatedDatasources() {
|
||||
this.searchRelatedDatasources(1, 0);
|
||||
this.relatedDatasourcesModal.cancelButton = false;
|
||||
this.relatedDatasourcesModal.okButton = false;
|
||||
this.relatedDatasourcesModal.alertTitle = "Related content providers of";
|
||||
this.relatedDatasourcesModal.open();
|
||||
}
|
||||
|
||||
public removeUnknown(array: string[]): string[] {
|
||||
return array.filter(value => value.toLowerCase() !== 'unknown');
|
||||
}
|
||||
|
||||
private handleError(message: string, error) {
|
||||
console.error("Content Provider Landing Page: " + message, error);
|
||||
}
|
||||
|
|
|
@ -34,13 +34,19 @@ import {Schema2jsonldModule} from '../../sharedComponents/schema2jsonld/schema2j
|
|||
import { SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
|
||||
import {ShowPublisherModule} from "../landing-utils/showPublisher.module";
|
||||
import {HelperModule} from "../../utils/helper/helper.module";
|
||||
import {LandingHeaderModule} from "../landing-utils/landing-header/landing-header.module";
|
||||
import {AlertModalModule} from "../../utils/modal/alertModal.module";
|
||||
import {NoLoadPaging} from "../../searchPages/searchUtils/no-load-paging.module";
|
||||
import {FeedbackModule} from "../feedback/feedback.module";
|
||||
|
||||
@NgModule({
|
||||
imports:
|
||||
[CommonModule, FormsModule, RouterModule,
|
||||
TabResultModule, IFrameModule, ErrorMessagesModule, MetricsModule, LandingModule,
|
||||
DataProvidersServiceModule, ProjectsServiceModule, SearchResearchResultsServiceModule,
|
||||
PagingModule, Schema2jsonldModule, SEOServiceModule, ShowPublisherModule, HelperModule],
|
||||
PagingModule, Schema2jsonldModule, SEOServiceModule, ShowPublisherModule, HelperModule,
|
||||
LandingHeaderModule, AlertModalModule, NoLoadPaging, FeedbackModule
|
||||
],
|
||||
declarations:
|
||||
[PublicationsTabComponent, DatasetsTabComponent, StatisticsTabComponent, ProjectsTabComponent, DatasourcesTabComponent, OrganizationsTabComponent,
|
||||
RelatedDatasourcesTabComponent, DataProviderComponent, SoftwareTabComponent, OrpsTabComponent
|
||||
|
|
|
@ -109,6 +109,21 @@ export class DataProviderService {
|
|||
this.dataProviderInfo.originalId = originalId;
|
||||
}
|
||||
}
|
||||
|
||||
this.dataProviderInfo.subjects = [];
|
||||
length = Array.isArray(data[0]['subjects']) ? data[0]['subjects'].length : 1;
|
||||
for(let i=0; i<length; i++) {
|
||||
let subject = Array.isArray(data[0]['subjects']) ? data[0]['subjects'][i] :data[0]['subjects'];
|
||||
if(subject && subject.content) {
|
||||
this.dataProviderInfo.subjects.push(subject.content);
|
||||
}
|
||||
}
|
||||
|
||||
if(!Array.isArray(data[0]['description'])) {
|
||||
this.dataProviderInfo.description = (data[0]['description']) ? String(data[0]['description']) : "";
|
||||
} else {
|
||||
this.dataProviderInfo.description = (data[0]['description'][0]) ? String(data[0]['description'][0]) : "";
|
||||
}
|
||||
}
|
||||
|
||||
if(data[1] != null) {
|
||||
|
@ -141,8 +156,6 @@ export class DataProviderService {
|
|||
this.dataProviderInfo.tabs.push({"name": "Content Providers", "content": "datasourcesTab"});
|
||||
this.dataProviderInfo.tabs2.push("Content Providers");
|
||||
}
|
||||
this.dataProviderInfo.tabs.push({"name": "Organizations", "content": "organizationsTab"});
|
||||
this.dataProviderInfo.tabs2.push("Organizations");
|
||||
|
||||
if(this.dataProviderInfo.tabsInTypes.relatedDatasourcesTab.has(data[1].classid)) {
|
||||
this.dataProviderInfo.tabs.push({"name": "Related Content Providers", "content": "relatedDatasourcesTab"});
|
||||
|
@ -219,7 +232,7 @@ export class DataProviderService {
|
|||
}
|
||||
|
||||
this.dataProviderInfo.organizations[counter] = {"name": "", "id": ""};
|
||||
this.dataProviderInfo.organizations[counter]['name'] = mydata.legalname;
|
||||
this.dataProviderInfo.organizations[counter]['name'] = (mydata.legalname ? mydata.legalname : "[no title available");
|
||||
this.dataProviderInfo.organizations[counter]['id'] = mydata['to'].content;
|
||||
|
||||
if(mydata.country != '' && mydata['country'].classname != '') {
|
||||
|
|
|
@ -5,110 +5,185 @@ import { FetchResearchResults } from '../../utils/fetchEntitiesClasses/fetchRese
|
|||
import { ErrorCodes} from '../../utils/properties/errorCodes';
|
||||
import { RouterHelper } from '../../utils/routerHelper.class';
|
||||
import { EnvProperties } from '../../utils/properties/env-properties';
|
||||
import {AlertModal} from "../../utils/modal/alert";
|
||||
|
||||
@Component({
|
||||
selector: 'relatedDatasourcesTab',
|
||||
template: `
|
||||
<errorMessages [status]="[fetchPublications.searchUtils.status, fetchDatasets.searchUtils.status, fetchSoftware.searchUtils.status, fetchOrps.searchUtils.status]"
|
||||
[type]="'related content providers'" tab_error_class=true>
|
||||
</errorMessages>
|
||||
selector: 'relatedDatasourcesTab',
|
||||
template: `
|
||||
<!-- <errorMessages [status]="[fetchPublications.searchUtils.status, fetchDatasets.searchUtils.status, fetchSoftware.searchUtils.status, fetchOrps.searchUtils.status]"-->
|
||||
<!-- [type]="'related content providers'" tab_error_class=true>-->
|
||||
<!-- </errorMessages>-->
|
||||
|
||||
<div *ngIf="(fetchPublications.searchUtils.status == errorCodes.DONE || fetchDatasets.searchUtils.status == errorCodes.DONE
|
||||
|| fetchSoftware.searchUtils.status == errorCodes.DONE || fetchOrps.searchUtils.status == errorCodes.DONE)
|
||||
&& !loading">
|
||||
<div *ngIf="results && results.size > pageSize" class="uk-margin">
|
||||
<span class="uk-text-bold">{{results.size | number}} related content providers, page {{page | number}} of {{totalPages(results.size) | number}}</span>
|
||||
<paging-no-load class="uk-float-right" [currentPage]="page" [totalResults]="results.size" [size]="pageSize" (pageChange)="updatePage($event)"></paging-no-load>
|
||||
</div>
|
||||
<!-- <div *ngIf="(fetchPublications.searchUtils.status == errorCodes.DONE || fetchDatasets.searchUtils.status == errorCodes.DONE-->
|
||||
<!-- || fetchSoftware.searchUtils.status == errorCodes.DONE || fetchOrps.searchUtils.status == errorCodes.DONE)-->
|
||||
<!-- && !loading">-->
|
||||
<!--<!– <div *ngIf="results && results.size > pageSize" class="uk-margin">–>-->
|
||||
<!--<!– <span class="uk-text-bold">{{results.size | number}} related content providers, page {{page | number}} of {{totalPages(results.size) | number}}</span>–>-->
|
||||
<!--<!– <paging-no-load class="uk-float-right" [currentPage]="page" [totalResults]="results.size" [size]="pageSize" (pageChange)="updatePage($event)"></paging-no-load>–>-->
|
||||
<!--<!– </div>–>-->
|
||||
<!-- <no-load-paging *ngIf="results.size >pageSize"-->
|
||||
<!-- [type]="'content providers'"-->
|
||||
<!-- (pageChange)="updatePage($event)"-->
|
||||
<!-- [page]="page" [pageSize]="pageSize"-->
|
||||
<!-- [totalResults]="results.size">-->
|
||||
<!-- </no-load-paging>-->
|
||||
<!-- -->
|
||||
<!-- <table class="uk-table uk-table-striped">-->
|
||||
<!-- <thead>-->
|
||||
<!-- <tr>-->
|
||||
<!-- <th class="uk-text-center">Content Provider Name</th>-->
|
||||
<!-- <th *ngIf="fetchPublications.results.length > 0 || fetchPublications.searchUtils.status == errorCodes.ERROR"-->
|
||||
<!-- class="uk-text-center">-->
|
||||
<!-- Number of Publications-->
|
||||
<!-- </th>-->
|
||||
<!-- <th *ngIf="fetchDatasets.results.length > 0 || fetchDatasets.searchUtils.status == errorCodes.ERROR"-->
|
||||
<!-- class="uk-text-center">-->
|
||||
<!-- Number of Research Data-->
|
||||
<!-- </th>-->
|
||||
<!-- <th *ngIf="fetchSoftware.results.length > 0 || fetchSoftware.searchUtils.status == errorCodes.ERROR"-->
|
||||
<!-- class="uk-text-center">-->
|
||||
<!-- Number of Software-->
|
||||
<!-- </th>-->
|
||||
<!-- <th *ngIf="fetchOrps.results.length > 0 || fetchOrps.searchUtils.status == errorCodes.ERROR"-->
|
||||
<!-- class="uk-text-center">-->
|
||||
<!-- Number of Other Research Products-->
|
||||
<!-- </th>-->
|
||||
<!-- </tr>-->
|
||||
<!-- </thead>-->
|
||||
<!-- <tbody>-->
|
||||
<!-- <ng-container *ngIf="results">-->
|
||||
<!-- <ng-container *ngFor="let id of getKeys(results); let i=index">-->
|
||||
<!-- <tr *ngIf="i>=(page-1)*pageSize && i<page*pageSize">-->
|
||||
<!-- <td class="uk-text-center">-->
|
||||
<!-- <a [queryParams]="{datasourceId: id}" routerLinkActive="router-link-active" routerLink="/search/dataprovider" (click)="onLinkClick()">-->
|
||||
<!-- {{results.get(id).name}}-->
|
||||
<!-- </a>-->
|
||||
<!-- </td>-->
|
||||
<!-- <td *ngIf="fetchPublications.results.length > 0" class="uk-text-center">-->
|
||||
<!--<!– *ngIf="results.get(id).countPublications > 0"–>-->
|
||||
<!-- <a -->
|
||||
<!-- [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'f1', 'fv1', 'type', 'qf'], ['resulthostingdatasourceid', id, 'collectedfromdatasourceid', dataproviderId, 'publications', 'false'])"-->
|
||||
<!-- routerLinkActive="router-link-active" [routerLink]="properties.searchLinkToAdvancedResults" (click)="onLinkClick()">-->
|
||||
<!-- {{results.get(id).countPublications | number}}-->
|
||||
<!-- </a>-->
|
||||
<!--<!– <span *ngIf="results.get(id).countPublications <= 0">-</span>–>-->
|
||||
<!-- </td>-->
|
||||
<!-- <td *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR" class="uk-text-center">-</td>-->
|
||||
|
||||
<table class="uk-table uk-table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="uk-text-center">Content Provider Name</th>
|
||||
<th *ngIf="fetchPublications.results.length > 0 || fetchPublications.searchUtils.status == errorCodes.ERROR"
|
||||
class="uk-text-center">
|
||||
Number of Publications
|
||||
</th>
|
||||
<th *ngIf="fetchDatasets.results.length > 0 || fetchDatasets.searchUtils.status == errorCodes.ERROR"
|
||||
class="uk-text-center">
|
||||
Number of Research Data
|
||||
</th>
|
||||
<th *ngIf="fetchSoftware.results.length > 0 || fetchSoftware.searchUtils.status == errorCodes.ERROR"
|
||||
class="uk-text-center">
|
||||
Number of Software
|
||||
</th>
|
||||
<th *ngIf="fetchOrps.results.length > 0 || fetchOrps.searchUtils.status == errorCodes.ERROR"
|
||||
class="uk-text-center">
|
||||
Number of Other Research Products
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<ng-container *ngIf="results">
|
||||
<ng-container *ngFor="let id of getKeys(results); let i=index">
|
||||
<tr *ngIf="i>=(page-1)*pageSize && i<page*pageSize">
|
||||
<td class="uk-text-center">
|
||||
<a [queryParams]="{datasourceId: id}" routerLinkActive="router-link-active" routerLink="/search/dataprovider">
|
||||
{{results.get(id).name}}
|
||||
</a>
|
||||
</td>
|
||||
<td *ngIf="fetchPublications.results.length > 0" class="uk-text-center">
|
||||
<a [queryParams]="routerHelper.createQueryParams(['hostedBy', 'hs', 'collectedFrom', 'cl'], [id, 'and', dataproviderId, 'and'])"
|
||||
routerLinkActive="router-link-active" [routerLink]="linkToSearchPublications">
|
||||
{{results.get(id).countPublications | number}}
|
||||
</a>
|
||||
</td>
|
||||
<td *ngIf="fetchPublications.searchUtils.status == errorCodes.ERROR" class="uk-text-center">-</td>
|
||||
<!-- <td *ngIf="fetchDatasets.results.length > 0" class="uk-text-center">-->
|
||||
<!--<!– *ngIf="results.get(id).countDatasets > 0"–>-->
|
||||
<!-- <a -->
|
||||
<!-- [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'f1', 'fv1', 'type', 'qf'], ['resulthostingdatasourceid', id, 'collectedfromdatasourceid', dataproviderId, 'datasets', 'false'])"-->
|
||||
<!-- routerLinkActive="router-link-active" [routerLink]="properties.searchLinkToAdvancedResults" (click)="onLinkClick()">-->
|
||||
<!-- {{results.get(id).countDatasets | number}}-->
|
||||
<!-- </a>-->
|
||||
<!--<!– <span *ngIf="results.get(id).countDatasets <= 0">-</span>–>-->
|
||||
<!-- </td>-->
|
||||
<!-- <td *ngIf="fetchDatasets.searchUtils.status == errorCodes.ERROR" class="uk-text-center">-</td>-->
|
||||
|
||||
<td *ngIf="fetchDatasets.results.length > 0" class="uk-text-center">
|
||||
<a [queryParams]="routerHelper.createQueryParams(['hostedBy', 'hs', 'collectedFrom', 'cl'], [id, 'and', dataproviderId, 'and'])"
|
||||
routerLinkActive="router-link-active" [routerLink]="linkToSearchResearchData">
|
||||
{{results.get(id).countDatasets | number}}
|
||||
</a>
|
||||
</td>
|
||||
<td *ngIf="fetchDatasets.searchUtils.status == errorCodes.ERROR" class="uk-text-center">-</td>
|
||||
<!-- <td *ngIf="fetchSoftware.results.length > 0" class="uk-text-center">-->
|
||||
<!--<!– *ngIf="results.get(id).countSoftware > 0"–>-->
|
||||
<!-- <a -->
|
||||
<!-- [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'f1', 'fv1', 'type', 'qf'], ['resulthostingdatasourceid', id, 'collectedfromdatasourceid', dataproviderId, 'software', 'false'])"-->
|
||||
<!-- routerLinkActive="router-link-active" [routerLink]="properties.searchLinkToAdvancedResults" (click)="onLinkClick()">-->
|
||||
<!-- {{results.get(id).countSoftware | number}}-->
|
||||
<!-- </a>-->
|
||||
<!--<!– <span *ngIf="results.get(id).countSoftware <= 0">-</span>–>-->
|
||||
<!-- </td>-->
|
||||
<!-- <td *ngIf="fetchSoftware.searchUtils.status == errorCodes.ERROR" class="uk-text-center">-</td>-->
|
||||
|
||||
<td *ngIf="fetchSoftware.results.length > 0" class="uk-text-center">
|
||||
<a [queryParams]="routerHelper.createQueryParams(['hostedBy', 'hs', 'collectedFrom', 'cl'], [id, 'and', dataproviderId, 'and'])"
|
||||
routerLinkActive="router-link-active" [routerLink]="linkToSearchSoftware">
|
||||
{{results.get(id).countSoftware | number}}
|
||||
</a>
|
||||
</td>
|
||||
<td *ngIf="fetchSoftware.searchUtils.status == errorCodes.ERROR" class="uk-text-center">-</td>
|
||||
<!-- <td *ngIf="fetchOrps.results.length > 0" class="uk-text-center">-->
|
||||
<!--<!– *ngIf="results.get(id).countOrps > 0"–>-->
|
||||
<!-- <a -->
|
||||
<!-- [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'f1', 'fv1', 'type', 'qf'], ['resulthostingdatasourceid', id, 'collectedfromdatasourceid', dataproviderId, 'other', 'false'])"-->
|
||||
<!-- routerLinkActive="router-link-active" [routerLink]="properties.searchLinkToAdvancedResults" (click)="onLinkClick()">-->
|
||||
<!-- {{results.get(id).countOrps | number}}-->
|
||||
<!-- </a>-->
|
||||
<!--<!– <span *ngIf="results.get(id).countOrps <= 0">-</span>–>-->
|
||||
<!-- </td>-->
|
||||
<!-- <td *ngIf="fetchOrps.searchUtils.status == errorCodes.ERROR" class="uk-text-center">-</td>-->
|
||||
<!-- </tr>-->
|
||||
<!-- </ng-container>-->
|
||||
<!-- </ng-container>-->
|
||||
<!-- </tbody>-->
|
||||
<!-- </table>-->
|
||||
<!-- </div>-->
|
||||
|
||||
<td *ngIf="fetchOrps.results.length > 0" class="uk-text-center">
|
||||
<a [queryParams]="routerHelper.createQueryParams(['hostedBy', 'hs', 'collectedFrom', 'cl'], [id, 'and', dataproviderId, 'and'])"
|
||||
routerLinkActive="router-link-active" [routerLink]="linkToSearchOrps">
|
||||
{{results.get(id).countOrps | number}}
|
||||
</a>
|
||||
</td>
|
||||
<td *ngIf="fetchOrps.searchUtils.status == errorCodes.ERROR" class="uk-text-center">-</td>
|
||||
</tr>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
`
|
||||
|
||||
<errorMessages [status]="[fetchResults.searchUtils.status]"
|
||||
[type]="'related content providers'" tab_error_class=true>
|
||||
</errorMessages>
|
||||
|
||||
<div *ngIf="fetchResults.searchUtils.status == errorCodes.DONE && !loading">
|
||||
<div class="uk-text-muted uk-text-small uk-margin-bottom">
|
||||
*Only top 100 content providers that host research outcomes and are aggregated by {{collectedFromName}} are shown.
|
||||
</div>
|
||||
<no-load-paging *ngIf="results.length >pageSize"
|
||||
[type]="'content providers'"
|
||||
(pageChange)="updatePage($event)"
|
||||
[page]="page" [pageSize]="pageSize"
|
||||
[totalResults]="results.length">
|
||||
</no-load-paging>
|
||||
|
||||
<table class="uk-table uk-table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th class="uk-text-center">Content Provider Name</th>
|
||||
<th *ngIf="fetchResults.results.length > 0 || fetchResults.searchUtils.status == errorCodes.ERROR"
|
||||
class="uk-text-center">
|
||||
Number of Research Outcomes
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<ng-container *ngIf="results">
|
||||
<ng-container *ngFor="let result of results; let i=index">
|
||||
<tr *ngIf="i>=(page-1)*pageSize && i<page*pageSize">
|
||||
<td class="uk-text-center">
|
||||
<a [queryParams]="{datasourceId: result.id}" routerLinkActive="router-link-active" routerLink="/search/dataprovider"
|
||||
(click)="onLinkClick()">
|
||||
{{result.name}}
|
||||
</a>
|
||||
</td>
|
||||
<td *ngIf="fetchResults.results.length > 0" class="uk-text-center">
|
||||
<a
|
||||
[queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'f1', 'fv1', 'f2', 'fv2', 'qf'], ['collectedfromdatasourceid', dataproviderId, 'resulthostingdatasourceid,or', dataproviderId, 'resulthostingdatasourceid', result.id, 'false'])"
|
||||
routerLinkActive="router-link-active" [routerLink]="properties.searchLinkToAdvancedResults"
|
||||
(click)="onLinkClick()">
|
||||
{{result.count | number}}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
</tbody>
|
||||
</table>
|
||||
<no-load-paging *ngIf="results.length >pageSize"
|
||||
[type]="'content providers'"
|
||||
(pageChange)="updatePage($event)"
|
||||
[page]="page" [pageSize]="pageSize"
|
||||
[totalResults]="results.length">
|
||||
</no-load-paging>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
|
||||
export class RelatedDatasourcesTabComponent {
|
||||
@Input() dataproviderId: string;
|
||||
@Input() fetchPublications : FetchResearchResults;
|
||||
@Input() fetchDatasets : FetchResearchResults;
|
||||
@Input() fetchSoftware : FetchResearchResults;
|
||||
@Input() fetchOrps: FetchResearchResults;
|
||||
// @Input() fetchPublications : FetchResearchResults;
|
||||
// @Input() fetchDatasets : FetchResearchResults;
|
||||
// @Input() fetchSoftware : FetchResearchResults;
|
||||
// @Input() fetchOrps: FetchResearchResults;
|
||||
@Input() fetchResults: FetchResearchResults;
|
||||
|
||||
// true: preprocessing is not over
|
||||
@Input() loading: boolean = true;
|
||||
// Εvery content provider's id is a single key of a map
|
||||
@Input() results: Map<string, {"name": string, "countPublications": string, "countDatasets": string, "countSoftware": string, "countOrps": string}>;
|
||||
//@Input() results: Map<string, {"name": string, "countPublications": string, "countDatasets": string, "countSoftware": string, "countOrps": string}>;
|
||||
@Input() results: {"id": string, "name": string, "count": number}[];
|
||||
@Input() properties:EnvProperties ;
|
||||
|
||||
public linkToSearchPublications: string = "";
|
||||
public linkToSearchResearchData: string = "";
|
||||
public linkToSearchSoftware: string = "";
|
||||
public linkToSearchOrps: string = "";
|
||||
@Input() collectedFromName: string ="[no title available]";
|
||||
@Input() modal: AlertModal;
|
||||
|
||||
public routerHelper:RouterHelper = new RouterHelper();
|
||||
public errorCodes:ErrorCodes = new ErrorCodes();
|
||||
|
@ -118,12 +193,7 @@ export class RelatedDatasourcesTabComponent {
|
|||
|
||||
constructor () {}
|
||||
|
||||
ngOnInit() {
|
||||
this.linkToSearchPublications = this.properties.searchLinkToAdvancedPublications;
|
||||
this.linkToSearchResearchData = this.properties.searchLinkToAdvancedDatasets;
|
||||
this.linkToSearchSoftware = this.properties.searchLinkToAdvancedSoftware;
|
||||
this.linkToSearchOrps = this.properties.searchLinkToAdvancedOrps;
|
||||
}
|
||||
ngOnInit() {}
|
||||
|
||||
ngOnDestroy() {}
|
||||
|
||||
|
@ -142,4 +212,10 @@ export class RelatedDatasourcesTabComponent {
|
|||
public getKeys( map) {
|
||||
return Array.from(map.keys());
|
||||
}
|
||||
|
||||
public onLinkClick() {
|
||||
if(this.modal) {
|
||||
this.modal.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,28 +9,33 @@ import {EnvProperties} from '../../utils/properties/env-properties';
|
|||
template: `
|
||||
<errorMessages [status]="[fetchPublications.searchUtils.status, fetchDatasets.searchUtils.status]" [type]="'statistics'" tab_error_class=true></errorMessages>
|
||||
|
||||
<div *ngIf="(fetchPublications.searchUtils.status == errorCodes.DONE || fetchDatasets.searchUtils.status == errorCodes.DONE)">
|
||||
<p class="uk-text-bold">Research Results Timeline</p>
|
||||
<i-frame [url]=docsTimelineUrl ></i-frame>
|
||||
<p class="uk-text-bold">Research Results Types</p>
|
||||
<i-frame [url]=docsTypesUrl ></i-frame>
|
||||
</div>
|
||||
<ng-container *ngIf="(fetchPublications.searchUtils.status == errorCodes.DONE || fetchDatasets.searchUtils.status == errorCodes.DONE)">
|
||||
<div class="uk-padding uk-padding-remove-top">
|
||||
<span class="uk-text-bold uk-text-small">Research Results Timeline</span>
|
||||
<i-frame [url]=docsTimelineUrl ></i-frame>
|
||||
</div>
|
||||
<div class="uk-padding uk-padding-remove-top">
|
||||
<span class="uk-text-bold uk-text-small">Research Results Types</span>
|
||||
<i-frame [url]=docsTypesUrl ></i-frame>
|
||||
</div>
|
||||
</ng-container>
|
||||
|
||||
<div *ngIf="fetchPublications.searchUtils.totalResults > 0 || (fetchDatasets.searchUtils.totalResults > 0)">
|
||||
<p class="uk-text-bold">Funders in Research Results of content provider</p>
|
||||
<div *ngIf="fetchPublications.searchUtils.totalResults > 0 || (fetchDatasets.searchUtils.totalResults > 0)"
|
||||
class="uk-padding uk-padding-remove-top">
|
||||
<span class="uk-text-bold uk-text-small">Funders in Research Results of content provider</span>
|
||||
<i-frame [url]=docsFunderUrl ></i-frame>
|
||||
</div>
|
||||
|
||||
<div *ngIf="fetchPublications.searchUtils.totalResults > 0 ">
|
||||
<p class="uk-text-bold">Projects with most Publications</p>
|
||||
<div *ngIf="fetchPublications.searchUtils.totalResults > 0 "
|
||||
class="uk-padding uk-padding-remove-top">
|
||||
<span class="uk-text-bold uk-text-small">Projects with most Publications</span>
|
||||
<i-frame [url]=pubsProjectsUrl ></i-frame>
|
||||
</div>
|
||||
|
||||
<div *ngIf="(fetchDatasets.searchUtils.totalResults > 0)">
|
||||
<div>
|
||||
<p class="uk-text-bold">Projects with most Research Data</p>
|
||||
<i-frame [url]=dataProjectsUrl></i-frame>
|
||||
</div>
|
||||
<div *ngIf="(fetchDatasets.searchUtils.totalResults > 0)"
|
||||
class="uk-padding uk-padding-remove-top">
|
||||
<span class="uk-text-bold uk-text-small">Projects with most Research Data</span>
|
||||
<i-frame [url]=dataProjectsUrl></i-frame>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
|
|
|
@ -0,0 +1,78 @@
|
|||
<div *ngIf="!showForm" class="uk-container uk-container-large uk-margin-top" id="feedback-pos">
|
||||
<span class="feedback uk-float-right">
|
||||
<span class="uk-margin-small-right">Any information missing or wrong?</span>
|
||||
<a (click)="changeShowForm(true)" class="portal-link">Report an Issue</a>
|
||||
</span>
|
||||
</div>
|
||||
<div *ngIf="showForm && !sent" class="feedback-page">
|
||||
<div class="portal-background-color uk-padding-small">
|
||||
<div class="uk-container">
|
||||
<span class="clickable" (click)="openBackModal()"><span uk-icon="chevron-left"></span> Back</span>
|
||||
<h2 class="uk-margin-remove-top">Report issues in...</h2>
|
||||
<landing-header *ngIf="resultLandingInfo" [properties]="properties" [title]="title"
|
||||
[subTitle]="resultLandingInfo.subtitle" [underCuration]="resultLandingInfo.underCurationMessage"
|
||||
[entityType]="entityType" [types]="resultLandingInfo.types"
|
||||
[year]="resultLandingInfo.date" [embargoEndDate]="resultLandingInfo.embargoEndDate">
|
||||
</landing-header>
|
||||
<landing-header *ngIf="organizationInfo" [properties]="properties" [title]="title"
|
||||
[subTitle]="(organizationInfo.name && organizationInfo.title.name !== organizationInfo.name)?organizationInfo.name:null"
|
||||
[entityType]="entityType">
|
||||
</landing-header>
|
||||
<landing-header *ngIf="projectInfo && title" [properties]="properties" [title]="title"
|
||||
[subTitle]="projectInfo.acronym ? projectInfo.title : ''"
|
||||
[entityType]="entityType" [startDate]="projectInfo.startDate" [endDate]="projectInfo.endDate"
|
||||
[status]="projectInfo.status">
|
||||
</landing-header>
|
||||
<landing-header *ngIf="dataProviderInfo" [properties]="properties" [title]="title"
|
||||
[subTitle]="(dataProviderInfo.officialName
|
||||
&& dataProviderInfo.title.name !== dataProviderInfo.officialName)?dataProviderInfo.officialName:null"
|
||||
[entityType]="entityType"
|
||||
[types]="dataProviderInfo.type ? [dataProviderInfo.type] : null">
|
||||
</landing-header>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="form" [formGroup]="form" class="uk-container uk-padding-small">
|
||||
<div formArrayName="issues" class="uk-margin-top">
|
||||
<div *ngFor="let control of issues.controls; let i = index" [formGroupName]="i" class="uk-margin-medium-bottom">
|
||||
<div>
|
||||
<span>Issue #{{i + 1}}</span>
|
||||
<span class="uk-float-right clickable" (click)="removeIssue(i)">Remove</span>
|
||||
</div>
|
||||
<div class="form">
|
||||
<mat-select [formControl]="control.get('field')"
|
||||
[disableOptionCentering]="true" [placeholder]="'Select the field to report the issue'"
|
||||
class="matSelection uk-margin-bottom" panelClass="matSelectionPanel">
|
||||
<mat-option *ngFor="let field of fields" [value]="field">{{field}}</mat-option>
|
||||
</mat-select>
|
||||
<textarea [formControl]="control.get('report')"
|
||||
rows="4" placeholder="Write your report here..."></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="uk-margin-small-bottom">
|
||||
<span class="clickable" (click)="addIssue()">
|
||||
<button class="uk-icon-button portal-button uk-icon uk-margin-small-right" uk-icon="plus"></button>
|
||||
<span>Report issue for another field</span>
|
||||
</span>
|
||||
</div>
|
||||
<div>
|
||||
<button [class.uk-disabled]="form.invalid" [class.portal-button]="form.valid"
|
||||
(click)="sendReport()" class="uk-button uk-width-1-4@m uk-width-1-3@s uk-float-right">Send
|
||||
report
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="sent" class="uk-position-relative">
|
||||
<div class="uk-position-top-center">
|
||||
<div class="feedback-sent uk-margin-small-top">
|
||||
<h2>Thank you for your feedback</h2>
|
||||
<p>Your feedback is successfully received and it will soon be reviewed by our graph experts!</p>
|
||||
<span uk-icon="icon: check; ratio: 4"></span>
|
||||
</div>
|
||||
<div class="uk-text-center uk-margin-medium-top">
|
||||
<button (click)="changeShowForm(false)" class="uk-button portal-button uk-width-1-2">Go back to {{entityType}}'s page</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<modal-alert #backModal (alertOutput)="changeShowForm(false)"></modal-alert>
|
|
@ -0,0 +1,108 @@
|
|||
import {
|
||||
Component,
|
||||
ElementRef,
|
||||
EventEmitter,
|
||||
Input,
|
||||
OnChanges,
|
||||
OnInit,
|
||||
Output,
|
||||
SimpleChanges,
|
||||
ViewChild
|
||||
} from "@angular/core";
|
||||
import {ResultLandingInfo} from "../../utils/entities/resultLandingInfo";
|
||||
import {EnvProperties} from "../../utils/properties/env-properties";
|
||||
import {FormArray, FormBuilder, FormGroup, Validators} from "@angular/forms";
|
||||
import {AlertModal} from "../../utils/modal/alert";
|
||||
import {HelperFunctions} from "../../utils/HelperFunctions.class";
|
||||
import {OrganizationInfo} from "../../utils/entities/organizationInfo";
|
||||
import {ProjectInfo} from "../../utils/entities/projectInfo";
|
||||
import {DataProviderInfo} from "../../utils/entities/dataProviderInfo";
|
||||
import {EmailService} from "../../utils/email/email.service";
|
||||
|
||||
@Component({
|
||||
selector: 'feedback',
|
||||
templateUrl: 'feedback.component.html'
|
||||
})
|
||||
export class FeedbackComponent implements OnInit, OnChanges {
|
||||
@ViewChild('feedback') feedback: ElementRef;
|
||||
@ViewChild('backModal') backModal: AlertModal;
|
||||
@Input() showForm: boolean = false;
|
||||
@Input() resultLandingInfo: ResultLandingInfo = null;
|
||||
@Input() organizationInfo: OrganizationInfo = null;
|
||||
@Input() projectInfo: ProjectInfo = null;
|
||||
@Input() dataProviderInfo: DataProviderInfo = null;
|
||||
@Input() title: string = null;
|
||||
@Input() properties: EnvProperties = null;
|
||||
@Input() entityType: string = null;
|
||||
@Input() fields: string[] = [];
|
||||
@Output() show: EventEmitter<boolean> = new EventEmitter<boolean>();
|
||||
|
||||
public sent: boolean = false;
|
||||
public form: FormGroup;
|
||||
public url: string = null;
|
||||
|
||||
constructor(private fb: FormBuilder,
|
||||
private emailService: EmailService) {
|
||||
}
|
||||
|
||||
ngOnInit(): void {
|
||||
this.init();
|
||||
if(typeof window !== "undefined") {
|
||||
this.url = window.location.href;
|
||||
}
|
||||
if(this.resultLandingInfo) {
|
||||
this.title = this.resultLandingInfo.title;
|
||||
} else if(this.organizationInfo) {
|
||||
this.title = this.organizationInfo.title.name;
|
||||
} else if(this.dataProviderInfo) {
|
||||
this.title = this.dataProviderInfo.title.name;
|
||||
}
|
||||
}
|
||||
|
||||
ngOnChanges(changes: SimpleChanges): void {
|
||||
if(changes.showForm) {
|
||||
this.init();
|
||||
}
|
||||
}
|
||||
|
||||
init() {
|
||||
this.sent = false;
|
||||
this.form = this.fb.group({
|
||||
issues: this.fb.array([], Validators.required)
|
||||
});
|
||||
this.addIssue();
|
||||
}
|
||||
|
||||
public addIssue() {
|
||||
let issue: FormGroup = this.fb.group({
|
||||
field: this.fb.control('', Validators.required),
|
||||
report: this.fb.control('', Validators.required)
|
||||
});
|
||||
this.issues.push(issue);
|
||||
}
|
||||
|
||||
public removeIssue(index: number) {
|
||||
this.issues.removeAt(index);
|
||||
}
|
||||
|
||||
public get issues(): FormArray {
|
||||
return <FormArray>this.form.get('issues');
|
||||
}
|
||||
|
||||
changeShowForm(value: boolean) {
|
||||
this.show.emit(value);
|
||||
HelperFunctions.scroll();
|
||||
}
|
||||
|
||||
public openBackModal() {
|
||||
this.backModal.alertTitle = 'Go back to ' + this.entityType + '\'s page';
|
||||
this.backModal.message = 'All changes will be deleted. Are you sure you want to proceed?';
|
||||
this.backModal.okButtonText = 'Yes';
|
||||
this.backModal.cancelButtonText = 'No';
|
||||
this.backModal.open();
|
||||
}
|
||||
|
||||
public sendReport() {
|
||||
this.sent = true;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,16 @@
|
|||
import {NgModule} from "@angular/core";
|
||||
import {CommonModule} from "@angular/common";
|
||||
import {FeedbackComponent} from "./feedback.component";
|
||||
import {LandingHeaderModule} from "../landing-utils/landing-header/landing-header.module";
|
||||
import {ReactiveFormsModule} from "@angular/forms";
|
||||
import {MatSelectModule} from "@angular/material/select";
|
||||
import {AlertModalModule} from "../../utils/modal/alertModal.module";
|
||||
import {EmailService} from "../../utils/email/email.service";
|
||||
|
||||
@NgModule({
|
||||
imports: [CommonModule, LandingHeaderModule, ReactiveFormsModule, MatSelectModule, AlertModalModule],
|
||||
declarations: [FeedbackComponent],
|
||||
providers: [EmailService],
|
||||
exports: [FeedbackComponent]
|
||||
})
|
||||
export class FeedbackModule {}
|
|
@ -203,7 +203,7 @@ export class HtmlProjectReportComponent {
|
|||
intro += '</head>';
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
this.subHTML = this.htmlService.getHTML(this.projectId, this.totalResults, this.resultsType, this.properties.csvAPIURL).subscribe(
|
||||
this.subHTML = this.htmlService.getHTML(this.projectId, this.resultsType, this.properties.csvAPIURL).subscribe(
|
||||
data => {
|
||||
//let body: string = intro+'<body><h1>'+this.header1+'</h1><h2>'+this.header2+'</h2>'+data+'</body></html>';
|
||||
let body: string = intro + '<body><h1>' + this.header1 + '</h1><h2>' + this.header2 + '</h2>';
|
||||
|
|
|
@ -6,28 +6,11 @@ export class HtmlProjectReportService {
|
|||
|
||||
constructor(private http: HttpClient ) {}
|
||||
|
||||
getHTML(id: string, size: number, type:string, csvAPIURL: string ):any {
|
||||
|
||||
let resultTypeId: string;
|
||||
let requestType: string;
|
||||
if(type == "publication") {
|
||||
resultTypeId = 'publication';
|
||||
requestType = 'publications';
|
||||
} else if(type == "research data") {
|
||||
resultTypeId = 'dataset';
|
||||
requestType = 'datasets';
|
||||
} else if(type == "software") {
|
||||
resultTypeId = 'software';
|
||||
requestType = 'software'
|
||||
} else if(type == 'other research product') {
|
||||
resultTypeId = 'other';
|
||||
requestType = 'other';
|
||||
}
|
||||
|
||||
getHTML(id: string, requestType:string, csvAPIURL: string ):any {
|
||||
let url = csvAPIURL;
|
||||
url += '?format=html&type='+requestType+'&fq=(((oaftype exact result) and (resulttypeid exact "'+resultTypeId+'")) and (relprojectid exact "'+id+'"))';
|
||||
|
||||
let key = url;
|
||||
url += '?format=html&type='+requestType+'&fq=(' +
|
||||
//'((oaftype exact result) and (resulttypeid exact "'+resultTypeId+'")) and
|
||||
'(relprojectid exact "'+id+'"))';
|
||||
|
||||
return this.http.get(url,{responseType: 'text'});
|
||||
}
|
||||
|
|
|
@ -1,60 +1,50 @@
|
|||
import {Component, ElementRef, Input} from '@angular/core';
|
||||
import {
|
||||
AfterContentInit,
|
||||
AfterViewInit,
|
||||
Component,
|
||||
ElementRef,
|
||||
EventEmitter,
|
||||
Input,
|
||||
OnInit,
|
||||
Output,
|
||||
ViewChild
|
||||
} from '@angular/core';
|
||||
import {ActivatedRoute} from '@angular/router';
|
||||
|
||||
interface addthis {
|
||||
layers: refresh;
|
||||
init: Function;
|
||||
toolbox: Function;
|
||||
}
|
||||
interface refresh {
|
||||
refresh: Function;
|
||||
}
|
||||
declare var addthis: addthis;
|
||||
// declare var loadAddThis: any;
|
||||
interface addthis {
|
||||
layers: Refresh;
|
||||
init: Function;
|
||||
toolbox: Function;
|
||||
}
|
||||
|
||||
interface Refresh {
|
||||
refresh: Function;
|
||||
}
|
||||
|
||||
declare var addthis: addthis;
|
||||
|
||||
//<addThis ></addThis>
|
||||
@Component({
|
||||
selector: 'addThis',
|
||||
template: `
|
||||
<p class="addthis_inline_share_toolbox"></p>
|
||||
<p class="addthis_inline_share_toolbox"></p>
|
||||
`
|
||||
})
|
||||
export class AddThisComponent {
|
||||
private sub:any;
|
||||
|
||||
|
||||
constructor(private route: ActivatedRoute) {
|
||||
|
||||
}
|
||||
export class AddThisComponent implements OnInit {
|
||||
@Output() event: EventEmitter<boolean> = new EventEmitter<boolean>();
|
||||
|
||||
constructor(private route: ActivatedRoute) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.sub = this.route.queryParams.subscribe(data => {
|
||||
|
||||
this.route.queryParams.subscribe(data => {
|
||||
if (typeof document !== 'undefined' && typeof addthis !== 'undefined') {
|
||||
try{
|
||||
//console.log("AddThis: try load");
|
||||
// addthis.toolbox();
|
||||
// addthis.init();
|
||||
if(addthis.layers && addthis.layers.refresh) {
|
||||
addthis.layers.refresh();
|
||||
}catch (e) {
|
||||
// console.log("AddThis may didn't load properly");
|
||||
// try{
|
||||
// addthis.init();
|
||||
// addthis.layers.refresh();
|
||||
// console.log("AddThis: one more");
|
||||
// }catch (e) {
|
||||
// console.log("AddThis error again");
|
||||
// }
|
||||
} else {
|
||||
this.event.emit(false);
|
||||
}
|
||||
} else {
|
||||
this.event.emit(false);
|
||||
}
|
||||
// if (typeof document !== 'undefined' ) {
|
||||
// console.log("AddThis: try load");
|
||||
// loadAddThis();
|
||||
//
|
||||
//
|
||||
// }
|
||||
});
|
||||
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,75 +1,106 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import {HelperFunctions} from "../../utils/HelperFunctions.class";
|
||||
import {EnvProperties} from "../../utils/properties/env-properties";
|
||||
|
||||
@Component({
|
||||
selector: 'availableOn',
|
||||
template: `
|
||||
<dl [class]="'uk-description-list-line' + ((availableOn && availableOn.length > threshold) ? ' uk-margin-remove-bottom' : '')">
|
||||
<dt class="sideInfoTitle ">Download from</dt>
|
||||
<dd class="line" *ngFor="let available of availableOn.slice(0, showNum) let i=index" >
|
||||
<div>
|
||||
<!--div class="{{available['bestAccessMode']}}"-->
|
||||
<div [class]="available['bestAccessMode'] ? available['bestAccessMode'] : 'UNKNOWN ACCESSMODE'">
|
||||
<span *ngIf="available.downloadUrl.length > 1"
|
||||
class="custom-external custom-icon">
|
||||
{{available.downloadName}}
|
||||
<span *ngFor="let url of available.downloadUrl; let i=index;">
|
||||
<a href="{{url}}" target="_blank"
|
||||
|
||||
attr.uk-tooltip="pos:right; delay:10"
|
||||
[title]="available.accessMode[i] ? available.accessMode[i] : 'UNKNOWN ACCESSMODE'">
|
||||
[{{(i+1) | number}}]
|
||||
</a>
|
||||
</span>
|
||||
</span>
|
||||
<a class="custom-external custom-icon"
|
||||
*ngIf="available['downloadUrl'].length == 1"
|
||||
href="{{available['downloadUrl']}}"
|
||||
target="_blank"
|
||||
|
||||
attr.uk-tooltip="pos:right; delay:10"
|
||||
[title]="available.bestAccessMode ? available.bestAccessMode : 'UNKNOWN ACCESSMODE'">
|
||||
{{available.downloadName}}
|
||||
</a>
|
||||
<span *ngIf="available.collectedName" class="uk-text-bold">via</span>
|
||||
<a *ngIf="available.collectedName"
|
||||
[queryParams]="{datasourceId: available.collectedId}" routerLinkActive="router-link-active" routerLink="/search/dataprovider">
|
||||
{{available.collectedName}}
|
||||
</a>
|
||||
<span *ngIf="available.type || available.year">(<span *ngIf="available.type">{{available.type}}<span *ngIf="available.year">, </span></span><span *ngIf="available.year">{{available.year}}</span>)</span>
|
||||
</div>
|
||||
</div>
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
selector: 'availableOn',
|
||||
template: `
|
||||
<div class="sideInfoTitle uk-margin-small-bottom">Download from</div>
|
||||
<div class="download-from uk-height-max-large uk-overflow-auto">
|
||||
<div *ngFor="let available of availableOn.slice(0, showNum) let i=index"
|
||||
class="uk-flex uk-flex-top"
|
||||
[title]="available.bestAccessMode ? available.bestAccessMode : 'Not available'">
|
||||
<span class="uk-margin-small-right">
|
||||
<img [src]="available.icon">
|
||||
</span>
|
||||
<div class="uk-width-expand">
|
||||
<span *ngIf="available.downloadUrl.length > 1" class="title">
|
||||
<span class="uk-text-bold">{{available.downloadName}}</span>
|
||||
<a *ngFor="let url of available.downloadUrl; let i=index;">
|
||||
[href]="url" target="_blank">
|
||||
[{{(i + 1) | number}}]
|
||||
</a>
|
||||
</span>
|
||||
<a *ngIf="available.downloadUrl.length === 1" [href]="available.downloadUrl[0]"
|
||||
class="title" target="_blank">
|
||||
{{available.downloadName}}
|
||||
<span class="custom-external custom-icon space"></span>
|
||||
</a>
|
||||
<div *ngIf="removeUnknown(available.type) || available.year" class="uk-text-small">
|
||||
<span *ngIf="removeUnknown(available.type)" class="uk-text-capitalize">{{available.type}}</span>
|
||||
<span *ngIf="removeUnknown(available.type) && available.year"> . </span>
|
||||
<span *ngIf="available.year">{{available.year}}</span>
|
||||
</div>
|
||||
<div *ngIf="available.collectedName" class="uk-text-small provider">
|
||||
<span>Provider: </span>
|
||||
<a *ngIf="available.collectedId" routerLink="/search/dataprovider" [queryParams]="{datasourceId: available.collectedId}">
|
||||
{{available.collectedName}}
|
||||
</a>
|
||||
<span *ngIf="!available.collectedId">
|
||||
{{available.collectedName}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="showNum > threshold" class="uk-text-right uk-margin-bottom">
|
||||
<a (click)="showNum = threshold; scroll()">
|
||||
View less
|
||||
</a>
|
||||
</div>
|
||||
<!-- <div *ngIf="showNum == threshold && availableOn && availableOn.length > 5">...</div>-->
|
||||
<!-- <div *ngIf="showNum == threshold && availableOn && availableOn.length > 5">...</div>-->
|
||||
<div *ngIf="showNum == threshold && availableOn && availableOn.length > 5" class="uk-text-right uk-margin-bottom">
|
||||
<a (click)="showNum = availableOn.length;">
|
||||
View more
|
||||
</a>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
`
|
||||
})
|
||||
|
||||
export class AvailableOnComponent {
|
||||
@Input() availableOn: { "downloadName": string, "downloadUrl": string[],
|
||||
"collectedName": string, "collectedId": string,
|
||||
"accessMode": string[], "bestAccessMode": string,
|
||||
"type": string, "year":string }[];
|
||||
|
||||
public threshold: number = 5;
|
||||
public showNum: number = 5;
|
||||
|
||||
constructor () {}
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
public scroll() {
|
||||
HelperFunctions.scroll();
|
||||
@Input() availableOn: {
|
||||
"downloadName": string, "downloadUrl": string[],
|
||||
"collectedName": string, "collectedId": string,
|
||||
"accessMode": string[], "bestAccessMode": string,
|
||||
"type": string, "year": string, icon: string
|
||||
}[];
|
||||
@Input() properties: EnvProperties;
|
||||
public open = 'assets/common-assets/unlock.svg';
|
||||
public closed = 'assets/common-assets/lock.svg';
|
||||
public unknown = 'assets/common-assets/question.svg';
|
||||
public threshold: number = 4;
|
||||
public showNum: number = 4;
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.availableOn.forEach(available => {
|
||||
if (available.bestAccessMode) {
|
||||
if (available.bestAccessMode.toLowerCase().indexOf('open') !== -1) {
|
||||
available.icon = this.open;
|
||||
} else if (available.bestAccessMode.toLowerCase().indexOf('not available') !== -1) {
|
||||
available.icon = this.unknown;
|
||||
} else {
|
||||
available.icon = this.closed;
|
||||
}
|
||||
} else {
|
||||
available.icon = this.unknown;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public removeUnknown(value: string): string {
|
||||
if(this.properties.environment === 'production') {
|
||||
if (value.toLowerCase() === 'unknown') {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
return value;
|
||||
}
|
||||
|
||||
public scroll() {
|
||||
HelperFunctions.scroll();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -9,19 +9,14 @@ declare var Sys:any;
|
|||
selector: 'citeThis',
|
||||
template: `
|
||||
|
||||
<div class="citationDownloader ">
|
||||
<dl class="uk-description-list-line">
|
||||
<!--dt class="title">Cite this {{type}}</dt-->
|
||||
<dd class="line" >
|
||||
<mat-select class="matSelection" id="citations" name="citeselect" [(ngModel)]="selectedStyle" (ngModelChange)="styleChanged()"
|
||||
[disableOptionCentering]="true"
|
||||
panelClass="matSelectionPanel">
|
||||
<mat-option value="0">select a citation style</mat-option>
|
||||
<mat-option *ngFor=" let style of this.citation.templates let i = index" [value]="style">{{style}}</mat-option>
|
||||
</mat-select>
|
||||
<div *ngIf="selectedStyle!='0'" id="citation" class="box-content uk-padding-small uk-overflow-auto" [innerHTML]=citationText></div>
|
||||
</dd>
|
||||
</dl>
|
||||
<div class="uk-padding-small">
|
||||
<mat-select class="matSelection" id="citations" name="citeselect" [(ngModel)]="selectedStyle" (ngModelChange)="styleChanged()"
|
||||
[disableOptionCentering]="true"
|
||||
panelClass="matSelectionPanel">
|
||||
<mat-option value="0">select a citation style</mat-option>
|
||||
<mat-option *ngFor=" let style of this.citation.templates let i = index" [value]="style">{{style}}</mat-option>
|
||||
</mat-select>
|
||||
<div *ngIf="selectedStyle!='0'" id="citation" class="box-content uk-margin-small-top uk-overflow-auto" [innerHTML]=citationText></div>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
|
|
|
@ -4,62 +4,65 @@ import {HelperFunctions} from "../../utils/HelperFunctions.class";
|
|||
@Component({
|
||||
selector: 'fundedBy',
|
||||
template: `
|
||||
<dl [class]="'uk-description-list-line' + ((fundedByProjects && fundedByProjects.length > threshold) ? ' uk-margin-remove-bottom' : '')">
|
||||
<dt class="sideInfoTitle ">Funded by</dt>
|
||||
<dd class="line"
|
||||
*ngFor="let item of fundedByProjects.slice(0, showNum) let i=index">
|
||||
<div><!-- *ngIf="i<5 || showAll"-->
|
||||
<span uk-tooltip="pos:right; delay:10"
|
||||
title="{{buildFundingTooltip(item)}}">
|
||||
|
||||
<a *ngIf="!item['inline'] && item.id"
|
||||
[queryParams]="{projectId: item.id}" routerLinkActive="router-link-active" routerLink="/search/project">
|
||||
<span *ngIf="item['funderShortname'] || item['funderName']">{{item['funderShortname']?item['funderShortname']:item['funderName']}}</span>
|
||||
<span *ngIf="!item['funderShortname'] && !item['funderName']">[no funder available]</span>
|
||||
<span *ngIf="item['acronym'] || item['title']">| {{ item['acronym']?item['acronym']:item['title']}}</span>
|
||||
</a>
|
||||
|
||||
<a *ngIf="item['inline'] && item.id"
|
||||
[queryParams]="{projectId: item.id}" routerLinkActive="router-link-active" routerLink="/search/project">
|
||||
<mark>
|
||||
<span *ngIf="item['funderShortname'] || item['funderName']">{{item['funderShortname']?item['funderShortname']:item['funderName']}}</span>
|
||||
<span *ngIf="!item['funderShortname'] && !item['funderName']">[no funder available]</span>
|
||||
<span *ngIf="item['acronym'] || item['title']">| {{ item['acronym']?item['acronym']:item['title']}}</span>
|
||||
</mark>
|
||||
</a>
|
||||
|
||||
<span class="clickable" *ngIf="!item['inline'] && !item.id">
|
||||
<span *ngIf="item['funderShortname'] || item['funderName']">{{item['funderShortname']?item['funderShortname']:item['funderName']}}</span>
|
||||
<span *ngIf="!item['funderShortname'] && !item['funderName']">[no funder available]</span>
|
||||
<span *ngIf="item['acronym'] || item['title']">| {{ item['acronym']?item['acronym']:item['title']}}</span>
|
||||
</span>
|
||||
|
||||
<span class="clickable" *ngIf="item['inline'] && !item.id">
|
||||
<mark>
|
||||
<span *ngIf="item['funderShortname'] || item['funderName']">{{item['funderShortname']?item['funderShortname']:item['funderName']}}</span>
|
||||
<span *ngIf="!item['funderShortname'] && !item['funderName']">[no funder available]</span>
|
||||
<span *ngIf="item['acronym'] || item['title']">| {{ item['acronym']?item['acronym']:item['title']}}</span>
|
||||
</mark>
|
||||
</span>
|
||||
|
||||
{{" "}}<span class="uk-icon">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20" icon="info" ratio="1"><path d="M12.13,11.59 C11.97,12.84 10.35,14.12 9.1,14.16 C6.17,14.2 9.89,9.46 8.74,8.37 C9.3,8.16 10.62,7.83 10.62,8.81 C10.62,9.63 10.12,10.55 9.88,11.32 C8.66,15.16 12.13,11.15 12.14,11.18 C12.16,11.21 12.16,11.35 12.13,11.59 C12.08,11.95 12.16,11.35 12.13,11.59 L12.13,11.59 Z M11.56,5.67 C11.56,6.67 9.36,7.15 9.36,6.03 C9.36,5 11.56,4.54 11.56,5.67 L11.56,5.67 Z"></path><circle fill="none" stroke="#000" stroke-width="1.1" cx="10" cy="10" r="9"></circle></svg>
|
||||
</span>
|
||||
<li>
|
||||
<span class="uk-text-muted">Funded by: </span>
|
||||
<span *ngFor="let item of fundedByProjects.slice(0, showNum) let i=index">
|
||||
<span class="clickable uk-link">
|
||||
<mark *ngIf="item.inline">
|
||||
<span *ngIf="item['funderShortname'] || item['funderName']">{{item['funderShortname']?item['funderShortname']:item['funderName']}}</span>
|
||||
<span *ngIf="!item['funderShortname'] && !item['funderName']">[no funder available]</span>
|
||||
<span *ngIf="item['acronym'] || item['title']">| {{ item['acronym']?item['acronym']:item['title']}}</span>
|
||||
</mark>
|
||||
<span *ngIf="!item.inline">
|
||||
<span *ngIf="item['funderShortname'] || item['funderName']">{{item['funderShortname']?item['funderShortname']:item['funderName']}}</span>
|
||||
<span *ngIf="!item['funderShortname'] && !item['funderName']">[no funder available]</span>
|
||||
<span *ngIf="item['acronym'] || item['title']">| {{ item['acronym']?item['acronym']:item['title']}}</span>
|
||||
</span>
|
||||
</span>
|
||||
<div class="default-dropdown uk-margin-remove-top uk-padding-small"
|
||||
uk-dropdown="pos: bottom-left; mode:click">
|
||||
<span class="uk-text-small">Project</span>
|
||||
<div class="uk-margin-bottom">
|
||||
<a *ngIf="item.id" class="uk-h6 uk-margin-remove"
|
||||
[queryParams]="{projectId: item.id}" routerLink="/search/project">
|
||||
{{item['acronym']?item['acronym']:item['title']}}
|
||||
</a>
|
||||
<span *ngIf="!item.id" class="uk-h6 uk-margin-remove">
|
||||
{{item['acronym']?item['acronym']:item['title']}}
|
||||
</span>
|
||||
</div>
|
||||
<ul class="uk-list uk-padding-remove-left uk-margin-bottom">
|
||||
<li *ngIf="item.funderShortname || item.funderName">
|
||||
<span class="uk-text-muted">Funder: </span>
|
||||
{{item.funderName?item.funderName:item.funderShortname}}
|
||||
<span *ngIf="item.funderShortname && item.funderName">
|
||||
({{item.funderShortname}})
|
||||
</span>
|
||||
</li>
|
||||
<li *ngIf="item.code">
|
||||
<span class="uk-text-muted">Project Code: </span>{{item.code}}
|
||||
</li>
|
||||
<li *ngIf="item.funding">
|
||||
<span class="uk-text-muted">Funding stream: </span>{{item.funding}}
|
||||
</li>
|
||||
</ul>
|
||||
<div *ngIf="item.provenanceAction" class="uk-text-small uk-text-muted">
|
||||
{{item.provenanceAction}}
|
||||
</div>
|
||||
</div>
|
||||
</dd>
|
||||
</dl>
|
||||
<div *ngIf="showNum > threshold" class="uk-text-right uk-margin-bottom">
|
||||
<a (click)="showNum = threshold; scroll()">
|
||||
View less
|
||||
</a>
|
||||
</div>
|
||||
<!-- <div *ngIf="showNum == threshold && fundedByProjects && fundedByProjects.length > 5">...</div>-->
|
||||
<div *ngIf="showNum == threshold && fundedByProjects && fundedByProjects.length > threshold" class="uk-text-right uk-margin-bottom">
|
||||
<a (click)="showNum = fundedByProjects.length;">
|
||||
View more
|
||||
</a>
|
||||
</div>
|
||||
<span *ngIf="i < (fundedByProjects.slice(0, showNum).length - 1)">, </span>
|
||||
</span>
|
||||
<div *ngIf="showNum > threshold" class="uk-text-right uk-margin-bottom">
|
||||
<a (click)="showNum = threshold; scroll()">
|
||||
View less
|
||||
</a>
|
||||
</div>
|
||||
<div *ngIf="showNum == threshold && fundedByProjects && fundedByProjects.length > threshold" class="uk-text-right uk-margin-bottom">
|
||||
<a (click)="showNum = fundedByProjects.length;">
|
||||
View more
|
||||
</a>
|
||||
</div>
|
||||
</li>
|
||||
`
|
||||
})
|
||||
|
||||
|
|
|
@ -0,0 +1,101 @@
|
|||
import {Component, Input} from "@angular/core";
|
||||
import {EnvProperties} from "../../../utils/properties/env-properties";
|
||||
import {Author} from "../../../utils/result-preview/result-preview";
|
||||
import {AlertModal} from "../../../utils/modal/alert";
|
||||
|
||||
@Component({
|
||||
selector: 'landing-header',
|
||||
template: `
|
||||
<div class="title-section">
|
||||
<span *ngIf="underCuration" title="{{buildCurationTooltip()}}"
|
||||
uk-tooltip="pos:bottom-right; delay:10; cls: under-curation-tooltip"
|
||||
class="under-curation uk-position-top-right uk-margin-small-right uk-margin-small-top">
|
||||
</span>
|
||||
<div class="uk-text-small">
|
||||
<span *ngIf="entityType" class="uk-text-capitalize">
|
||||
{{entityType}}
|
||||
</span>
|
||||
<span *ngIf="properties.environment !== 'production' && types && removeDuplicates(types).length > 0">
|
||||
{{' . ' + removeDuplicates(types).join(' . ')}}
|
||||
</span>
|
||||
<span *ngIf="properties.environment === 'production' && types && removeUnknown(types, true).length > 0">
|
||||
{{' . ' + removeUnknown(types, true).join(' . ')}}
|
||||
</span>
|
||||
<span>
|
||||
<span *ngIf="startDate || endDate">
|
||||
{{' . '}}
|
||||
</span>
|
||||
<span *ngIf="startDate && !endDate">
|
||||
{{'from '}}
|
||||
</span>
|
||||
<span *ngIf="!startDate && endDate">
|
||||
{{'until '}}
|
||||
</span>
|
||||
<span *ngIf="startDate">
|
||||
{{startDate | date: 'yyyy'}}
|
||||
</span>
|
||||
<span *ngIf="startDate && endDate">
|
||||
{{' - '}}
|
||||
</span>
|
||||
<span *ngIf="endDate">
|
||||
{{endDate | date: 'yyyy'}}
|
||||
</span>
|
||||
</span>
|
||||
<span *ngIf="status && status != ''">
|
||||
{{' . ' + status}}
|
||||
</span>
|
||||
<span *ngIf="year && year != ''">
|
||||
{{' . ' + year}}
|
||||
</span>
|
||||
<span *ngIf="embargoEndDate">
|
||||
. Embargo end date: {{embargoEndDate | date: 'dd MMM yyyy'}}
|
||||
</span>
|
||||
</div>
|
||||
<showTitle [titleName]="title" classNames="uk-margin-remove-bottom"></showTitle>
|
||||
<div *ngIf="subTitle">
|
||||
<span [innerHTML]="subTitle"></span>
|
||||
</div>
|
||||
<div *ngIf="authors" class="uk-margin-small-bottom uk-margin-small-top">
|
||||
<showAuthors [authorsLimit]="authorLimit" [modal]="modal" [showAll]="showAllAuthors" [authors]="authors" [small]="false"></showAuthors>
|
||||
</div>
|
||||
</div>`
|
||||
})
|
||||
export class LandingHeaderComponent {
|
||||
@Input() entityType: string;
|
||||
@Input() properties: EnvProperties;
|
||||
@Input() types: string[];
|
||||
@Input() startDate: number; // project landing
|
||||
@Input() endDate: number; // project landing
|
||||
@Input() status: string; // project landing
|
||||
@Input() year: string;
|
||||
@Input() embargoEndDate: Date;
|
||||
@Input() title: string;
|
||||
@Input() subTitle: string;
|
||||
@Input() authors: Author[];
|
||||
@Input() authorLimit: number = 30;
|
||||
@Input() showAllAuthors: boolean = true;
|
||||
@Input() underCuration: boolean = false;
|
||||
@Input() modal: AlertModal;
|
||||
|
||||
public removeUnknown(array: string[], type: boolean = false): string[] {
|
||||
if (type) {
|
||||
return this.removeDuplicates(array).filter(value => value.toLowerCase() !== 'unknown');
|
||||
} else {
|
||||
return array.filter(value => value.toLowerCase() !== 'unknown');
|
||||
}
|
||||
}
|
||||
|
||||
public removeDuplicates(array: string[]): string[] {
|
||||
return array.filter(value => value.toLowerCase() !== this.entityType);
|
||||
}
|
||||
|
||||
public buildCurationTooltip(): string {
|
||||
let tooltipContent: string = "<div class='uk-margin'>";
|
||||
|
||||
tooltipContent += "<h4>Record in preview</h4>";
|
||||
tooltipContent += "<p>Bibliographic record accepted by the system, but not yet processed by <br> OpenAIRE tools for information quality improvement and de-duplication</p>";
|
||||
|
||||
tooltipContent += "</div>";
|
||||
return tooltipContent;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,12 @@
|
|||
import {NgModule} from "@angular/core";
|
||||
import {LandingHeaderComponent} from "./landing-header.component";
|
||||
import {CommonModule} from "@angular/common";
|
||||
import {LandingModule} from "../landing.module";
|
||||
import {ShowAuthorsModule} from "../../../utils/authors/showAuthors.module";
|
||||
|
||||
@NgModule({
|
||||
imports: [CommonModule, LandingModule, ShowAuthorsModule],
|
||||
declarations: [LandingHeaderComponent],
|
||||
exports: [LandingHeaderComponent]
|
||||
})
|
||||
export class LandingHeaderModule {}
|
|
@ -1,45 +1,32 @@
|
|||
import {HostedByCollectedFrom, Journal, Project, RelationResult} from "../../utils/result-preview/result-preview";
|
||||
|
||||
export class ParsingFunctions {
|
||||
|
||||
constructor () {}
|
||||
|
||||
public ngOnDestroy() {}
|
||||
|
||||
public parseFundingByProjects(fundedByProjects: { "id": string, "acronym": string, "title": string,
|
||||
"funderShortname": string, "funderName": string,
|
||||
"funding": string, "code": string,
|
||||
"provenanceAction": string, "inline": boolean
|
||||
}[],
|
||||
relation: any, provenanceActionVocabulary: any):
|
||||
{ "id": string, "acronym": string, "title": string,
|
||||
"funderShortname": string, "funderName": string,
|
||||
"funding": string, "code": string,
|
||||
"provenanceAction": string, "inline": boolean
|
||||
}[] {
|
||||
if(fundedByProjects == undefined) {
|
||||
fundedByProjects = new Array<{"id": string, "acronym": string, "title": string,
|
||||
"funderShortname": string, "funderName": string,
|
||||
"funding": string, "code": string,
|
||||
"provenanceAction": string, "inline": boolean
|
||||
}>();
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
public ngOnDestroy() {
|
||||
}
|
||||
|
||||
public parseFundingByProjects(fundedByProjects: Project[], relation: any,
|
||||
provenanceActionVocabulary: any): Project[] {
|
||||
if (fundedByProjects == undefined) {
|
||||
fundedByProjects = [];
|
||||
}
|
||||
|
||||
let fundedByProject: { "id": string, "acronym": string, "title": string,
|
||||
"funderShortname": string, "funderName": string,
|
||||
"funding": string, "code": string,
|
||||
"provenanceAction": string, "inline": boolean
|
||||
} = { "id": "", "acronym": "", "title": "",
|
||||
"funderShortname": "", "funderName": "",
|
||||
"funding": "", "code": "", "provenanceAction": "", "inline": false
|
||||
};
|
||||
|
||||
if(relation.title != 'unidentified') {
|
||||
|
||||
let fundedByProject: Project = {
|
||||
"id": "", "acronym": "", "title": "",
|
||||
"funderShortname": "", "funderName": "",
|
||||
"funding": "", "code": "", "provenanceAction": "", "inline": false
|
||||
};
|
||||
|
||||
if (relation.title != 'unidentified') {
|
||||
fundedByProject['id'] = relation['to'].content;
|
||||
fundedByProject['acronym'] = relation.acronym;
|
||||
fundedByProject['title'] = relation.title;
|
||||
fundedByProject['code'] = relation.code;
|
||||
|
||||
if(provenanceActionVocabulary != null && relation.provenanceaction in provenanceActionVocabulary) {
|
||||
|
||||
if (provenanceActionVocabulary != null && relation.provenanceaction in provenanceActionVocabulary) {
|
||||
fundedByProject['provenanceAction'] = provenanceActionVocabulary[relation.provenanceaction];
|
||||
}
|
||||
} else {
|
||||
|
@ -49,425 +36,429 @@ export class ParsingFunctions {
|
|||
fundedByProject['code'] = "";
|
||||
fundedByProject['provenanceAction'] = "";
|
||||
}
|
||||
|
||||
if(relation.hasOwnProperty("funding")) {
|
||||
let funding: {"funderName": string, "funderShortname": string, "stream": string};
|
||||
|
||||
if (relation.hasOwnProperty("funding")) {
|
||||
let funding: { "funderName": string, "funderShortname": string, "stream": string };
|
||||
funding = this.parseFundingTrees(relation.funding);
|
||||
|
||||
if(funding.funderName) {
|
||||
|
||||
if (funding.funderName) {
|
||||
fundedByProject['funderName'] = funding.funderName;
|
||||
}
|
||||
if(funding.funderShortname) {
|
||||
if (funding.funderShortname) {
|
||||
fundedByProject['funderShortname'] = funding.funderShortname;
|
||||
}
|
||||
if(funding.stream) {
|
||||
if (funding.stream) {
|
||||
fundedByProject['funding'] = funding.stream;
|
||||
}
|
||||
}
|
||||
fundedByProjects.push(fundedByProject);
|
||||
return fundedByProjects;
|
||||
}
|
||||
|
||||
|
||||
// publication & research data : for fundedByProjects | project landing : for funding
|
||||
public parseFundingTrees(fundingTree: any): {"funderName": string, "funderShortname": string, "stream": string} {
|
||||
let funding: {"funderName": string, "funderShortname": string, "stream": string} = {"funderName": "", "funderShortname": "", "stream": ""};
|
||||
public parseFundingTrees(fundingTree: any): { "funderName": string, "funderShortname": string, "stream": string } {
|
||||
let funding: { "funderName": string, "funderShortname": string, "stream": string } = {
|
||||
"funderName": "",
|
||||
"funderShortname": "",
|
||||
"stream": ""
|
||||
};
|
||||
let length = Array.isArray(fundingTree) ? fundingTree.length : 1;
|
||||
|
||||
for(let i=0; i<length; i++) {
|
||||
|
||||
for (let i = 0; i < length; i++) {
|
||||
let fundingData = Array.isArray(fundingTree) ? fundingTree[i] : fundingTree;
|
||||
|
||||
if(fundingData.hasOwnProperty("funder")) {
|
||||
|
||||
if (fundingData.hasOwnProperty("funder")) {
|
||||
funding.funderShortname = fundingData['funder'].shortname;
|
||||
funding.funderName = fundingData['funder'].name;
|
||||
}
|
||||
|
||||
|
||||
funding.stream = this.addFundingLevel0(fundingData, funding.stream);
|
||||
|
||||
|
||||
funding.stream = this.addFundingLevel1(fundingData, funding.stream);
|
||||
|
||||
|
||||
funding.stream = this.addFundingLevel2(fundingData, funding.stream);
|
||||
}
|
||||
return funding;
|
||||
}
|
||||
|
||||
addFundingLevel0(parent: string, fundingStream: string) : string {
|
||||
if(parent.hasOwnProperty("funding_level_0")) {
|
||||
|
||||
addFundingLevel0(parent: string, fundingStream: string): string {
|
||||
if (parent.hasOwnProperty("funding_level_0")) {
|
||||
let level0 = parent['funding_level_0'];
|
||||
|
||||
|
||||
fundingStream += (fundingStream) ? " ; " : "";
|
||||
fundingStream += level0.name;
|
||||
}
|
||||
return fundingStream;
|
||||
}
|
||||
|
||||
|
||||
addFundingLevel1(parent: string, fundingStream: string): string {
|
||||
if(parent.hasOwnProperty("funding_level_1")) {
|
||||
if (parent.hasOwnProperty("funding_level_1")) {
|
||||
let level1 = parent['funding_level_1'];
|
||||
|
||||
|
||||
// For projects' parsing
|
||||
if(level1.hasOwnProperty("parent")) {
|
||||
if (level1.hasOwnProperty("parent")) {
|
||||
fundingStream = this.addFundingLevel0(level1.parent, fundingStream);
|
||||
}
|
||||
|
||||
|
||||
fundingStream += (fundingStream) ? " | " : "";
|
||||
fundingStream += level1.name;
|
||||
}
|
||||
return fundingStream;
|
||||
}
|
||||
|
||||
|
||||
addFundingLevel2(parent: string, fundingStream: string): string {
|
||||
if(parent.hasOwnProperty("funding_level_2")) {
|
||||
if (parent.hasOwnProperty("funding_level_2")) {
|
||||
let level2 = parent['funding_level_2'];
|
||||
|
||||
|
||||
// For projects' parsing
|
||||
if(level2.hasOwnProperty("parent")) {
|
||||
if (level2.hasOwnProperty("parent")) {
|
||||
fundingStream = this.addFundingLevel1(level2.parent, fundingStream);
|
||||
}
|
||||
|
||||
|
||||
fundingStream += (fundingStream) ? " | " : "";
|
||||
fundingStream += level2.name;
|
||||
}
|
||||
return fundingStream;
|
||||
}
|
||||
|
||||
|
||||
// publication & dataset landing : for collectedFrom
|
||||
parseCollectedFrom( collectedFrom: {"name": string, "id": string}[],
|
||||
parseCollectedFrom(collectedFrom: { "name": string, "id": string }[],
|
||||
_collectedFrom: any) {
|
||||
let length: number = collectedFrom.length;
|
||||
collectedFrom[length] = {"name": "", "id": ""};
|
||||
collectedFrom[length]['name'] = _collectedFrom.name;
|
||||
collectedFrom[length]['id'] = _collectedFrom.id;
|
||||
}
|
||||
|
||||
|
||||
// publication & dataset landing : for downloadFrom
|
||||
addPublisherToHostedBy_collectedFrom( hostedBy_collectedFrom: {"downloadName": string, "downloadUrl": string[], "collectedName": string, "collectedId": string, "accessMode": string[], "bestAccessMode": string, "type": string, "year":string}[],
|
||||
publisher: string, journal:{"journal": string, "issn": string, "lissn": string},
|
||||
identifiers: Map<string, string[]>/*, title: { "name": string, "url": string, "accessMode": string}*/) {
|
||||
if( publisher && identifiers != null && identifiers.has('doi')) {
|
||||
if( hostedBy_collectedFrom == null) {
|
||||
hostedBy_collectedFrom = new Array<{"downloadName": string, "downloadUrl": string[], "collectedName": string, "collectedId": string, "accessMode": string[], "bestAccessMode": string, "type": string, "year":string}>();
|
||||
addPublisherToHostedBy_collectedFrom(hostedBy_collectedFrom: HostedByCollectedFrom[],
|
||||
publisher: string, journal: Journal,
|
||||
identifiers: Map<string, string[]>/*, title: { "name": string, "url": string, "accessMode": string}*/) {
|
||||
if (publisher && identifiers != null && identifiers.has('doi')) {
|
||||
if (hostedBy_collectedFrom == null) {
|
||||
hostedBy_collectedFrom = [];
|
||||
}
|
||||
let available: {"downloadName": string, "downloadUrl": string[], "collectedName": string, "collectedId": string, "accessMode": string[], "bestAccessMode": string, "type": string, "year":string};
|
||||
available = {"downloadName": "", "downloadUrl": null, "collectedName": "", "collectedId": "", "accessMode": null, "bestAccessMode": null, "type": "", "year": ""};
|
||||
|
||||
if(journal && journal.journal) {
|
||||
available.downloadName = publisher + "/ "+journal['journal'];
|
||||
let available: HostedByCollectedFrom = {
|
||||
downloadName: "",
|
||||
downloadUrl: null,
|
||||
collectedName: "",
|
||||
collectedId: "",
|
||||
accessMode: null,
|
||||
bestAccessMode: null,
|
||||
type: "",
|
||||
year: ""
|
||||
};
|
||||
|
||||
if (journal && journal.journal) {
|
||||
available.downloadName = publisher + "/ " + journal['journal'];
|
||||
} else {
|
||||
available.downloadName = publisher;
|
||||
}
|
||||
|
||||
let url = "https://dx.doi.org/"+identifiers.get("doi")[0];
|
||||
|
||||
|
||||
let url = "https://dx.doi.org/" + identifiers.get("doi")[0];
|
||||
|
||||
available.downloadUrl = new Array<string>();
|
||||
available.accessMode = new Array<string>();
|
||||
|
||||
|
||||
available.downloadUrl.push(url);
|
||||
/*
|
||||
if(title != undefined && title['url'] == "") {
|
||||
title['url'] = url;
|
||||
}
|
||||
*/
|
||||
/*
|
||||
if(title != undefined && title['url'] == "") {
|
||||
title['url'] = url;
|
||||
}
|
||||
*/
|
||||
hostedBy_collectedFrom.push(available);
|
||||
}
|
||||
return hostedBy_collectedFrom;
|
||||
}
|
||||
|
||||
|
||||
// publication & dataset landing : for downloadFrom
|
||||
parseDownloadFrom(downloadFrom: Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>, instance: any, url: string)
|
||||
{
|
||||
parseDownloadFrom(downloadFrom: Map<string, { "url": string[], "accessMode": string[], "bestAccessMode": string }>, instance: any, url: string) {
|
||||
let key: string = instance['hostedby'].name;
|
||||
|
||||
if(key) {
|
||||
|
||||
if (key) {
|
||||
this.addUrlAndAccessMode(downloadFrom, instance, key, url);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// publication & dataset landing : for publishedIn
|
||||
parsePublishedIn(publishedIn: Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>, instance: any, result: any, url: string, counter: number): number {
|
||||
if(result != null && result.hasOwnProperty("source")) {
|
||||
parsePublishedIn(publishedIn: Map<string, { "url": string[], "accessMode": string[], "bestAccessMode": string }>, instance: any, result: any, url: string, counter: number): number {
|
||||
if (result != null && result.hasOwnProperty("source")) {
|
||||
let key: string;
|
||||
if(Array.isArray(result.source)) {
|
||||
if(counter==result.source.length) {
|
||||
if (Array.isArray(result.source)) {
|
||||
if (counter == result.source.length) {
|
||||
counter--;
|
||||
}
|
||||
key = result['source'][counter];
|
||||
} else {
|
||||
key = result['source'];
|
||||
}
|
||||
|
||||
if(key) {
|
||||
|
||||
if (key) {
|
||||
this.addUrlAndAccessMode(publishedIn, instance, key, url);
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
return counter;
|
||||
}
|
||||
|
||||
|
||||
// publication & dataset landing : for downloadFrom and publishedIn
|
||||
addUrlAndAccessMode(mapStructure: Map<string, {"url": string[], "accessMode": string[], "bestAccessMode": string}>, instance: any, key: string, url: string) {
|
||||
if(!mapStructure.has(key)) {
|
||||
addUrlAndAccessMode(mapStructure: Map<string, { "url": string[], "accessMode": string[], "bestAccessMode": string }>, instance: any, key: string, url: string) {
|
||||
if (!mapStructure.has(key)) {
|
||||
mapStructure.set(key, {"url": null, "accessMode": null, "bestAccessMode": null});
|
||||
}
|
||||
|
||||
if(mapStructure.get(key)['url'] == null) {
|
||||
|
||||
if (mapStructure.get(key)['url'] == null) {
|
||||
mapStructure.get(key)['url'] = new Array<string>();
|
||||
}
|
||||
|
||||
if(url) {
|
||||
|
||||
if (url) {
|
||||
mapStructure.get(key)['url'].push(url);
|
||||
}
|
||||
|
||||
if(mapStructure.get(key)['accessMode'] == null) {
|
||||
|
||||
if (mapStructure.get(key)['accessMode'] == null) {
|
||||
mapStructure.get(key)['accessMode'] = new Array<string>();
|
||||
}
|
||||
|
||||
if(instance.hasOwnProperty("accessright")) {
|
||||
if(url) {
|
||||
mapStructure.get(key)['accessMode'].push(instance['accessright'].classid);
|
||||
|
||||
if (instance.hasOwnProperty("accessright")) {
|
||||
if (url) {
|
||||
mapStructure.get(key)['accessMode'].push(instance['accessright'].classname);
|
||||
}
|
||||
|
||||
if(this.changeBestAccessMode(mapStructure.get(key)['bestAccessMode'], instance['accessright'])) {
|
||||
mapStructure.get(key)['bestAccessMode'] = instance['accessright'].classid;
|
||||
|
||||
if (this.changeBestAccessMode(mapStructure.get(key)['bestAccessMode'], instance['accessright'])) {
|
||||
mapStructure.get(key)['bestAccessMode'] = instance['accessright'].classname;
|
||||
}
|
||||
} else if(url) {
|
||||
} else if (url) {
|
||||
mapStructure.get(key)['accessMode'].push("");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
parseHostedBy_collectedFrom(hostedBy_collectedFrom: { "downloadName": string, "downloadUrl": string[],
|
||||
"collectedName": string, "collectedId": string,
|
||||
"accessMode": string[], "bestAccessMode": string,
|
||||
"type": string, "year":string }[],
|
||||
|
||||
|
||||
parseHostedBy_collectedFrom(hostedBy_collectedFrom: HostedByCollectedFrom[],
|
||||
instance: any, data: any, url: string, counter: number/*,
|
||||
title: { "name": string, "url": string, "accessMode": string}*/, accessMode: string): number {
|
||||
let available: {"downloadName": string, "downloadUrl": string[], "collectedName": string, "collectedId": string, "accessMode": string[], "bestAccessMode": string, "type": string, "year":string};
|
||||
available = {"downloadName": "", "downloadUrl": null, "collectedName": "", "collectedId": "", "accessMode": null, "bestAccessMode": null, "type": "", "year": ""};
|
||||
|
||||
if(instance['hostedby'].name && instance['hostedby'].name != "other resources" && instance['hostedby'].name != "Unknown Repository") {
|
||||
available.downloadName = instance['hostedby'].name;
|
||||
} else {
|
||||
if(data != null && data.hasOwnProperty("source")) {
|
||||
let downloadName: string;
|
||||
if(Array.isArray(data.source)) {
|
||||
|
||||
if(counter==data.source.length) {
|
||||
counter--;
|
||||
}
|
||||
downloadName = data['source'][counter];
|
||||
} else {
|
||||
downloadName = data['source'];
|
||||
}
|
||||
if(downloadName) {
|
||||
counter++;
|
||||
available.downloadName = downloadName;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if(available.downloadName) {
|
||||
if(instance.hasOwnProperty("collectedfrom")) {
|
||||
available.collectedId = instance['collectedfrom'].id;
|
||||
available.collectedName = instance['collectedfrom'].name;
|
||||
}
|
||||
|
||||
if(instance.hasOwnProperty("instancetype") && instance['instancetype'].classname) {
|
||||
available.type = instance['instancetype'].classname;
|
||||
}
|
||||
|
||||
if(instance.hasOwnProperty("dateofacceptance")) {
|
||||
var date:string = (instance.dateofacceptance)+""; // transform to string in case it is an integer
|
||||
available.year = (date && (date).indexOf('-') !== -1)?date.split('-')[0]:date;
|
||||
}
|
||||
|
||||
available.accessMode = new Array<string>();
|
||||
available.downloadUrl = new Array<string>();
|
||||
available['downloadUrl'].push(url);
|
||||
if(instance.hasOwnProperty("accessright")) {
|
||||
if(url) {
|
||||
available['accessMode'].push(instance['accessright'].classid);
|
||||
}
|
||||
|
||||
if(this.changeBestAccessMode(available.bestAccessMode, instance['accessright'])) {
|
||||
available.bestAccessMode = instance['accessright'].classid;
|
||||
/*
|
||||
if(title != undefined) {
|
||||
if(this.changeBestAccessMode(title['accessMode'], instance['accessright'])) {
|
||||
title['accessMode'] = instance['accessright'].classid;
|
||||
title['url'] = url;
|
||||
}
|
||||
}
|
||||
*/
|
||||
if(this.changeBestAccessMode(accessMode, instance['accessright'])) {
|
||||
accessMode = instance['accessright'].classid;
|
||||
let available: HostedByCollectedFrom = {
|
||||
"downloadName": "",
|
||||
"downloadUrl": null,
|
||||
"collectedName": "",
|
||||
"collectedId": "",
|
||||
"accessMode": null,
|
||||
"bestAccessMode": null,
|
||||
"type": "",
|
||||
"year": ""
|
||||
};
|
||||
|
||||
if (instance['hostedby'].name && instance['hostedby'].name != "other resources" && instance['hostedby'].name != "Unknown Repository") {
|
||||
available.downloadName = instance['hostedby'].name;
|
||||
} else {
|
||||
if (data != null && data.hasOwnProperty("source")) {
|
||||
let downloadName: string;
|
||||
if (Array.isArray(data.source)) {
|
||||
|
||||
if (counter == data.source.length) {
|
||||
counter--;
|
||||
}
|
||||
}
|
||||
/*
|
||||
if(title != undefined) {
|
||||
if(!title['url']) {
|
||||
title['url'] = url;
|
||||
}
|
||||
}
|
||||
*/
|
||||
} else if(url) {
|
||||
available['accessMode'].push("");
|
||||
}
|
||||
|
||||
hostedBy_collectedFrom.push(available);
|
||||
}
|
||||
|
||||
return counter;
|
||||
downloadName = data['source'][counter];
|
||||
} else {
|
||||
downloadName = data['source'];
|
||||
}
|
||||
if (downloadName) {
|
||||
counter++;
|
||||
available.downloadName = downloadName;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (available.downloadName) {
|
||||
if (instance.hasOwnProperty("collectedfrom")) {
|
||||
available.collectedId = instance['collectedfrom'].id;
|
||||
available.collectedName = instance['collectedfrom'].name;
|
||||
}
|
||||
|
||||
if (instance.hasOwnProperty("instancetype") && instance['instancetype'].classname) {
|
||||
available.type = instance['instancetype'].classname;
|
||||
}
|
||||
|
||||
if (instance.hasOwnProperty("dateofacceptance")) {
|
||||
var date: string = (instance.dateofacceptance) + ""; // transform to string in case it is an integer
|
||||
available.year = (date && (date).indexOf('-') !== -1) ? date.split('-')[0] : date;
|
||||
}
|
||||
|
||||
available.accessMode = new Array<string>();
|
||||
available.downloadUrl = new Array<string>();
|
||||
available['downloadUrl'].push(url);
|
||||
if (instance.hasOwnProperty("accessright")) {
|
||||
if (url) {
|
||||
available['accessMode'].push(instance['accessright'].classname);
|
||||
}
|
||||
|
||||
if (this.changeBestAccessMode(available.bestAccessMode, instance['accessright'])) {
|
||||
available.bestAccessMode = instance['accessright'].classname;
|
||||
/*
|
||||
if(title != undefined) {
|
||||
if(this.changeBestAccessMode(title['accessMode'], instance['accessright'])) {
|
||||
title['accessMode'] = instance['accessright'].classid;
|
||||
title['url'] = url;
|
||||
}
|
||||
}
|
||||
*/
|
||||
if (this.changeBestAccessMode(accessMode, instance['accessright'])) {
|
||||
accessMode = instance['accessright'].classname;
|
||||
}
|
||||
}
|
||||
/*
|
||||
if(title != undefined) {
|
||||
if(!title['url']) {
|
||||
title['url'] = url;
|
||||
}
|
||||
}
|
||||
*/
|
||||
} else if (url) {
|
||||
available['accessMode'].push("");
|
||||
}
|
||||
|
||||
hostedBy_collectedFrom.push(available);
|
||||
}
|
||||
|
||||
return counter;
|
||||
}
|
||||
|
||||
|
||||
// publication & dataset landing : for downloadFrom and publishedIn
|
||||
changeBestAccessMode(currentAccessMode: string, accessMode: any): boolean {
|
||||
if(!accessMode) {
|
||||
if (!accessMode) {
|
||||
return false;
|
||||
}
|
||||
accessMode = accessMode.classid;
|
||||
|
||||
|
||||
switch (currentAccessMode) {
|
||||
case null:
|
||||
if(accessMode != "UNKNOWN") {
|
||||
if (accessMode != "UNKNOWN") {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case "CLOSED":
|
||||
if( accessMode == "OPEN" ||
|
||||
accessMode == "OPEN SOURCE" ||
|
||||
accessMode == "EMBARGO" ||
|
||||
accessMode == "RESTRICTED") {
|
||||
return true;
|
||||
if (accessMode == "OPEN" ||
|
||||
accessMode == "OPEN SOURCE" ||
|
||||
accessMode == "EMBARGO" ||
|
||||
accessMode == "RESTRICTED") {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case "RESTRICTED":
|
||||
if( accessMode == "OPEN" ||
|
||||
accessMode == "OPEN SOURCE" ||
|
||||
accessMode == "EMBARGO") {
|
||||
return true;
|
||||
if (accessMode == "OPEN" ||
|
||||
accessMode == "OPEN SOURCE" ||
|
||||
accessMode == "EMBARGO") {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case "EMBARGO":
|
||||
if( accessMode == "OPEN" ||
|
||||
accessMode == "OPEN SOURCE") {
|
||||
if (accessMode == "OPEN" ||
|
||||
accessMode == "OPEN SOURCE") {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
case "OPEN SOURCE":
|
||||
if( accessMode == "OPEN") {
|
||||
if (accessMode == "OPEN") {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
// publication & dataset & software & orp landing : for relatedResearchResults
|
||||
parseRelatedResearchResults(relatedResearchResults: Map<string, { "name": string, "id": string, "date": string,
|
||||
"percentage": number, "class": string}[]>, relation: any, provenanceAction: string) :
|
||||
Map<string, { "name": string, "id": string, "date": string,
|
||||
"percentage": number, "class": string}[]> {
|
||||
if(relatedResearchResults == undefined) {
|
||||
relatedResearchResults = new Map<string, {"name": string, "id": string, "date": string,
|
||||
"percentage": number, "class": string }[]>();
|
||||
parseRelatedResearchResults(relatedResearchResults: RelationResult[], relation: any, provenanceAction: string):
|
||||
RelationResult[] {
|
||||
if (relatedResearchResults == undefined) {
|
||||
relatedResearchResults = []
|
||||
}
|
||||
|
||||
if(!relatedResearchResults.has(provenanceAction)) {
|
||||
relatedResearchResults.set(provenanceAction,
|
||||
new Array<{ "name": string, "id": string, "date": string,
|
||||
"percentage": number, "class": string }>());
|
||||
}
|
||||
relatedResearchResults.get(provenanceAction).push(this.parseRelatedOrSimilarResearchResult(relation, "trust"));
|
||||
|
||||
relatedResearchResults.push(this.parseRelatedOrSimilarResearchResult(relation, "trust", provenanceAction));
|
||||
return relatedResearchResults;
|
||||
}
|
||||
|
||||
|
||||
// publication & dataset & software & orp landing : for supplementaryResearchResults
|
||||
parseSupplementaryResearchResults(supplementaryResearchResults: { "name": string, "id": string, "date": string,
|
||||
"percentage": number, "class": string}[], relation: any) :
|
||||
{ "name": string, "id": string, "date": string, "percentage": number, "class": string }[] {
|
||||
if(supplementaryResearchResults == undefined) {
|
||||
supplementaryResearchResults = new Array<{"name": string, "id": string, "date": string,
|
||||
"percentage": number, "class": string}>();
|
||||
parseSupplementaryResearchResults(supplementaryResearchResults: RelationResult[], relation: any): RelationResult[] {
|
||||
if (supplementaryResearchResults == undefined) {
|
||||
supplementaryResearchResults = [];
|
||||
}
|
||||
supplementaryResearchResults.push(this.parseRelatedOrSimilarResearchResult(relation, "trust"));
|
||||
return supplementaryResearchResults;
|
||||
}
|
||||
|
||||
|
||||
// publication & dataset & software & orp landing : for supplementedByResearchResults
|
||||
parseSupplementedByResearchResults(supplementedByResearchResults: { "name": string, "id": string, "date": string,
|
||||
"percentage": number, "class": string}[], relation: any) :
|
||||
{ "name": string, "id": string, "date": string, "percentage": number, "class": string }[] {
|
||||
if(supplementedByResearchResults == undefined) {
|
||||
supplementedByResearchResults = new Array<{"name": string, "id": string, "date": string,
|
||||
"percentage": number, "class": string}>();
|
||||
parseSupplementedByResearchResults(supplementedByResearchResults: RelationResult[], relation: any): RelationResult[] {
|
||||
if (supplementedByResearchResults == undefined) {
|
||||
supplementedByResearchResults = [];
|
||||
}
|
||||
supplementedByResearchResults.push(this.parseRelatedOrSimilarResearchResult(relation, "trust"));
|
||||
return supplementedByResearchResults;
|
||||
}
|
||||
|
||||
|
||||
// publication & dataset & software & orp landing : for similarResearchResults
|
||||
parseSimilarResearchResults(similarResearchResults: { "name": string, "id": string, "date": string,
|
||||
"percentage": number, "class": string}[], relation: any) :
|
||||
{ "name": string, "id": string, "date": string, "percentage": number, "class": string }[] {
|
||||
if(similarResearchResults == undefined) {
|
||||
similarResearchResults = new Array<{"name": string, "id": string, "date": string,
|
||||
"percentage": number, "class": string}>();
|
||||
parseSimilarResearchResults(similarResearchResults: RelationResult[], relation: any): RelationResult[] {
|
||||
if (similarResearchResults == undefined) {
|
||||
similarResearchResults = [];
|
||||
}
|
||||
similarResearchResults.push(this.parseRelatedOrSimilarResearchResult(relation, "similarity"));
|
||||
return similarResearchResults;
|
||||
}
|
||||
|
||||
|
||||
// publication & dataset & software & orp landing : for relatedResearchResults and similarResearchResults
|
||||
parseRelatedOrSimilarResearchResult(relation: any, percentageName: string): {"name": string, "id": string, "date": string, "percentage": number, "class": string} {
|
||||
let researchResult: {"name": string, "id": string, "date": string, "percentage": number, "class": string}
|
||||
= {"name": "", "id": "", "date": "", "percentage": null, "class": ""}
|
||||
if(relation['resulttype'].classname == "publication") {
|
||||
parseRelatedOrSimilarResearchResult(relation: any, percentageName: string, provenanceAction: string = null): RelationResult {
|
||||
let researchResult: RelationResult = {
|
||||
name: "",
|
||||
id: "",
|
||||
date: "",
|
||||
percentage: null,
|
||||
class: "",
|
||||
provenanceAction: provenanceAction
|
||||
};
|
||||
if (relation['resulttype'].classname == "publication") {
|
||||
researchResult['class'] = "publication";
|
||||
} else if(relation['resulttype'].classname == "dataset") {
|
||||
} else if (relation['resulttype'].classname == "dataset") {
|
||||
researchResult['class'] = "dataset";
|
||||
} else if(relation['resulttype'].classname == "software") {
|
||||
} else if (relation['resulttype'].classname == "software") {
|
||||
researchResult['class'] = "software";
|
||||
} else if(relation['resulttype'].classname == "other") {
|
||||
} else if (relation['resulttype'].classname == "other") {
|
||||
researchResult['class'] = "other";
|
||||
}
|
||||
|
||||
researchResult['id'] = relation['to'].content;
|
||||
let titleName = Array.isArray(relation['title']) ? relation['title'][0].content : relation['title'].content;
|
||||
researchResult['name'] = titleName;
|
||||
if(relation.hasOwnProperty("dateofacceptance")) {
|
||||
var date:string = ((Array.isArray(relation.dateofacceptance))?(relation.dateofacceptance[0]):(relation.dateofacceptance))+""; // transform to string in case it is an integer
|
||||
researchResult['date'] = (date && (date).indexOf('-') !== -1)?date.split('-')[0]:date;
|
||||
if (relation.hasOwnProperty("dateofacceptance")) {
|
||||
var date: string = ((Array.isArray(relation.dateofacceptance)) ? (relation.dateofacceptance[0]) : (relation.dateofacceptance)) + ""; // transform to string in case it is an integer
|
||||
researchResult['date'] = (date && (date).indexOf('-') !== -1) ? date.split('-')[0] : date;
|
||||
}
|
||||
//researchResult['date'] = relation.dateofacceptance.substring(0,4);;
|
||||
researchResult['percentage'] = Math.round(relation[percentageName]*100);
|
||||
researchResult['percentage'] = Math.round(relation[percentageName] * 100);
|
||||
return researchResult;
|
||||
}
|
||||
|
||||
sortByPercentage(results: { "name": string, "id": string, "date": string, "percentage": number, "class": string}[]) : { "name": string, "id": string, "date": string, "percentage": number, "class": string}[] {
|
||||
if(results) {
|
||||
return results.sort(function(a, b){return b["percentage"] - a["percentage"]});
|
||||
|
||||
sortByPercentage(results: RelationResult[]): RelationResult[] {
|
||||
if (results) {
|
||||
return results.sort(function (a, b) {
|
||||
return b["percentage"] - a["percentage"]
|
||||
});
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
|
||||
// publication & dataset landing : for identifiers
|
||||
parseIdentifiers(pid: any): Map<string, string[]> {
|
||||
let identifiers = new Map<string, string[]>();
|
||||
|
||||
if(pid.hasOwnProperty("classname") && pid['classname'] != "") {
|
||||
if(pid.classname == "doi" || pid.classname == "pmc" || pid.classname == "handle") {
|
||||
if(!identifiers.has(pid.classname)) {
|
||||
|
||||
if (pid.hasOwnProperty("classname") && pid['classname'] != "") {
|
||||
if (pid.classname == "doi" || pid.classname == "pmc" || pid.classname == "handle" || pid == "pmid") {
|
||||
if (!identifiers.has(pid.classname)) {
|
||||
identifiers.set(pid.classname, new Array<string>());
|
||||
}
|
||||
|
||||
|
||||
identifiers.get(pid.classname).push(pid.content);
|
||||
}
|
||||
} else {
|
||||
for(let i=0; i<pid.length; i++) {
|
||||
if(pid[i].classname == "doi" || pid[i].classname == "pmc" || pid[i].classname == "handle") {
|
||||
if(!identifiers.has(pid[i].classname)) {
|
||||
for (let i = 0; i < pid.length; i++) {
|
||||
if (pid[i].classname == "doi" || pid[i].classname == "pmc" || pid[i].classname == "handle" || pid == "pmid") {
|
||||
if (!identifiers.has(pid[i].classname)) {
|
||||
identifiers.set(pid[i].classname, new Array<string>());
|
||||
}
|
||||
identifiers.get(pid[i].classname).push(pid[i].content);
|
||||
|
@ -476,42 +467,42 @@ export class ParsingFunctions {
|
|||
}
|
||||
return identifiers;
|
||||
}
|
||||
|
||||
|
||||
// publication & dataset landing : for subjects and otherSubjects and classifiedSubjects
|
||||
parseAllSubjects(_subjects: any): [string[], Map<string, string[]>, Map<string, string[]>] {
|
||||
let subjects: string[];
|
||||
let otherSubjects: Map<string, string[]>;
|
||||
let classifiedSubjects: Map<string, string[]>;
|
||||
|
||||
|
||||
let subject;
|
||||
let length = Array.isArray(_subjects) ? _subjects.length : 1;
|
||||
|
||||
for(let i=0; i<length; i++) {
|
||||
|
||||
for (let i = 0; i < length; i++) {
|
||||
subject = Array.isArray(_subjects) ? _subjects[i] : _subjects;
|
||||
if(subject.classid != "") {
|
||||
if(subject.inferred && subject.inferred == true) {
|
||||
if(classifiedSubjects == undefined) {
|
||||
if (subject.classid != "") {
|
||||
if (subject.inferred && subject.inferred == true) {
|
||||
if (classifiedSubjects == undefined) {
|
||||
classifiedSubjects = new Map<string, string[]>();
|
||||
}
|
||||
|
||||
if(!classifiedSubjects.has(subject.classname)) {
|
||||
|
||||
if (!classifiedSubjects.has(subject.classname)) {
|
||||
classifiedSubjects.set(subject.classname, new Array<string>());
|
||||
}
|
||||
|
||||
|
||||
classifiedSubjects.get(subject.classname).push(subject.content);
|
||||
} else {
|
||||
if(subject.classid == "keyword") {
|
||||
if(subjects == undefined) {
|
||||
if (subject.classid == "keyword") {
|
||||
if (subjects == undefined) {
|
||||
subjects = new Array<string>();
|
||||
}
|
||||
|
||||
|
||||
subjects.push(subject.content);
|
||||
} else {
|
||||
if(otherSubjects == undefined) {
|
||||
if (otherSubjects == undefined) {
|
||||
otherSubjects = new Map<string, string[]>();
|
||||
}
|
||||
|
||||
if(!otherSubjects.has(subject.classname)) {
|
||||
|
||||
if (!otherSubjects.has(subject.classname)) {
|
||||
otherSubjects.set(subject.classname, new Array<string>());
|
||||
}
|
||||
otherSubjects.get(subject.classname).push(subject.content);
|
||||
|
@ -521,21 +512,25 @@ export class ParsingFunctions {
|
|||
}
|
||||
return [subjects, otherSubjects, classifiedSubjects];
|
||||
}
|
||||
|
||||
parseContexts(_contexts: any): {"labelContext": string, "labelCategory": string,
|
||||
"labelConcept": string, inline:boolean}[] {
|
||||
let contexts = new Array<{"labelContext": string, "labelCategory": string,
|
||||
"labelConcept": string, inline:boolean}>();
|
||||
|
||||
|
||||
parseContexts(_contexts: any): {
|
||||
"labelContext": string, "labelCategory": string,
|
||||
"labelConcept": string, inline: boolean
|
||||
}[] {
|
||||
let contexts = new Array<{
|
||||
"labelContext": string, "labelCategory": string,
|
||||
"labelConcept": string, inline: boolean
|
||||
}>();
|
||||
|
||||
let position = 0;
|
||||
let labels = "";
|
||||
let context;
|
||||
let length = Array.isArray(_contexts) ? _contexts.length : 1;
|
||||
for(let i=0; i<length; i++) {
|
||||
for (let i = 0; i < length; i++) {
|
||||
context = Array.isArray(_contexts) ? _contexts[i] : _contexts;
|
||||
|
||||
if(context.hasOwnProperty("type") && (context['type'] == "community" || context['type'] == "ri")) {
|
||||
if(context.hasOwnProperty("category")) {
|
||||
|
||||
if (context.hasOwnProperty("type") && (context['type'] == "community" || context['type'] == "ri")) {
|
||||
if (context.hasOwnProperty("category")) {
|
||||
let category;
|
||||
let length2 = Array.isArray(context['category']) ? context['category'].length : 1;
|
||||
for (let z = 0; z < length2; z++) {
|
||||
|
@ -545,12 +540,12 @@ export class ParsingFunctions {
|
|||
let length1 = Array.isArray(category['concept']) ? category['concept'].length : 1;
|
||||
for (let j = 0; j < length1; j++) {
|
||||
categoryConcept = Array.isArray(category['concept']) ? category['concept'][j] : category['concept'];
|
||||
|
||||
|
||||
contexts[position] = {"labelContext": "", "labelCategory": "", "labelConcept": "", inline: false};
|
||||
contexts[position]['labelContext'] = context.label;
|
||||
contexts[position]['labelCategory'] = category.label;
|
||||
contexts[position]['labelConcept'] = categoryConcept.label;
|
||||
|
||||
|
||||
position++;
|
||||
}
|
||||
} else {
|
||||
|
@ -573,91 +568,91 @@ export class ParsingFunctions {
|
|||
}
|
||||
return contexts;
|
||||
}
|
||||
|
||||
|
||||
parseTypes(types: string[], uniqueTypes: Set<string>, instance: any) {
|
||||
if(instance.hasOwnProperty("instancetype") && instance['instancetype'].classname) {
|
||||
if(!uniqueTypes.has(instance['instancetype'].classname)) {
|
||||
if (instance.hasOwnProperty("instancetype") && instance['instancetype'].classname) {
|
||||
if (!uniqueTypes.has(instance['instancetype'].classname)) {
|
||||
types.push(instance['instancetype'].classname);
|
||||
uniqueTypes.add(instance['instancetype'].classname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
parseLanguages(_languages: any) {
|
||||
var languages = new Array<string>();
|
||||
|
||||
if(!Array.isArray(_languages)) {
|
||||
if(_languages.classname != "Undetermined" && _languages.classname) {
|
||||
|
||||
if (!Array.isArray(_languages)) {
|
||||
if (_languages.classname != "Undetermined" && _languages.classname) {
|
||||
languages.push(_languages.classname);
|
||||
}
|
||||
} else {
|
||||
for(let i=0; i<_languages.length; i++) {
|
||||
if(_languages[i].classname != "Undetermined" && _languages[i].classname) {
|
||||
for (let i = 0; i < _languages.length; i++) {
|
||||
if (_languages[i].classname != "Undetermined" && _languages[i].classname) {
|
||||
languages.push(_languages[i].classname);
|
||||
}
|
||||
}
|
||||
}
|
||||
return languages;
|
||||
}
|
||||
|
||||
|
||||
parseCountries(_countries: any) {
|
||||
var countries = new Array<string>();
|
||||
|
||||
if(!Array.isArray(_countries)) {
|
||||
if(_countries.classname != "Undetermined" && _countries.classname) {
|
||||
|
||||
if (!Array.isArray(_countries)) {
|
||||
if (_countries.classname != "Undetermined" && _countries.classname) {
|
||||
countries.push(_countries.classname);
|
||||
}
|
||||
} else {
|
||||
for(let i=0; i<countries.length; i++) {
|
||||
if(_countries[i].classname != "Undetermined" && _countries[i].classname) {
|
||||
for (let i = 0; i < countries.length; i++) {
|
||||
if (_countries[i].classname != "Undetermined" && _countries[i].classname) {
|
||||
countries.push(_countries[i].classname);
|
||||
}
|
||||
}
|
||||
}
|
||||
return countries;
|
||||
}
|
||||
|
||||
|
||||
parseProgrammingLanguages(_pLanguages) {
|
||||
var pLanguages = new Array<string>();
|
||||
|
||||
if(!Array.isArray(_pLanguages)) {
|
||||
if(_pLanguages.classname != "Undetermined" && _pLanguages.classname) {
|
||||
|
||||
if (!Array.isArray(_pLanguages)) {
|
||||
if (_pLanguages.classname != "Undetermined" && _pLanguages.classname) {
|
||||
pLanguages.push(_pLanguages.classname);
|
||||
}
|
||||
} else {
|
||||
for(let i=0; i<_pLanguages.length; i++) {
|
||||
if(_pLanguages[i].classname != "Undetermined" && _pLanguages[i].classname) {
|
||||
for (let i = 0; i < _pLanguages.length; i++) {
|
||||
if (_pLanguages[i].classname != "Undetermined" && _pLanguages[i].classname) {
|
||||
pLanguages.push(_pLanguages[i].classname);
|
||||
}
|
||||
}
|
||||
}
|
||||
return pLanguages;
|
||||
}
|
||||
|
||||
parseReferences(citations: any): {"name": string, "url": string}[] {
|
||||
let references = new Array<{"name": string, "url": string}>();
|
||||
|
||||
|
||||
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<length; i++) {
|
||||
for (let i = 0; i < length; i++) {
|
||||
citation = Array.isArray(citations) ? citations[i] : citations;
|
||||
|
||||
|
||||
let url;
|
||||
if(citation.hasOwnProperty("id")) {
|
||||
if (citation.hasOwnProperty("id")) {
|
||||
let citationId;
|
||||
let length1 = Array.isArray(citation['id']) ? citation['id'].length : 1;
|
||||
for(let j=0; j<length1; j++) {
|
||||
for (let j = 0; j < length1; j++) {
|
||||
citationId = Array.isArray(citation['id']) ? citation['id'][j] : citation['id'];
|
||||
|
||||
if(citationId.type == "pmid") {
|
||||
url = "http://www.ncbi.nlm.nih.gov/pubmed/"+citationId.value;
|
||||
|
||||
if (citationId.type == "pmid") {
|
||||
url = "http://www.ncbi.nlm.nih.gov/pubmed/" + citationId.value;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
references[citation.position-1] = { "name": "", "url": ""};
|
||||
references[citation.position-1]['name'] = citation.rawText;
|
||||
references[citation.position-1]['url'] = url;
|
||||
|
||||
references[citation.position - 1] = {"name": "", "url": ""};
|
||||
references[citation.position - 1]['name'] = citation.rawText;
|
||||
references[citation.position - 1]['url'] = url;
|
||||
}
|
||||
return references;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,120 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import {ActivatedRoute} from '@angular/router';
|
||||
|
||||
import {FetchProjects} from '../../utils/fetchEntitiesClasses/fetchProjects.class';
|
||||
import {SearchProjectsService} from '../../services/searchProjects.service';
|
||||
|
||||
import {ErrorCodes} from '../../utils/properties/errorCodes';
|
||||
import {StringUtils} from '../../utils/string-utils.class';
|
||||
import {RouterHelper} from '../../utils/routerHelper.class';
|
||||
import {EnvProperties} from '../../utils/properties/env-properties';
|
||||
import {ResultLandingInfo} from "../../utils/entities/resultLandingInfo";
|
||||
import {ResultPreview} from "../../utils/result-preview/result-preview";
|
||||
import {SearchResult} from "../../utils/entities/searchResult";
|
||||
import {AlertModal} from "../../utils/modal/alert";
|
||||
|
||||
@Component({
|
||||
selector: 'projectsInModal',
|
||||
template: `
|
||||
<errorMessages [status]="[fetchProjects.searchUtils.status]" [type]="'projects'"
|
||||
tab_error_class=true></errorMessages>
|
||||
|
||||
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.DONE">
|
||||
<ul *ngIf="fetchProjects.funders.length > 1" class="uk-list uk-list-divider uk-margin-remove">
|
||||
<li *ngFor="let filter of fetchProjects.filters ">
|
||||
<!--div class="text-bold">Filter by {{filter.title}}:</div-->
|
||||
<span *ngFor="let value of filter.values" class="uk-animation-fade uk-margin-small-right">
|
||||
<input [(ngModel)]="value.selected" type="checkbox"
|
||||
(ngModelChange)="filterChange(value.selected)"/>
|
||||
<span title="{{value.name}}"> {{value.name}}</span>
|
||||
</span>
|
||||
</li>
|
||||
</ul>
|
||||
<no-load-paging *ngIf="fetchProjects.searchUtils.totalResults > size" [type]="'projects'"
|
||||
(pageChange)="pageChange($event)"
|
||||
[page]="page" [pageSize]="size"
|
||||
[totalResults]="fetchProjects.searchUtils.totalResults">
|
||||
</no-load-paging>
|
||||
<ul class="uk-list uk-list-divider uk-margin">
|
||||
<li *ngFor="let result of fetchProjects.results">
|
||||
<result-preview [properties]="properties" [modal]="modal" [result]="getResultPreview(result)"></result-preview>
|
||||
</li>
|
||||
</ul>
|
||||
<no-load-paging *ngIf="fetchProjects.searchUtils.totalResults > size" [type]="'projects'"
|
||||
(pageChange)="pageChange($event)"
|
||||
[page]="page" [pageSize]="size"
|
||||
[totalResults]="fetchProjects.searchUtils.totalResults">
|
||||
</no-load-paging>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
|
||||
export class ProjectsInModalComponent {
|
||||
@Input() fetchProjects: FetchProjects;
|
||||
@Input() organizationId: string = "";
|
||||
@Input() properties: EnvProperties;
|
||||
@Input() modal: AlertModal;
|
||||
public page: number = 1;
|
||||
public size: number = 10;
|
||||
public linkToSearchProjects: string;
|
||||
|
||||
public routerHelper: RouterHelper = new RouterHelper();
|
||||
public errorCodes: ErrorCodes = new ErrorCodes();
|
||||
|
||||
private filterQuery: string = "";
|
||||
|
||||
constructor(private route: ActivatedRoute,
|
||||
private _searchProjectsService: SearchProjectsService) {
|
||||
}
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
if (this.organizationId) {
|
||||
this.linkToSearchProjects = this.properties.searchLinkToAdvancedProjects;//+"?organization="+this.organizationId+"or=and";;
|
||||
if (this.fetchProjects.searchUtils.totalResults > 0) {
|
||||
this.search(false, "");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public getResultPreview(result: SearchResult): ResultPreview {
|
||||
return ResultPreview.searchResultConvert(result, 'project');
|
||||
}
|
||||
|
||||
private search(refine: boolean, filterQuery: string) {
|
||||
var refineFields: string [] = ["funder"];
|
||||
this.fetchProjects.getResultsForOrganizations(this.organizationId, filterQuery, this.page, this.size, (refine) ? refineFields : [], this.properties);
|
||||
}
|
||||
|
||||
public pageChange($event) {
|
||||
this.page = $event.value;
|
||||
this.search(false, this.filterQuery);
|
||||
}
|
||||
|
||||
public filterChange($event) {
|
||||
this.updateFilters();
|
||||
//this.search(true, this.filterQuery);
|
||||
this.search(false, this.filterQuery);
|
||||
}
|
||||
|
||||
private updateFilters() {
|
||||
this.filterQuery = "";
|
||||
for (let filter of this.fetchProjects.filters) {
|
||||
var filterLimits = "";
|
||||
for (let value of filter.values) {
|
||||
if (value.selected == true) {
|
||||
//filterLimits+=((filterLimits.length == 0)?'':',') +'"'+ StringUtils.URIEncode(value.id)+'"';
|
||||
filterLimits += ((filterLimits.length == 0) ? '' : ' or ') + filter.filterId + ' exact ';
|
||||
filterLimits += '"' + StringUtils.URIEncode(value.id) + '"';
|
||||
}
|
||||
}
|
||||
if (filterLimits.length > 0) {
|
||||
//this.filterQuery+=' and '+filter.filterId + ' exact '+ filterLimits + ' ';
|
||||
this.filterQuery += ' and ( ' + filterLimits + ' ) ';
|
||||
}
|
||||
|
||||
}
|
||||
//console.log("Filter Changed"+this.filterQuery);
|
||||
|
||||
}
|
||||
}
|
|
@ -7,25 +7,27 @@ import { RouterModule } from '@angular/router';
|
|||
|
||||
import { ProjectsServiceModule} from '../../services/projectsService.module';
|
||||
import { TabResultModule } from '../../searchPages/searchUtils/tabResult.module';
|
||||
import { SearchingProjectsTabComponent} from './searchingProjectsInTab.component';
|
||||
import { ProjectsInModalComponent} from './projects-in-modal.component';
|
||||
|
||||
import {PagingModule } from '../../utils/paging.module';
|
||||
import {ErrorMessagesModule} from '../../utils/errorMessages.module';
|
||||
import {NoLoadPaging} from "../../searchPages/searchUtils/no-load-paging.module";
|
||||
import {ResultPreviewModule} from "../../utils/result-preview/result-preview.module";
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule, CommonModule, FormsModule,
|
||||
ProjectsServiceModule, TabResultModule,
|
||||
PagingModule, ErrorMessagesModule
|
||||
],
|
||||
RouterModule, CommonModule, FormsModule,
|
||||
ProjectsServiceModule, TabResultModule,
|
||||
PagingModule, ErrorMessagesModule, NoLoadPaging, ResultPreviewModule
|
||||
],
|
||||
declarations: [
|
||||
SearchingProjectsTabComponent
|
||||
ProjectsInModalComponent
|
||||
],
|
||||
providers:[
|
||||
],
|
||||
exports: [
|
||||
|
||||
SearchingProjectsTabComponent
|
||||
ProjectsInModalComponent
|
||||
]
|
||||
})
|
||||
export class SearchingProjectsTabModule { }
|
||||
export class ProjectsInModalModule { }
|
|
@ -4,44 +4,51 @@ import {HelperFunctions} from "../../utils/HelperFunctions.class";
|
|||
@Component({
|
||||
selector: 'relatedTo',
|
||||
template: `
|
||||
<dl relatedTo [class]="'uk-description-list-line' + ((contexts && contexts.length > threshold) ? ' uk-margin-remove-bottom' : '')">
|
||||
<dt class="sideInfoTitle">Related to</dt>
|
||||
<dd class="line" *ngFor="let item of contexts.slice(0, showNum) let i=index">
|
||||
<span *ngIf="!item['inline']">
|
||||
<span>{{item['labelContext']}}</span>
|
||||
<span *ngIf="item['labelCategory']"><span uk-icon="icon: arrow-right"></span>{{item['labelCategory']}}</span>
|
||||
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
|
||||
</span>
|
||||
<mark *ngIf="item['inline']">
|
||||
<span>{{item['labelContext']}}</span>
|
||||
<span *ngIf="item['labelCategory']"><span uk-icon="icon: arrow-right"></span>{{item['labelCategory']}}</span>
|
||||
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
|
||||
</mark>
|
||||
</dd>
|
||||
</dl>
|
||||
<div *ngIf="showNum > threshold" class="uk-text-right uk-margin-bottom">
|
||||
<a (click)="showNum = threshold; scroll()">
|
||||
View less
|
||||
</a>
|
||||
</div>
|
||||
<div *ngIf="showNum == threshold && contexts && contexts.length > threshold" class="uk-text-right uk-margin-bottom">
|
||||
<a (click)="showNum = contexts.length;">
|
||||
View more
|
||||
</a>
|
||||
<div class="uk-margin-bottom">
|
||||
<div class="uk-text-small">
|
||||
<div class="uk-text-muted">
|
||||
Communities:
|
||||
</div>
|
||||
<div class="uk-margin-small-left" *ngFor="let item of contexts.slice(0, showNum); let i=index">
|
||||
<span *ngIf="!item['inline']">
|
||||
<span>{{item['labelContext']}}</span>
|
||||
<span *ngIf="item['labelCategory']"><span uk-icon="icon: arrow-right"></span>{{item['labelCategory']}}</span>
|
||||
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
|
||||
</span>
|
||||
<mark *ngIf="item['inline']">
|
||||
<span>{{item['labelContext']}}</span>
|
||||
<span *ngIf="item['labelCategory']"><span
|
||||
uk-icon="icon: arrow-right"></span>{{item['labelCategory']}}</span>
|
||||
<span *ngIf="item['labelConcept']">: {{item['labelConcept']}}</span>
|
||||
</mark>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="showNum > threshold" class="uk-text-right">
|
||||
<a (click)="showNum = threshold; scroll()">
|
||||
View less
|
||||
</a>
|
||||
</div>
|
||||
<div *ngIf="showNum == threshold && contexts && contexts.length > threshold" class="uk-text-right">
|
||||
<a (click)="showNum = contexts.length;">
|
||||
View more
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
|
||||
export class RelatedToComponent {
|
||||
@Input() contexts: { "labelContext": string, "labelCategory": string, "labelConcept": string, "inline": boolean}[];
|
||||
|
||||
@Input() contexts: { "labelContext": string, "labelCategory": string, "labelConcept": string, "inline": boolean }[];
|
||||
|
||||
public threshold: number = 5;
|
||||
public showNum: number = 5;
|
||||
|
||||
constructor () {}
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
public scroll() {
|
||||
HelperFunctions.scroll();
|
||||
}
|
||||
|
|
|
@ -1,116 +0,0 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import {ActivatedRoute} from '@angular/router';
|
||||
|
||||
import { FetchProjects } from '../../utils/fetchEntitiesClasses/fetchProjects.class';
|
||||
import { SearchProjectsService } from '../../services/searchProjects.service';
|
||||
|
||||
import {ErrorCodes} from '../../utils/properties/errorCodes';
|
||||
import {StringUtils} from '../../utils/string-utils.class';
|
||||
import {RouterHelper} from '../../utils/routerHelper.class';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
|
||||
@Component({
|
||||
selector: 'searchingProjectsTab',
|
||||
template: `
|
||||
<errorMessages [status]="[fetchProjects.searchUtils.status]" [type]="'projects'" tab_error_class=true></errorMessages>
|
||||
|
||||
<div *ngIf="fetchProjects.searchUtils.status == errorCodes.DONE">
|
||||
<div class = "uk-text-right" *ngIf = "fetchProjects.searchUtils.totalResultsNoFilters > 10">
|
||||
<a [queryParams]="routerHelper.createQueryParams(['organization', 'og'], [organizationId, 'and'])"
|
||||
routerLinkActive="router-link-active" [routerLink]="linkToSearchProjects" class="uk-button uk-button-text">
|
||||
View all {{fetchProjects.searchUtils.totalResultsNoFilters | number}} results
|
||||
</a>
|
||||
</div>
|
||||
<div class= "searchPaging uk-panel uk-margin-top">
|
||||
<div class="uk-clearfix">
|
||||
<div class="uk-float-right" *ngIf="fetchProjects.results && fetchProjects.searchUtils.totalResults > fetchProjects.searchUtils.size">
|
||||
<paging-no-load [currentPage]="page" [totalResults]="fetchProjects.searchUtils.totalResults" [term]="keyword" [size]="size" (pageChange)="pageChange($event)"> </paging-no-load>
|
||||
</div>
|
||||
</div>
|
||||
<ul *ngIf = "fetchProjects.funders.length > 1" class="uk-list uk-list-divider uk-margin-remove">
|
||||
<li *ngFor="let filter of fetchProjects.filters " >
|
||||
<!--div class="text-bold">Filter by {{filter.title}}:</div-->
|
||||
<span *ngFor = "let value of filter.values" class = "uk-animation-fade">
|
||||
<input [(ngModel)]="value.selected" type="checkbox" (ngModelChange)="filterChange(value.selected)" />
|
||||
<span title = "{{value.name}}"> {{value.name}}</span><span *ngIf = "showResultCount === true" > ({{value.number | number}})</span>
|
||||
</span>
|
||||
</li>
|
||||
|
||||
<li *ngIf = "fetchProjects.searchUtils.totalResults !=fetchProjects.searchUtils.totalResultsNoFilters "> Filtered {{fetchProjects.searchUtils.totalResults | number}} results of {{fetchProjects.searchUtils.totalResultsNoFilters | number}} total results</li>
|
||||
<li></li>
|
||||
</ul>
|
||||
|
||||
<tab-result [(results)]="fetchProjects.results" [(status)]= "fetchProjects.searchUtils.status"
|
||||
type="project" urlParam="projectId" [showLoading] = true [showOrganizations] = false>
|
||||
</tab-result>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
|
||||
export class SearchingProjectsTabComponent {
|
||||
@Input() fetchProjects : FetchProjects;
|
||||
@Input() organizationId:string = "";
|
||||
@Input() properties:EnvProperties;
|
||||
public page :number = 1;
|
||||
public size :number = 10;
|
||||
public linkToSearchProjects: string;
|
||||
|
||||
public routerHelper:RouterHelper = new RouterHelper();
|
||||
public errorCodes:ErrorCodes = new ErrorCodes();
|
||||
|
||||
private filterQuery:string = "";
|
||||
|
||||
constructor (private route: ActivatedRoute,
|
||||
private _searchProjectsService: SearchProjectsService) {
|
||||
}
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
if(this.organizationId) {
|
||||
this.linkToSearchProjects = this.properties.searchLinkToAdvancedProjects;//+"?organization="+this.organizationId+"or=and";;
|
||||
if(this.fetchProjects.searchUtils.totalResults > 0) {
|
||||
this.search(false,"");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private search(refine:boolean, filterQuery:string){
|
||||
var refineFields:string [] = ["funder"];
|
||||
this.fetchProjects.getResultsForOrganizations(this.organizationId, filterQuery, this.page, this.size,(refine)?refineFields:[], this.properties);
|
||||
}
|
||||
|
||||
public pageChange($event) {
|
||||
this.page=$event.value;
|
||||
this.search(false, this.filterQuery);
|
||||
}
|
||||
|
||||
public filterChange($event) {
|
||||
this.updateFilters();
|
||||
//this.search(true, this.filterQuery);
|
||||
this.search(false, this.filterQuery);
|
||||
}
|
||||
|
||||
private updateFilters (){
|
||||
this.filterQuery = "";
|
||||
for (let filter of this.fetchProjects.filters){
|
||||
var filterLimits="";
|
||||
for (let value of filter.values){
|
||||
if(value.selected == true){
|
||||
//filterLimits+=((filterLimits.length == 0)?'':',') +'"'+ StringUtils.URIEncode(value.id)+'"';
|
||||
filterLimits+=((filterLimits.length == 0)?'':' or ')+filter.filterId+' exact ';
|
||||
filterLimits+='"'+ StringUtils.URIEncode(value.id)+'"';
|
||||
}
|
||||
}
|
||||
if(filterLimits.length > 0){
|
||||
//this.filterQuery+=' and '+filter.filterId + ' exact '+ filterLimits + ' ';
|
||||
this.filterQuery+=' and ( ' + filterLimits + ' ) ';
|
||||
}
|
||||
|
||||
}
|
||||
//console.log("Filter Changed"+this.filterQuery);
|
||||
|
||||
}
|
||||
}
|
|
@ -2,92 +2,106 @@ import {Component, Input} from '@angular/core';
|
|||
import {HelperFunctions} from "../../utils/HelperFunctions.class";
|
||||
|
||||
@Component({
|
||||
selector: 'showIdentifiers',
|
||||
template: `
|
||||
|
||||
<span *ngIf="countIdentifiers() > 0" class="uk-text-bold">Identifiers: </span>
|
||||
|
||||
<span *ngIf="showAll && countIdentifiers() > pageSize">
|
||||
<a (click)="showAll = !showAll;">View less identifiers</a>
|
||||
selector: 'showIdentifiers',
|
||||
template: `
|
||||
<ng-container *ngFor="let key of getKeys(identifiers) let i=index">
|
||||
<li>
|
||||
<span *ngIf="countSizeOfPreviousIdentifiers(i) < pageSize || showAll" class="uk-margin-right">
|
||||
<span class="uk-text-muted uk-text-uppercase">{{key}}: </span>
|
||||
<ng-container *ngFor="let item of identifiers.get(key) let j=index">
|
||||
<span *ngIf="(sizeOfPreviousIdentifiers + j) < pageSize || showAll">
|
||||
<span class="uk-display-inline-block">
|
||||
<a *ngIf="key=='doi'" [href]="doiURL + item" target="_blank">
|
||||
{{item}} <span class="custom-external custom-icon space"></span>
|
||||
</a>
|
||||
<a *ngIf="key=='pmc'" [href]="pmcURL + item" target="_blank">
|
||||
{{item}} <span class="custom-external custom-icon space"></span>
|
||||
</a>
|
||||
<a *ngIf="key=='pmid'" [href]="pmidURL + item" target="_blank">
|
||||
{{item}} <span class="custom-external custom-icon space"></span>
|
||||
</a>
|
||||
<a *ngIf="key=='handle'" [href]="handleURL + item" target="_blank">
|
||||
{{item}} <span class="custom-external custom-icon space"></span>
|
||||
</a>
|
||||
</span>
|
||||
|
||||
<ng-container *ngFor="let key of getKeys(identifiers) let i=index">
|
||||
<ng-container *ngIf="countSizeOfPreviousIdentifiers(i) < pageSize">
|
||||
<ng-container *ngFor="let item of identifiers.get(key) let j=index">
|
||||
<span *ngIf="(sizeOfPreviousIdentifiers + j) < pageSize || showAll" class="custom-external custom-icon">
|
||||
<a *ngIf="key=='doi'" href="{{doiURL}}{{item}}" target="_blank">{{key}}: {{item}}</a><a
|
||||
*ngIf="key=='pmc'" href="{{pmcURL}}{{item}}" target="_blank">{{key}}: {{item}}</a><a
|
||||
*ngIf="key=='handle'" href="{{handleURL}}{{item}}" target="_blank">{{key}}: {{item}}</a></span><span
|
||||
|
||||
*ngIf="((sizeOfPreviousIdentifiers + j) < pageSize || showAll) && ((sizeOfPreviousIdentifiers + j) < countIdentifiers()-1)">{{", "}}</span>
|
||||
<span *ngIf="!showAll && (sizeOfPreviousIdentifiers + j)==pageSize"> ... </span>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
|
||||
<span *ngIf="!showAll && countIdentifiers() > pageSize">
|
||||
<a (click)="showAll = !showAll;">
|
||||
view all {{countIdentifiers() | number}} identifiers
|
||||
</a>
|
||||
</span>
|
||||
<span *ngIf="showAll && countIdentifiers() > pageSize">
|
||||
<a (click)="showAll = !showAll; scroll()">View less identifiers</a>
|
||||
</span>
|
||||
|
||||
|
||||
`
|
||||
})
|
||||
<span *ngIf="j !== (identifiers.get(key).length - 1)">, </span>
|
||||
</span>
|
||||
</ng-container>
|
||||
</span>
|
||||
</li>
|
||||
</ng-container>
|
||||
<div *ngIf="!showAll && countIdentifiers() > pageSize" class="uk-text-right">
|
||||
<a (click)="showAll = !showAll;">
|
||||
View all {{countIdentifiers() | number}} identifiers
|
||||
</a>
|
||||
</div>
|
||||
<div *ngIf="showAll && countIdentifiers() > pageSize" class="uk-text-right">
|
||||
<a (click)="showAll = !showAll; scroll()">View less identifiers</a>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
|
||||
export class ShowIdentifiersComponent {
|
||||
@Input() identifiers: Map<string, string[]>;
|
||||
public doiURL: string;
|
||||
public pmcURL: string;
|
||||
public handleURL: string;
|
||||
public showAll: boolean = false;
|
||||
public sizeOfIdentifiers: number = -1;
|
||||
public sizeOfPreviousIdentifiers: number = -1;
|
||||
public pageSize: number = 10;
|
||||
|
||||
constructor () {
|
||||
this.doiURL = "https://dx.doi.org/";
|
||||
this.pmcURL = "http://europepmc.org/articles/";
|
||||
this.handleURL = "http://hdl.handle.net/";
|
||||
}
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
public countIdentifiers(): number {
|
||||
if(this.sizeOfIdentifiers < 0) {
|
||||
let num: number = 0;
|
||||
if(this.identifiers != undefined) {
|
||||
this.identifiers.forEach(function (value, key, map) {
|
||||
num += value.length;
|
||||
});
|
||||
}
|
||||
this.sizeOfIdentifiers = num;
|
||||
}
|
||||
return this.sizeOfIdentifiers;
|
||||
}
|
||||
|
||||
public countSizeOfPreviousIdentifiers(index: number): number {
|
||||
@Input() identifiers: Map<string, string[]>;
|
||||
public doiURL: string;
|
||||
public pmcURL: string;
|
||||
public pmidURL: string;
|
||||
public handleURL: string;
|
||||
public showAll: boolean = false;
|
||||
public sizeOfIdentifiers: number = -1;
|
||||
public sizeOfPreviousIdentifiers: number = -1;
|
||||
public pageSize: number = 3;
|
||||
|
||||
constructor() {
|
||||
this.doiURL = "https://dx.doi.org/";
|
||||
this.pmcURL = "http://europepmc.org/articles/";
|
||||
this.handleURL = "http://hdl.handle.net/";
|
||||
this.pmidURL = "https://www.ncbi.nlm.nih.gov/pubmed/";
|
||||
}
|
||||
|
||||
ngOnInit() {}
|
||||
|
||||
public countIdentifiers(): number {
|
||||
if (this.sizeOfIdentifiers < 0) {
|
||||
let num: number = 0;
|
||||
let i: number = 0;
|
||||
if(this.identifiers != undefined) {
|
||||
this.identifiers.forEach(function (value, key, map) {
|
||||
if(i < index) {
|
||||
num += value.length;
|
||||
}
|
||||
i++;
|
||||
if (this.identifiers != undefined) {
|
||||
this.identifiers.forEach((value, key, map) => {
|
||||
num += value.length;
|
||||
});
|
||||
}
|
||||
this.sizeOfPreviousIdentifiers= num;
|
||||
return num;
|
||||
this.sizeOfIdentifiers = num;
|
||||
}
|
||||
|
||||
public scroll() {
|
||||
HelperFunctions.scroll();
|
||||
}
|
||||
public getKeys( map) {
|
||||
return Array.from(map.keys());
|
||||
return this.sizeOfIdentifiers;
|
||||
}
|
||||
|
||||
public countSizeOfPreviousIdentifiers(index: number): number {
|
||||
let num: number = 0;
|
||||
let i: number = 0;
|
||||
if (this.identifiers != undefined) {
|
||||
this.identifiers.forEach(function (value, key, map) {
|
||||
if (i < index) {
|
||||
num += value.length;
|
||||
}
|
||||
i++;
|
||||
});
|
||||
}
|
||||
this.sizeOfPreviousIdentifiers = num;
|
||||
return num;
|
||||
}
|
||||
|
||||
public scroll() {
|
||||
HelperFunctions.scroll();
|
||||
}
|
||||
|
||||
public getKeys(map) {
|
||||
return Array.from(map.keys()).sort((a: string, b: string) => {
|
||||
if(a === 'doi') {
|
||||
return -1;
|
||||
} else if(b === 'doi') {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,74 +4,95 @@ import {EnvProperties} from "../../utils/properties/env-properties";
|
|||
@Component({
|
||||
selector: 'showPublisher',
|
||||
template: `
|
||||
<li *ngIf="publisher"><span class="uk-text-bold">Publisher: </span> {{publisher}}</li>
|
||||
<li *ngIf="journal &&
|
||||
(journal['journal'] || journal['issn'] || journal['lissn']
|
||||
|| journal['volume'] || journal['eissn'] || journal['issue'])">
|
||||
<span class="uk-text-bold">Journal: </span>
|
||||
<span *ngIf="journal['journal']">{{journal['journal']}}</span
|
||||
><span *ngIf="journal['journal'] && (journal['volume'] || journal['issue'])">,</span>
|
||||
<span *ngIf="journal['volume']"
|
||||
> volume
|
||||
<span *ngIf="journal['volume'] > 0">{{journal['volume'] | number}}</span
|
||||
><span *ngIf="!(journal['volume'] > 0)">{{journal['volume']}}</span
|
||||
><span *ngIf="journal['issue'] || journal['start_page'] || journal['end_page']">,</span>
|
||||
</span>
|
||||
<span *ngIf="journal['issue']"
|
||||
> issue
|
||||
<span *ngIf="journal['issue'] > 0">{{journal['issue'] | number}}</span
|
||||
><span *ngIf="!(journal['issue'] > 0)">{{journal['issue']}}</span
|
||||
><span *ngIf="journal['start_page'] || journal['end_page']">,</span>
|
||||
</span>
|
||||
<span *ngIf="(journal['volume'] || journal['issue']) &&
|
||||
(journal['start_page'] && journal['end_page'])"> pages </span>
|
||||
<span *ngIf="(journal['volume'] || journal['issue']) &&
|
||||
((journal['start_page'] && !journal['end_page']) ||
|
||||
(!journal['start_page'] && journal['end_page']))">page</span>
|
||||
<span *ngIf="journal['start_page']"
|
||||
><span *ngIf="journal['start_page'] > 0">{{journal['start_page'] | number}}</span
|
||||
><span *ngIf="!(journal['start_page'] > 0)">{{journal['start_page']}}</span
|
||||
></span
|
||||
><span *ngIf="journal['start_page'] && journal['end_page']">-</span
|
||||
><span *ngIf="journal['end_page']"
|
||||
><span *ngIf="journal['end_page'] > 0">{{journal['end_page'] | number}}</span
|
||||
><span *ngIf="!(journal['end_page'] > 0)">{{journal['end_page']}}</span
|
||||
></span>
|
||||
<span *ngIf=" journal['journal'] && (journal['issn'] || journal['eissn'] || journal['lissn'])"> (</span
|
||||
><span *ngIf="journal['issn']">issn: {{journal['issn']}}<span
|
||||
*ngIf="journal['eissn'] || journal['lissn']">, </span
|
||||
></span
|
||||
><span *ngIf="journal['eissn']"> eissn: {{journal['eissn']}}<span *ngIf="journal['lissn']">, </span
|
||||
></span
|
||||
><span *ngIf="journal && journal['lissn']"> lissn: {{journal['lissn']}}
|
||||
></span
|
||||
><span *ngIf=" journal['journal'] && (journal['issn'] || journal['eissn'] || journal['lissn'])">)</span>
|
||||
<li *ngIf="publishDate || journal && (journal['journal'] || journal['issn'] || journal['lissn']
|
||||
|| journal['volume'] || journal['eissn'] || journal['issue'])">
|
||||
<span *ngIf="publishDate" class="uk-margin-right">
|
||||
<span class="uk-text-muted">Published: </span>
|
||||
{{publishDate | date: 'dd MMM yyyy'}}
|
||||
</span>
|
||||
<span *ngIf="journal && (journal['journal'] || journal['issn'] || journal['lissn']
|
||||
|| journal['volume'] || journal['eissn'] || journal['issue'])">
|
||||
<span class="uk-text-muted">Journal: </span>
|
||||
<span *ngIf="journal['journal']">{{journal['journal']}}</span>
|
||||
<span *ngIf="journal['journal'] && (journal['volume'] || journal['issue'])">, </span>
|
||||
<ng-container *ngIf="journal['volume']">
|
||||
<span class="uk-display-inline-block">
|
||||
volume
|
||||
<span *ngIf="journal['volume'] > 0">{{journal['volume'] | number}}</span>
|
||||
<span *ngIf="!(journal['volume'] > 0)">{{journal['volume']}}</span>
|
||||
</span>
|
||||
<span *ngIf="journal['issue'] || journal['start_page'] || journal['end_page']">, </span>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="journal['issue']">
|
||||
<span class="uk-display-inline-block">
|
||||
issue
|
||||
<span *ngIf="journal['issue'] > 0">{{journal['issue'] | number}}</span>
|
||||
<span *ngIf="!(journal['issue'] > 0)">{{journal['issue']}}</span>
|
||||
</span>
|
||||
<span *ngIf="journal['start_page'] || journal['end_page']">, </span>
|
||||
</ng-container>
|
||||
<span *ngIf="(journal['volume'] || journal['issue']) && (journal['start_page'] || journal['end_page'])"
|
||||
class="uk-display-inline-block">
|
||||
{{(journal['start_page'] && journal['end_page']) ? 'pages' : 'page'}}
|
||||
<span *ngIf="journal['start_page']">
|
||||
<span *ngIf="journal['start_page'] > 0">{{journal['start_page'] | number}}</span>
|
||||
<span *ngIf="!(journal['start_page'] > 0)">{{journal['start_page']}}</span>
|
||||
</span>
|
||||
<span *ngIf="journal['start_page'] && journal['end_page']">-</span>
|
||||
<span *ngIf="journal['end_page']">
|
||||
<span *ngIf="journal['end_page'] > 0">{{journal['end_page'] | number}}</span>
|
||||
<span *ngIf="!(journal['end_page'] > 0)">{{journal['end_page']}}</span>
|
||||
</span>
|
||||
</span>
|
||||
<span *ngIf=" journal['journal'] && (journal['issn'] || journal['eissn'] || journal['lissn'])"> (</span>
|
||||
<ng-container *ngIf="journal['issn']">
|
||||
<span class="uk-display-inline-block">issn: {{journal['issn']}}</span>
|
||||
<span *ngIf="journal['eissn'] || journal['lissn'] || !publisher">, </span>
|
||||
</ng-container>
|
||||
<ng-container *ngIf="journal['eissn']">
|
||||
<span class="uk-display-inline-block">eissn: {{journal['eissn']}}</span>
|
||||
<span *ngIf="journal['lissn'] || !publisher">, </span>
|
||||
</ng-container>
|
||||
<span *ngIf="journal['lissn']" class="uk-display-inline-block">
|
||||
<span class="uk-display-inline-block">lissn: {{journal['lissn']}}</span>
|
||||
<span *ngIf="!publisher">, </span>
|
||||
</span>
|
||||
<span *ngIf="journal && (journal['issn'] ||journal['lissn'] || journal['eissn'] ) && !publisher">
|
||||
<a target="_blank"
|
||||
[href]="properties.sherpaURL+(journal['issn']?journal['issn']:(journal['eissn']?journal['eissn']:journal['lissn'] ))"
|
||||
uk-tooltip="title: View information on Sherpa/RoMEO ">
|
||||
<img src="assets/common-assets/common/SHERPA-RoMEO-short-logo.gif" width=16 height=16 alt="">
|
||||
Copyright policy<span class="custom-external custom-icon space"></span>
|
||||
</a>
|
||||
</span>
|
||||
<span *ngIf=" journal['journal'] && (journal['issn'] || journal['eissn'] || journal['lissn'])">)</span>
|
||||
</span>
|
||||
</li>
|
||||
<li *ngIf="journal && (journal['issn'] ||
|
||||
journal['lissn'] || journal['eissn'] )">
|
||||
<span class="custom-external custom-icon"
|
||||
uk-tooltip="title: View information on Sherpa/RoMEO ">
|
||||
<a target="_blank"
|
||||
[href]="sherpaUrl+(journal['issn']?journal['issn']:(journal['eissn']?journal['eissn']:journal['lissn'] ))">
|
||||
Publisher copyright policies & self-archiving <img src="assets/common-assets/common/SHERPA-RoMEO-short-logo.gif" width=16 height=16 alt=""></a>
|
||||
</span>
|
||||
<li *ngIf="publisher">
|
||||
<span class="uk-text-muted">Publisher: </span> {{publisher}}
|
||||
<span *ngIf="journal && (journal['issn'] ||journal['lissn'] || journal['eissn'] )">
|
||||
(<a target="_blank"
|
||||
[href]="properties.sherpaURL+(journal['issn']?journal['issn']:(journal['eissn']?journal['eissn']:journal['lissn'] ))"
|
||||
uk-tooltip="title: View information on Sherpa/RoMEO ">
|
||||
<img src="assets/common-assets/common/SHERPA-RoMEO-short-logo.gif" width=16 height=16 alt="">
|
||||
Copyright policy<span class="custom-external custom-icon space"></span>
|
||||
</a>)</span>
|
||||
</li>
|
||||
|
||||
`
|
||||
})
|
||||
|
||||
export class ShowPublisherComponent {
|
||||
@Input() publishDate: Date;
|
||||
@Input() publisher;
|
||||
@Input() journal;
|
||||
@Input() sherpaUrl = 'http://www.sherpa.ac.uk/romeo/search.php?issn=';
|
||||
@Input() properties:EnvProperties;
|
||||
|
||||
|
||||
//@Input() sherpaUrl = 'http://www.sherpa.ac.uk/romeo/search.php?issn=';
|
||||
@Input() properties: EnvProperties;
|
||||
|
||||
|
||||
constructor() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,57 +1,53 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
|
||||
@Component({
|
||||
selector: 'showSubjects',
|
||||
template: `
|
||||
<div *ngIf="subjects != undefined || otherSubjects != undefined || classifiedSubjects != undefined ">
|
||||
|
||||
<div *ngIf="(subjects != undefined && subjects.length > 0) ||
|
||||
(otherSubjects != undefined && otherSubjects.size > 0) ||
|
||||
(classifiedSubjects != undefined && classifiedSubjects.size > 0)">
|
||||
<span class="uk-text-bold">Subject:</span>
|
||||
|
||||
<span *ngIf="subjects != undefined && subjects.length > 0"> {{subjects.join(" | ")}} </span>
|
||||
<ul class="uk-list">
|
||||
<li *ngIf="otherSubjects != undefined && otherSubjects.size > 0">
|
||||
<div *ngFor="let key of getKeys(otherSubjects)">
|
||||
<span class="uk-text-bold">{{key}}:</span> {{otherSubjects.get(key).join(" | ")}}
|
||||
</div>
|
||||
</li>
|
||||
<!--li *ngIf="(subjects == undefined || subjects.length == 0) &&
|
||||
(otherSubjects == undefined || otherSubjects.size == 0) &&
|
||||
classifiedSubjects != undefined && classifiedSubjects.size > 0">
|
||||
-
|
||||
</li-->
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div *ngIf="classifiedSubjects != undefined && classifiedSubjects.size > 0">
|
||||
<div class="uk-panel uk-padding-small uk-background-default" >
|
||||
<div *ngFor="let key of getKeys(classifiedSubjects)">
|
||||
<!--span class="uk-text-bold">Classified by OpenAIRE into</span-->
|
||||
<span class="uk-margin-small-right uk-icon uk-text-primary" ><svg width="20" height="20" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg"> <path fill="none" stroke="#000" stroke-width="1.1" d="M17.5,3.71 L17.5,7.72 C17.5,7.96 17.4,8.2 17.21,8.39 L8.39,17.2 C7.99,17.6 7.33,17.6 6.93,17.2 L2.8,13.07 C2.4,12.67 2.4,12.01 2.8,11.61 L11.61,2.8 C11.81,2.6 12.08,2.5 12.34,2.5 L16.19,2.5 C16.52,2.5 16.86,2.63 17.11,2.88 C17.35,3.11 17.48,3.4 17.5,3.71 L17.5,3.71 Z"></path> <circle cx="14" cy="6" r="1"></circle></svg></span>
|
||||
<span uk-tooltip="title: Classified by OpenAIRE; delay: 10">
|
||||
<span class="uk-text-bold">{{key}}:</span> {{classifiedSubjects.get(key).join(" | ")}}
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
|
||||
})
|
||||
selector: 'showSubjects',
|
||||
template: `
|
||||
<div *ngIf="classifiedSubjects && classifiedSubjects.size > 0" class="uk-text-small">
|
||||
<div class="uk-text-muted">
|
||||
Subjects by Vocabulary:
|
||||
</div>
|
||||
<div class="uk-margin-small-top">
|
||||
<div *ngFor="let key of getKeys(classifiedSubjects)" style="line-height: 20px">
|
||||
<span uk-icon="tag"></span>
|
||||
<span class="uk-text-bold uk-text-uppercase"> {{key}}: </span>
|
||||
<ng-container *ngFor="let subject of classifiedSubjects.get(key)">
|
||||
<span class="uk-display-inline-block label-classified">{{subject}}</span>
|
||||
</ng-container>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="(subjects && subjects.length > 0) || (otherSubjects && otherSubjects.size > 0)" class="uk-text-small"
|
||||
[class.uk-margin-top]="classifiedSubjects && classifiedSubjects.size > 0">
|
||||
<span class="uk-text-muted">Subjects: </span>
|
||||
<span *ngIf="subjects && subjects.length > 0">{{subjects.join(', ')}}</span>
|
||||
<span *ngIf="(subjects && subjects.length > 0) && (otherSubjects && otherSubjects.size > 0)">, </span>
|
||||
<span *ngIf="otherSubjects && otherSubjects.size > 0">
|
||||
<span *ngFor="let key of getKeys(otherSubjects); let i=index">
|
||||
<span *ngIf="otherSubjects.get(key).length > 0">
|
||||
<span>{{otherSubjects.get(key).join(', ')}}</span>
|
||||
<span *ngIf="i < (otherSubjects.size - 1)">, </span>
|
||||
</span>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
`
|
||||
})
|
||||
|
||||
export class ShowSubjectsComponent {
|
||||
@Input() subjects: string[];
|
||||
@Input() otherSubjects: Map<string, string[]>;
|
||||
@Input() classifiedSubjects: Map<string, string[]>;
|
||||
// private showClassifiedSbj: boolean = false;
|
||||
|
||||
constructor () {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
public getKeys( map) {
|
||||
return Array.from(map.keys());
|
||||
}
|
||||
@Input() subjects: string[];
|
||||
@Input() otherSubjects: Map<string, string[]>;
|
||||
@Input() classifiedSubjects: Map<string, string[]>;
|
||||
|
||||
// private showClassifiedSbj: boolean = false;
|
||||
|
||||
constructor() {
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
}
|
||||
|
||||
public getKeys(map) {
|
||||
return Array.from(map.keys());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,10 @@ import {ActivatedRoute} from '@angular/router';
|
|||
@Component({
|
||||
selector: 'showTitle',
|
||||
template: `
|
||||
<h2 [class]="classNames">
|
||||
<h1 [ngClass]="classNames" class="uk-h2">
|
||||
<div *ngIf="title != undefined" class="landingTitle">
|
||||
<span *ngIf="title['url'] != undefined && title['url'] != null && title['url'] != ''"
|
||||
<span *ngIf="title['url'] != undefined && title['url'] != null && title['url'] != ''"
|
||||
class="custom-external">
|
||||
|
||||
<a *ngIf="title['name'] != undefined && title['name'] != ''"
|
||||
href="{{title['url']}}" target="_blank"
|
||||
[innerHTML]="title['name']">
|
||||
|
@ -34,7 +33,7 @@ import {ActivatedRoute} from '@angular/router';
|
|||
<div *ngIf="!titleName && !title">
|
||||
<span>[no title available]</span>
|
||||
</div>
|
||||
</h2>
|
||||
</h1>
|
||||
`
|
||||
|
||||
})
|
||||
|
|
|
@ -8,59 +8,37 @@ import {RouterHelper} from '../../../utils/routerHelper.class';
|
|||
import {ErrorCodes} from '../../../utils/properties/errorCodes';
|
||||
|
||||
import {OrganizationsDeletedByInferenceService} from './deletedByInference.service';
|
||||
import {ResultLandingInfo} from "../../../utils/entities/resultLandingInfo";
|
||||
import {ResultPreview} from "../../../utils/result-preview/result-preview";
|
||||
import {AlertModal} from "../../../utils/modal/alert";
|
||||
|
||||
@Component({
|
||||
selector: 'deletedByInference',
|
||||
selector: 'organizationsDeletedByInference',
|
||||
template: `
|
||||
<errorMessages [status]="[status]" [type]="type" tab_error_class=true></errorMessages>
|
||||
|
||||
<div>
|
||||
<div *ngIf="results.length > pageSize" class="uk-margin-bottom">
|
||||
<span class="uk-h6">{{results.length | number}} {{type}}, page {{page | number}} of {{totalPages(results.length) | number}}</span>
|
||||
<paging-no-load class="uk-float-right" [currentPage]="page" [totalResults]="results.length" [size]="pageSize" (pageChange)="updatePage($event)"></paging-no-load>
|
||||
</div>
|
||||
|
||||
<ul class="uk-list uk-list-divider uk-margin">
|
||||
<li *ngFor="let result of results.slice((page-1)*pageSize, page*pageSize)" class="uk-margin-bottom">
|
||||
|
||||
<h5 *ngIf="result.title['url'] != undefined && result.title['url'] != null && result.title['url'] != ''"
|
||||
class="custom-external uk-margin-remove-bottom">
|
||||
|
||||
<a *ngIf="result.title['name'] != undefined && result.title['name'] != ''"
|
||||
href="{{result.title['url']}}" target="_blank"
|
||||
[innerHTML]="result.title['name']">
|
||||
</a>
|
||||
<a *ngIf="result.title['name'] == undefined || result.title['name'] == ''"
|
||||
href="{{result.title['url']}}" target="_blank">
|
||||
[no title available]
|
||||
</a>
|
||||
</h5>
|
||||
<h5 *ngIf="(result.title['name'] != undefined && result.title['name'] != '') &&
|
||||
(result.title['url'] == undefined || result.title['url'] == null || result.title['url'] == '')"
|
||||
class="uk-margin-remove-bottom"
|
||||
[innerHTML]="result.title['name']">
|
||||
</h5>
|
||||
<h5 *ngIf="(result.title['name'] == undefined || result.title['name'] == '') &&
|
||||
(result.title['url'] == undefined || result.title['url'] == null || result.title['url'] == '')"
|
||||
class="uk-margin-remove-bottom">
|
||||
[no title available]
|
||||
</h5>
|
||||
|
||||
<div *ngIf="result.title.name && result.title.name != result.name ">{{result.name}}</div>
|
||||
<span class="uk-label custom-label label-blue label-organization" title="Type">Organization</span>{{" "}}
|
||||
<span *ngIf="result.country" class="uk-label custom-label label-country "
|
||||
title="Country">{{result.country}}</span>{{" "}}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<no-load-paging *ngIf="results.length > pageSize" [type]="type"
|
||||
(pageChange)="updatePage($event)"
|
||||
[page]="page" [pageSize]="pageSize"
|
||||
[totalResults]="results.length">
|
||||
</no-load-paging>
|
||||
<ul class="uk-list uk-list-divider uk-margin">
|
||||
<li *ngFor="let result of results.slice((page-1)*pageSize, page*pageSize)">
|
||||
<result-preview [modal]="modal" [properties]="properties" [result]="getResultPreview(result)"></result-preview>
|
||||
</li>
|
||||
</ul>
|
||||
<no-load-paging *ngIf="results.length > pageSize" [type]="type"
|
||||
(pageChange)="updatePage($event)"
|
||||
[page]="page" [pageSize]="pageSize"
|
||||
[totalResults]="results.length">
|
||||
</no-load-paging>
|
||||
`
|
||||
})
|
||||
|
||||
export class OrganizationsDeletedByInferenceComponent {
|
||||
public results: OrganizationInfo[] = [];
|
||||
@Input() id: string;
|
||||
@Input() ids: string[] = [];
|
||||
@Input() type: string;
|
||||
@Input() modal: AlertModal;
|
||||
|
||||
// Custom tab paging variables
|
||||
public page: number = 1;
|
||||
|
@ -115,6 +93,10 @@ export class OrganizationsDeletedByInferenceComponent {
|
|||
}
|
||||
);
|
||||
}
|
||||
|
||||
public getResultPreview(result: OrganizationInfo): ResultPreview {
|
||||
return ResultPreview.organizationInfoConvert(result);
|
||||
}
|
||||
|
||||
public totalPages(totalResults: number): number {
|
||||
let totalPages:any = totalResults/this.pageSize;
|
||||
|
|
|
@ -12,11 +12,13 @@ import {ResultLandingUtilsModule} from '../../landing-utils/resultLandingUtils.m
|
|||
import {ErrorMessagesModule} from '../../../utils/errorMessages.module';
|
||||
import {ShowAuthorsModule} from "../../../utils/authors/showAuthors.module";
|
||||
import {LandingModule} from "../../landing-utils/landing.module";
|
||||
import {NoLoadPaging} from "../../../searchPages/searchUtils/no-load-paging.module";
|
||||
import {ResultPreviewModule} from "../../../utils/result-preview/result-preview.module";
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule, FormsModule, ResultLandingUtilsModule,
|
||||
PagingModule, ErrorMessagesModule, ShowAuthorsModule, LandingModule
|
||||
PagingModule, ErrorMessagesModule, ShowAuthorsModule, LandingModule, NoLoadPaging, ResultPreviewModule
|
||||
],
|
||||
declarations: [
|
||||
OrganizationsDeletedByInferenceComponent
|
||||
|
|
|
@ -1,217 +1,237 @@
|
|||
<div id="tm-main" class=" uk-section uk-padding-remove-top uk-margin-small-top tm-middle" >
|
||||
<div uk-grid>
|
||||
<div id="tm-main" class="landing uk-section uk-padding-remove-top uk-margin-small-top tm-middle">
|
||||
<div *ngIf="!showFeedback" uk-grid>
|
||||
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
|
||||
|
||||
<div class="uk-container organization">
|
||||
<div class="uk-container uk-container-large organization">
|
||||
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
|
||||
role="alert">{{warningMessage}}</div>
|
||||
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top"
|
||||
role="alert">{{errorMessage}}</div>
|
||||
<div [style.display]="showLoading ? 'inline' : 'none'"
|
||||
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span
|
||||
class="loading-gif uk-align-center"></span></div>
|
||||
class="loading-gif uk-align-center"></span></div>
|
||||
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
|
||||
[texts]="pageContents['top']"></helper>
|
||||
<div *ngIf="organizationInfo != null" class="uk-grid">
|
||||
|
||||
<div *ngIf="organizationInfo != null" class="uk-grid">
|
||||
<div class="uk-width-2-3@m uk-width-1-1@s uk-margin-bottom">
|
||||
<schema2jsonld *ngIf="organizationInfo" [data]=organizationInfo
|
||||
[URL]="properties.baseLink+'/search/organization?organizationId='+organizationId"
|
||||
type="organization"></schema2jsonld>
|
||||
|
||||
<!-- <showTitle [title]="organizationInfo.title"></showTitle>-->
|
||||
<showTitle [title]="organizationInfo.title" [classNames]="(properties.environment != 'production' && organizationInfo.deletedByInferenceIds) ? 'uk-margin-remove-bottom' : ''"></showTitle>
|
||||
|
||||
<div *ngIf="properties.environment != 'production' && organizationInfo.deletedByInferenceIds"
|
||||
class="uk-text-muted uk-text-small uk-margin-bottom" (click)="openDeletedByInference()">
|
||||
The following information is the result of merging
|
||||
<a>{{organizationInfo.deletedByInferenceIds.length}} other versions</a>
|
||||
<landing-header [properties]="properties" [title]="organizationInfo.title.name"
|
||||
[subTitle]="(organizationInfo.name
|
||||
&& organizationInfo.title.name !== organizationInfo.name)?organizationInfo.name:null"
|
||||
[entityType]="'organization'"></landing-header>
|
||||
<div *ngIf="organizationInfo.deletedByInferenceIds"
|
||||
class="uk-text-muted uk-text-small uk-text-right">
|
||||
<a (click)="openDeletedByInference()">View all {{organizationInfo.deletedByInferenceIds.length}}
|
||||
versions</a>
|
||||
</div>
|
||||
<div class="uk-text-large "
|
||||
*ngIf="organizationInfo.title.name && organizationInfo.title.name != organizationInfo.name ">{{organizationInfo.name}}</div>
|
||||
<span class="uk-label custom-label label-blue label-organization" title="Type">Organization</span>{{" "}}
|
||||
<span *ngIf="organizationInfo.country" class="uk-label custom-label label-country "
|
||||
title="Country">{{organizationInfo.country}}</span>{{" "}}
|
||||
|
||||
<ul class="custom-accordion" uk-accordion>
|
||||
|
||||
<li *ngIf="fetchPublications.searchUtils.totalResults > 0"
|
||||
(click)="activeTab='Publications'; searchPublicationsInit()">
|
||||
<a class="uk-accordion-title" href="#">
|
||||
Publications
|
||||
<!-- <span class="uk-badge uk-badge-notification"> -->
|
||||
<!-- ({{fetchPublications.searchUtils.totalResults | number}}) -->
|
||||
<!-- </span> -->
|
||||
<ul class="uk-list">
|
||||
<!-- Web Page -->
|
||||
<li *ngIf="organizationInfo.title && organizationInfo.title.url">
|
||||
<span class="uk-text-muted">Web page: </span>
|
||||
<a [href]="organizationInfo.title.url">
|
||||
<span>{{organizationInfo.title.url}}</span>
|
||||
<span class="custom-external custom-icon space"></span>
|
||||
</a>
|
||||
<div class="uk-accordion-content">
|
||||
<errorMessages [status]="[fetchPublications.searchUtils.status]" [type]="'publications'"
|
||||
tab_error_class=true></errorMessages>
|
||||
|
||||
<div *ngIf="fetchPublications.searchUtils.status == errorCodes.DONE">
|
||||
<div class="uk-text-right" *ngIf="fetchPublications.searchUtils.totalResults > 10">
|
||||
<a [queryParams]="routerHelper.createQueryParams(['organization', 'og'], [organizationId, 'and'])"
|
||||
routerLinkActive="router-link-active" [routerLink]="linkToSearchPublications"
|
||||
class="uk-button uk-button-text">
|
||||
View all {{fetchPublications.searchUtils.totalResults | number}} results
|
||||
</a>
|
||||
</div>
|
||||
<tab-result [(results)]="fetchPublications.results"
|
||||
[(status)]="fetchPublications.status"
|
||||
type="publication" urlParam="articleId">
|
||||
</tab-result>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<!-- <li (click)="activeTab='Research Data'; searchDatasetsInit()">
|
||||
<a class="uk-accordion-title" href="#">
|
||||
Research Data
|
||||
<span class="uk-badge uk-badge-notification">
|
||||
{{fetchDatasets.searchUtils.totalResults | number}}
|
||||
</span>
|
||||
</a>
|
||||
<div class="uk-accordion-content">
|
||||
<errorMessages [status]="[fetchDatasets.searchUtils.status]" [type]="'publications'" tab_error_class=true></errorMessages>
|
||||
|
||||
<div *ngIf="fetchDatasets.searchUtils.status == errorCodes.DONE">
|
||||
<div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults > 10">
|
||||
<a [queryParams]="routerHelper.createQueryParams(['organization', 'og'], [organizationId, 'and'])"
|
||||
routerLinkActive="router-link-active" [routerLink]="linkToSearchDatasets" class="uk-button uk-button-text">
|
||||
View all {{fetchDatasets.searchUtils.totalResults | number}} results
|
||||
</a>
|
||||
</div>
|
||||
<tab-result [(results)]="fetchDatasets.results"
|
||||
[(status)]= "fetchDatasets.status"
|
||||
type="dataset" urlParam="datasetId">
|
||||
</tab-result>
|
||||
</div>
|
||||
</div>
|
||||
</li> -->
|
||||
|
||||
<li (click)="activeTab='Projects'; projectsClicked=true;">
|
||||
<a class="uk-accordion-title" href="#">
|
||||
Projects
|
||||
<!-- <span class="uk-badge uk-badge-notification"> -->
|
||||
({{fetchProjects.searchUtils.totalResultsNoFilters | number}})
|
||||
<!-- </span> -->
|
||||
</a>
|
||||
<div class="uk-accordion-content">
|
||||
<searchingProjectsTab *ngIf="projectsClicked" [(fetchProjects)]="fetchProjects"
|
||||
[organizationId]="organizationId"
|
||||
[(properties)]=properties></searchingProjectsTab>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li (click)="activeTab='Content Providers'; searchDataprovidersInit()">
|
||||
<a class="uk-accordion-title" href="#">
|
||||
Content Providers
|
||||
<!-- <span class="uk-badge uk-badge-notification"> -->
|
||||
({{fetchDataproviders.searchUtils.totalResults | number}})
|
||||
<!-- </span> -->
|
||||
</a>
|
||||
<div class="uk-accordion-content">
|
||||
<errorMessages [status]="[fetchDataproviders.searchUtils.status]" [type]="'content providers'"
|
||||
tab_error_class=true></errorMessages>
|
||||
|
||||
<div *ngIf="fetchDataproviders.searchUtils.status == errorCodes.DONE">
|
||||
|
||||
<div class="uk-text-right" *ngIf="fetchDataproviders.searchUtils.totalResults > 10">
|
||||
<a [queryParams]="routerHelper.createQueryParams(['organization', 'og'], [organizationId, 'and'])"
|
||||
routerLinkActive="router-link-active" [routerLink]="linkToSearchDataproviders"
|
||||
class="uk-button uk-button-text">
|
||||
View all {{fetchDataproviders.searchUtils.totalResults | number}} results
|
||||
</a>
|
||||
</div>
|
||||
<tab-result [(results)]="fetchDataproviders.results"
|
||||
[(status)]="fetchDataproviders.status"
|
||||
type="dataprovider" urlParam="datasourceId">
|
||||
</tab-result>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Country -->
|
||||
<li *ngIf="organizationInfo.country">
|
||||
<span class="uk-text-muted">Country: </span>{{organizationInfo.country}}
|
||||
</li>
|
||||
</ul>
|
||||
<div class="uk-margin-medium-top">
|
||||
<div *ngIf="fetchProjects && fetchProjects.searchUtils.totalResults > 0"
|
||||
class="uk-margin-top simple-buttons uk-flex uk-flex-middle">
|
||||
<div *ngIf="fetchProjects && fetchProjects.searchUtils.totalResults > 0" (click)="openProjectsModal()"
|
||||
class="clickable uk-margin-right">
|
||||
<span class="uk-text-bold">{{fetchProjects.searchUtils.totalResults | number}}</span> Projects
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
*ngIf="total.publications > 0 || total.datasets > 0 || total.software > 0 || total.other > 0 || total.dataproviders > 0"
|
||||
class="uk-margin-top advanced-buttons uk-grid-small uk-child-width-1-4@s uk-child-width-1-2"
|
||||
uk-height-match="target: .target; row: false"
|
||||
uk-grid>
|
||||
<div *ngIf="total.publications > 0">
|
||||
<div class="uk-position-relative">
|
||||
<!-- <a [queryParams]="routerHelper.createQueryParams(['organization', 'og', 'type'], [organizationId, 'and', 'publications'])"-->
|
||||
<a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf'], ['relorganizationid', organizationId, 'publications', 'false'])"
|
||||
[routerLink]="properties.searchLinkToAdvancedResults">
|
||||
<div class="header target uk-text-bold">Publications</div>
|
||||
<div class="icon uk-position-center" uk-icon="icon: search;"></div>
|
||||
<div class="footer target uk-position-relative">
|
||||
<span class="uk-text-bold uk-position-center">{{total.publications | number}}</span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="total.datasets > 0">
|
||||
<div class="uk-position-relative">
|
||||
<a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf'], ['relorganizationid', organizationId, 'datasets', 'false'])"
|
||||
[routerLink]="properties.searchLinkToAdvancedResults">
|
||||
<div class="header target uk-text-bold">Research Data</div>
|
||||
<div class="icon uk-position-center" uk-icon="icon: search;"></div>
|
||||
<div class="footer target uk-position-relative">
|
||||
<span class="uk-text-bold uk-position-center">{{total.datasets | number}}</span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="total.software > 0">
|
||||
<div class="uk-position-relative">
|
||||
<a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf'], ['relorganizationid', organizationId, 'software', 'false'])"
|
||||
[routerLink]="properties.searchLinkToAdvancedResults">
|
||||
<div class="header target uk-text-bold">Software</div>
|
||||
<div class="icon uk-position-center" uk-icon="icon: search;"></div>
|
||||
<div class="footer target uk-position-relative">
|
||||
<span class="uk-text-bold uk-position-center">{{total.software | number}}</span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="total.other > 0">
|
||||
<div class="uk-position-relative">
|
||||
<a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0', 'type', 'qf'], ['relorganizationid', organizationId, 'other', 'false'])"
|
||||
[routerLink]="properties.searchLinkToAdvancedResults">
|
||||
<div class="header target uk-text-bold">Other Research Products</div>
|
||||
<div class="icon uk-position-center" uk-icon="icon: search;"></div>
|
||||
<div class="footer target uk-position-relative">
|
||||
<span class="uk-text-bold uk-position-center">{{total.other | number}}</span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="total.dataproviders > 0">
|
||||
<div class="uk-position-relative">
|
||||
<a [queryParams]="routerHelper.createQueryParams(['f0', 'fv0'], ['relorganizationid', organizationId])"
|
||||
[routerLink]="properties.searchLinkToAdvancedDataProviders">
|
||||
<div class="header target uk-text-bold">Content Providers</div>
|
||||
<div class="icon uk-position-center" uk-icon="icon: search;"></div>
|
||||
<div class="footer target uk-position-relative">
|
||||
<span class="uk-text-bold uk-position-center">{{total.dataproviders | number}}</span>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="uk-margin-small-top uk-flex uk-flex-bottom">
|
||||
<img src="assets/common-assets/graph.svg" style="opacity: 0.4">
|
||||
<span
|
||||
class="uk-margin-small-left uk-text-small uk-text-baseline uk-text-muted">Powered by OpenAIRE Open Research Graph</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="uk-width-1-3@m uk-width-1-1@s">
|
||||
<div class="uk-card uk-card-default uk-padding-small">
|
||||
<div>
|
||||
<div class="sideInfoTitle uk-margin-small-bottom uk-margin-small-top">Share - Bookmark</div>
|
||||
<addThis></addThis>
|
||||
</div>
|
||||
<div
|
||||
*ngIf="fetchPublications.searchUtils.totalResults > 0 || (fetchProjects && fetchProjects.funders.length > 0)"
|
||||
class="uk-margin-medium-top uk-margin-medium-bottom">
|
||||
<div class="uk-text-center uk-text-large">
|
||||
Application Box
|
||||
<div *ngIf="total.results > 0" class="uk-margin-top">
|
||||
<div class="sideInfoTitle uk-margin-small-bottom uk-margin-small-top">
|
||||
Download report - based on the affiliation information
|
||||
</div>
|
||||
<div class="app-box app-box uk-padding-small">
|
||||
<ul class="uk-list">
|
||||
|
||||
<ng-container *ngIf="fetchProjects && fetchProjects.funders.length > 0">
|
||||
<li *ngFor="let funder of fetchProjects.funders">
|
||||
<!--a href="{{downloadURLAPI}}resources?size={{organizationInfo.projects.get(key).length}}&{{csvProjectParamsHead}}{{organizationInfo.projects.get(key)[0]['funderId']}}{{csvParamsTail}}">
|
||||
Download projects report (CSV) for {{key}}
|
||||
</a-->
|
||||
<a class="clickable"
|
||||
(click)="downloadFile(downloadURLAPI+'?'+csvProjectParamsHead+encodeURI(funder.id)+csvParamsTail, 'funder-projects-report')">
|
||||
<!--span class="clickable" (click)="downloadProjectsFile(downloadURLAPI+'organizations/'+organizationId+'/projects?fq=(funderid exact '+funder.id+')&size='+funder.number)"-->
|
||||
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
|
||||
xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1"><polyline
|
||||
fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17"
|
||||
width="13"
|
||||
height="1"></rect><line
|
||||
fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line></svg></span>
|
||||
<span class="uk-icon-download"> Project list for {{funder.name}} (CSV)</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li *ngFor="let funder of fetchProjects.funders">
|
||||
<a class="clickable"
|
||||
(click)="confirmOpenApplyAll(funder.name,encodeURI(funder.id), funder.number)">
|
||||
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
|
||||
xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1"><polyline
|
||||
fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17"
|
||||
width="13"
|
||||
height="1"></rect><line
|
||||
fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line></svg></span>
|
||||
<span class="uk-icon-download"> Project Publications for {{funder.name}} (CSV)</span>
|
||||
</a>
|
||||
</li>
|
||||
</ng-container>
|
||||
<li *ngIf="fetchPublications.searchUtils.totalResults > 0">
|
||||
<!-- url = this.downloadURLAPI+"format=csv-special&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact '"+projects[index].id+"'))"-->
|
||||
|
||||
<!-- <a class="clickable" (click)="downloadFile(downloadURLAPI+'/organizations/'+organizationId+'?type=publications&format=csv')"> -->
|
||||
<a class="clickable"
|
||||
(click)="downloadFile(csvAffiliatedPublications, 'organization-publications-report')">
|
||||
<span class="uk-icon"><svg width="20" height="20" viewBox="0 0 20 20"
|
||||
xmlns="http://www.w3.org/2000/svg" icon="download" ratio="1"><polyline
|
||||
fill="none" stroke="#000" points="14,10 9.5,14.5 5,10"></polyline><rect x="3" y="17"
|
||||
width="13"
|
||||
height="1"></rect><line
|
||||
fill="none" stroke="#000" x1="9.5" y1="13.91" x2="9.5" y2="3"></line></svg></span>
|
||||
<span class="uk-icon-download"> Publications of organization (CSV) - based on the affiliation information.</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="app-box uk-padding-small uk-margin-small-left uk-margin-small-right">
|
||||
<div class="uk-animation-slide-top-small">
|
||||
<ul class="uk-padding-remove-bottom uk-list">
|
||||
<ng-container *ngFor="let contentType of contentTypes">
|
||||
<li *ngIf="total[contentType[0]] > 0">
|
||||
<a class="clickable" (click)="downloadFile(getCSVAffiliated(contentType[0]), contentType[0] + '-report')">
|
||||
<span uk-icon="download"></span>
|
||||
<span class="uk-text-capitalize uk-margin-small-left">{{contentType[1]}} (CSV)</span>
|
||||
</a>
|
||||
</li>
|
||||
</ng-container>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="fetchProjects && fetchProjects.funders && fetchProjects.funders.length > 0"
|
||||
class="uk-margin-top">
|
||||
<div class="sideInfoTitle uk-margin-small-bottom uk-margin-small-top">
|
||||
Funder report
|
||||
</div>
|
||||
<div class="app-box uk-padding-small uk-margin-small-left uk-margin-small-right">
|
||||
<div class="uk-padding-small uk-padding-remove-vertical">
|
||||
<div>
|
||||
<mat-select [(value)]="funder"
|
||||
[disableOptionCentering]="true"
|
||||
class="matSelection" panelClass="matSelectionPanel">
|
||||
<mat-option value="">Specify by Funder</mat-option>
|
||||
<mat-option *ngFor="let element of fetchProjects.funders"
|
||||
[value]="element">{{element.name}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
</div>
|
||||
<div *ngIf="funder && funder != ''"
|
||||
class="uk-animation-slide-top-small uk-margin-top">
|
||||
<ul class="uk-padding-remove-bottom uk-list">
|
||||
<li>
|
||||
<a class="clickable"
|
||||
(click)="downloadFile(getFunderProjects(), funder.name + '-projects-report')">
|
||||
<span uk-icon="download"></span>
|
||||
<span class="uk-text-capitalize uk-margin-small-left">projects (CSV)</span>
|
||||
</a>
|
||||
</li>
|
||||
<li *ngFor="let contentType of contentTypes">
|
||||
<a class="clickable"
|
||||
(click)="confirmOpenApplyAll(contentType[0])">
|
||||
<span uk-icon="download"></span>
|
||||
<span class="uk-text-capitalize uk-margin-small-left">{{contentType[1]}} (CSV)</span>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="uk-margin-small-top uk-text-muted uk-text-small uk-text-right">
|
||||
Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<modal-alert *ngIf="organizationInfo.deletedByInferenceIds"
|
||||
#AlertModalDeletedByInference classBody="uk-width-xxlarge">
|
||||
<deletedByInference *ngIf="deleteByInferenceOpened"
|
||||
[id]="organizationInfo.objIdentifier" [ids]="organizationInfo.deletedByInferenceIds" [type]="'organizations'"></deletedByInference>
|
||||
</modal-alert>
|
||||
</div>
|
||||
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
|
||||
[texts]="pageContents['bottom']"></helper>
|
||||
<modal-loading></modal-loading>
|
||||
<modal-alert #AlertModalApplyAll (alertOutput)="confirmCloseApplyAll($event)"></modal-alert>
|
||||
<modal-alert #AlertModalCsvError></modal-alert>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<feedback *ngIf="organizationInfo && properties.environment === 'development'" [organizationInfo]="organizationInfo"
|
||||
[properties]="properties" [entityType]="'organization'" [fields]="feedbackFields"
|
||||
[showForm]="showFeedback" (show)="showFeedback = $event"></feedback>
|
||||
</div>
|
||||
<!-- Other versions -->
|
||||
<modal-alert *ngIf="organizationInfo && organizationInfo.deletedByInferenceIds"
|
||||
#AlertModalDeletedByInference classBody="uk-width-xxlarge uk-padding-remove-right">
|
||||
<landing-header [properties]="properties" [title]="organizationInfo.title.name"
|
||||
[subTitle]="(organizationInfo.name
|
||||
&& organizationInfo.title.name !== organizationInfo.name)?organizationInfo.name:null"
|
||||
[entityType]="'organization'"></landing-header>
|
||||
<div class="uk-margin-medium-top uk-margin-medium-right">
|
||||
<organizationsDeletedByInference *ngIf="deleteByInferenceOpened"
|
||||
[id]="organizationInfo.objIdentifier"
|
||||
[ids]="organizationInfo.deletedByInferenceIds"
|
||||
[modal]="AlertModalDeletedByInference"
|
||||
[type]="'organizations'">
|
||||
</organizationsDeletedByInference>
|
||||
</div>
|
||||
</modal-alert>
|
||||
<!-- Projects -->
|
||||
<modal-alert *ngIf="organizationInfo && fetchProjects && fetchProjects.results"
|
||||
#projectsModal classBody="uk-width-xxlarge uk-padding-remove-right">
|
||||
<landing-header [properties]="properties" [title]="organizationInfo.title.name"
|
||||
[subTitle]="(organizationInfo.name
|
||||
&& organizationInfo.title.name !== organizationInfo.name)?organizationInfo.name:null"
|
||||
[entityType]="'organization'">
|
||||
</landing-header>
|
||||
<div class="uk-margin-medium-top uk-margin-medium-right">
|
||||
<projectsInModal [fetchProjects]="fetchProjects"
|
||||
[modal]="projectsModal"
|
||||
[organizationId]="organizationId"
|
||||
[properties]=properties>
|
||||
</projectsInModal>
|
||||
</div>
|
||||
</modal-alert>
|
||||
<modal-loading></modal-loading>
|
||||
<modal-alert #AlertModalApplyAll (alertOutput)="confirmCloseApplyAll()"></modal-alert>
|
||||
<modal-alert #AlertModalCsvError></modal-alert>
|
|
@ -1,20 +1,15 @@
|
|||
import {Component, ElementRef, Input, ViewChild} from '@angular/core';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {Meta, Title} from '@angular/platform-browser';
|
||||
|
||||
import {OrganizationService} from '../../services/organization.service';
|
||||
import {OrganizationInfo} from '../../utils/entities/organizationInfo';
|
||||
import {ReportsService} from '../../services/reports.service';
|
||||
import {FetchResearchResults} from '../../utils/fetchEntitiesClasses/fetchResearchResults.class';
|
||||
// import {FetchDatasets} from '../../utils/fetchEntitiesClasses/fetchDatasets.class';
|
||||
import {FetchProjects} from '../../utils/fetchEntitiesClasses/fetchProjects.class';
|
||||
import {FetchDataproviders} from '../../utils/fetchEntitiesClasses/fetchDataproviders.class';
|
||||
import {SearchResearchResultsService} from '../../services/searchResearchResults.service';
|
||||
// import {SearchDatasetsService} from '../../services/searchDatasets.service';
|
||||
import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
|
||||
import {SearchProjectsService} from '../../services/searchProjects.service';
|
||||
import {ErrorCodes} from '../../utils/properties/errorCodes';
|
||||
import {SearchingProjectsTabComponent} from '../landing-utils/searchingProjectsInTab.component';
|
||||
import {ProjectsInModalComponent} from '../landing-utils/projects-in-modal.component';
|
||||
import {RouterHelper} from '../../utils/routerHelper.class';
|
||||
|
||||
import {ModalLoading} from '../../utils/modal/loading.component';
|
||||
|
@ -26,71 +21,76 @@ import {HelperFunctions} from "../../utils/HelperFunctions.class";
|
|||
import {HelperService} from "../../utils/helper/helper.service";
|
||||
import {Location} from "@angular/common";
|
||||
|
||||
interface Total {
|
||||
publications: number;
|
||||
datasets: number;
|
||||
software: number;
|
||||
other: number;
|
||||
results: number;
|
||||
dataproviders: number;
|
||||
}
|
||||
|
||||
@Component({
|
||||
selector: 'organization',
|
||||
templateUrl: 'organization.component.html',
|
||||
})
|
||||
|
||||
export class OrganizationComponent {
|
||||
@Input() piwikSiteId = null;
|
||||
@Input() communityId = null;
|
||||
|
||||
|
||||
public organizationInfo: OrganizationInfo;
|
||||
public organizationId: string;
|
||||
|
||||
|
||||
// Message variables
|
||||
public warningMessage = "";
|
||||
public errorMessage = "";
|
||||
public showLoading: boolean = true;
|
||||
|
||||
|
||||
// CSV variables
|
||||
public downloadURLAPI: string;
|
||||
public csvProjectParamsHead: string;
|
||||
public csvPublicationParamsHead: string;
|
||||
public csvParamsTail: string;
|
||||
public csvAffiliatedPublications: string;
|
||||
|
||||
|
||||
// Active tab variable for responsiveness
|
||||
public activeTab: string = "Publications";
|
||||
|
||||
|
||||
// Variables for publications, research data, projects, dataproviders tabs
|
||||
public fetchPublications: FetchResearchResults;
|
||||
public linkToSearchPublications: string = "";
|
||||
// public fetchDatasets: FetchDatasets;
|
||||
// public linkToSearchDatasets: string = "";
|
||||
public total: Total = {
|
||||
publications: 0,
|
||||
datasets: 0,
|
||||
software: 0,
|
||||
other: 0,
|
||||
results: 0,
|
||||
dataproviders: 0
|
||||
};
|
||||
public fetchProjects: FetchProjects;
|
||||
public fetchDataproviders: FetchDataproviders;
|
||||
public linkToSearchDataproviders: string = "";
|
||||
//public projectFunders:string[] = [];
|
||||
|
||||
// Variables for projects query (query results only if projects tab is clicked)
|
||||
public projectsClicked: boolean = false;
|
||||
@ViewChild(SearchingProjectsTabComponent) searchingProjectsTabComponent: SearchingProjectsTabComponent;
|
||||
|
||||
@ViewChild(ProjectsInModalComponent) projectsInModalComponent: ProjectsInModalComponent;
|
||||
|
||||
@ViewChild(ModalLoading) loading: ModalLoading;
|
||||
// Alert box when CSV: Project Publications for a funder is requested
|
||||
@ViewChild('AlertModalApplyAll') alertApplyAll;
|
||||
// Alert box when something is wrong with CSV requests
|
||||
@ViewChild('AlertModalCsvError') alertCsvError;
|
||||
|
||||
|
||||
public routerHelper: RouterHelper = new RouterHelper();
|
||||
public errorCodes: ErrorCodes = new ErrorCodes();
|
||||
public pageContents = null;
|
||||
public divContents = null;
|
||||
|
||||
//private projectsNum: number = 0;
|
||||
//private fundersSet: Set<string>;
|
||||
//private emptyFundersSet: boolean = true;
|
||||
|
||||
// Request results for publications, research data and content providers only the one time (first time tab is clicked)
|
||||
private reloadPublications: boolean = true;
|
||||
// private reloadDatasets: boolean = true;
|
||||
private reloadDataproviders: boolean = true;
|
||||
|
||||
|
||||
// Helper variables to specify funder in downloadPublicationsFile function
|
||||
private funder: string;
|
||||
public contentTypes: [string,string][] =[
|
||||
['results', 'all research outcomes'],
|
||||
['publications', 'publications'],
|
||||
['datasets', 'research data'],
|
||||
['software', 'software'],
|
||||
['other', 'other research products'],
|
||||
];
|
||||
public funderContentType: string = '';
|
||||
public funder: any = "";
|
||||
private funderId: string;
|
||||
private funderCountPublications: number;
|
||||
private funderCount: number;
|
||||
sub: any;
|
||||
infoSub: any;
|
||||
piwiksub: any;
|
||||
|
@ -100,12 +100,16 @@ export class OrganizationComponent {
|
|||
countPublSub: any;
|
||||
downloadProjectPublSub: any;
|
||||
properties: EnvProperties;
|
||||
|
||||
public indexUpdateDate: Date;
|
||||
public showFeedback: boolean = false;
|
||||
public feedbackFields: string [] = ['Name', 'Country', 'Other'];
|
||||
|
||||
@ViewChild('AlertModalDeletedByInference') alertModalDeletedByInference;
|
||||
@ViewChild('projectsModal') projectsModal;
|
||||
public deleteByInferenceOpened: boolean = false;
|
||||
|
||||
|
||||
//private ngUnsubscribe: Subject<void> = new Subject<void>();
|
||||
|
||||
|
||||
constructor(private element: ElementRef,
|
||||
private _organizationService: OrganizationService,
|
||||
private _piwikService: PiwikService,
|
||||
|
@ -121,17 +125,16 @@ export class OrganizationComponent {
|
|||
private helper: HelperService,
|
||||
private seoService: SEOService,
|
||||
private _location: Location) {
|
||||
|
||||
this.fetchPublications = new FetchResearchResults(this._searchResearchResultsService);
|
||||
// this.fetchDatasets = new FetchDatasets(this._searchDatasetsService);
|
||||
this.fetchProjects = new FetchProjects(this._searchProjectsService);
|
||||
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
|
||||
}
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
if(this.properties.lastIndexUpdate) {
|
||||
this.indexUpdateDate = new Date(this.properties.lastIndexUpdate);
|
||||
}
|
||||
//this.getDivContents();
|
||||
this.getPageContents();
|
||||
this.updateUrl(data.envSpecific.baseLink + this._router.url);
|
||||
|
@ -140,43 +143,47 @@ export class OrganizationComponent {
|
|||
this.organizationInfo = null;
|
||||
this.updateTitle("Organization");
|
||||
this.updateDescription("");
|
||||
this.projectsClicked = false;
|
||||
|
||||
|
||||
this.organizationId = params['organizationId'];
|
||||
|
||||
|
||||
if (this.organizationId) {
|
||||
this.getOrganizationInfo();
|
||||
} else {
|
||||
this.showLoading = false;
|
||||
this._router.navigate(['/error'], {queryParams: {"page": this._location.path(true), "page_type": "organization"}});
|
||||
this._router.navigate(['/error'], {
|
||||
queryParams: {
|
||||
"page": this._location.path(true),
|
||||
"page_type": "organization"
|
||||
}
|
||||
});
|
||||
//this.warningMessage = "No valid organization id";
|
||||
}
|
||||
|
||||
|
||||
HelperFunctions.scroll();
|
||||
|
||||
|
||||
this.csvParamsTail = '" and relorganizationid exact "' + this.organizationId + '" ))';
|
||||
|
||||
|
||||
});
|
||||
|
||||
|
||||
this.downloadURLAPI = this.properties.csvAPIURL;
|
||||
this.csvAffiliatedPublications = this.downloadURLAPI + "?format=csv&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relorganizationid exact \"" + this.organizationId + "\"))";
|
||||
this.csvProjectParamsHead = 'format=csv&type=projects&fq=( (oaftype exact project)and (funder exact "';
|
||||
//this.csvAffiliatedPublications = this.downloadURLAPI + "?format=csv&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relorganizationid exact \"" + this.organizationId + "\"))";
|
||||
this.csvProjectParamsHead = 'format=csv&type=projects&fq=((funder exact "';
|
||||
//this.csvPublicationParamsHead = 'format=csv-special&type=publications&page=0&query=((((oaftype exact result) and (resulttypeid exact publication)) and (funderid exact ';
|
||||
}
|
||||
|
||||
|
||||
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();
|
||||
|
@ -202,26 +209,62 @@ export class OrganizationComponent {
|
|||
if (this.downloadProjectPublSub) {
|
||||
this.downloadProjectPublSub.unsubscribe();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
this.ngUnsubscribe.next();
|
||||
this.ngUnsubscribe.complete();
|
||||
*/
|
||||
}
|
||||
|
||||
|
||||
private getTotalResearchResults() {
|
||||
this._searchResearchResultsService.numOfEntityResults('publication',
|
||||
this.organizationInfo.objIdentifier, 'organization', this.properties).subscribe(total => {
|
||||
this.total.publications = total;
|
||||
this.total.results += total;
|
||||
});
|
||||
this._searchResearchResultsService.numOfEntityResults('dataset',
|
||||
this.organizationInfo.objIdentifier, 'organization', this.properties).subscribe(total => {
|
||||
this.total.datasets = total;
|
||||
this.total.results += total;
|
||||
});
|
||||
this._searchResearchResultsService.numOfEntityResults('software',
|
||||
this.organizationInfo.objIdentifier, 'organization', this.properties).subscribe(total => {
|
||||
this.total.software = total;
|
||||
this.total.results += total;
|
||||
});
|
||||
this._searchResearchResultsService.numOfEntityResults('other',
|
||||
this.organizationInfo.objIdentifier, 'organization', this.properties).subscribe(total => {
|
||||
this.total.other = total;
|
||||
this.total.results += total;
|
||||
});
|
||||
}
|
||||
|
||||
private getTotalDataproviders() {
|
||||
this._searchDataprovidersService.numOfEntityDataproviders(
|
||||
this.organizationInfo.objIdentifier,'organization', this.properties).subscribe(
|
||||
total => {
|
||||
this.total.dataproviders = total;
|
||||
});
|
||||
}
|
||||
|
||||
private getOrganizationInfo() {
|
||||
|
||||
|
||||
this.warningMessage = '';
|
||||
this.errorMessage = ""
|
||||
this.showLoading = true;
|
||||
|
||||
|
||||
this.organizationInfo = null;
|
||||
|
||||
|
||||
this.infoSub = this._organizationService.getOrganizationInfo(this.organizationId, this.properties).subscribe(
|
||||
data => {
|
||||
if (data == null) {
|
||||
this.showLoading = false;
|
||||
this._router.navigate(['/error'], {queryParams: {"page": this._location.path(true), "page_type": "organization"}});
|
||||
this._router.navigate(['/error'], {
|
||||
queryParams: {
|
||||
"page": this._location.path(true),
|
||||
"page_type": "organization"
|
||||
}
|
||||
});
|
||||
this.errorMessage = 'No organization found';
|
||||
} else {
|
||||
this.organizationInfo = data;
|
||||
|
@ -231,35 +274,24 @@ export class OrganizationComponent {
|
|||
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
|
||||
this.piwiksub = this._piwikService.trackView(this.properties, this.organizationInfo.title.name, this.piwikSiteId).subscribe();
|
||||
}
|
||||
console.log(this.organizationInfo);
|
||||
var refineFields: string [] = ["funder"];
|
||||
|
||||
//this.searchPublications();
|
||||
this.fetchPublications.getNumForEntity("publication", "organization", this.organizationId, this.properties);
|
||||
// this.fetchDatasets.getNumForEntity("organization", this.organizationId, this.properties);
|
||||
this.getTotalResearchResults();
|
||||
this.getTotalDataproviders();
|
||||
this.fetchProjects.getResultsForOrganizations(this.organizationId, "", 1, 0, refineFields, this.properties);
|
||||
|
||||
this.fetchDataproviders.getNumForEntity("organization", this.organizationId, this.properties);
|
||||
|
||||
this.showLoading = false;
|
||||
|
||||
/*let projectsNum = 0;
|
||||
|
||||
if(this.organizationInfo.projects != undefined) {
|
||||
this.fundersSet = new Set<string>();
|
||||
this.organizationInfo.projects.forEach(function (value, key, map) {
|
||||
projectsNum += value.length;
|
||||
this.fundersSet.add(key);
|
||||
}.bind(this));
|
||||
}
|
||||
|
||||
this.projectsNum = projectsNum;*/
|
||||
}
|
||||
},
|
||||
err => {
|
||||
//console.log(err)
|
||||
this.handleError("Error getting organization for id: " + this.organizationId, err);
|
||||
if(err.status == 404) {
|
||||
this._router.navigate(['/error'], {queryParams: {"page": this._location.path(true), "page_type": "organization"}});
|
||||
if (err.status == 404) {
|
||||
this._router.navigate(['/error'], {
|
||||
queryParams: {
|
||||
"page": this._location.path(true),
|
||||
"page_type": "organization"
|
||||
}
|
||||
});
|
||||
}
|
||||
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this.properties.searchLinkToOrganizations);
|
||||
//this.errorMessage = 'No organization found';
|
||||
|
@ -267,90 +299,20 @@ export class OrganizationComponent {
|
|||
}
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
private handleClick(funder: string) {
|
||||
if(this.emptyFundersSet) {
|
||||
this.fundersSet.clear();
|
||||
this.emptyFundersSet = false;
|
||||
}
|
||||
|
||||
if(this.fundersSet.has(funder)) {
|
||||
this.fundersSet.delete(funder);
|
||||
|
||||
if(this.fundersSet.size == 0) {
|
||||
this.organizationInfo.projects.forEach(function (value, key, map) {
|
||||
this.fundersSet.add(key);
|
||||
}.bind(this));
|
||||
this.emptyFundersSet = true;
|
||||
}
|
||||
console.info(funder+" funder deleted");
|
||||
} else {
|
||||
this.fundersSet.add(funder);
|
||||
console.info(funder+" funder added");
|
||||
}
|
||||
}
|
||||
*/
|
||||
//private getProjectsData(key: string): any {
|
||||
//return this.projectsData;
|
||||
//}
|
||||
|
||||
private searchPublications() {
|
||||
this.fetchPublications.getResultsForEntity("publication", "organization", this.organizationId, 1, 10, this.properties);
|
||||
this.linkToSearchPublications = this.properties.searchLinkToAdvancedPublications;
|
||||
//if(this.fetchPublications.searchUtils.totalResults > 0) {
|
||||
this.reloadPublications = false;
|
||||
//this.activeTab = "Publications";
|
||||
//} else {
|
||||
//this.projectsClicked = true;
|
||||
//}
|
||||
}
|
||||
|
||||
// private searchDatasets() {
|
||||
// this.fetchDatasets.getResultsForEntity("organization", this.organizationId, 1, 10,this.properties);
|
||||
// this.linkToSearchPublications = this.properties.searchLinkToAdvancedDatasets;
|
||||
// this.reloadDatasets = false;
|
||||
// }
|
||||
|
||||
private searchDataproviders() {
|
||||
this.fetchDataproviders.getResultsForEntity("organization", this.organizationId, 1, 10, this.properties);
|
||||
this.linkToSearchDataproviders = this.properties.searchLinkToAdvancedDataProviders;
|
||||
|
||||
//if(this.fetchDataproviders.searchUtils.totalResults > 0) {
|
||||
this.reloadDataproviders = false;
|
||||
//this.activeTab = "Content Providers";
|
||||
//} else {
|
||||
|
||||
//}
|
||||
}
|
||||
|
||||
public searchPublicationsInit() {
|
||||
if (this.reloadPublications && this.fetchPublications.searchUtils.totalResults > 0) {
|
||||
this.searchPublications();
|
||||
}
|
||||
}
|
||||
|
||||
// public searchDatasetsInit() {
|
||||
// if(this.reloadDatasets && this.fetchDatasets.searchUtils.totalResults > 0) {
|
||||
// this.searchDatasets();
|
||||
// }
|
||||
// }
|
||||
|
||||
public searchDataprovidersInit() {
|
||||
if (this.reloadDataproviders && this.fetchDataproviders.searchUtils.totalResults > 0) {
|
||||
this.searchDataproviders();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*public searchDataproviders(page: number = 1) {
|
||||
this.fetchDataproviders.getResultsForEntity("organization", this.organizationId, page, 1, this.properties);
|
||||
}*/
|
||||
|
||||
public downloadFile(url: string, filename: string) {
|
||||
|
||||
this.openLoading();
|
||||
this.setMessageLoading("Downloading CSV file");
|
||||
|
||||
|
||||
this.downloadFileSub = this._reportsService.downloadCSVFile(url).subscribe(
|
||||
data => {
|
||||
this.closeLoading();
|
||||
|
||||
|
||||
var url = window.URL.createObjectURL(data);
|
||||
var a = window.document.createElement('a');
|
||||
window.document.body.appendChild(a);
|
||||
|
@ -360,7 +322,7 @@ export class OrganizationComponent {
|
|||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
a.remove(); // remove the element
|
||||
|
||||
|
||||
//window.open(window.URL.createObjectURL(data));
|
||||
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
|
||||
this.downloadFilePiwikSub = this._piwikService.trackDownload(this.properties, url, this.piwikSiteId).subscribe();
|
||||
|
@ -369,40 +331,40 @@ export class OrganizationComponent {
|
|||
err => {
|
||||
//console.log("Error downloading the file.");
|
||||
this.handleError("Error downloading file: " + filename + ".csv", err);
|
||||
|
||||
|
||||
this.closeLoading();
|
||||
this.confirmOpenCsvError();
|
||||
}/*,
|
||||
() => console.log('Completed file download.')*/
|
||||
);
|
||||
}
|
||||
|
||||
private downloadPublicationsFile(funder: string, funderId: string, count: number) {
|
||||
|
||||
|
||||
private downloadFileByFunder() {
|
||||
|
||||
this.openLoading();
|
||||
this.setMessageLoading("Downloading CSV file");
|
||||
|
||||
|
||||
let response: string[] = [];
|
||||
let totalResponse: string = "";
|
||||
let projects = [];
|
||||
let counter: number = count;
|
||||
let counter: number = this.funderCount;
|
||||
let title: boolean = false;
|
||||
let title_index: number = 0;
|
||||
|
||||
let filename: string = 'funder-project-publications-report';
|
||||
|
||||
this.countProjectsSub = this._searchProjectsService.getProjectsForOrganizations(this.organizationId, ' and (funder exact "' + funderId + '" ) ', 1, count, [], this.properties).subscribe(
|
||||
|
||||
let filename: string = 'funder-project-' + this.funderContentType + '-report';
|
||||
|
||||
this.countProjectsSub = this._searchProjectsService.getProjectsForOrganizations(this.organizationId, ' and (funder exact "' + this.encodeURI(this.funderId) + '" ) ', 1, this.funderCount, [], this.properties).subscribe(
|
||||
data => {
|
||||
projects = data[1];
|
||||
for (let index = 0; index < projects.length; index++) {
|
||||
this.countPublSub = this._searchResearchResultsService.numOfEntityResults("publication", projects[index].id, "project", this.properties).subscribe(
|
||||
this.countPublSub = this._searchResearchResultsService.numOfEntityResults(this.funderContentType, projects[index].id, "project", this.properties).subscribe(
|
||||
data => {
|
||||
//if(data == 0 && title) { // if no publications for this project
|
||||
if (data == 0 && (counter > 1 || title)) { // if no publications for this project
|
||||
counter--;
|
||||
response[index] = "";
|
||||
//console.info("index: "+index, "counter: "+counter, "id:"+projects[index].id, response[index]);
|
||||
|
||||
|
||||
if (counter == 0) {
|
||||
//for(let i=count-1; i>=0; i--) {
|
||||
for (let i = 0; i < projects.length; i++) {
|
||||
|
@ -415,7 +377,7 @@ export class OrganizationComponent {
|
|||
}
|
||||
}
|
||||
this.closeLoading();
|
||||
|
||||
|
||||
var csvurl = window.URL.createObjectURL(new Blob([totalResponse], {type: 'text/csv'}));
|
||||
var a = window.document.createElement('a');
|
||||
window.document.body.appendChild(a);
|
||||
|
@ -431,18 +393,18 @@ export class OrganizationComponent {
|
|||
if (!title) {
|
||||
title_index = index;
|
||||
//console.info(title_index);
|
||||
url = this.downloadURLAPI + "?format=csv-special&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact \"" + projects[index].id + "\"))"
|
||||
url = this.downloadURLAPI + '?format=csv-special&' + this.getTypeParam(this.funderContentType)+ '&fq=((relprojectid exact "' + projects[index].id + '"))';
|
||||
} else {
|
||||
url = this.downloadURLAPI + "?format=csv-special-notitle&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact \"" + projects[index].id + "\"))"
|
||||
url = this.downloadURLAPI + '?format=csv-special-notitle&' + this.getTypeParam(this.funderContentType)+ '&fq=((relprojectid exact "' + projects[index].id + '"))';
|
||||
}
|
||||
title = true;
|
||||
|
||||
|
||||
this.downloadProjectPublSub = this._reportsService.getCSVResponse(url).subscribe(
|
||||
data => {
|
||||
counter--;
|
||||
response[index] = data;
|
||||
//console.info("index: "+index, "counter: "+counter, "id:"+projects[index].id, response[index]);
|
||||
|
||||
|
||||
if (counter == 0) {
|
||||
//for(let i=count-1; i>=0; i--) {
|
||||
for (let i = 0; i < projects.length; i++) {
|
||||
|
@ -455,7 +417,7 @@ export class OrganizationComponent {
|
|||
}
|
||||
}
|
||||
this.closeLoading();
|
||||
|
||||
|
||||
var csvurl = window.URL.createObjectURL(new Blob([totalResponse], {type: 'text/csv'}));
|
||||
var a = window.document.createElement('a');
|
||||
window.document.body.appendChild(a);
|
||||
|
@ -469,7 +431,7 @@ export class OrganizationComponent {
|
|||
},
|
||||
err => {
|
||||
this.handleError("Error downloading file: " + filename, err);
|
||||
|
||||
|
||||
this.closeLoading();
|
||||
this.confirmOpenCsvError();
|
||||
}/*,
|
||||
|
@ -484,18 +446,18 @@ export class OrganizationComponent {
|
|||
},
|
||||
err => {
|
||||
this.handleError("Error getting projects for organization with id: " + this.organizationId, err);
|
||||
|
||||
|
||||
this.closeLoading();
|
||||
this.confirmOpenCsvError();
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
private updateDescription(description: string) {
|
||||
this._meta.updateTag({content: description.substring(0, 160)}, "name='description'");
|
||||
this._meta.updateTag({content: description.substring(0, 160)}, "property='og:description'");
|
||||
}
|
||||
|
||||
|
||||
private updateTitle(title: string) {
|
||||
var _prefix = "";
|
||||
// if(!this.communityId) {
|
||||
|
@ -505,30 +467,30 @@ export class OrganizationComponent {
|
|||
this._title.setTitle(title);
|
||||
this._meta.updateTag({content: title}, "property='og:title'");
|
||||
}
|
||||
|
||||
|
||||
private updateUrl(url: string) {
|
||||
this._meta.updateTag({content: url}, "property='og:url'");
|
||||
}
|
||||
|
||||
|
||||
private openLoading() {
|
||||
if (this.loading) {
|
||||
this.loading.open();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private closeLoading() {
|
||||
if (this.loading) {
|
||||
this.loading.close();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private setMessageLoading(message: string) {
|
||||
if (this.loading) {
|
||||
this.loading.message = message;
|
||||
}
|
||||
}
|
||||
|
||||
public confirmOpenApplyAll(funder: string, funderId: string, funderCountPublications: number) {
|
||||
|
||||
public confirmOpenApplyAll(contentType: string) {
|
||||
this.alertApplyAll.cancelButton = true;
|
||||
this.alertApplyAll.okButton = true;
|
||||
this.alertApplyAll.alertTitle = "CSV FILE";
|
||||
|
@ -536,16 +498,15 @@ export class OrganizationComponent {
|
|||
this.alertApplyAll.okButtonText = "Yes";
|
||||
this.alertApplyAll.cancelButtonText = "No";
|
||||
this.alertApplyAll.open();
|
||||
|
||||
this.funder = funder;
|
||||
this.funderId = funderId;
|
||||
this.funderCountPublications = funderCountPublications;
|
||||
this.funderId = this.funder.id;
|
||||
this.funderCount = this.funder.number;
|
||||
this.funderContentType = contentType;
|
||||
}
|
||||
|
||||
public confirmCloseApplyAll(data) {
|
||||
this.downloadPublicationsFile(this.funder, this.funderId, this.funderCountPublications);
|
||||
|
||||
public confirmCloseApplyAll() {
|
||||
this.downloadFileByFunder();
|
||||
}
|
||||
|
||||
|
||||
public confirmOpenCsvError() {
|
||||
this.alertCsvError.cancelButton = false;
|
||||
this.alertCsvError.okButton = true;
|
||||
|
@ -554,20 +515,43 @@ export class OrganizationComponent {
|
|||
this.alertCsvError.okButtonText = "OK";
|
||||
this.alertCsvError.open();
|
||||
}
|
||||
|
||||
|
||||
encodeURI(input: string): string {
|
||||
return StringUtils.URIEncode(input);
|
||||
}
|
||||
|
||||
|
||||
private handleError(message: string, error) {
|
||||
console.error("Organizaton Landing Page: " + message, error);
|
||||
}
|
||||
|
||||
|
||||
openDeletedByInference() {
|
||||
this.deleteByInferenceOpened = true;
|
||||
this.alertModalDeletedByInference.cancelButton = false;
|
||||
this.alertModalDeletedByInference.okButton = false;
|
||||
this.alertModalDeletedByInference.alertTitle = "Other versions";
|
||||
this.alertModalDeletedByInference.alertTitle = "Other versions of";
|
||||
this.alertModalDeletedByInference.open();
|
||||
}
|
||||
|
||||
openProjectsModal() {
|
||||
this.projectsInModalComponent.pageChange({value: 1});
|
||||
this.projectsModal.cancelButton = false;
|
||||
this.projectsModal.okButton = false;
|
||||
this.projectsModal.alertTitle = "Projects of";
|
||||
this.projectsModal.open();
|
||||
}
|
||||
|
||||
public getTypeParam(type: string): string {
|
||||
if(type == 'results') {
|
||||
type = 'publications&type=datasets&type=software&type=other';
|
||||
}
|
||||
return 'type='+type;
|
||||
}
|
||||
|
||||
getCSVAffiliated(contentType: string): string {
|
||||
return this.downloadURLAPI + '?format=csv&' + this.getTypeParam(contentType) + '&fq=(relorganizationid exact "' + this.organizationId + '")';
|
||||
}
|
||||
|
||||
getFunderProjects(): string {
|
||||
return this.downloadURLAPI + '?'+this.csvProjectParamsHead+encodeURI(this.funder.id)+this.csvParamsTail;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,13 +16,16 @@ import {ReportsServiceModule} from '../../services/reportsService.module';
|
|||
import {SearchResearchResultsServiceModule} from '../../services/searchResearchResultsService.module';
|
||||
import {ProjectsServiceModule} from '../../services/projectsService.module';
|
||||
|
||||
import {SearchingProjectsTabModule} from '../landing-utils/searchingProjectsInTab.module';
|
||||
import {ProjectsInModalModule} from '../landing-utils/projects-in-modal.module';
|
||||
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 {HelperModule} from "../../utils/helper/helper.module";
|
||||
import {OrganizationsDeletedByInferenceModule} from "./deletedByInference/deletedByInference.module";
|
||||
import {LandingHeaderModule} from "../landing-utils/landing-header/landing-header.module";
|
||||
import {FeedbackModule} from "../feedback/feedback.module";
|
||||
import {MatSelectModule} from "@angular/material/select";
|
||||
|
||||
|
||||
@NgModule({
|
||||
|
@ -34,12 +37,12 @@ import {OrganizationsDeletedByInferenceModule} from "./deletedByInference/delete
|
|||
DataProvidersServiceModule,
|
||||
ReportsServiceModule,
|
||||
OrganizationServiceModule,
|
||||
SearchingProjectsTabModule,
|
||||
ProjectsInModalModule,
|
||||
OrganizationServiceModule,
|
||||
SearchResearchResultsServiceModule,
|
||||
ProjectsServiceModule,
|
||||
Schema2jsonldModule, SEOServiceModule, HelperModule,
|
||||
OrganizationsDeletedByInferenceModule
|
||||
OrganizationsDeletedByInferenceModule, LandingHeaderModule, FeedbackModule, MatSelectModule
|
||||
],
|
||||
declarations: [
|
||||
OrganizationComponent,
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -20,6 +20,7 @@ import {SEOService} from '../../sharedComponents/SEO/SEO.service';
|
|||
import {HelperFunctions} from "../../utils/HelperFunctions.class";
|
||||
import {HelperService} from "../../utils/helper/helper.service";
|
||||
import {Location} from "@angular/common";
|
||||
import {HtmlProjectReportService} from "../htmlProjectReport/htmlProjectReport.service";
|
||||
|
||||
@Component({
|
||||
selector: 'project',
|
||||
|
@ -47,20 +48,19 @@ export class ProjectComponent {
|
|||
public chartAccessModeUrl: string;
|
||||
public chartDatasourcesUrl: string;
|
||||
|
||||
// HTML variables in APP BOX
|
||||
public publications_dynamic: string;
|
||||
public datasets_dynamic: string;
|
||||
public software_dynamic: string;
|
||||
public orps_dynamic: string;
|
||||
// Clipboard variable for HTML dynamic content
|
||||
public clipboard;
|
||||
|
||||
public project;
|
||||
|
||||
// CSV variables
|
||||
public downloadURLAPI: string;
|
||||
public csvParams: string;
|
||||
public csvParamsDatasets: string;
|
||||
public csvParamsSoftware: string;
|
||||
public csvParamsOrps: string;
|
||||
|
||||
// HTML (download) variables
|
||||
public header1: string = "";
|
||||
public header2: string = "";
|
||||
public htmlResultDownload: string = "";
|
||||
|
||||
// Message variables
|
||||
public warningMessage = "";
|
||||
|
@ -70,12 +70,18 @@ export class ProjectComponent {
|
|||
// Active tab variable for responsiveness
|
||||
public activeTab: string = "Publications";
|
||||
|
||||
@ViewChild('statisticsModal') statisticsModal;
|
||||
|
||||
// Request results for publications, research data and software only the one time (first time tab is clicked)
|
||||
private reloadPublications: boolean = true;
|
||||
private reloadDatasets: boolean = true;
|
||||
private reloadSoftware: boolean = true;
|
||||
private reloadOrps: boolean = true;
|
||||
|
||||
// Variables for entity selections on the right column
|
||||
public share_research_results_type: string = "";
|
||||
public download_research_results_type: string = "";
|
||||
|
||||
// Variables for publications, research data, software tabs
|
||||
public fetchPublications: FetchResearchResults;
|
||||
public linkToSearchPublications = "";
|
||||
|
@ -91,36 +97,53 @@ export class ProjectComponent {
|
|||
public pageContents = null;
|
||||
public divContents = null;
|
||||
|
||||
public share_research_results_type: string = "";
|
||||
public indexUpdateDate: Date;
|
||||
public showFeedback: boolean;
|
||||
public feedbackFields: string [] = [
|
||||
'Title', 'Funding Information', 'Duration',
|
||||
'Organizations', 'Other'];
|
||||
|
||||
@ViewChild(ModalLoading) loading: ModalLoading;
|
||||
// Alert box when something is wrong with CSV requests
|
||||
@ViewChild('AlertModalCsvError') alertCsvError;
|
||||
|
||||
// Description variables for view more/less functionality
|
||||
public thresholdDescription: number = 670;
|
||||
public showNumDescription: number = 670;
|
||||
|
||||
// Organizations variables for view more/less functionality
|
||||
public thresholdOrganizations: number = 20;
|
||||
public showNumOrganizations: number = 20;
|
||||
|
||||
sub: any;
|
||||
piwiksub: any;
|
||||
infoSub: any;
|
||||
downloadFilePiwikSub: any;
|
||||
downloadHtmlFilePiwikSub: any;
|
||||
properties: EnvProperties;
|
||||
|
||||
constructor(private _projectService: ProjectService,
|
||||
private _piwikService: PiwikService,
|
||||
private route: ActivatedRoute,
|
||||
private router: Router,
|
||||
private _searchResearchResultsService: SearchResearchResultsService,
|
||||
private _reportsService: ReportsService,
|
||||
public subHTML: any;
|
||||
|
||||
constructor(private route: ActivatedRoute,
|
||||
private _router: Router,
|
||||
private _location: Location,
|
||||
private _meta: Meta,
|
||||
private _title: Title,
|
||||
private _router: Router,
|
||||
private helper: HelperService,
|
||||
private seoService: SEOService,
|
||||
private _location: Location) {
|
||||
}
|
||||
private _piwikService: PiwikService,
|
||||
private helper: HelperService,
|
||||
private _projectService: ProjectService,
|
||||
private _searchResearchResultsService: SearchResearchResultsService,
|
||||
private _reportsService: ReportsService,
|
||||
private htmlService: HtmlProjectReportService) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
if(this.properties.lastIndexUpdate) {
|
||||
this.indexUpdateDate = new Date(this.properties.lastIndexUpdate);
|
||||
}
|
||||
//this.getDivContents();
|
||||
this.getPageContents();
|
||||
this.updateUrl(data.envSpecific.baseLink + this._router.url);
|
||||
|
@ -137,6 +160,8 @@ export class ProjectComponent {
|
|||
var title = "Project";
|
||||
var description = "";
|
||||
|
||||
this.header1 = "";
|
||||
|
||||
this.updateTitle(title);
|
||||
this.updateDescription(description);
|
||||
this.projectId = params['projectId'];
|
||||
|
@ -159,15 +184,32 @@ export class ProjectComponent {
|
|||
this.downloadURLAPI = this.properties.csvAPIURL;
|
||||
|
||||
this.createClipboard();
|
||||
this.csvParams = "?format=csv-special&type=publications&fq=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact \"" + this.projectId + "\"))";
|
||||
this.csvParamsDatasets = "?format=csv-special&type=datasets&fq=(((oaftype exact result) and (resulttypeid exact dataset)) and (relprojectid exact \"" + this.projectId + "\"))";
|
||||
this.csvParamsSoftware = "?format=csv-special&type=software&fq=(((oaftype exact result) and (resulttypeid exact software)) and (relprojectid exact \"" + this.projectId + "\"))";
|
||||
this.csvParamsOrps = "?format=csv-special&type=other&fq=(((oaftype exact result) and (resulttypeid exact other)) and (relprojectid exact \"" + this.projectId + "\"))";
|
||||
|
||||
HelperFunctions.scroll();
|
||||
});
|
||||
}
|
||||
|
||||
public getFileNameType(type: string) {
|
||||
if(type == "results") {
|
||||
return "research-outcomes";
|
||||
} else if(type == "publications") {
|
||||
return "publications";
|
||||
} else if(type == "datasets") {
|
||||
return "research-data";
|
||||
} else if(type == "software") {
|
||||
return "software";
|
||||
} else if(type == "other") {
|
||||
return "other-research-products";
|
||||
}
|
||||
return "results";
|
||||
}
|
||||
|
||||
public getCsvParams(type: string) {
|
||||
// if(type == "results") {
|
||||
// type = "publications&type=datasets&type=software&type=other";
|
||||
// }
|
||||
return "?format=csv-special&type="+type+"&fq=(relprojectid exact \"" + this.projectId + "\")";
|
||||
}
|
||||
|
||||
private getPageContents() {
|
||||
this.helper.getPageHelpContents(this._router.url, this.properties, this.communityId).subscribe(contents => {
|
||||
this.pageContents = contents;
|
||||
|
@ -180,47 +222,20 @@ export class ProjectComponent {
|
|||
})
|
||||
}
|
||||
|
||||
getDynamicContent(type: string) {
|
||||
return "<script type=\"text/javascript\">"
|
||||
+ "\n<!--"
|
||||
+ "\ndocument.write('<div id=\"oa_widget\"></div>');"
|
||||
+ "\ndocument.write('<script type=\"text/javascript\""
|
||||
+ " src=\"" + this.properties.widgetLink
|
||||
+ this.projectId + "&type="
|
||||
+ type
|
||||
+ "\"></script>');"
|
||||
+ "\n-->"
|
||||
+ "\n</script>";
|
||||
}
|
||||
|
||||
actionsAfterLoadId() {
|
||||
this.publications_dynamic =
|
||||
"<script type=\"text/javascript\">"
|
||||
+ "\n<!--"
|
||||
+ "\ndocument.write('<div id=\"oa_widget\"></div>');"
|
||||
+ "\ndocument.write('<script type=\"text/javascript\""
|
||||
+ " src=\"" + this.properties.widgetLink
|
||||
+ this.projectId + "&type=publication\"></script>');"
|
||||
+ "\n-->"
|
||||
+ "\n</script>";
|
||||
|
||||
this.datasets_dynamic =
|
||||
"<script type=\"text/javascript\">"
|
||||
+ "\n<!--"
|
||||
+ "\ndocument.write('<div id=\"oa_widget\"></div>');"
|
||||
+ "\ndocument.write('<script type=\"text/javascript\""
|
||||
+ " src=\"" + this.properties.widgetLink
|
||||
+ this.projectId + "&type=dataset\"></script>');"
|
||||
+ "\n-->"
|
||||
+ "\n</script>";
|
||||
|
||||
this.software_dynamic =
|
||||
"<script type=\"text/javascript\">"
|
||||
+ "\n<!--"
|
||||
+ "\ndocument.write('<div id=\"oa_widget\"></div>');"
|
||||
+ "\ndocument.write('<script type=\"text/javascript\""
|
||||
+ " src=\"" + this.properties.widgetLink
|
||||
+ this.projectId + "&type=software\"></script>');"
|
||||
+ "\n-->"
|
||||
+ "\n</script>";
|
||||
|
||||
this.orps_dynamic =
|
||||
"<script type=\"text/javascript\">"
|
||||
+ "\n<!--"
|
||||
+ "\ndocument.write('<div id=\"oa_widget\"></div>');"
|
||||
+ "\ndocument.write('<script type=\"text/javascript\""
|
||||
+ " src=\"" + this.properties.widgetLink
|
||||
+ this.projectId + "&type=other\"></script>');"
|
||||
+ "\n-->"
|
||||
+ "\n</script>";
|
||||
|
||||
this.getProjectInfo(this.projectId);
|
||||
//this.searchPublications();
|
||||
this.fetchPublications.getNumForEntity("publication", "project", this.projectId, this.properties);
|
||||
|
@ -242,29 +257,23 @@ export class ProjectComponent {
|
|||
if (this.downloadFilePiwikSub) {
|
||||
this.downloadFilePiwikSub.unsubscribe();
|
||||
}
|
||||
if(this.downloadHtmlFilePiwikSub) {
|
||||
this.downloadHtmlFilePiwikSub.unsubscribe();
|
||||
}
|
||||
}
|
||||
|
||||
private createClipboard() {
|
||||
if (typeof window !== 'undefined') {
|
||||
|
||||
let publications_clipboard, datasets_clipboard, software_clipboard, other_clipboard;
|
||||
delete this.clipboard;
|
||||
let Clipboard;
|
||||
Clipboard = require('clipboard');
|
||||
publications_clipboard = new Clipboard('.publications_clipboard_btn');
|
||||
datasets_clipboard = new Clipboard('.datasets_clipboard_btn');
|
||||
software_clipboard = new Clipboard('.software_clipboard_btn');
|
||||
other_clipboard = new Clipboard('.other_clipboard_btn');
|
||||
this.clipboard = new Clipboard('.clipboard_btn');
|
||||
}
|
||||
}
|
||||
|
||||
private searchPublications() {
|
||||
this.fetchPublications.getResultsForEntity("publication", "project", this.projectId, 1, 10, this.properties);
|
||||
this.linkToSearchPublications = this.properties.searchLinkToAdvancedPublications;// + "?project=" + this.projectId+"&pr=and";
|
||||
//if(this.fetchPublications.searchUtils.totalResults > 0) {
|
||||
//this.activeTab = "Publications";
|
||||
//} else {
|
||||
//this.searchDatasetsInit();
|
||||
//}
|
||||
this.reloadPublications = false;
|
||||
}
|
||||
|
||||
|
@ -377,14 +386,14 @@ export class ProjectComponent {
|
|||
}
|
||||
this.seoService.createLinkForCanonicalURL(this.properties.baseLink + this._router.url);
|
||||
this.updateTitle(this.projectName);
|
||||
this.updateDescription("project, " + this.projectName + "," + this.projectInfo.funder + "," + this.projectInfo.acronym);
|
||||
this.updateDescription("project, " + this.projectName + "," + this.projectInfo.funding.funderShortName + "," + this.projectInfo.acronym);
|
||||
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
|
||||
this.piwiksub = this._piwikService.trackView(this.properties, this.projectName, this.piwikSiteId).subscribe();
|
||||
}
|
||||
|
||||
this.project = {
|
||||
funderId: "",
|
||||
funderName: this.projectInfo.funder,
|
||||
funderName: ((this.projectInfo.funding) ? this.projectInfo.funding.funderShortName: ''),
|
||||
projectId: this.projectId,
|
||||
projectName: this.projectInfo.title,
|
||||
projectAcronym: this.projectInfo.acronym,
|
||||
|
@ -404,7 +413,7 @@ export class ProjectComponent {
|
|||
this.showLoading = false;
|
||||
}
|
||||
|
||||
public downloadfile(url: string, filename: string) {
|
||||
public downloadCsvFile(url: string, filename: string) {
|
||||
this.openLoading();
|
||||
this.setMessageLoading("Downloading CSV file");
|
||||
|
||||
|
@ -412,17 +421,9 @@ export class ProjectComponent {
|
|||
data => {
|
||||
this.closeLoading();
|
||||
|
||||
var url = window.URL.createObjectURL(data);
|
||||
var a = window.document.createElement('a');
|
||||
window.document.body.appendChild(a);
|
||||
a.setAttribute('style', 'display: none');
|
||||
a.href = url;
|
||||
a.download = filename + ".csv";
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
a.remove(); // remove the element
|
||||
let url = window.URL.createObjectURL(data);
|
||||
this.download(url, filename+".csv");
|
||||
|
||||
//window.open(window.URL.createObjectURL(data));
|
||||
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
|
||||
this.downloadFilePiwikSub = this._piwikService.trackDownload(this.properties, url).subscribe();
|
||||
}
|
||||
|
@ -432,55 +433,191 @@ export class ProjectComponent {
|
|||
this.handleError("Error downloading file: " + filename, error);
|
||||
|
||||
this.closeLoading();
|
||||
this.confirmOpenCsvError();
|
||||
this.confirmOpenFileDownloadError("CSV");
|
||||
}/*,
|
||||
() => console.log('Completed file download.')*/
|
||||
);
|
||||
}
|
||||
|
||||
/*
|
||||
showHTML(){
|
||||
let info:string = "<h1>Publications of Project ";
|
||||
|
||||
if(this.projectInfo.title != undefined && this.projectInfo.title != "") {
|
||||
info += this.projectInfo.title;
|
||||
}
|
||||
if((this.projectInfo.title != undefined && this.projectInfo.title != "") &&
|
||||
((this.projectInfo.acronym != undefined && this.projectInfo.acronym != "") ||
|
||||
(this.projectInfo.callIdentifier != undefined && this.projectInfo.callIdentifier != ""))) {
|
||||
info += "(";
|
||||
}
|
||||
if(this.projectInfo.acronym != undefined && this.projectInfo.acronym != "") {
|
||||
info += this.projectInfo.acronym + " - ";
|
||||
}
|
||||
if(this.projectInfo.callIdentifier != undefined && this.projectInfo.callIdentifier != "") {
|
||||
info += this.projectInfo.callIdentifier;
|
||||
}
|
||||
if((this.projectInfo.title != undefined && this.projectInfo.title != "") &&
|
||||
((this.projectInfo.acronym != undefined && this.projectInfo.acronym != "") ||
|
||||
(this.projectInfo.callIdentifier != undefined && this.projectInfo.callIdentifier != ""))) {
|
||||
info += ")";
|
||||
}
|
||||
info +="</h1>";
|
||||
info += "<h3>"+this.fetchPublications.searchUtils.totalResults+" publications</h3>";
|
||||
|
||||
let htmlParams = 'resources?format=html&page=0&size='+this.fetchPublications.searchUtils.totalResults+'&type=publications&query=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact "'+this.projectId+'"))';
|
||||
this._reportsService.downloadHTMLFile(this.downloadURLAPI+htmlParams, info)
|
||||
.subscribe(data => this.funct(data),
|
||||
error => console.log("Error downloading the file."),
|
||||
() => console.log('Completed file download.'));
|
||||
}
|
||||
|
||||
funct(data) {
|
||||
var win = window.open(window.URL.createObjectURL(data));
|
||||
}
|
||||
*/
|
||||
public metricsResults($event) {
|
||||
this.totalViews = $event.totalViews;
|
||||
this.totalDownloads = $event.totalDownloads;
|
||||
this.pageViews = $event.pageViews;
|
||||
}
|
||||
|
||||
public openStatistics() {
|
||||
this.statsClicked = true;
|
||||
this.statisticsModal.cancelButton = false;
|
||||
this.statisticsModal.okButton = false;
|
||||
this.statisticsModal.alertTitle = "Statistics of";
|
||||
this.statisticsModal.open();
|
||||
}
|
||||
|
||||
private createHeaders(type: string) {
|
||||
this.openLoading();
|
||||
this.setMessageLoading("Downloading HTML file");
|
||||
|
||||
if(!this.header1) {
|
||||
this.createHeader1();
|
||||
}
|
||||
|
||||
if (type == "publications") {
|
||||
this.header2 = this.fetchPublications.searchUtils.totalResults.toLocaleString('en-US') + " publications";
|
||||
} else if (type == "datasets") {
|
||||
this.header2 = this.fetchDatasets.searchUtils.totalResults.toLocaleString('en-US') + " research data";
|
||||
} else if (type == "software") {
|
||||
this.header2 = this.fetchSoftware.searchUtils.totalResults.toLocaleString('en-US') + " software";
|
||||
} else if (type == "other") {
|
||||
this.header2 = this.fetchOrps.searchUtils.totalResults.toLocaleString('en-US') + " other research products";
|
||||
} else if (type == "results") {
|
||||
let totalResults: number = (+this.fetchPublications.searchUtils.totalResults) +
|
||||
(+this.fetchDatasets.searchUtils.totalResults) +
|
||||
(+this.fetchSoftware.searchUtils.totalResults) +
|
||||
(+this.fetchOrps.searchUtils.totalResults);
|
||||
|
||||
this.header2 = totalResults.toLocaleString('en-US') + " research outcomes";
|
||||
}
|
||||
}
|
||||
|
||||
private createHtmlFile(type: string, filename: string) {
|
||||
let intro: string = '<!doctype html>';
|
||||
intro += '<html lang="en-gb" dir="ltr" vocab="http://schema.org/">';
|
||||
intro += '<head>';
|
||||
intro += '<title>' + this.header1 + '</title>';
|
||||
intro += '</head>';
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
this.subHTML = this.htmlService.getHTML(this.projectId, type, this.properties.csvAPIURL).subscribe(
|
||||
data => {
|
||||
//console.info(data);
|
||||
this.htmlResultDownload = intro + '<body><div>' + this.header1 + '</div><div><h4>' + this.header2 + '</h4></div>';
|
||||
this.htmlResultDownload += "<table><thead><tr> <th>Type</th><th>Title</th><th>Authors</th><th>Publication Year</th><th>DOI</th><th>Permanent Identifier</th><th>Publication type</th><th>Journal</th><th>Project Name (GA Number)</th><th>Access Mode</th></tr></thead><tbody>" + data + "</tbody></table>";
|
||||
this.htmlResultDownload += '</body></html>';
|
||||
|
||||
//console.info(this.htmlResultDownload);
|
||||
this.closeLoading();
|
||||
|
||||
let url = window.URL.createObjectURL(new Blob([this.htmlResultDownload], { type: 'text/html' }));
|
||||
this.download(url, filename+".html");
|
||||
|
||||
if (this.properties.enablePiwikTrack && (typeof document !== 'undefined')) {
|
||||
this.downloadHtmlFilePiwikSub = this._piwikService.trackDownload(this.properties, url).subscribe();
|
||||
}
|
||||
},
|
||||
err => {
|
||||
this.handleError("Error getting html for id: " + this.projectId, err);
|
||||
//this.errorMessage = 'Service not available';
|
||||
this.closeLoading();
|
||||
this.confirmOpenFileDownloadError("HTML");
|
||||
}
|
||||
);
|
||||
} else {
|
||||
this.closeLoading();
|
||||
this.confirmOpenFileDownloadError("HTML");
|
||||
}
|
||||
}
|
||||
|
||||
downloadHtmlFile(type: string, filename: string) {
|
||||
this.createHeaders(type);
|
||||
this.createHtmlFile(type, filename);
|
||||
}
|
||||
|
||||
createHeader1() {
|
||||
// if (title != undefined && title != "") {
|
||||
// this.header1 += title;
|
||||
// }
|
||||
// if ((title != undefined && title != "") &&
|
||||
// ((acronym != undefined && acronym != "") ||
|
||||
// (code != undefined && code != ""))) {
|
||||
// this.header1 += "(";
|
||||
// }
|
||||
// if (acronym != undefined && acronym != "") {
|
||||
// this.header1 += acronym + " - ";
|
||||
// }
|
||||
// if (code != undefined && code != "") {
|
||||
// this.header1 += code;
|
||||
// }
|
||||
// if ((title != undefined && title != "") &&
|
||||
// ((acronym != undefined && acronym != "") ||
|
||||
// (code != undefined && code != ""))) {
|
||||
// this.header1 += ")";
|
||||
// }
|
||||
|
||||
this.header1 = "<div style=\"font-size:12px;\"><span>Project</span>";
|
||||
|
||||
if(this.projectInfo.startDate || this.projectInfo.endDate) {
|
||||
this.header1 += "<span> . "
|
||||
}
|
||||
if(this.projectInfo.startDate && !this.projectInfo.endDate) {
|
||||
this.header1 += "from ";
|
||||
}
|
||||
if(!this.projectInfo.startDate && this.projectInfo.endDate) {
|
||||
this.header1 += "until ";
|
||||
}
|
||||
if(this.projectInfo.startDate) {
|
||||
let startYear = (new Date(this.projectInfo.startDate)).getFullYear();
|
||||
this.header1 += startYear;
|
||||
}
|
||||
if(this.projectInfo.startDate && this.projectInfo.endDate) {
|
||||
this.header1 += " - ";
|
||||
}
|
||||
if(this.projectInfo.endDate) {
|
||||
let endYear = (new Date(this.projectInfo.endDate)).getFullYear();
|
||||
this.header1 += endYear;
|
||||
}
|
||||
if(this.projectInfo.startDate || this.projectInfo.endDate) {
|
||||
this.header1 += "</span>"
|
||||
}
|
||||
|
||||
if(this.projectInfo.status) {
|
||||
this.header1 += "<span> . "+this.projectInfo.status+"</span>";
|
||||
}
|
||||
|
||||
if(this.projectInfo.funding && this.projectInfo.funding.code) {
|
||||
this.header1 += "<span> . "+this.projectInfo.funding.code+"</span>";
|
||||
}
|
||||
this.header1 += "</div>";
|
||||
|
||||
this.header1 += "<h1 style=\"margin:0;\"><div><a href=\""+window.location.href +"\">";
|
||||
if(this.projectInfo.acronym) {
|
||||
this.header1 += this.projectInfo.acronym;
|
||||
} else {
|
||||
this.header1 += "[no title available]";
|
||||
}
|
||||
this.header1 += "</a></div></h2>";
|
||||
//<showTitle [titleName]="title" classNames="uk-margin-remove-bottom"></showTitle>
|
||||
if(this.projectInfo.title) {
|
||||
this.header1 += "<div><span>"+this.projectInfo.title+"</span></div>";
|
||||
}
|
||||
}
|
||||
|
||||
public download(url, filename) {
|
||||
//var url = window.URL.createObjectURL(new Blob([this.htmlResultDownload], { type: 'text/html' }));
|
||||
var a = window.document.createElement('a');
|
||||
window.document.body.appendChild(a);
|
||||
a.setAttribute('style', 'display: none');
|
||||
a.href = url;
|
||||
a.download = filename;
|
||||
a.click();
|
||||
window.URL.revokeObjectURL(url);
|
||||
a.remove(); // remove the element
|
||||
}
|
||||
|
||||
// copyToClipboard(element: HTMLElement) {
|
||||
// if (typeof document !== 'undefined') {
|
||||
// if (window.getSelection) {
|
||||
// const selection = window.getSelection();
|
||||
// const range = document.createRange();
|
||||
// range.selectNodeContents(element);
|
||||
// selection.removeAllRanges();
|
||||
// selection.addRange(range);
|
||||
// document.execCommand('copy');
|
||||
// } else {
|
||||
// console.warn("Could not select text in node: Unsupported browser.");
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
|
||||
private updateDescription(description: string) {
|
||||
this._meta.updateTag({content: description.substring(0, 160)}, "name='description'");
|
||||
this._meta.updateTag({content: description.substring(0, 160)}, "property='og:description'");
|
||||
|
@ -518,10 +655,10 @@ export class ProjectComponent {
|
|||
}
|
||||
}
|
||||
|
||||
public confirmOpenCsvError() {
|
||||
public confirmOpenFileDownloadError(fileType: string) {
|
||||
this.alertCsvError.cancelButton = false;
|
||||
this.alertCsvError.okButton = true;
|
||||
this.alertCsvError.alertTitle = "ERROR DOWNLOADING CSV FILE";
|
||||
this.alertCsvError.alertTitle = "ERROR DOWNLOADING "+fileType+" FILE";
|
||||
this.alertCsvError.message = "There was an error in csv downloading. Please try again later.";
|
||||
this.alertCsvError.okButtonText = "OK";
|
||||
this.alertCsvError.open();
|
||||
|
@ -532,8 +669,8 @@ export class ProjectComponent {
|
|||
}
|
||||
|
||||
isRouteAvailable(routeToCheck: string) {
|
||||
for (let i = 0; i < this.router.config.length; i++) {
|
||||
let routePath: string = this.router.config[i].path;
|
||||
for (let i = 0; i < this._router.config.length; i++) {
|
||||
let routePath: string = this._router.config[i].path;
|
||||
if (routePath == routeToCheck) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -1,41 +1,47 @@
|
|||
//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 { NgModule} from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import {MatSelectModule} from "@angular/material";
|
||||
|
||||
import { ProjectComponent } from './project.component';
|
||||
import {ProjectServiceModule} from './projectService.module';
|
||||
import {HtmlProjectReportService} from "../htmlProjectReport/htmlProjectReport.service";
|
||||
import {ReportsServiceModule} from '../../services/reportsService.module';
|
||||
import {SearchResearchResultsServiceModule} from '../../services/searchResearchResultsService.module';
|
||||
|
||||
import {MetricsModule} from '../landing-utils/metrics.module';
|
||||
import {LandingModule } from '../landing-utils/landing.module';
|
||||
import {LandingHeaderModule} from "../landing-utils/landing-header/landing-header.module";
|
||||
|
||||
import { ProjectServiceModule} from './projectService.module';
|
||||
import {LoadingModalModule} from '../../utils/modal/loadingModal.module';
|
||||
import {AlertModalModule} from '../../utils/modal/alertModal.module';
|
||||
import {ErrorMessagesModule} from '../../utils/errorMessages.module';
|
||||
|
||||
import { ProjectComponent } from './project.component';
|
||||
import {HelperModule} from "../../utils/helper/helper.module";
|
||||
import {IFrameModule} from '../../utils/iframe.module';
|
||||
import {MetricsModule} from '../landing-utils/metrics.module';
|
||||
import {ReportsServiceModule} from '../../services/reportsService.module';
|
||||
import {SearchResearchResultsServiceModule} from '../../services/searchResearchResultsService.module';
|
||||
import {TabResultModule } from '../../searchPages/searchUtils/tabResult.module';
|
||||
import { LandingModule } from '../landing-utils/landing.module';
|
||||
|
||||
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 {HelperModule} from "../../utils/helper/helper.module";
|
||||
import {SEOServiceModule } from '../../sharedComponents/SEO/SEOService.module';
|
||||
import {FeedbackModule} from "../feedback/feedback.module";
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule, FormsModule, RouterModule, LandingModule,
|
||||
LoadingModalModule, AlertModalModule, ErrorMessagesModule,
|
||||
TabResultModule, IFrameModule, MetricsModule, ReportsServiceModule,
|
||||
IFrameModule, MetricsModule, ReportsServiceModule,
|
||||
SearchResearchResultsServiceModule, ProjectServiceModule,
|
||||
Schema2jsonldModule, SEOServiceModule, HelperModule
|
||||
|
||||
Schema2jsonldModule, SEOServiceModule, HelperModule,
|
||||
LandingHeaderModule, MatSelectModule, FeedbackModule
|
||||
|
||||
],
|
||||
declarations: [
|
||||
ProjectComponent
|
||||
],
|
||||
providers:[
|
||||
FreeGuard, IsRouteEnabled
|
||||
FreeGuard, IsRouteEnabled, HtmlProjectReportService
|
||||
],
|
||||
exports: [
|
||||
ProjectComponent
|
||||
|
|
|
@ -98,32 +98,79 @@ export class ProjectService {
|
|||
|
||||
parseProjectInfo (data: any, properties:EnvProperties):any {
|
||||
this.projectInfo = new ProjectInfo();
|
||||
this.projectInfo.funding = {funderName: "", funderShortName: "", code: "", fundingStream: "",
|
||||
budget: "", contribution: "", currency: ""};
|
||||
|
||||
// ['result']['header']['dri:objIdentifier']
|
||||
if(data[3] != null) {
|
||||
this.projectInfo.id = data[3];
|
||||
}
|
||||
if(data[0] != null) {
|
||||
this.projectInfo.acronym = data[0].acronym;
|
||||
this.projectInfo.title = Array.isArray(data[0]['title']) ? data[0].title[0] : data[0].title;
|
||||
this.projectInfo.callIdentifier = data[0].callidentifier;
|
||||
this.projectInfo.contractNum = data[0].code;
|
||||
this.projectInfo.startDate = data[0].startdate;
|
||||
this.projectInfo.endDate = data[0].enddate;
|
||||
|
||||
// ['result']['metadata']['oaf:entity']['oaf:project']['fundingtree']
|
||||
if(data[1] != null) {
|
||||
let funding: {"funderName": string, "funderShortname": string, "stream": string};
|
||||
funding = this.parsingFunctions.parseFundingTrees(data[1]);
|
||||
if(funding.funderName) {
|
||||
this.projectInfo.funding.funderName = funding.funderName;
|
||||
}
|
||||
if(funding.funderShortname) {
|
||||
this.projectInfo.funding.funderShortName = funding.funderShortname;
|
||||
}
|
||||
if(funding.stream) {
|
||||
this.projectInfo.funding.fundingStream = funding.stream;
|
||||
}
|
||||
}
|
||||
|
||||
// ['result']['metadata']['oaf:entity']['oaf:project']
|
||||
if(data[0] != null) {
|
||||
this.projectInfo.acronym = data[0].acronym;
|
||||
this.projectInfo.title = Array.isArray(data[0]['title']) ? data[0].title[0] : data[0].title;
|
||||
this.projectInfo.funding.code = data[0].code;
|
||||
if(data[0].startdate) {
|
||||
let date: number = Date.parse(data[0].startdate);
|
||||
this.projectInfo.startDate = (date ? date : null);
|
||||
}
|
||||
if(data[0].enddate) {
|
||||
let date: number = Date.parse(data[0].enddate);
|
||||
this.projectInfo.endDate = (date ? date : null);
|
||||
}
|
||||
if(this.projectInfo.endDate || this.projectInfo.startDate) {
|
||||
let todayDate = Date.parse(new Date().toString());
|
||||
this.projectInfo.currentDate = todayDate;
|
||||
if(this.projectInfo.startDate) {
|
||||
let startDate = +(this.projectInfo.startDate);
|
||||
if (todayDate < startDate) {
|
||||
this.projectInfo.status = "Not started";
|
||||
}
|
||||
}
|
||||
if(this.projectInfo.endDate && !this.projectInfo.status) {
|
||||
let endDate = +(this.projectInfo.endDate);
|
||||
if (todayDate <= endDate) {
|
||||
this.projectInfo.status = "On going";
|
||||
} else {
|
||||
this.projectInfo.status = "Closed";
|
||||
}
|
||||
}
|
||||
}
|
||||
if(this.projectInfo.funding) {
|
||||
if(this.projectInfo.funding.funderShortName == "EC") {
|
||||
this.projectInfo.openAccessMandatePublications = data[0].oamandatepublications;
|
||||
this.projectInfo.specialClause39 = data[0].ecsc39;
|
||||
this.projectInfo.openAccessMandateDatasets = data[0].ecarticle29_3;
|
||||
}
|
||||
this.projectInfo.funding.budget = data[0].totalcost;//"10000";
|
||||
this.projectInfo.funding.contribution = data[0].fundedamount;//"200100";
|
||||
this.projectInfo.funding.currency = data[0].currency;//"EUR";
|
||||
}
|
||||
if(data[1] != null) {
|
||||
let funding: {"funderName": string, "funderShortname": string, "stream": string};
|
||||
funding = this.parsingFunctions.parseFundingTrees(data[1]);
|
||||
if(funding.funderShortname) {
|
||||
this.projectInfo.funder = funding.funderShortname;
|
||||
}
|
||||
if(funding.stream) {
|
||||
this.projectInfo['funding'] = funding.stream;
|
||||
}
|
||||
if(!Array.isArray(data[0]['summary'])) {
|
||||
this.projectInfo.description = (data[0]['summary']) ? String(data[0]['summary']) : "";
|
||||
} else {
|
||||
this.projectInfo.description = (data[0]['summary'][0]) ? String(data[0]['summary'][0]) : "";
|
||||
}
|
||||
}
|
||||
|
||||
if(data[2] != null) {
|
||||
// ['result']['metadata']['oaf:entity']['oaf:project']['rels']['rel']
|
||||
if(data[2] != null) {
|
||||
this.projectInfo.organizations = [];//new Map<string, string>();
|
||||
|
||||
let acronym: string = "";
|
||||
|
@ -170,8 +217,8 @@ export class ProjectService {
|
|||
}
|
||||
}
|
||||
|
||||
if(this.projectInfo.funder == "EC") {
|
||||
this.projectInfo.url = properties.cordisURL+this.projectInfo.contractNum;
|
||||
if(this.projectInfo.funding && this.projectInfo.funding.funderShortName == "EC") {
|
||||
this.projectInfo.url = properties.cordisURL+this.projectInfo.funding.code;
|
||||
this.projectInfo.urlInfo = "Detailed project information (CORDIS)";
|
||||
}
|
||||
|
||||
|
|
|
@ -1,160 +1,92 @@
|
|||
import {Component, ViewChild} from '@angular/core';
|
||||
import {ElementRef, Input} from '@angular/core';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {Component, ViewChild} from '@angular/core';
|
||||
import {ElementRef, Input} from '@angular/core';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
|
||||
import {EnvProperties} from '../../../utils/properties/env-properties';
|
||||
import {ResultLandingInfo} from '../../../utils/entities/resultLandingInfo';
|
||||
import {RouterHelper} from '../../../utils/routerHelper.class';
|
||||
import {ErrorCodes} from '../../../utils/properties/errorCodes';
|
||||
import {EnvProperties} from '../../../utils/properties/env-properties';
|
||||
import {ResultLandingInfo} from '../../../utils/entities/resultLandingInfo';
|
||||
import {RouterHelper} from '../../../utils/routerHelper.class';
|
||||
import {ErrorCodes} from '../../../utils/properties/errorCodes';
|
||||
|
||||
import {DeletedByInferenceService} from './deletedByInference.service';
|
||||
import {DeletedByInferenceService} from './deletedByInference.service';
|
||||
import {SearchResult} from "../../../utils/entities/searchResult";
|
||||
import {ResultPreview} from "../../../utils/result-preview/result-preview";
|
||||
import {AlertModal} from "../../../utils/modal/alert";
|
||||
|
||||
@Component({
|
||||
selector: 'deletedByInference',
|
||||
template: `
|
||||
selector: 'deletedByInference',
|
||||
template: `
|
||||
<errorMessages [status]="[status]" [type]="type" tab_error_class=true></errorMessages>
|
||||
|
||||
<div>
|
||||
<div *ngIf="results.length > pageSize" class="uk-margin-bottom">
|
||||
<span class="uk-h6">{{results.length | number}} {{type}}, page {{page | number}} of {{totalPages(results.length) | number}}</span>
|
||||
<paging-no-load class="uk-float-right" [currentPage]="page" [totalResults]="results.length" [size]="pageSize" (pageChange)="updatePage($event)"></paging-no-load>
|
||||
</div>
|
||||
|
||||
<ul class="uk-list uk-list-divider uk-margin">
|
||||
<li *ngFor="let result of results.slice((page-1)*pageSize, page*pageSize)">
|
||||
<h5 *ngIf="result.title" class="uk-margin-remove-bottom">
|
||||
<span [innerHTML]="result.title"></span>
|
||||
</h5>
|
||||
<h5 *ngIf="!result.title">
|
||||
<span>[no title available]</span>
|
||||
</h5>
|
||||
|
||||
<span *ngIf="result.types && result.types.length > 0"class="uk-label custom-label label-blue label-publication" title="Type">{{result.types.join(", ")}}</span>{{" "}}
|
||||
<span *ngIf="result.languages && result.languages.length > 0" class="uk-label custom-label label-language " title="Language">{{result.languages.join(", ")}}</span>{{" "}}
|
||||
<span *ngIf="result.countries && result.countries.length > 0" class="uk-label custom-label label-country " title="Country">{{result.countries.join(", ")}}</span>{{" "}}
|
||||
<span *ngIf="result.accessMode" [class]="'uk-label custom-label label-'+ result.accessMode " title="Access Mode">{{result.accessMode}}</span>{{" "}}
|
||||
|
||||
<div>
|
||||
<showAuthors [authors]="result.authors"></showAuthors>
|
||||
<span *ngIf="result.date != ''">({{result.date}})</span>
|
||||
</div>
|
||||
|
||||
<div *ngIf="result.identifiers && result.identifiers.size > 0">
|
||||
<showIdentifiers [identifiers]="result.identifiers"></showIdentifiers>
|
||||
</div>
|
||||
|
||||
<div *ngIf="result.hostedBy_collectedFrom != undefined && result.hostedBy_collectedFrom.length > 0">
|
||||
<span class="uk-text-bold"> Download From: </span>
|
||||
<span *ngFor="let available of result.hostedBy_collectedFrom let i=index">
|
||||
<span *ngIf="available.downloadUrl.length > 1"
|
||||
class="custom-external custom-icon">
|
||||
{{available.downloadName}}
|
||||
<span *ngFor="let url of available.downloadUrl; let i=index;">
|
||||
<a href="{{url}}" target="_blank"
|
||||
attr.uk-tooltip="pos:right; delay:10">
|
||||
[{{(i+1) | number}}]
|
||||
</a>
|
||||
</span>
|
||||
</span><a
|
||||
class="custom-external custom-icon"
|
||||
*ngIf="available['downloadUrl'].length == 1"
|
||||
href="{{available['downloadUrl']}}"
|
||||
target="_blank"
|
||||
attr.uk-tooltip="pos:right; delay:10">
|
||||
{{available.downloadName}}</a><span
|
||||
*ngIf="i < result['hostedBy_collectedFrom'].length-1">,</span>
|
||||
</span>
|
||||
<span *ngIf="result['hostedBy_collectedFrom'].length > 15">...</span>
|
||||
</div>
|
||||
|
||||
<div *ngIf="result.description" class="uk-margin-bottom uk-text-justify descriptionText">
|
||||
{{result.description}}
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
`
|
||||
<no-load-paging *ngIf="results.length > pageSize" [type]="type"
|
||||
(pageChange)="updatePage($event)"
|
||||
[page]="page" [pageSize]="pageSize"
|
||||
[totalResults]="results.length">
|
||||
</no-load-paging>
|
||||
<ul class="uk-list uk-list-divider uk-margin">
|
||||
<li *ngFor="let result of results.slice((page-1)*pageSize, page*pageSize)">
|
||||
<result-preview [modal]="modal" [properties]="properties" [result]="getResultPreview(result)"></result-preview>
|
||||
</li>
|
||||
</ul>
|
||||
<no-load-paging *ngIf="results.length > pageSize" [type]="type"
|
||||
(pageChange)="updatePage($event)"
|
||||
[page]="page" [pageSize]="pageSize"
|
||||
[totalResults]="results.length">
|
||||
</no-load-paging>
|
||||
`
|
||||
})
|
||||
|
||||
export class DeletedByInferenceComponent {
|
||||
public results: ResultLandingInfo[] = [];
|
||||
@Input() id: string;
|
||||
@Input() ids: string[] = [];
|
||||
@Input() type: string;
|
||||
|
||||
@Input() resultType: string;
|
||||
@Input() modal: AlertModal;
|
||||
|
||||
// Custom tab paging variables
|
||||
public page: number = 1;
|
||||
public pageSize: number = 5;
|
||||
|
||||
|
||||
public status: number;
|
||||
public routerHelper:RouterHelper = new RouterHelper();
|
||||
public errorCodes:ErrorCodes = new ErrorCodes();
|
||||
|
||||
public routerHelper: RouterHelper = new RouterHelper();
|
||||
public errorCodes: ErrorCodes = new ErrorCodes();
|
||||
|
||||
sub: any;
|
||||
properties:EnvProperties;
|
||||
|
||||
constructor ( private element: ElementRef,
|
||||
private _deletedByInferenceService: DeletedByInferenceService,
|
||||
private route: ActivatedRoute,
|
||||
private _router: Router) {
|
||||
properties: EnvProperties;
|
||||
|
||||
constructor(private element: ElementRef,
|
||||
private _deletedByInferenceService: DeletedByInferenceService,
|
||||
private route: ActivatedRoute,
|
||||
private _router: Router) {
|
||||
}
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
|
||||
this.properties = data.envSpecific;
|
||||
|
||||
});
|
||||
this.sub = this.route.queryParams.subscribe(data => {
|
||||
this.errorCodes = new ErrorCodes();
|
||||
this.status = this.errorCodes.LOADING;
|
||||
|
||||
this.getDeletedByInference();
|
||||
this.sub = this.route.queryParams.subscribe(data => {
|
||||
this.errorCodes = new ErrorCodes();
|
||||
this.status = this.errorCodes.LOADING;
|
||||
|
||||
this.getDeletedByInference();
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy() {}
|
||||
|
||||
|
||||
ngOnDestroy() {
|
||||
}
|
||||
|
||||
getDeletedByInference() {
|
||||
this.results = [];
|
||||
this.status = this.errorCodes.LOADING;
|
||||
/*
|
||||
if(this.ids) {
|
||||
var allRequests = [];
|
||||
for(let id of this.ids) {
|
||||
allRequests.push(this._deletedByInferenceService.getDeletedByInferencePublications(id, this.properties));
|
||||
}
|
||||
|
||||
zip.apply(null, allRequests).subscribe(
|
||||
// this._deletedByInferenceService.getDeletedByInferencePublications(id, this.properties).subscribe(
|
||||
data => {
|
||||
this.results = data;
|
||||
this.status = this.errorCodes.DONE;
|
||||
},
|
||||
error => {
|
||||
if(error.status == '404') {
|
||||
this.status = this.errorCodes.NOT_FOUND;
|
||||
} else if(error.status == '500') {
|
||||
this.status = this.errorCodes.ERROR;
|
||||
} else {
|
||||
this.status = this.errorCodes.NOT_AVAILABLE;
|
||||
}
|
||||
}
|
||||
);
|
||||
}
|
||||
*/
|
||||
this._deletedByInferenceService.getDeletedByInferenceResults(this.id, String(this.ids.length), this.properties).subscribe(
|
||||
data => {
|
||||
this.results = data;
|
||||
this.status = this.errorCodes.DONE;
|
||||
},
|
||||
error => {
|
||||
if(error.status == '404') {
|
||||
if (error.status == '404') {
|
||||
this.status = this.errorCodes.NOT_FOUND;
|
||||
} else if(error.status == '500') {
|
||||
} else if (error.status == '500') {
|
||||
this.status = this.errorCodes.ERROR;
|
||||
} else {
|
||||
this.status = this.errorCodes.NOT_AVAILABLE;
|
||||
|
@ -162,15 +94,19 @@ export class DeletedByInferenceComponent {
|
|||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public getResultPreview(result: ResultLandingInfo): ResultPreview {
|
||||
return ResultPreview.resultLandingInfoConvert(result, this.resultType);
|
||||
}
|
||||
|
||||
public totalPages(totalResults: number): number {
|
||||
let totalPages:any = totalResults/this.pageSize;
|
||||
if(!(Number.isInteger(totalPages))) {
|
||||
totalPages = (parseInt(totalPages, this.pageSize) + 1);
|
||||
let totalPages: any = totalResults / this.pageSize;
|
||||
if (!(Number.isInteger(totalPages))) {
|
||||
totalPages = (parseInt(totalPages, this.pageSize) + 1);
|
||||
}
|
||||
return totalPages;
|
||||
}
|
||||
|
||||
|
||||
public updatePage($event) {
|
||||
this.page = $event.value;
|
||||
}
|
||||
|
|
|
@ -11,11 +11,14 @@ import {ResultLandingUtilsModule} from '../../landing-utils/resultLandingUtils.m
|
|||
|
||||
import {ErrorMessagesModule} from '../../../utils/errorMessages.module';
|
||||
import {ShowAuthorsModule} from "../../../utils/authors/showAuthors.module";
|
||||
import {SearchResultsModule} from "../../../searchPages/searchUtils/searchResults.module";
|
||||
import {NoLoadPaging} from "../../../searchPages/searchUtils/no-load-paging.module";
|
||||
import {ResultPreviewModule} from "../../../utils/result-preview/result-preview.module";
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule, FormsModule, ResultLandingUtilsModule,
|
||||
PagingModule, ErrorMessagesModule, ShowAuthorsModule
|
||||
PagingModule, ErrorMessagesModule, ShowAuthorsModule, SearchResultsModule, NoLoadPaging, ResultPreviewModule
|
||||
],
|
||||
declarations: [
|
||||
DeletedByInferenceComponent
|
||||
|
|
|
@ -1,109 +1,194 @@
|
|||
<div id="tm-main" class=" uk-section uk-padding-remove-top uk-margin-small-top tm-middle">
|
||||
<div uk-grid >
|
||||
<div id="tm-main" class="landing uk-section uk-padding-remove-top uk-margin-small-top tm-middle">
|
||||
<div *ngIf="!showFeedback" uk-grid>
|
||||
<div class="tm-main uk-width-1-1@s uk-width-1-1@m uk-width-1-1@l uk-row-first ">
|
||||
<div class="uk-container publication">
|
||||
<div class="uk-container uk-container-large publication">
|
||||
<div *ngIf="warningMessage.length > 0" class="uk-alert uk-alert-warning uk-margin-large-top"
|
||||
role="alert">{{warningMessage}}</div>
|
||||
<div *ngIf="errorMessage.length > 0" class="uk-alert uk-alert-danger uk-margin-large-top"
|
||||
role="alert">{{errorMessage}}</div>
|
||||
<div [style.display]="showLoading ? 'inline' : 'none'"
|
||||
class="uk-animation-fade uk-margin-large-top uk-width-1-1" role="alert"><span
|
||||
class="loading-gif uk-align-center"></span></div>
|
||||
class="loading-gif uk-align-center"></span></div>
|
||||
<helper *ngIf="pageContents && pageContents['top'] && pageContents['top'].length > 0"
|
||||
[texts]="pageContents['top']"></helper>
|
||||
<div *ngIf="resultLandingInfo != null" class="uk-grid">
|
||||
|
||||
<div class="uk-width-2-3@m uk-width-1-1@s uk-margin-bottom">
|
||||
<div *ngIf="resultLandingInfo != null" class="uk-grid">
|
||||
<div class="uk-width-2-3@m uk-width-1-1@s uk-margin-bottom">
|
||||
<!-- schema.org-->
|
||||
<schema2jsonld *ngIf="resultLandingInfo.record" [data]=resultLandingInfo.record
|
||||
[URL]="properties.baseLink+linkToLandingPage+id"></schema2jsonld>
|
||||
<showTitle [titleName]="resultLandingInfo.title" [classNames]="(properties.environment != 'production' && resultLandingInfo.deletedByInferenceIds) ? 'uk-margin-remove-bottom' : ''"></showTitle>
|
||||
<!-- <div *ngIf="testBrowser" class="uk-text-small">-->
|
||||
<!-- <a class="" (click)="gotoAccordions();">-->
|
||||
<!-- View relations of this-->
|
||||
<!-- <span *ngIf="type == 'publication' || type == 'software'">{{type}}</span>-->
|
||||
<!-- <span *ngIf="type == 'dataset'">research data</span>-->
|
||||
<!-- <span *ngIf="type == 'orp'">product</span>-->
|
||||
<!-- </a>-->
|
||||
<!-- </div>-->
|
||||
<div *ngIf="properties.environment != 'production' && resultLandingInfo.deletedByInferenceIds"
|
||||
class="uk-text-muted uk-text-small uk-margin-bottom" (click)="openDeletedByInference()">
|
||||
The following information is the result of merging
|
||||
<a>{{resultLandingInfo.deletedByInferenceIds.length}} other versions</a>
|
||||
<landing-header [properties]="properties" [title]="resultLandingInfo.title"
|
||||
[subTitle]="resultLandingInfo.subtitle" [underCuration]="resultLandingInfo.underCurationMessage"
|
||||
[entityType]="getTypeName()" [types]="resultLandingInfo.types"
|
||||
[year]="resultLandingInfo.date" [embargoEndDate]="resultLandingInfo.embargoEndDate">
|
||||
</landing-header>
|
||||
<div *ngIf="resultLandingInfo.deletedByInferenceIds"
|
||||
class="uk-text-muted uk-text-small uk-text-right">
|
||||
<a (click)="openDeletedByInference()">View all {{resultLandingInfo.deletedByInferenceIds.length}}
|
||||
versions</a>
|
||||
</div>
|
||||
<p class="uk-text-large" *ngIf="resultLandingInfo.subtitle">
|
||||
<span [innerHTML]="resultLandingInfo.subtitle"></span>
|
||||
</p>
|
||||
<span *ngIf="resultLandingInfo.types && resultLandingInfo.types.length > 0"
|
||||
class="uk-label custom-label label-blue label-publication"
|
||||
title="Type">{{resultLandingInfo.types.join(", ")}}</span>{{" "}}
|
||||
<span *ngIf="resultLandingInfo.programmingLanguages && resultLandingInfo.programmingLanguages.length > 0"
|
||||
class="uk-label custom-label label-progrLanguage "
|
||||
title="Programming Language">{{resultLandingInfo.programmingLanguages.join(", ")}}</span>{{" "}}
|
||||
<span *ngIf="resultLandingInfo.languages && resultLandingInfo.languages.length > 0"
|
||||
class="uk-label custom-label label-language "
|
||||
title="Language">{{resultLandingInfo.languages.join(", ")}}</span>{{" "}}
|
||||
<span *ngIf="resultLandingInfo.countries && resultLandingInfo.countries.length > 0"
|
||||
class="uk-label custom-label label-country "
|
||||
title="Country">{{resultLandingInfo.countries.join(", ")}}</span>{{" "}}
|
||||
<!-- <span *ngIf="resultLandingInfo.title && resultLandingInfo.title.accessMode" [class]="'uk-label custom-label label-'+ resultLandingInfo.title.accessMode ">{{resultLandingInfo.title.accessMode}}</span> -->
|
||||
<span *ngIf="resultLandingInfo.accessMode"
|
||||
[class]="'uk-label custom-label label-'+ accessClass(resultLandingInfo.accessMode) "
|
||||
title="Access Mode">{{resultLandingInfo.accessMode}}</span>{{" "}}
|
||||
|
||||
<span *ngIf="resultLandingInfo.underCurationMessage" class="uk-label custom-label label-underCuration">
|
||||
<span uk-tooltip="pos:right; delay:10"
|
||||
title="{{buildCurationTooltip()}}">
|
||||
<i>Record in preview</i>
|
||||
<i class="uk-icon-info-circle"></i>
|
||||
</span></span>{{" "}}
|
||||
|
||||
|
||||
<div class=" uk-margin-top">
|
||||
<showAuthors [authors]="resultLandingInfo.authors"></showAuthors>
|
||||
<span *ngIf="resultLandingInfo.date != ''">({{resultLandingInfo.date}})</span>
|
||||
<div class="uk-margin-small-bottom uk-margin-small-top">
|
||||
<showAuthors [authors]="resultLandingInfo.authors" [small]="false"></showAuthors>
|
||||
</div>
|
||||
<!-- Labels -->
|
||||
<div class="uk-margin-bottom">
|
||||
<span *ngIf="properties.environment !== 'production' && resultLandingInfo.accessMode"
|
||||
[class]="'uk-label custom-label label-'+ accessClass(resultLandingInfo.accessMode)"
|
||||
title="Access Mode">{{resultLandingInfo.accessMode}}
|
||||
</span>{{" "}}
|
||||
<span *ngIf="properties.environment === 'production' && resultLandingInfo.accessMode
|
||||
&& resultLandingInfo.accessMode.toLowerCase() !== 'not available'"
|
||||
[class]="'uk-label custom-label label-'+ accessClass(resultLandingInfo.accessMode)"
|
||||
title="Access Mode">{{resultLandingInfo.accessMode}}
|
||||
</span>{{" "}}
|
||||
<span
|
||||
*ngIf="properties.environment !== 'production' && resultLandingInfo.languages && resultLandingInfo.languages.length > 0">
|
||||
<ng-container *ngFor="let language of resultLandingInfo.languages">
|
||||
<span class="uk-label custom-label label-language" title="Language">{{language}}</span>
|
||||
{{' '}}
|
||||
</ng-container>
|
||||
</span>
|
||||
<span *ngIf="properties.environment === 'production' && resultLandingInfo.languages &&
|
||||
removeUnknown(resultLandingInfo.languages).length > 0">
|
||||
<ng-container *ngFor="let language of removeUnknown(resultLandingInfo.languages)">
|
||||
<span class="uk-label custom-label label-language" title="Language">{{language}}</span>
|
||||
{{' '}}
|
||||
</ng-container>
|
||||
</span>
|
||||
<span *ngIf="resultLandingInfo.programmingLanguages && resultLandingInfo.programmingLanguages.length > 0">
|
||||
<ng-container *ngFor="let programmingLanguage of resultLandingInfo.programmingLanguages">
|
||||
<span class="uk-label custom-label label-language" title="Programming Language">{{programmingLanguage}}</span>
|
||||
{{' '}}
|
||||
</ng-container>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<ul class="uk-list">
|
||||
<!--Published Date, Journal and Publisher-->
|
||||
<showPublisher [publisher]="resultLandingInfo.publisher"
|
||||
[publishDate]="resultLandingInfo.dateofacceptance"
|
||||
[journal]="resultLandingInfo.journal" [properties]="properties"></showPublisher>
|
||||
<li *ngIf="resultLandingInfo.embargoEndDate"><span
|
||||
class="uk-text-bold">Embargo end date:</span> {{resultLandingInfo.embargoEndDate}}</li>
|
||||
<!-- Countries -->
|
||||
<li *ngIf="resultLandingInfo.countries && resultLandingInfo.countries.length > 0">
|
||||
<span class="uk-text-muted">
|
||||
{{(resultLandingInfo.countries.length === 1) ? 'Country: ' : 'Countries: '}}
|
||||
</span>
|
||||
{{resultLandingInfo.countries.join(", ")}}
|
||||
</li>
|
||||
<!-- Funded By -->
|
||||
<li *ngIf="resultLandingInfo.fundedByProjects && resultLandingInfo.fundedByProjects.length > 0">
|
||||
<fundedBy [fundedByProjects]="resultLandingInfo.fundedByProjects"></fundedBy>
|
||||
</li>
|
||||
<!-- Identifiers -->
|
||||
<li *ngIf="resultLandingInfo.identifiers && resultLandingInfo.identifiers.size > 0">
|
||||
<showIdentifiers [identifiers]="resultLandingInfo.identifiers"></showIdentifiers>
|
||||
</li>
|
||||
<li
|
||||
*ngIf="resultLandingInfo">
|
||||
<showSubjects [subjects]="resultLandingInfo.subjects"
|
||||
[otherSubjects]="resultLandingInfo.otherSubjects"
|
||||
[classifiedSubjects]="resultLandingInfo.classifiedSubjects">
|
||||
</showSubjects>
|
||||
</li>
|
||||
</ul>
|
||||
<hr *ngIf="resultLandingInfo.description">
|
||||
<div *ngIf="resultLandingInfo.description"
|
||||
class="uk-text-justify descriptionText uk-height-max-medium uk-overflow-auto">
|
||||
<span>{{resultLandingInfo.description.substring(0, showNumDescription)}}</span
|
||||
><span
|
||||
*ngIf="showNumDescription == thresholdDescription && resultLandingInfo.description.length > thresholdDescription">...</span
|
||||
><span
|
||||
*ngIf="showNumDescription == thresholdDescription && resultLandingInfo.description.length > thresholdDescription"
|
||||
class="uk-text-right">
|
||||
<a (click)="showNumDescription = resultLandingInfo.description.length;">
|
||||
View more
|
||||
</a>
|
||||
</span>
|
||||
<!-- Description -->
|
||||
<div *ngIf="resultLandingInfo.description" class="uk-margin-bottom">
|
||||
<div class="uk-text-justify uk-text-small uk-height-max-medium uk-overflow-auto">
|
||||
<span class="uk-text-muted">Abstract: </span>
|
||||
<span>{{resultLandingInfo.description.substring(0, showNumDescription)}}</span>
|
||||
<span *ngIf="showNumDescription == thresholdDescription &&
|
||||
resultLandingInfo.description.length > thresholdDescription">...</span>
|
||||
</div>
|
||||
<div *ngIf="showNumDescription == thresholdDescription &&
|
||||
resultLandingInfo.description.length > thresholdDescription" class="uk-text-right">
|
||||
<a (click)="showNumDescription = resultLandingInfo.description.length;">
|
||||
View more
|
||||
</a>
|
||||
</div>
|
||||
<div *ngIf="resultLandingInfo.description && showNumDescription > thresholdDescription"
|
||||
class="uk-text-right">
|
||||
<a (click)="showNumDescription = thresholdDescription;">
|
||||
View less
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="resultLandingInfo.description && showNumDescription > thresholdDescription"
|
||||
class="uk-width-1-1 uk-text-right">
|
||||
<!-- scroll() -->
|
||||
<a (click)="showNumDescription = thresholdDescription;">
|
||||
View less
|
||||
</a>
|
||||
<!-- Communities -->
|
||||
<div *ngIf="resultLandingInfo.contexts && resultLandingInfo.contexts.length >0 ">
|
||||
<relatedTo [contexts]="resultLandingInfo.contexts"></relatedTo>
|
||||
</div>
|
||||
|
||||
|
||||
<ul #accordions class="custom-accordion" uk-accordion>
|
||||
|
||||
<!-- Subjects -->
|
||||
<div *ngIf="resultLandingInfo.subjects || resultLandingInfo.otherSubjects ||
|
||||
resultLandingInfo.classifiedSubjects" class="uk-margin-bottom">
|
||||
<showSubjects [subjects]="resultLandingInfo.subjects"
|
||||
[otherSubjects]="resultLandingInfo.otherSubjects"
|
||||
[classifiedSubjects]="resultLandingInfo.classifiedSubjects">
|
||||
</showSubjects>
|
||||
</div>
|
||||
<div class="uk-margin-medium-top">
|
||||
<div *ngIf="resultLandingInfo.references || resultLandingInfo.bioentities"
|
||||
class="uk-margin-top simple-buttons uk-flex uk-flex-middle">
|
||||
<div *ngIf="resultLandingInfo.references" (click)="openReferences()" class="clickable uk-margin-right">
|
||||
<span class="uk-text-bold">{{resultLandingInfo.references.length | number}}</span> References
|
||||
</div>
|
||||
<div *ngIf="resultLandingInfo.bioentities" (click)="openBioentities()" class="clickable">
|
||||
<span class="uk-text-bold">{{bioentitiesNum | number}}</span> Bioentities
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="resultLandingInfo.relatedResearchResults || resultLandingInfo.similarResearchResults ||
|
||||
resultLandingInfo.supplementaryResearchResults || resultLandingInfo.supplementedByResearchResults ||
|
||||
resultLandingInfo.organizations"
|
||||
class="uk-margin-top advanced-buttons uk-grid-small uk-child-width-1-4@s uk-child-width-1-2"
|
||||
uk-height-match="target: .target; row: false"
|
||||
uk-grid>
|
||||
<div *ngIf="resultLandingInfo.relatedResearchResults">
|
||||
<div class="clickable" (click)="openRelationResults('Related research results of',
|
||||
resultLandingInfo.relatedResearchResults)">
|
||||
<div class="header target uk-text-bold">Related Research Results</div>
|
||||
<div class="footer target uk-position-relative">
|
||||
<span
|
||||
class="uk-text-bold uk-position-center">{{resultLandingInfo.relatedResearchResults.length | number}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="resultLandingInfo.similarResearchResults">
|
||||
<div class="clickable" (click)="openRelationResults('Similar research results of',
|
||||
resultLandingInfo.similarResearchResults, 'similarity')">
|
||||
<div class="header target uk-text-bold">Similar Research Results</div>
|
||||
<div class="footer target uk-position-relative">
|
||||
<span
|
||||
class="uk-text-bold uk-position-center">{{resultLandingInfo.similarResearchResults.length | number}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="resultLandingInfo.supplementaryResearchResults">
|
||||
<div class="clickable" (click)="openRelationResults('Supplementary research results of',
|
||||
resultLandingInfo.supplementaryResearchResults)">
|
||||
<div class="header target uk-text-bold">Supplementary Research Results</div>
|
||||
<div class="footer target uk-position-relative">
|
||||
<span
|
||||
class="uk-text-bold uk-position-center">{{resultLandingInfo.supplementaryResearchResults.length | number}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="resultLandingInfo.supplementedByResearchResults">
|
||||
<div class="clickable" (click)="openRelationResults('Research results supplemented by',
|
||||
resultLandingInfo.supplementedByResearchResults)">
|
||||
<div class="header target uk-text-bold">Research Results supplemented by
|
||||
this {{getTypeName()}}</div>
|
||||
<div class="footer target uk-position-relative">
|
||||
<span
|
||||
class="uk-text-bold uk-position-center">{{resultLandingInfo.supplementedByResearchResults.length | number}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div *ngIf="resultLandingInfo.organizations">
|
||||
<div class="clickable" (click)="openOrganizations()">
|
||||
<div class="header target uk-text-bold">Related Organizations</div>
|
||||
<div class="footer target uk-position-relative">
|
||||
<span
|
||||
class="uk-text-bold uk-position-center">{{resultLandingInfo.organizations.length | number}}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="uk-margin-small-top uk-flex uk-flex-bottom">
|
||||
<img src="assets/common-assets/graph.svg" style="opacity: 0.4">
|
||||
<span
|
||||
class="uk-margin-small-left uk-text-small uk-text-baseline uk-text-muted">Powered by OpenAIRE Open Research Graph</span>
|
||||
</div>
|
||||
<!--<ul #accordions class="custom-accordion" uk-accordion>
|
||||
<li *ngIf="resultLandingInfo.references" (click)="activeTab='References'">
|
||||
<a class="uk-accordion-title" href="#">
|
||||
References
|
||||
|
@ -121,7 +206,7 @@
|
|||
</div>
|
||||
|
||||
<div
|
||||
*ngFor="let item of resultLandingInfo.references.slice((referencesPage-1)*pageSize, referencesPage*pageSize)">
|
||||
*ngFor="let item of resultLandingInfo.references.slice((referencesPage-1)*pageSize, referencesPage*pageSize)">
|
||||
<p *ngIf=" item && item['url']"
|
||||
class="custom-external custom-icon">
|
||||
<a href="{{item['url']}}" target="_blank">
|
||||
|
@ -135,25 +220,6 @@
|
|||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li *ngIf="resultLandingInfo.relatedResearchResults" (click)="activeTab='Related Research Results'">
|
||||
<a class="uk-accordion-title" href="#">
|
||||
Related Research Results
|
||||
({{relatedResearchResultsNum | number}})
|
||||
</a>
|
||||
<div class="uk-accordion-content">
|
||||
<div>
|
||||
<div *ngFor="let provenanceaction of getKeys(resultLandingInfo.relatedResearchResults)">
|
||||
<div class="uk-text-large">{{provenanceaction}}</div>
|
||||
|
||||
<tabTable percentageName="trust"
|
||||
[info]="resultLandingInfo.relatedResearchResults.get(provenanceaction)"
|
||||
[properties]=properties></tabTable>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
<li *ngIf="resultLandingInfo.similarResearchResults" (click)="activeTab='Similar Research Results'">
|
||||
<a class="uk-accordion-title" href="#">
|
||||
Similar Research Results
|
||||
|
@ -167,7 +233,8 @@
|
|||
</div>
|
||||
</li>
|
||||
|
||||
<li *ngIf="resultLandingInfo.supplementaryResearchResults" (click)="activeTab='Supplementary Research Results'">
|
||||
<li *ngIf="resultLandingInfo.supplementaryResearchResults"
|
||||
(click)="activeTab='Supplementary Research Results'">
|
||||
<a class="uk-accordion-title" href="#">
|
||||
Supplementary Research Results
|
||||
({{resultLandingInfo.supplementaryResearchResults.length | number}})
|
||||
|
@ -180,7 +247,8 @@
|
|||
</div>
|
||||
</li>
|
||||
|
||||
<li *ngIf="resultLandingInfo.supplementedByResearchResults" (click)="activeTab='Research Results supplemented by this product'">
|
||||
<li *ngIf="resultLandingInfo.supplementedByResearchResults"
|
||||
(click)="activeTab='Research Results supplemented by this product'">
|
||||
<a class="uk-accordion-title" href="#">
|
||||
Research Results supplemented by this
|
||||
<span *ngIf="type == 'publication' || type == 'software'">{{type}}</span>
|
||||
|
@ -215,7 +283,7 @@
|
|||
<table class="uk-table uk-table-small uk-table-divider uk-table-middle ">
|
||||
<tbody>
|
||||
<tr
|
||||
*ngFor="let organization of resultLandingInfo.organizations.slice((organizationsPage-1)*pageSize, organizationsPage*pageSize)">
|
||||
*ngFor="let organization of resultLandingInfo.organizations.slice((organizationsPage-1)*pageSize, organizationsPage*pageSize)">
|
||||
<td>
|
||||
<a *ngIf="(organization['id']) && ((organization['name']) || (organization['shortname']))"
|
||||
[queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active"
|
||||
|
@ -272,7 +340,7 @@
|
|||
<tbody>
|
||||
<ng-container *ngFor="let key of getKeys(resultLandingInfo.bioentities) let i=index">
|
||||
<tr
|
||||
*ngFor="let keyIn of keysToArray(resultLandingInfo.bioentities.get(key)).slice((bioentitiesPage-1)*pageSize, bioentitiesPage*pageSize)">
|
||||
*ngFor="let keyIn of keysToArray(resultLandingInfo.bioentities.get(key)).slice((bioentitiesPage-1)*pageSize, bioentitiesPage*pageSize)">
|
||||
<td class="uk-text-center" *ngIf="keyIn">
|
||||
<span class="custom-external custom-icon">
|
||||
<a href="{{resultLandingInfo.bioentities.get(key).get(keyIn)}}"
|
||||
|
@ -309,7 +377,7 @@
|
|||
|
||||
<ul class="uk-list uk-list-divider uk-margin">
|
||||
<li
|
||||
*ngFor="let result of resultLandingInfo.openCitations.slice((openCitationsPage-1)*pageSize, openCitationsPage*pageSize)">
|
||||
*ngFor="let result of resultLandingInfo.openCitations.slice((openCitationsPage-1)*pageSize, openCitationsPage*pageSize)">
|
||||
<h5 *ngIf="result.title">
|
||||
<span *ngIf="result.url"
|
||||
class="custom-external">
|
||||
|
@ -356,141 +424,271 @@
|
|||
(metricsResults)="metricsResults($event)" [properties]=properties>
|
||||
</metrics>
|
||||
<i-frame *ngIf="metricsClicked && totalViews>0"
|
||||
[url]=viewsFrameUrl >
|
||||
[url]=viewsFrameUrl>
|
||||
</i-frame>
|
||||
<i-frame *ngIf="metricsClicked && totalDownloads>0"
|
||||
[url]=downloadsFrameUrl>
|
||||
</i-frame>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
</ul>-->
|
||||
</div>
|
||||
|
||||
<div class="uk-width-1-3@m uk-width-1-1@s">
|
||||
<b2note *ngIf=" properties.environment === 'development' && resultLandingInfo" [id]="id" [landingInfo]="resultLandingInfo"></b2note>
|
||||
<div *ngIf="isRouteAvailable('participate/direct-claim') " class=" uk-padding-small">
|
||||
<button class=" uk-button portal-button uk-width-1-1 ">
|
||||
<span class="uk-icon">
|
||||
<svg icon="link" ratio="1" xmlns="http://www.w3.org/2000/svg" width="25" viewBox="0 0 20 20"
|
||||
height="25"><path
|
||||
d="M10.625,12.375 L7.525,15.475 C6.825,16.175 5.925,16.175 5.225,15.475 L4.525,14.775 C3.825,14.074 3.825,13.175 4.525,12.475 L7.625,9.375"
|
||||
fill="none" stroke="#000" stroke-width="1.1"></path><path
|
||||
d="M9.325,7.375 L12.425,4.275 C13.125,3.575 14.025,3.575 14.724,4.275 L15.425,4.975 C16.125,5.675 16.125,6.575 15.425,7.275 L12.325,10.375"
|
||||
fill="none" stroke="#000" stroke-width="1.1"></path><path d="M7.925,11.875 L11.925,7.975"
|
||||
fill="none" stroke="#000"
|
||||
stroke-width="1.1"></path></svg>
|
||||
</span>
|
||||
Link this <span *ngIf="type != 'orp'">{{title.toLowerCase()}}</span><span *ngIf="type == 'orp'">product</span> to...
|
||||
</button>
|
||||
<div class=" uk-text-center uk-margin-expand uk-padding-small uk-margin-auto default-dropdown "
|
||||
uk-dropdown="mode:click">
|
||||
<div class="uk-grid uk-child-width-1-3 uk-width-large ">
|
||||
<div><a
|
||||
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[id,type,'project'])"
|
||||
routerLinkActive="router-link-active" routerLink="/participate/direct-claim"
|
||||
>
|
||||
<button class="uk-icon-button portal-button">
|
||||
<span class="uk-icon">
|
||||
<svg height="20" icon="album" ratio="1" viewBox="0 0 20 20" width="20"
|
||||
xmlns="http://www.w3.org/2000/svg"><rect height="1" width="10" x="5" y="2"></rect><rect
|
||||
height="1" width="14" x="3" y="4"></rect><rect fill="none" height="11" stroke="#000"
|
||||
width="17" x="1.5" y="6.5"></rect></svg></span>
|
||||
</button>
|
||||
<div>Projects</div>
|
||||
</a></div>
|
||||
<div><a
|
||||
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[id,type,'result'])"
|
||||
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
|
||||
<button class="uk-icon-button portal-button">
|
||||
<div class="uk-card uk-card-default uk-padding-small">
|
||||
<!--<b2note *ngIf=" properties.environment === 'development' && resultLandingInfo" [id]="id"
|
||||
[landingInfo]="resultLandingInfo"></b2note>-->
|
||||
<div *ngIf="isRouteAvailable('participate/direct-claim')">
|
||||
<div class="uk-margin-auto uk-width-3-4">
|
||||
<button class="uk-button uk-width-1-1 portal-button">
|
||||
<span uk-icon="link"></span>
|
||||
Link this <span *ngIf="type != 'orp'">{{title.toLowerCase()}}</span><span
|
||||
*ngIf="type == 'orp'">product</span> to...
|
||||
</button>
|
||||
</div>
|
||||
<div class="uk-text-center uk-margin-expand uk-padding-small uk-margin-auto default-dropdown "
|
||||
uk-dropdown="mode:click">
|
||||
<div class="uk-grid uk-child-width-1-3 uk-width-large ">
|
||||
<div>
|
||||
<a [queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[id,type,'project'])"
|
||||
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
|
||||
<button class="uk-icon-button portal-button">
|
||||
<span class="uk-icon">
|
||||
<svg height="20" icon="album" ratio="1" viewBox="0 0 20 20" width="20"
|
||||
xmlns="http://www.w3.org/2000/svg"><rect height="1" width="10" x="5" y="2"></rect><rect
|
||||
height="1" width="14" x="3" y="4"></rect><rect fill="none" height="11" stroke="#000"
|
||||
width="17" x="1.5"
|
||||
y="6.5"></rect></svg>
|
||||
</span>
|
||||
</button>
|
||||
<div>Projects</div>
|
||||
</a></div>
|
||||
<div><a
|
||||
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[id,type,'result'])"
|
||||
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
|
||||
<button class="uk-icon-button portal-button">
|
||||
<span class="uk-icon">
|
||||
<svg height="20" icon="copy" ratio="1" viewBox="0 0 20 20" width="20"
|
||||
xmlns="http://www.w3.org/2000/svg"><rect fill="none" height="16" stroke="#000"
|
||||
width="12" x="3.5" y="2.5"></rect><polyline
|
||||
fill="none" points="5 0.5 17.5 0.5 17.5 17" stroke="#000"></polyline></svg></span>
|
||||
</button>
|
||||
<div>Research results</div>
|
||||
</a></div>
|
||||
<div><a
|
||||
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[id,type,'context'])"
|
||||
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
|
||||
<button class="uk-icon-button portal-button">
|
||||
<span class="uk-icon">
|
||||
fill="none" points="5 0.5 17.5 0.5 17.5 17" stroke="#000"></polyline></svg></span>
|
||||
</button>
|
||||
<div>Research results</div>
|
||||
</a></div>
|
||||
<div><a
|
||||
[queryParams]="routerHelper.createQueryParams(['id','type','linkTo'],[id,type,'context'])"
|
||||
routerLinkActive="router-link-active" routerLink="/participate/direct-claim">
|
||||
<button class="uk-icon-button portal-button">
|
||||
<span class="uk-icon">
|
||||
<svg height="20" icon="users" ratio="1" viewBox="0 0 20 20" width="20"
|
||||
xmlns="http://www.w3.org/2000/svg"><circle cx="7.7" cy="8.6" fill="none" r="3.5"
|
||||
stroke="#000" stroke-width="1.1"></circle><path
|
||||
d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3" fill="none"
|
||||
stroke="#000" stroke-width="1.1"></path><path
|
||||
d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"
|
||||
fill="none" stroke="#000" stroke-width="1.1"></path></svg></span>
|
||||
</button>
|
||||
<div>Communities</div>
|
||||
</a></div>
|
||||
d="M1,18.1 C1.7,14.6 4.4,12.1 7.6,12.1 C10.9,12.1 13.7,14.8 14.3,18.3" fill="none"
|
||||
stroke="#000" stroke-width="1.1"></path><path
|
||||
d="M11.4,4 C12.8,2.4 15.4,2.8 16.3,4.7 C17.2,6.6 15.7,8.9 13.6,8.9 C16.5,8.9 18.8,11.3 19.2,14.1"
|
||||
fill="none" stroke="#000" stroke-width="1.1"></path></svg></span>
|
||||
</button>
|
||||
<div>Communities</div>
|
||||
</a></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<div class="sideInfoTitle uk-margin-small-bottom uk-margin-small-top">Share - Bookmark</div>
|
||||
<addThis></addThis>
|
||||
</div>
|
||||
<altmetrics *ngIf="resultLandingInfo.identifiers && resultLandingInfo.identifiers.get('doi')"
|
||||
id="{{resultLandingInfo.identifiers.get('doi')[0]}}" type="doi">
|
||||
</altmetrics>
|
||||
<ul class="uk-list uk-margin-remove-bottom">
|
||||
<!-- <li *ngIf="testBrowser" class="uk-text-center">-->
|
||||
<!-- <button class="uk-button portal-button" (click)="gotoAccordions();">-->
|
||||
<!-- View relations of this-->
|
||||
<!-- <span *ngIf="type == 'publication' || type == 'software'">{{type}}</span>-->
|
||||
<!-- <span *ngIf="type == 'dataset'">research data</span>-->
|
||||
<!-- <span *ngIf="type == 'orp'">product</span>-->
|
||||
<!-- </button>-->
|
||||
<!-- </li>-->
|
||||
<li *ngIf="resultLandingInfo.hostedBy_collectedFrom && resultLandingInfo.hostedBy_collectedFrom.length > 0">
|
||||
<availableOn [availableOn]="resultLandingInfo.hostedBy_collectedFrom"></availableOn>
|
||||
</li>
|
||||
<li
|
||||
*ngIf="resultLandingInfo.fundedByProjects != undefined && resultLandingInfo.fundedByProjects.length > 0">
|
||||
<fundedBy [fundedByProjects]="resultLandingInfo.fundedByProjects"></fundedBy>
|
||||
</li>
|
||||
|
||||
<li *ngIf="resultLandingInfo.contexts && resultLandingInfo.contexts.length >0 ">
|
||||
<relatedTo [contexts]="resultLandingInfo.contexts"></relatedTo>
|
||||
</li>
|
||||
<!-- <li>-->
|
||||
<!-- <metrics [pageViews]="pageViews" shortView=true-->
|
||||
<!-- [id]="id" [entityType]="'results'" [entity]="'Publication'"-->
|
||||
<!-- (metricsResults)="metricsResults($event)" [(properties)] = properties>-->
|
||||
<!-- </metrics>-->
|
||||
<!-- </li>-->
|
||||
<li>
|
||||
<div class=" sideInfoTitle cite-this-button uk-width-1-1" type="button">
|
||||
Cite this <span *ngIf="type != 'orp'">{{title.toLowerCase()}}</span><span *ngIf="type == 'orp'">research product</span>
|
||||
<!-- Share -->
|
||||
<div [class.uk-hidden]="!addThis" class="uk-margin-top">
|
||||
<div class="sideInfoTitle uk-margin-small-bottom">Share - Bookmark</div>
|
||||
<addThis (event)="hideAddThis($event)"></addThis>
|
||||
</div>
|
||||
<!-- Download From -->
|
||||
<div
|
||||
*ngIf="resultLandingInfo.hostedBy_collectedFrom && resultLandingInfo.hostedBy_collectedFrom.length > 0"
|
||||
class="uk-margin-top">
|
||||
<availableOn [properties]="properties"
|
||||
[availableOn]="resultLandingInfo.hostedBy_collectedFrom"></availableOn>
|
||||
</div>
|
||||
<!-- Metrics -->
|
||||
<div *ngIf="hasAltMetrics" class="uk-margin-top">
|
||||
<div class="sideInfoTitle uk-margin-small-bottom">Metrics</div>
|
||||
<div uk-grid class="uk-child-width-1-3 uk-text-center uk-flex uk-flex-middle">
|
||||
<div></div><!-- Open Citations-->
|
||||
<div>
|
||||
<altmetrics *ngIf="hasAltMetrics" id="{{resultLandingInfo.identifiers.get('doi')[0]}}" type="doi">
|
||||
</altmetrics>
|
||||
</div>
|
||||
<div></div><!-- OpenAIRE Metrics -->
|
||||
</div>
|
||||
<div class=" ">
|
||||
<citeThis [result]="resultLandingInfo" [id]="id" [type]="title.toLowerCase()"></citeThis>
|
||||
</div>
|
||||
<div class="uk-margin-top">
|
||||
<div class="sideInfoTitle uk-margin-small-bottom">
|
||||
Cite this {{getTypeName()}}
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
<citeThis [result]="resultLandingInfo" [id]="id" [type]="title.toLowerCase()"></citeThis>
|
||||
</div>
|
||||
</div>
|
||||
<div class="uk-margin-small-top uk-text-muted uk-text-small uk-text-right">
|
||||
Last update of records in OpenAIRE: {{indexUpdateDate | date: 'MMM dd, yyyy'}}
|
||||
</div>
|
||||
</div>
|
||||
<modal-alert *ngIf="resultLandingInfo.deletedByInferenceIds"
|
||||
#AlertModalDeletedByInference classBody="uk-width-xxlarge">
|
||||
<deletedByInference *ngIf="type == 'publication' && deleteByInferenceOpened"
|
||||
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'publications'"></deletedByInference>
|
||||
<deletedByInference *ngIf="type == 'dataset' && deleteByInferenceOpened"
|
||||
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'research data'"></deletedByInference>
|
||||
<deletedByInference *ngIf="type == 'software' && deleteByInferenceOpened"
|
||||
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'software'"></deletedByInference>
|
||||
<deletedByInference *ngIf="type == 'orp' && deleteByInferenceOpened"
|
||||
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']" [ids]="resultLandingInfo.deletedByInferenceIds" [type]="'other research products'"></deletedByInference>
|
||||
</modal-alert>
|
||||
</div>
|
||||
<helper *ngIf="pageContents && pageContents['bottom'] && pageContents['bottom'].length > 0"
|
||||
[texts]="pageContents['bottom']"></helper>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<feedback *ngIf="resultLandingInfo && properties.environment === 'development'" [resultLandingInfo]="resultLandingInfo"
|
||||
[properties]="properties" [entityType]="getTypeName()" [fields]="feedbackFields"
|
||||
[showForm]="showFeedback" (show)="showFeedback = $event"></feedback>
|
||||
<!-- Other versions -->
|
||||
<modal-alert *ngIf="resultLandingInfo && resultLandingInfo.deletedByInferenceIds"
|
||||
#AlertModalDeletedByInference classBody="uk-width-xxlarge uk-padding-remove-right">
|
||||
<landing-header [properties]="properties" [title]="resultLandingInfo.title" [modal]="AlertModalDeletedByInference"
|
||||
[subTitle]="resultLandingInfo.subtitle" [authorLimit]="10" [showAllAuthors]="false"
|
||||
[entityType]="getTypeName()" [authors]="resultLandingInfo.authors" [types]="resultLandingInfo.types"
|
||||
[year]="resultLandingInfo.date" [embargoEndDate]="resultLandingInfo.embargoEndDate">
|
||||
</landing-header>
|
||||
<div class="uk-margin-medium-top uk-margin-medium-right">
|
||||
<deletedByInference *ngIf="type == 'publication' && deleteByInferenceOpened"
|
||||
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
||||
[ids]="resultLandingInfo.deletedByInferenceIds"
|
||||
[modal]="AlertModalDeletedByInference"
|
||||
[resultType]="type" [type]="'publications'"></deletedByInference>
|
||||
<deletedByInference *ngIf="type == 'dataset' && deleteByInferenceOpened"
|
||||
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
||||
[ids]="resultLandingInfo.deletedByInferenceIds"
|
||||
[modal]="AlertModalDeletedByInference"
|
||||
[resultType]="'dataset'" [type]="'research data'"></deletedByInference>
|
||||
<deletedByInference *ngIf="type == 'software' && deleteByInferenceOpened"
|
||||
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
||||
[ids]="resultLandingInfo.deletedByInferenceIds"
|
||||
[modal]="AlertModalDeletedByInference"
|
||||
[resultType]="type" [type]="'software'"></deletedByInference>
|
||||
<deletedByInference *ngIf="type == 'orp' && deleteByInferenceOpened"
|
||||
[id]="resultLandingInfo.record['result']['header']['dri:objIdentifier']"
|
||||
[ids]="resultLandingInfo.deletedByInferenceIds"
|
||||
[modal]="AlertModalDeletedByInference"
|
||||
[resultType]="'other'" [type]="'other research products'"></deletedByInference>
|
||||
</div>
|
||||
</modal-alert>
|
||||
<!-- References -->
|
||||
<modal-alert *ngIf="resultLandingInfo && resultLandingInfo.references"
|
||||
classBody="uk-width-xxlarge uk-padding-remove-right" #referencesModal>
|
||||
<landing-header [properties]="properties" [title]="resultLandingInfo.title"
|
||||
[subTitle]="resultLandingInfo.subtitle" [authorLimit]="10" [showAllAuthors]="false" [modal]="referencesModal"
|
||||
[entityType]="getTypeName()" [authors]="resultLandingInfo.authors" [types]="resultLandingInfo.types"
|
||||
[year]="resultLandingInfo.date" [embargoEndDate]="resultLandingInfo.embargoEndDate">
|
||||
</landing-header>
|
||||
<div class="uk-margin-medium-top uk-margin-medium-right">
|
||||
<no-load-paging *ngIf="resultLandingInfo.references.length > 1.5*pageSize" [type]="'references'"
|
||||
(pageChange)="updateReferencesPage($event)"
|
||||
[page]="referencesPage" [pageSize]="1.5*pageSize"
|
||||
[totalResults]="resultLandingInfo.references.length">
|
||||
</no-load-paging>
|
||||
<div
|
||||
*ngFor="let item of resultLandingInfo.references.slice((referencesPage-1)*1.5*pageSize, referencesPage*1.5*pageSize)">
|
||||
<p *ngIf="item">
|
||||
{{item['name']}}
|
||||
<span *ngIf="item.url">
|
||||
[<a href="{{item['url']}}" target="_blank">PubMed</a>]
|
||||
</span>
|
||||
</p>
|
||||
</div>
|
||||
<no-load-paging *ngIf="resultLandingInfo.references.length > 1.5*pageSize" [type]="'references'"
|
||||
(pageChange)="updateReferencesPage($event)"
|
||||
[page]="referencesPage" [pageSize]="1.5*pageSize"
|
||||
[totalResults]="resultLandingInfo.references.length">
|
||||
</no-load-paging>
|
||||
</div>
|
||||
</modal-alert>
|
||||
<!-- Bioentities -->
|
||||
<modal-alert *ngIf="resultLandingInfo && resultLandingInfo.bioentities"
|
||||
classBody="uk-width-xxlarge uk-padding-remove-right" #bioentitiesModal>
|
||||
<landing-header [properties]="properties" [title]="resultLandingInfo.title" [modal]="bioentitiesModal"
|
||||
[subTitle]="resultLandingInfo.subtitle" [authorLimit]="10" [showAllAuthors]="false"
|
||||
[entityType]="getTypeName()" [authors]="resultLandingInfo.authors" [types]="resultLandingInfo.types"
|
||||
[year]="resultLandingInfo.date" [embargoEndDate]="resultLandingInfo.embargoEndDate">
|
||||
</landing-header>
|
||||
<div class="uk-margin-medium-top uk-margin-medium-right">
|
||||
<no-load-paging *ngIf="bioentitiesNum > 2*pageSize" [type]="'bioentities'"
|
||||
(pageChange)="updateBioentitiesPage($event)"
|
||||
[page]="bioentitiesPage" [pageSize]="2*pageSize"
|
||||
[totalResults]="bioentitiesNum">
|
||||
</no-load-paging>
|
||||
<div class="uk-child-width-1-4@s uk-child-width-1-2 bioentities-buttons" uk-grid>
|
||||
<ng-container *ngFor="let key of getKeys(resultLandingInfo.bioentities) let i=index">
|
||||
<ng-container
|
||||
*ngFor="let keyIn of keysToArray(resultLandingInfo.bioentities.get(key)).slice((bioentitiesPage-1)*2*pageSize, bioentitiesPage*2*pageSize)">
|
||||
<div>
|
||||
<div [title]="key" *ngIf="keyIn && !resultLandingInfo.bioentities.get(key).get(keyIn)">
|
||||
{{keyIn}}
|
||||
</div>
|
||||
<a [href]="resultLandingInfo.bioentities.get(key).get(keyIn)" target="_blank"
|
||||
[title]="key" *ngIf="keyIn && resultLandingInfo.bioentities.get(key).get(keyIn)">
|
||||
{{keyIn}}
|
||||
<span class="custom-external custom-icon space"></span>
|
||||
</a>
|
||||
</div>
|
||||
</ng-container>
|
||||
</ng-container>
|
||||
</div>
|
||||
<no-load-paging *ngIf="bioentitiesNum > 2*pageSize" [type]="'bioentities'"
|
||||
(pageChange)="updateBioentitiesPage($event)"
|
||||
[page]="bioentitiesPage" [pageSize]="2*pageSize"
|
||||
[totalResults]="bioentitiesNum">
|
||||
</no-load-paging>
|
||||
</div>
|
||||
</modal-alert>
|
||||
<!-- Relation Results-->
|
||||
<modal-alert *ngIf="resultLandingInfo" classBody="uk-width-xxlarge uk-padding-remove-right" #relationModal>
|
||||
<landing-header [properties]="properties" [title]="resultLandingInfo.title" [modal]="relationModal"
|
||||
[subTitle]="resultLandingInfo.subtitle" [authorLimit]="10" [showAllAuthors]="false"
|
||||
[entityType]="getTypeName()" [authors]="resultLandingInfo.authors" [types]="resultLandingInfo.types"
|
||||
[year]="resultLandingInfo.date" [embargoEndDate]="resultLandingInfo.embargoEndDate">
|
||||
</landing-header>
|
||||
<div *ngIf="relationResults" class="uk-margin-medium-top uk-margin-medium-right">
|
||||
<no-load-paging *ngIf="relationResults.length > pageSize" [type]="'research results'"
|
||||
(pageChange)="updateRelationPage($event)"
|
||||
[page]="relationPage" [pageSize]="pageSize"
|
||||
[totalResults]="relationResults.length">
|
||||
</no-load-paging>
|
||||
<ul class="uk-list uk-list-divider uk-margin">
|
||||
<li *ngFor="let item of relationResults.slice((relationPage-1)*pageSize, relationPage*pageSize)">
|
||||
<result-preview [modal]="relationModal" [properties]="properties"
|
||||
[result]="getResultPreview(item)"></result-preview>
|
||||
</li>
|
||||
</ul>
|
||||
<no-load-paging *ngIf="relationResults.length > pageSize" [type]="'research results'"
|
||||
(pageChange)="updateRelationPage($event)"
|
||||
[page]="relationPage" [pageSize]="pageSize"
|
||||
[totalResults]="relationResults.length">
|
||||
</no-load-paging>
|
||||
</div>
|
||||
</modal-alert>
|
||||
<!-- Related Organizations-->
|
||||
<modal-alert *ngIf="resultLandingInfo && resultLandingInfo.organizations"
|
||||
classBody="uk-width-xxlarge uk-padding-remove-right" #organizationModal>
|
||||
<landing-header [properties]="properties" [title]="resultLandingInfo.title" [modal]="organizationModal"
|
||||
[subTitle]="resultLandingInfo.subtitle" [authorLimit]="10" [showAllAuthors]="false"
|
||||
[entityType]="getTypeName()" [authors]="resultLandingInfo.authors" [types]="resultLandingInfo.types"
|
||||
[year]="resultLandingInfo.date" [embargoEndDate]="resultLandingInfo.embargoEndDate">
|
||||
</landing-header>
|
||||
<div class="uk-margin-medium-top uk-margin-medium-right">
|
||||
<no-load-paging *ngIf="resultLandingInfo.organizations.length > pageSize" [type]="'organizations'"
|
||||
(pageChange)="updateOrganizationsPage($event)"
|
||||
[page]="relationPage" [pageSize]="pageSize"
|
||||
[totalResults]="resultLandingInfo.organizations.length">
|
||||
</no-load-paging>
|
||||
<ul class="uk-list uk-list-divider uk-margin">
|
||||
<li *ngFor="let item of resultLandingInfo.organizations.slice((relationPage-1)*pageSize, relationPage*pageSize)">
|
||||
<result-preview [modal]="organizationModal" [properties]="properties"
|
||||
[result]="getResultPreviewFromOrg(item)"></result-preview>
|
||||
</li>
|
||||
</ul>
|
||||
<no-load-paging *ngIf="resultLandingInfo.organizations.length > pageSize" [type]="'organizations'"
|
||||
(pageChange)="updateOrganizationsPage($event)"
|
||||
[page]="relationPage" [pageSize]="pageSize"
|
||||
[totalResults]="resultLandingInfo.organizations.length">
|
||||
</no-load-paging>
|
||||
</div>
|
||||
</modal-alert>
|
||||
</div>
|
||||
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {Component, ElementRef, Input, ViewChild} from '@angular/core';
|
||||
import {ChangeDetectorRef, Component, Input, ViewChild} from '@angular/core';
|
||||
import {ActivatedRoute, Router} from '@angular/router';
|
||||
import {Meta, Title} from '@angular/platform-browser';
|
||||
|
||||
|
@ -12,14 +12,14 @@ import {SEOService} from '../../sharedComponents/SEO/SEO.service';
|
|||
import {HelperFunctions} from '../../utils/HelperFunctions.class';
|
||||
import {HelperService} from '../../utils/helper/helper.service';
|
||||
import {Location} from "@angular/common";
|
||||
import {MetricsService} from "../../services/metrics.service";
|
||||
import {Organization, RelationResult, ResultPreview} from "../../utils/result-preview/result-preview";
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'result-landing',
|
||||
templateUrl: 'resultLanding.component.html',
|
||||
|
||||
})
|
||||
|
||||
export class ResultLandingComponent {
|
||||
@Input() type: string = "publication";
|
||||
@Input() piwikSiteId = null;
|
||||
|
@ -29,9 +29,15 @@ export class ResultLandingComponent {
|
|||
@Input() activeTab: string = "References";
|
||||
|
||||
@ViewChild('AlertModalDeletedByInference') alertModalDeletedByInference;
|
||||
@ViewChild('referencesModal') referencesModal;
|
||||
@ViewChild('bioentitiesModal') bioentitiesModal;
|
||||
@ViewChild('relationModal') relationModal;
|
||||
@ViewChild('organizationModal') organizationModal;
|
||||
public deleteByInferenceOpened: boolean = false;
|
||||
|
||||
public resultLandingInfo: ResultLandingInfo;
|
||||
public relationResults: RelationResult[];
|
||||
public relation: string = 'trust';
|
||||
public id: string;
|
||||
public title: string;
|
||||
|
||||
|
@ -39,15 +45,12 @@ export class ResultLandingComponent {
|
|||
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;
|
||||
public thresholdDescription: number = 670;
|
||||
public showNumDescription: number = 670;
|
||||
|
||||
// Metrics tab variables
|
||||
public metricsClicked: boolean;
|
||||
public hasAltMetrics: boolean = false;
|
||||
public viewsFrameUrl: string;
|
||||
public downloadsFrameUrl: string;
|
||||
public totalViews: number;
|
||||
|
@ -56,15 +59,15 @@ export class ResultLandingComponent {
|
|||
|
||||
// Custom tab paging variables
|
||||
public referencesPage: number = 1;
|
||||
public bioentitiesPage: number = 1;
|
||||
public relationPage: 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 = "";
|
||||
|
@ -75,17 +78,20 @@ export class ResultLandingComponent {
|
|||
|
||||
private doi: string;
|
||||
public doiURL: string;
|
||||
private result;
|
||||
sub: any;
|
||||
piwiksub: any;
|
||||
infoSub: any;
|
||||
properties: EnvProperties;
|
||||
public indexUpdateDate: Date;
|
||||
public pageContents = null;
|
||||
public divContents = null;
|
||||
|
||||
@ViewChild('accordions')
|
||||
accordions: ElementRef;
|
||||
testBrowser: boolean = false;
|
||||
|
||||
public addThis: boolean = true;
|
||||
public showFeedback: boolean = false;
|
||||
public feedbackFields: string [] = [
|
||||
'Title', 'Authors', 'Access rights',
|
||||
'Publisher information', 'Funding Information',
|
||||
'Persistent identifiers','Other'];
|
||||
|
||||
constructor(private _resultLaningService: ResultLandingService,
|
||||
private _piwikService: PiwikService,
|
||||
|
@ -96,6 +102,8 @@ export class ResultLandingComponent {
|
|||
private _router: Router,
|
||||
private helper: HelperService,
|
||||
private seoService: SEOService,
|
||||
private metricsService: MetricsService,
|
||||
private cdr: ChangeDetectorRef,
|
||||
private _location: Location) {
|
||||
}
|
||||
|
||||
|
@ -103,11 +111,13 @@ export class ResultLandingComponent {
|
|||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
if(this.properties.lastIndexUpdate) {
|
||||
this.indexUpdateDate = new Date(this.properties.lastIndexUpdate);
|
||||
}
|
||||
//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") {
|
||||
|
@ -195,8 +205,31 @@ export class ResultLandingComponent {
|
|||
this.infoSub.unsubscribe();
|
||||
}
|
||||
}
|
||||
|
||||
public getTypeName(): string {
|
||||
if (this.type === "dataset") {
|
||||
return "research data";
|
||||
} else if (this.type === "orp" || this.type === "other") {
|
||||
return "other research product";
|
||||
} else {
|
||||
return this.type;
|
||||
}
|
||||
}
|
||||
|
||||
public removeUnknown(array: string[], type: boolean = false): string[] {
|
||||
if (type) {
|
||||
return this.removeDuplicates(array).filter(value => value.toLowerCase() !== 'unknown');
|
||||
} else {
|
||||
return array.filter(value => value.toLowerCase() !== 'unknown');
|
||||
}
|
||||
}
|
||||
|
||||
public removeDuplicates(array: string[]): string[] {
|
||||
let type = this.getTypeName();
|
||||
return array.filter(value => value.toLowerCase() !== type);
|
||||
}
|
||||
|
||||
private getOpenCitations(id: string) {
|
||||
private getOpenCitations() {
|
||||
this._resultLaningService.getOpenCitations(this.id, this.properties).subscribe(
|
||||
data => {
|
||||
this.resultLandingInfo.openCitations = data[1];
|
||||
|
@ -234,7 +267,7 @@ export class ResultLandingComponent {
|
|||
}
|
||||
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);
|
||||
this.getOpenCitations();
|
||||
}
|
||||
|
||||
if (this.resultLandingInfo.title) {
|
||||
|
@ -252,32 +285,15 @@ export class ResultLandingComponent {
|
|||
});
|
||||
}
|
||||
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.metricsService.hasAltMetrics(this.properties.altMetricsAPIURL, this.doi).subscribe(hasAltMetrics => {
|
||||
this.hasAltMetrics = hasAltMetrics;
|
||||
}, error => {
|
||||
this.hasAltMetrics = false;
|
||||
});
|
||||
}
|
||||
|
||||
this.showLoading = false;
|
||||
|
||||
if (this.resultLandingInfo.references) {
|
||||
this.activeTab = "References";
|
||||
} else if (this.resultLandingInfo.relatedResearchResults) {
|
||||
|
@ -359,6 +375,14 @@ export class ResultLandingComponent {
|
|||
public updateReferencesPage($event) {
|
||||
this.referencesPage = $event.value;
|
||||
}
|
||||
|
||||
public updateBioentitiesPage($event) {
|
||||
this.bioentitiesPage = $event.value;
|
||||
}
|
||||
|
||||
public updateRelationPage($event) {
|
||||
this.relationPage = $event.value;
|
||||
}
|
||||
|
||||
public updateOrganizationsPage($event) {
|
||||
this.organizationsPage = $event.value;
|
||||
|
@ -368,10 +392,6 @@ export class ResultLandingComponent {
|
|||
this.softwarePage = $event.value;
|
||||
}
|
||||
|
||||
public updateBioentitiesPage($event) {
|
||||
this.bioentitiesPage = $event.value;
|
||||
}
|
||||
|
||||
public updateOpenCitationsPage($event) {
|
||||
this.openCitationsPage = $event.value;
|
||||
}
|
||||
|
@ -430,27 +450,58 @@ export class ResultLandingComponent {
|
|||
this.deleteByInferenceOpened = true;
|
||||
this.alertModalDeletedByInference.cancelButton = false;
|
||||
this.alertModalDeletedByInference.okButton = false;
|
||||
this.alertModalDeletedByInference.alertTitle = "Other versions";
|
||||
//this.alertModalDeletedByInference.message = "There was an error in csv downloading. Please try again later.";
|
||||
//this.alertModalDeletedByInference.okButtonText = "OK";
|
||||
this.alertModalDeletedByInference.alertTitle = "Other versions of";
|
||||
this.alertModalDeletedByInference.open();
|
||||
}
|
||||
|
||||
gotoAccordions() {
|
||||
//this.accordions.nativeElement.scrollIntoView();
|
||||
|
||||
let offsetHeight = document.getElementById('stickyNavbar').offsetHeight;
|
||||
|
||||
// scroll to your element
|
||||
this.accordions.nativeElement.scrollIntoView(true);
|
||||
|
||||
// now account for fixed header
|
||||
var scrolledY = window.scrollY;
|
||||
|
||||
if(scrolledY){
|
||||
window.scroll(0, scrolledY - offsetHeight - 50);
|
||||
}
|
||||
|
||||
openReferences() {
|
||||
this.referencesModal.cancelButton = false;
|
||||
this.referencesModal.okButton = false;
|
||||
this.referencesModal.alertTitle = "References of";
|
||||
this.referencesPage = 1;
|
||||
this.referencesModal.open();
|
||||
}
|
||||
|
||||
openBioentities() {
|
||||
this.bioentitiesModal.cancelButton = false;
|
||||
this.bioentitiesModal.okButton = false;
|
||||
this.bioentitiesModal.alertTitle = "Bioentities of";
|
||||
this.bioentitiesPage = 1;
|
||||
this.bioentitiesModal.open();
|
||||
}
|
||||
|
||||
openRelationResults(title: string, relationResults: RelationResult[], relation: string = 'trust') {
|
||||
this.relationResults = relationResults;
|
||||
this.relation = relation;
|
||||
this.relationModal.cancelButton = false;
|
||||
this.relationModal.okButton = false;
|
||||
this.relationModal.alertTitle = title;
|
||||
this.relationPage = 1;
|
||||
this.relationModal.open();
|
||||
}
|
||||
|
||||
openOrganizations() {
|
||||
this.relation = 'trust';
|
||||
this.organizationModal.cancelButton = false;
|
||||
this.organizationModal.okButton = false;
|
||||
this.organizationModal.alertTitle = 'Related organizations of';
|
||||
this.organizationsPage = 1;
|
||||
this.organizationModal.open();
|
||||
}
|
||||
|
||||
public getResultPreview(result: RelationResult): ResultPreview {
|
||||
return ResultPreview.relationResultConvert(result, this.relation);
|
||||
}
|
||||
|
||||
public getResultPreviewFromOrg(result: Organization): ResultPreview {
|
||||
return ResultPreview.organizationConvert(result, this.relation);
|
||||
}
|
||||
|
||||
public hideAddThis(value: boolean) {
|
||||
this.addThis = value;
|
||||
this.cdr.detectChanges();
|
||||
}
|
||||
|
||||
updateUrlWithType(){
|
||||
this.type = this.resultLandingInfo.resultType;
|
||||
if(this.type == "publication") {
|
||||
|
|
|
@ -25,14 +25,18 @@ import {HelperModule} from "../../utils/helper/helper.module";
|
|||
import {ResultLandingUtilsModule} from "../landing-utils/resultLandingUtils.module";
|
||||
import {AlertModalModule} from "../../utils/modal/alertModal.module";
|
||||
import {AnnotationModule} from "../annotation/annotation.module";
|
||||
import {LandingHeaderModule} from "../landing-utils/landing-header/landing-header.module";
|
||||
import {NoLoadPaging} from "../../searchPages/searchUtils/no-load-paging.module";
|
||||
import {ResultPreviewModule} from "../../utils/result-preview/result-preview.module";
|
||||
import {FeedbackModule} from "../feedback/feedback.module";
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule, FormsModule, LandingModule, SharedModule, RouterModule,
|
||||
CiteThisModule, PagingModule, IFrameModule,
|
||||
MetricsModule, AltMetricsModule, ConfigurationServiceModule, Schema2jsonldModule, SEOServiceModule,
|
||||
DeletedByInferenceModule, ShowAuthorsModule, HelperModule, ResultLandingUtilsModule, AlertModalModule, AnnotationModule
|
||||
],
|
||||
imports: [
|
||||
CommonModule, FormsModule, LandingModule, SharedModule, RouterModule,
|
||||
CiteThisModule, PagingModule, IFrameModule,
|
||||
MetricsModule, AltMetricsModule, ConfigurationServiceModule, Schema2jsonldModule, SEOServiceModule,
|
||||
DeletedByInferenceModule, ShowAuthorsModule, HelperModule, ResultLandingUtilsModule, AlertModalModule, AnnotationModule, LandingHeaderModule, NoLoadPaging, ResultPreviewModule, FeedbackModule
|
||||
],
|
||||
declarations: [
|
||||
ResultLandingComponent
|
||||
],
|
||||
|
|
|
@ -5,6 +5,7 @@ import {ResultLandingInfo} from '../../utils/entities/resultLandingInfo';
|
|||
import {EnvProperties} from '../../utils/properties/env-properties';
|
||||
import {ParsingFunctions} from '../landing-utils/parsingFunctions.class';
|
||||
import {map, tap} from "rxjs/operators";
|
||||
import {Organization} from "../../utils/result-preview/result-preview";
|
||||
|
||||
@Injectable()
|
||||
export class ResultLandingService {
|
||||
|
@ -89,7 +90,7 @@ export class ResultLandingService {
|
|||
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.dateofacceptance = data[0].dateofacceptance?new Date(data[0].dateofacceptance):null;
|
||||
this.resultLandingInfo.publisher = data[0].publisher;
|
||||
if(!Array.isArray(data[0].description)) {
|
||||
//this.resultLandingInfo.description = String(data[0].description);
|
||||
|
@ -98,7 +99,7 @@ export class ResultLandingService {
|
|||
//this.resultLandingInfo.description = String(data[0].description[0]);
|
||||
this.resultLandingInfo.description = (data[0] && data[0].description[0]) ? String(data[0].description[0]) : "";
|
||||
}
|
||||
this.resultLandingInfo.embargoEndDate = data[0].embargoenddate;
|
||||
this.resultLandingInfo.embargoEndDate = data[0].embargoenddate?new Date(data[0].embargoenddate):null;
|
||||
}
|
||||
|
||||
if(data[0]['bestaccessright'] && data[0]['bestaccessright'].hasOwnProperty("classname")) {
|
||||
|
@ -191,6 +192,20 @@ export class ResultLandingService {
|
|||
/**********************************************************/
|
||||
}
|
||||
}
|
||||
/* Order Download from via openness*/
|
||||
this.resultLandingInfo.hostedBy_collectedFrom.sort((a, b) => {
|
||||
if(a.bestAccessMode && a.bestAccessMode.toLowerCase() === 'open access') {
|
||||
return -1;
|
||||
} else if(b.bestAccessMode && b.bestAccessMode.toLowerCase() === 'open access') {
|
||||
return 1;
|
||||
} else if(!a.bestAccessMode || a.bestAccessMode.toLowerCase() !== 'not available') {
|
||||
return 1;
|
||||
} else if(!b.bestAccessMode || b.bestAccessMode.toLowerCase() !== 'not available') {
|
||||
return -1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
if(data[3].hasOwnProperty("externalreference")) {
|
||||
|
@ -281,13 +296,7 @@ export class ResultLandingService {
|
|||
return (item != undefined && item.fullName != undefined);
|
||||
});
|
||||
}
|
||||
|
||||
if(this.resultLandingInfo.relatedResearchResults) {
|
||||
let self = this;
|
||||
this.resultLandingInfo.relatedResearchResults.forEach(function (value, key, map) {
|
||||
self.resultLandingInfo.relatedResearchResults.set(key, self.parsingFunctions.sortByPercentage(value));
|
||||
});
|
||||
}
|
||||
this.resultLandingInfo.relatedResearchResults = this.parsingFunctions.sortByPercentage(this.resultLandingInfo.relatedResearchResults);
|
||||
this.resultLandingInfo.similarResearchResults = this.parsingFunctions.sortByPercentage(this.resultLandingInfo.similarResearchResults);
|
||||
this.resultLandingInfo.supplementaryResearchResults = this.parsingFunctions.sortByPercentage(this.resultLandingInfo.supplementaryResearchResults);
|
||||
this.resultLandingInfo.supplementedByResearchResults = this.parsingFunctions.sortByPercentage(this.resultLandingInfo.supplementedByResearchResults);
|
||||
|
@ -295,22 +304,18 @@ export class ResultLandingService {
|
|||
return this.resultLandingInfo;
|
||||
}
|
||||
|
||||
parseRelatedOrganizations(organizations: {"name": string, "shortname":string, "id": string, "websiteUrl": string, "country": string, "trust": number}[], relation: any):
|
||||
{"name": string, "shortname":string, "id": string, "websiteUrl": string, "country": string, "trust": number}[] {
|
||||
parseRelatedOrganizations(organizations: Organization[], relation: any): Organization[] {
|
||||
if(organizations == undefined) {
|
||||
organizations = new Array<{
|
||||
"name": string, "shortname": string,
|
||||
"id": string, "websiteUrl": string,
|
||||
"country": string, "trust": number}>();
|
||||
organizations = []
|
||||
}
|
||||
|
||||
let organization: { "name": string, "shortname": string,
|
||||
"id": string, "websiteUrl": string,
|
||||
"country": string, "trust": number
|
||||
} = {
|
||||
"name": "", "shortname": "",
|
||||
"id": "", "websiteUrl": "",
|
||||
"country": "", "trust": null
|
||||
name: "", shortname: "",
|
||||
id: "", websiteUrl: "",
|
||||
country: "", trust: null
|
||||
};
|
||||
|
||||
organization.id = relation['to'].content;
|
||||
|
|
|
@ -25,7 +25,7 @@ import {EnvProperties} from '../../utils/properties/env-properties';
|
|||
import {SEOService} from '../../sharedComponents/SEO/SEO.service';
|
||||
import {StringUtils} from '../../utils/string-utils.class';
|
||||
import {SearchCustomFilter} from "../searchUtils/searchUtils.class";
|
||||
import {Observable} from "rxjs";
|
||||
import {Observable, Subscription} from "rxjs";
|
||||
|
||||
@Component({
|
||||
changeDetection: ChangeDetectionStrategy.Default,
|
||||
|
@ -452,7 +452,7 @@ export class SearchComponent {
|
|||
|
||||
}
|
||||
|
||||
private numOfSearchResults(resultType: string, fetchClass: FetchResearchResults, refineParams): Observable<any> {
|
||||
private numOfSearchResults(resultType: string, fetchClass: FetchResearchResults, refineParams) {
|
||||
return this._searchResearchResultsService.numOfSearchResults(resultType, this.keyword, this.properties, refineParams).subscribe(
|
||||
data => {
|
||||
fetchClass.searchUtils.totalResults = data;
|
||||
|
|
|
@ -5,7 +5,7 @@ import {Observable} from 'rxjs';
|
|||
import {Metrics} from '../utils/entities/metrics';
|
||||
|
||||
import{EnvProperties} from '../utils/properties/env-properties';
|
||||
import {map} from "rxjs/operators";
|
||||
import {catchError, map} from "rxjs/operators";
|
||||
|
||||
@Injectable()
|
||||
export class MetricsService {
|
||||
|
@ -13,12 +13,15 @@ export class MetricsService {
|
|||
|
||||
constructor(private http: HttpClient ) {}
|
||||
|
||||
hasAltMetrics(url: string, doi: string): Observable<boolean> {
|
||||
return this.http.get(url + doi).pipe(map(res => !!(res)));
|
||||
}
|
||||
|
||||
getMetrics (id: string, entityType: string, properties:EnvProperties):any {
|
||||
let url = properties.metricsAPIURL+entityType+"/"+id+"/clicks";
|
||||
let key = url;
|
||||
|
||||
return this.http.get((properties.useCache)? (properties.cacheUrl+encodeURIComponent(url)): url)
|
||||
//.map(res => <any> res.json())
|
||||
.pipe(map(res => this.parseMetrics(res["downloads"], res["views"], res["total_downloads"], res["total_views"],
|
||||
res["total_openaire_views"], res["total_openaire_downloads"], res["pageviews"], properties)));
|
||||
}
|
||||
|
|
|
@ -203,7 +203,7 @@ export class SearchDataprovidersService {
|
|||
var basicQuery = "(oaftype exact datasource) "
|
||||
url += "?query=";
|
||||
if(datasourceId!= null && datasourceId != '' ) {
|
||||
url +=" ( "+basicQuery+ " ) " +" and (collectedfromdatasourceid exact \"" + datasourceId + "\")";
|
||||
url +=" ( "+basicQuery+ " ) " +" and (collectedfromdatasourceid exact \"" + datasourceId + "\" or resulthostingdatasourceid exact \""+ datasourceId + "\")";
|
||||
}else{
|
||||
url +=" ( "+basicQuery+ " ) ";
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ export class SearchProjectsService {
|
|||
var basicQuery = "(oaftype exact project) "
|
||||
url += "?query=";
|
||||
if(datasourceId!= null && datasourceId != '' ) {
|
||||
url +=" ( "+basicQuery+ " ) " +" and (collectedfromdatasourceid exact \"" + datasourceId + "\")";
|
||||
url +=" ( "+basicQuery+ " ) " +" and (collectedfromdatasourceid exact \"" + datasourceId + "\" or resulthostingdatasourceid exact \""+ datasourceId + "\")";
|
||||
}else{
|
||||
url +=" ( "+basicQuery+ " ) ";
|
||||
}
|
||||
|
@ -74,6 +74,7 @@ export class SearchProjectsService {
|
|||
//.map(res => <any> res.json())
|
||||
.pipe(map(res => [res['meta'].total, this.parseResults(res['results']), RefineResultsUtils.parse(res['refineResults'],refineFields, "project")]));
|
||||
}
|
||||
|
||||
getProjectsForOrganizations (organizationId: string, filterquery: string, page: number, size: number, refineFields:string[] , properties:EnvProperties ):any {
|
||||
let url = properties.searchResourcesAPIURL;
|
||||
var basicQuery = "(oaftype exact project) "
|
||||
|
@ -149,6 +150,10 @@ export class SearchProjectsService {
|
|||
result.acronym = resData['acronym'];
|
||||
result.code = resData['code'];
|
||||
|
||||
result.budget = resData.totalcost;//"10000";
|
||||
result.contribution = resData.fundedamount;//"200100";
|
||||
result.currency = resData.currency;//"EUR";
|
||||
|
||||
result.id = Array.isArray(data) ? data[i]['result']['header']['dri:objIdentifier'] : data['result']['header']['dri:objIdentifier'];
|
||||
|
||||
if(!Array.isArray(resData['summary'])) {
|
||||
|
|
|
@ -1,50 +1,48 @@
|
|||
import {Component, ElementRef, Input} from '@angular/core';
|
||||
import { OpenAireJsonldConverterService } from './service/open-aire-jsonld-converter.service';
|
||||
import { JsonldDocumentSerializerService } from './service/jsonld-document-serializer.service';
|
||||
import {OpenAireJsonldConverterService} from './service/open-aire-jsonld-converter.service';
|
||||
import {JsonldDocumentSerializerService} from './service/jsonld-document-serializer.service';
|
||||
|
||||
@Component({
|
||||
selector: 'schema2jsonld',
|
||||
template: `
|
||||
<ngx-json-ld [json]="json"></ngx-json-ld>
|
||||
<ngx-json-ld [json]="json"></ngx-json-ld>
|
||||
`
|
||||
})
|
||||
export class Schema2jsonldComponent {
|
||||
@Input() data; // for project, organization, datasource
|
||||
@Input() URL;
|
||||
@Input() logoURL; // for home, search
|
||||
@Input() otherURL; //for project, datasource
|
||||
@Input() name;
|
||||
@Input() searchAction = true;
|
||||
@Input() type="result";
|
||||
|
||||
json;
|
||||
constructor( private documentParser: OpenAireJsonldConverterService,
|
||||
private documentSerializer: JsonldDocumentSerializerService) {
|
||||
|
||||
@Input() data; // for project, organization, datasource
|
||||
@Input() URL;
|
||||
@Input() logoURL; // for home, search
|
||||
@Input() otherURL; //for project, datasource
|
||||
@Input() name;
|
||||
@Input() searchAction = true;
|
||||
@Input() type = "result";
|
||||
public json;
|
||||
|
||||
constructor(private documentParser: OpenAireJsonldConverterService,
|
||||
private documentSerializer: JsonldDocumentSerializerService) {
|
||||
|
||||
}
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
var docOvject;
|
||||
if(this.type == 'project'){
|
||||
docOvject = this.documentParser.convertProject(this.data, this.URL, this.otherURL);
|
||||
this.json = this.documentSerializer.serializeOrganization(docOvject);
|
||||
}else if(this.type == 'organization'){
|
||||
docOvject = this.documentParser.convertOrganization(this.data, this.URL);
|
||||
this.json = this.documentSerializer.serializeOrganization(docOvject);
|
||||
}else if(this.type == 'datasource'){
|
||||
docOvject = this.documentParser.convertDatasource(this.data, this.URL, this.otherURL);
|
||||
this.json = this.documentSerializer.serializeOrganization(docOvject);
|
||||
}else if(this.type == 'home'){
|
||||
this.json = this.documentParser.createHome(this.name, this.URL, this.logoURL);
|
||||
}else if(this.type == 'search'){
|
||||
this.json = this.documentParser.createSearchPage(this.name, this.URL, this.logoURL, this.searchAction);
|
||||
}else if(this.type == 'result'){
|
||||
docOvject = this.documentParser.convertResult(this.data, this.URL);
|
||||
this.json = this.documentSerializer.serializeDataset(docOvject);
|
||||
}else{
|
||||
this.json = this.documentParser.createSimplePage(this.name, this.URL);
|
||||
}
|
||||
|
||||
var docOvject;
|
||||
if (this.type == 'project') {
|
||||
docOvject = this.documentParser.convertProject(this.data, this.URL, this.otherURL);
|
||||
this.json = this.documentSerializer.serializeOrganization(docOvject);
|
||||
} else if (this.type == 'organization') {
|
||||
docOvject = this.documentParser.convertOrganization(this.data, this.URL);
|
||||
this.json = this.documentSerializer.serializeOrganization(docOvject);
|
||||
} else if (this.type == 'datasource') {
|
||||
docOvject = this.documentParser.convertDatasource(this.data, this.URL, this.otherURL);
|
||||
this.json = this.documentSerializer.serializeOrganization(docOvject);
|
||||
} else if (this.type == 'home') {
|
||||
this.json = this.documentParser.createHome(this.name, this.URL, this.logoURL);
|
||||
} else if (this.type == 'search') {
|
||||
this.json = this.documentParser.createSearchPage(this.name, this.URL, this.logoURL, this.searchAction);
|
||||
} else if (this.type == 'result') {
|
||||
docOvject = this.documentParser.convertResult(this.data, this.URL);
|
||||
this.json = this.documentSerializer.serializeDataset(docOvject);
|
||||
} else {
|
||||
this.json = this.documentParser.createSimplePage(this.name, this.URL);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -77,15 +77,14 @@ export class OpenAireJsonldConverterService {
|
|||
|
||||
convertProject(project: any, URL, otherUrl): Organization {
|
||||
const doc = new Organization();
|
||||
|
||||
doc.title = (project.name)?project.title:project.acronym;
|
||||
doc.title = (project.title)?project.title:project.acronym;
|
||||
doc.identifier = new Array<Identifier>();
|
||||
doc.identifier.push({id:project.contractNum, schema: "grantid"});
|
||||
doc.identifier.push({id:project.funding.code, schema: "grantid"});
|
||||
var funder = new Organization();
|
||||
funder.title = project.funder;
|
||||
funder.title = project.funding.funderShortName;
|
||||
doc.funder = funder;
|
||||
doc.url = URL;
|
||||
doc.sameAs =[project.url]
|
||||
doc.sameAs =[project.url];
|
||||
return doc;
|
||||
}
|
||||
|
||||
|
@ -103,8 +102,8 @@ convertOrganization(organization: any, URL): Organization {
|
|||
convertDatasource(datasource: any, URL, otherUrl): Organization {
|
||||
const doc = new Organization();
|
||||
|
||||
doc.title = datasource.title.name
|
||||
doc.identifier = datasource.contractNum;
|
||||
doc.title = datasource.title.name;
|
||||
//doc.identifier = datasource.contractNum;
|
||||
doc.legalName = datasource.officialName;
|
||||
if(datasource.countries && datasource.countries.length > 0){
|
||||
doc.areaServed = datasource.countries[0];
|
||||
|
|
|
@ -4,22 +4,22 @@ import {HelperFunctions} from '../HelperFunctions.class';
|
|||
import {RouterHelper} from "../routerHelper.class";
|
||||
import {EnvProperties} from '../properties/env-properties';
|
||||
import {isPlatformBrowser} from "@angular/common";
|
||||
import {Keyword} from "../../searchPages/searchUtils/highlight/highlight.component";
|
||||
import {Author} from "../result-preview/result-preview";
|
||||
import {AlertModal} from "../modal/alert";
|
||||
|
||||
@Component({
|
||||
selector: 'showAuthors',
|
||||
template: `
|
||||
<div *ngIf="authors != undefined" class="uk-height-max-small uk-overflow-auto">
|
||||
<div *ngIf="authors" class="uk-height-max-medium uk-overflow-auto">
|
||||
<span *ngFor="let author of authors.slice(0,numberOfAuthors) let i=index">
|
||||
<span *ngIf="!author.orcid || (properties.environment == 'production') || !testBrowser"
|
||||
class="uk-text-small">
|
||||
<highlight [element]="author.fullName" [keywords]="keywords" [field]="'author'"></highlight>
|
||||
[class.uk-text-small]="small">
|
||||
{{author.fullName}}
|
||||
</span>
|
||||
<a *ngIf="author.orcid && (properties.environment != 'production') && testBrowser"
|
||||
class="cursor-default"> <img src="assets/common-assets/common/ORCIDiD_icon16x16.png" alt="">{{" "}}
|
||||
<span class="uk-text-small">
|
||||
<highlight [element]="author.fullName" [keywords]="keywords" [field]="'author'"></highlight>
|
||||
<span [class.uk-text-small]="small">
|
||||
{{author.fullName}}
|
||||
</span>
|
||||
</a>
|
||||
<div *ngIf="author.orcid && (properties.environment != 'production')"
|
||||
|
@ -48,45 +48,60 @@ import {Author} from "../result-preview/result-preview";
|
|||
<div class="uk-margin-top">
|
||||
Search <b>{{author.fullName}}</b> by <b>ORCID</b> in OpenAIRE's
|
||||
</div>
|
||||
<div class="uk-text-center uk-margin-small uk-margin-large-left uk-margin-large-right">
|
||||
<div *ngIf="properties.environment === 'development'"
|
||||
class="uk-text-center uk-margin-small uk-margin-large-left uk-margin-large-right">
|
||||
<a class="uk-button uk-button-small portal-button uk-padding uk-padding-remove-top uk-padding-remove-bottom uk-width-1-1"
|
||||
(click)="onClick()()"
|
||||
[queryParams]="routerHelper.createQueryParams(['orcid','oc'],[quote(author['orcid']),'and'])"
|
||||
routerLinkActive="router-link-active" routerLink="/search/advanced/publications">
|
||||
Publications
|
||||
routerLinkActive="router-link-active" routerLink="/search/advanced/research-outcomes">
|
||||
Research outcomes
|
||||
</a>
|
||||
</div>
|
||||
<div class="uk-text-center uk-margin-small uk-margin-large-left uk-margin-large-right">
|
||||
<a class="uk-button uk-button-small portal-button uk-padding uk-padding-remove-top uk-padding-remove-bottom uk-width-1-1"
|
||||
[queryParams]="routerHelper.createQueryParams(['orcid','oc'],[quote(author['orcid']),'and'])"
|
||||
routerLinkActive="router-link-active" routerLink="/search/advanced/datasets">
|
||||
Research Data
|
||||
</a>
|
||||
</div>
|
||||
<div class="uk-text-center uk-margin-small uk-margin-large-left uk-margin-large-right">
|
||||
<a class="uk-button uk-button-small portal-button uk-padding uk-padding-remove-top uk-padding-remove-bottom uk-width-1-1"
|
||||
[queryParams]="routerHelper.createQueryParams(['orcid','oc'],[quote(author['orcid']),'and'])"
|
||||
routerLinkActive="router-link-active" routerLink="/search/advanced/software">
|
||||
Software
|
||||
</a>
|
||||
</div>
|
||||
<div class="uk-text-center uk-margin-small uk-margin-large-left uk-margin-large-right">
|
||||
<a class="uk-button uk-button-small portal-button uk-padding uk-padding-remove-top uk-padding-remove-bottom uk-width-1-1"
|
||||
[queryParams]="routerHelper.createQueryParams(['orcid','oc'],[quote(author['orcid']),'and'])"
|
||||
routerLinkActive="router-link-active" routerLink="/search/advanced/other">
|
||||
Other Research Products
|
||||
</a>
|
||||
</div>
|
||||
</div
|
||||
><span>;{{" "}}</span>
|
||||
<ng-container *ngIf="properties.environment !== 'development'">
|
||||
<div class="uk-text-center uk-margin-small uk-margin-large-left uk-margin-large-right">
|
||||
<a class="uk-button uk-button-small portal-button uk-padding uk-padding-remove-top uk-padding-remove-bottom uk-width-1-1"
|
||||
(click)="onClick()"
|
||||
[queryParams]="routerHelper.createQueryParams(['orcid','oc'],[quote(author['orcid']),'and'])"
|
||||
routerLinkActive="router-link-active" routerLink="/search/advanced/publications">
|
||||
Publications
|
||||
</a>
|
||||
</div>
|
||||
<div class="uk-text-center uk-margin-small uk-margin-large-left uk-margin-large-right">
|
||||
<a class="uk-button uk-button-small portal-button uk-padding uk-padding-remove-top uk-padding-remove-bottom uk-width-1-1"
|
||||
(click)="onClick()"
|
||||
[queryParams]="routerHelper.createQueryParams(['orcid','oc'],[quote(author['orcid']),'and'])"
|
||||
routerLinkActive="router-link-active" routerLink="/search/advanced/datasets">
|
||||
Research Data
|
||||
</a>
|
||||
</div>
|
||||
<div class="uk-text-center uk-margin-small uk-margin-large-left uk-margin-large-right">
|
||||
<a class="uk-button uk-button-small portal-button uk-padding uk-padding-remove-top uk-padding-remove-bottom uk-width-1-1"
|
||||
(click)="onClick()"
|
||||
[queryParams]="routerHelper.createQueryParams(['orcid','oc'],[quote(author['orcid']),'and'])"
|
||||
routerLinkActive="router-link-active" routerLink="/search/advanced/software">
|
||||
Software
|
||||
</a>
|
||||
</div>
|
||||
<div class="uk-text-center uk-margin-small uk-margin-large-left uk-margin-large-right">
|
||||
<a class="uk-button uk-button-small portal-button uk-padding uk-padding-remove-top uk-padding-remove-bottom uk-width-1-1"
|
||||
(click)="onClick()"
|
||||
[queryParams]="routerHelper.createQueryParams(['orcid','oc'],[quote(author['orcid']),'and'])"
|
||||
routerLinkActive="router-link-active" routerLink="/search/advanced/other">
|
||||
Other Research Products
|
||||
</a>
|
||||
</div>
|
||||
</ng-container>
|
||||
</div>
|
||||
<span>;{{" "}}</span>
|
||||
</span>
|
||||
<span *ngIf="numberOfAuthors == authorsLimit && authors.length > authorsLimit"> ... </span>
|
||||
<span *ngIf="showAll && numberOfAuthors == authorsLimit && authors.length > authorsLimit">
|
||||
<a (click)="numberOfAuthors = authors.length;">
|
||||
view all {{authors.length | number}} authors
|
||||
</a>
|
||||
</span>
|
||||
</div>
|
||||
<div *ngIf="authors != undefined && showAll && numberOfAuthors > authorsLimit" class="uk-width-1-1 uk-text-right">
|
||||
<div *ngIf="authors && showAll && numberOfAuthors == authorsLimit && authors.length > authorsLimit" class="uk-width-1-1 uk-text-right">
|
||||
<a (click)="numberOfAuthors = authors.length;">
|
||||
View all {{authors.length | number}} authors
|
||||
</a>
|
||||
</div>
|
||||
<div *ngIf="authors && showAll && numberOfAuthors > authorsLimit" class="uk-width-1-1 uk-text-right">
|
||||
<a (click)="numberOfAuthors = authorsLimit;">View less authors</a>
|
||||
</div>
|
||||
`
|
||||
|
@ -97,7 +112,8 @@ export class ShowAuthorsComponent {
|
|||
@Input() authors: Author[];
|
||||
@Input() authorsLimit: number = 30;
|
||||
@Input() showAll: boolean = true;
|
||||
@Input() keywords: Keyword[];
|
||||
@Input() small: boolean = true;
|
||||
@Input() modal: AlertModal;
|
||||
|
||||
public numberOfAuthors: number;
|
||||
public properties: EnvProperties;
|
||||
|
@ -130,4 +146,10 @@ export class ShowAuthorsComponent {
|
|||
public scroll() {
|
||||
HelperFunctions.scroll();
|
||||
}
|
||||
|
||||
public onClick() {
|
||||
if(this.modal) {
|
||||
this.modal.cancel();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,14 +1,13 @@
|
|||
import { NgModule} from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import {NgModule} from '@angular/core';
|
||||
import {CommonModule} from '@angular/common';
|
||||
import {FormsModule} from '@angular/forms';
|
||||
import {RouterModule} from '@angular/router';
|
||||
|
||||
import {ShowAuthorsComponent} from './showAuthors.component';
|
||||
import {HighlightModule} from "../../searchPages/searchUtils/highlight/highlight.module";
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule, FormsModule, RouterModule, HighlightModule
|
||||
CommonModule, FormsModule, RouterModule
|
||||
],
|
||||
declarations: [
|
||||
ShowAuthorsComponent
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import {Email} from "./email";
|
||||
import {Body} from "./body";
|
||||
import {FormArray} from "@angular/forms";
|
||||
|
||||
export class Composer {
|
||||
private static noteBodySize = "14px";
|
||||
|
@ -63,7 +64,11 @@ export class Composer {
|
|||
email.recipients = admins;
|
||||
return email;
|
||||
}
|
||||
|
||||
|
||||
/*public static composeEmailForFeedback(issues: any[], recipients: string[]): Email {
|
||||
|
||||
}*/
|
||||
|
||||
public static composeEmailToInformOldManagersForTheNewOnes(communityName: string, communityId: string, firstVersionOfManagers: any, managers: any) : Email {
|
||||
let email: Email = new Email();
|
||||
|
||||
|
|
|
@ -10,6 +10,8 @@ export class DataProviderInfo {
|
|||
originalId: string;
|
||||
countries: string[];
|
||||
journal: {"journal": "", "issn": string, "lissn": string, "eissn": string};
|
||||
description: string;
|
||||
subjects: string[];
|
||||
|
||||
//collected from datasource api
|
||||
aggregationStatus: {"fundedContent": string, "indexRecords": string, "fulltexts": string, "lastUpdateDate": string};
|
||||
|
@ -168,5 +170,6 @@ export class DataProviderInfo {
|
|||
//projects: any;
|
||||
datasources: any;
|
||||
|
||||
relatedDatasources: Map<string, {"name": string, "countPublications": string, "countDatasets": string, "countSoftware": string, "countOrps": string}>;
|
||||
//relatedDatasources: Map<string, {"name": string, "countPublications": string, "countDatasets": string, "countSoftware": string, "countOrps": string}>;
|
||||
relatedDatasources: {"id": string, "name": string, "count": number}[] = [];
|
||||
}
|
||||
|
|
|
@ -1,16 +1,28 @@
|
|||
export class OrganizationInfo {
|
||||
title: { "name": string, "url": string };
|
||||
name: string;
|
||||
country: string;
|
||||
objIdentifier: string;
|
||||
|
||||
|
||||
projects: Map<string, { "name": string, "id":string, "code": string,
|
||||
"acronym": string, "funder": string, "funderId": string,
|
||||
"fundingStream": string, "fundingLevel1": string, "fundingLevel2": string,
|
||||
"sc39": string, "startDate": string, "endDate": string }[]>;
|
||||
//dataProviders: { "name": string, "url": string, "type": string, "websiteUrl": string,
|
||||
// "organizations": {"name": string, "url": string}[]}[];
|
||||
|
||||
deletedByInferenceIds: string[];
|
||||
export interface OrganizationProject {
|
||||
name: string;
|
||||
id: string;
|
||||
code: string;
|
||||
acronym: string;
|
||||
funder: string;
|
||||
funderId: string;
|
||||
fundingStream: string;
|
||||
fundingLevel1: string;
|
||||
fundingLevel2: string;
|
||||
sc39: string;
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
}
|
||||
|
||||
export class OrganizationInfo {
|
||||
title: { name: string; url: string; };
|
||||
name: string;
|
||||
country: string;
|
||||
objIdentifier: string;
|
||||
|
||||
|
||||
projects: Map<string, OrganizationProject[]>;
|
||||
//dataProviders: { name: string; url: string; type: string; websiteUrl: string;
|
||||
// organizations: {name: string; url: string}[]}[];
|
||||
|
||||
deletedByInferenceIds: string[];
|
||||
}
|
||||
|
|
|
@ -2,22 +2,21 @@ export class ProjectInfo {
|
|||
id:string;
|
||||
acronym: string;
|
||||
title: string;
|
||||
callIdentifier: string;
|
||||
funder: string;
|
||||
funding: string;
|
||||
contractNum: string;
|
||||
startDate: string;
|
||||
endDate: string;
|
||||
|
||||
funding: {funderName: string, funderShortName: string, code: string, fundingStream: string, budget: string, contribution: string, currency: string};
|
||||
startDate: number;
|
||||
endDate: number;
|
||||
currentDate: number;
|
||||
status: string;
|
||||
openAccessMandatePublications: string;
|
||||
openAccessMandateDatasets: string;
|
||||
specialClause39: string;
|
||||
organizations: { "acronym": string, "name": string, "id": string }[];//Map<string, string>;
|
||||
url: string;
|
||||
urlInfo: string;
|
||||
|
||||
description: string;
|
||||
//publications: any;
|
||||
researchData: any;
|
||||
statistics: any;
|
||||
|
||||
totalPublications: number;
|
||||
totalDatasets: number;
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
import {
|
||||
Author,
|
||||
HostedByCollectedFrom,
|
||||
Journal,
|
||||
Organization,
|
||||
Project,
|
||||
RelationResult
|
||||
} from "../result-preview/result-preview";
|
||||
|
||||
export class ResultLandingInfo {
|
||||
// PUBLICATION, DATASET, SOFTWARE, ORP
|
||||
record;
|
||||
|
@ -5,59 +14,53 @@ export class ResultLandingInfo {
|
|||
// PUBLICATION, DATASET, SOFTWARE, ORP, DELETED_BY_INFERENCE
|
||||
title: string;
|
||||
accessMode: string;
|
||||
authors: {"fullName": string, "orcid": string}[];
|
||||
authors: Author[];
|
||||
date: string;
|
||||
dateofacceptance: string;
|
||||
embargoEndDate: string;
|
||||
dateofacceptance: Date;
|
||||
embargoEndDate: Date;
|
||||
types: string[];
|
||||
identifiers: Map<string, string[]>; //key is the classname
|
||||
languages: string[];
|
||||
countries: string[];
|
||||
description: string;
|
||||
|
||||
hostedBy_collectedFrom: {"downloadName": string, "downloadUrl": string[],
|
||||
"collectedName": string, "collectedId": string,
|
||||
"accessMode": string[], "bestAccessMode": string,
|
||||
"type": string, "year":string}[];
|
||||
|
||||
|
||||
hostedBy_collectedFrom: HostedByCollectedFrom[];
|
||||
|
||||
// PUBLICATION, DATASET, SOFTWARE, ORP
|
||||
fundedByProjects: { "id": string, "acronym": string, "title": string,
|
||||
"funderShortname": string, "funderName": string,
|
||||
"funding": string, "code": string, "provenanceAction": string, "inline": boolean}[];
|
||||
|
||||
fundedByProjects: Project[];
|
||||
|
||||
underCurationMessage: boolean;
|
||||
publisher: string;
|
||||
journal: {"journal": string, "issn": string, "lissn": string, "eissn": string,
|
||||
"issue": string, "volume": string, "start_page": string, "end_page": string};
|
||||
|
||||
journal: Journal;
|
||||
|
||||
subjects: string[];
|
||||
otherSubjects: Map<string, string[]>;
|
||||
classifiedSubjects: Map<string, string[]>; //<class of subject, subjects>
|
||||
|
||||
|
||||
// percentage is for trust
|
||||
relatedResearchResults: Map<string, { "name": string, "id": string, "date": string, "percentage": number, "class": string}[]>;
|
||||
relatedResearchResults: RelationResult[];
|
||||
// percentage is for similarity
|
||||
similarResearchResults: { "name": string, "id": string, "date": string, "percentage": number, "class": string}[];
|
||||
similarResearchResults: RelationResult[];
|
||||
//isSupplementedBy
|
||||
supplementaryResearchResults;
|
||||
supplementaryResearchResults: RelationResult[];
|
||||
//isSupplementTo
|
||||
supplementedByResearchResults;
|
||||
|
||||
contexts: { "labelContext": string, "labelCategory": string, "labelConcept": string, "inline": boolean}[];
|
||||
|
||||
supplementedByResearchResults: RelationResult[];
|
||||
|
||||
contexts: { "labelContext": string, "labelCategory": string, "labelConcept": string, "inline": boolean }[];
|
||||
|
||||
deletedByInferenceIds: string[];
|
||||
|
||||
|
||||
// PUBLICATION, DATASET, ORP
|
||||
references: { "name": string, "url": string}[];
|
||||
|
||||
references: { "name": string, "url": string }[];
|
||||
|
||||
// PUBLICATION
|
||||
bioentities: Map<string, Map<string, string>>; //<site name, <>>
|
||||
organizations: {"name": string, "shortname":string, "id": string, "websiteUrl": string, "country": string, "trust": number}[];
|
||||
openCitations: {"url": string, "title": string, "year": string, "doi": string, "authors": string[]}[];
|
||||
|
||||
organizations: Organization[];
|
||||
openCitations: { "url": string, "title": string, "year": string, "doi": string, "authors": string[] }[];
|
||||
|
||||
// DATASET
|
||||
subtitle: string;
|
||||
|
||||
|
||||
// SOFTWARE
|
||||
programmingLanguages: string[];
|
||||
}
|
||||
|
|
|
@ -1,392 +1,397 @@
|
|||
import {SearchDataprovidersService} from '../../services/searchDataproviders.service';
|
||||
import { ErrorCodes} from '../../utils/properties/errorCodes';
|
||||
import {ErrorMessagesComponent} from '../../utils/errorMessages.component';
|
||||
import {ErrorCodes} from '../../utils/properties/errorCodes';
|
||||
import {ErrorMessagesComponent} from '../../utils/errorMessages.component';
|
||||
import {SearchCustomFilter, SearchUtilsClass} from '../../searchPages/searchUtils/searchUtils.class';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
import {EnvProperties} from '../../utils/properties/env-properties';
|
||||
import {StringUtils} from '../../utils/string-utils.class';
|
||||
|
||||
export class FetchDataproviders {
|
||||
private errorCodes: ErrorCodes;
|
||||
private errorMessages: ErrorMessagesComponent;
|
||||
|
||||
public results =[];
|
||||
public searchUtils:SearchUtilsClass = new SearchUtilsClass();
|
||||
public sub: any; public subResults: any;
|
||||
public CSV: any = { "columnNames": [ "Title", "Type", "Coutries", "Compatibility" ],
|
||||
"export":[]
|
||||
};
|
||||
|
||||
public results = [];
|
||||
public searchUtils: SearchUtilsClass = new SearchUtilsClass();
|
||||
public sub: any;
|
||||
public subResults: any;
|
||||
public CSV: any = {
|
||||
"columnNames": ["Title", "Type", "Coutries", "Compatibility"],
|
||||
"export": []
|
||||
};
|
||||
public CSVDownloaded = false;
|
||||
public csvParams: string;
|
||||
public loadPaging: boolean = true;
|
||||
public oldTotalResults: number = 0;
|
||||
|
||||
constructor ( private _searchDataprovidersService: SearchDataprovidersService ) {
|
||||
|
||||
constructor(private _searchDataprovidersService: SearchDataprovidersService) {
|
||||
this.errorCodes = new ErrorCodes();
|
||||
this.errorMessages = new ErrorMessagesComponent();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
public ngOnDestroy() {
|
||||
if(this.sub){
|
||||
if (this.sub) {
|
||||
this.sub.unsubscribe();
|
||||
}
|
||||
if(this.subResults){
|
||||
if (this.subResults) {
|
||||
this.subResults.unsubscribe();
|
||||
}
|
||||
}
|
||||
|
||||
public getResultsByKeyword(keyword:string, page: number, size: number, properties:EnvProperties, customFilter:SearchCustomFilter=null){
|
||||
|
||||
public getResultsByKeyword(keyword: string, page: number, size: number, properties: EnvProperties, customFilter: SearchCustomFilter = null) {
|
||||
var parameters = "";
|
||||
if(keyword.length > 0){
|
||||
if (keyword.length > 0) {
|
||||
parameters = "q=" + StringUtils.URIEncode(keyword);
|
||||
}
|
||||
|
||||
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
|
||||
|
||||
var refineParams = null;
|
||||
if(customFilter){
|
||||
refineParams = (refineParams?(refineParams+'&'):'')+"&fq="+StringUtils.URIEncode(customFilter.queryFieldName + " exact " + StringUtils.quote((customFilter.valueId )));
|
||||
if (customFilter) {
|
||||
refineParams = (refineParams ? (refineParams + '&') : '') + "&fq=" + StringUtils.URIEncode(customFilter.queryFieldName + " exact " + StringUtils.quote((customFilter.valueId)));
|
||||
}
|
||||
this.subResults = this._searchDataprovidersService.searchDataproviders(parameters,refineParams, page, size,[], properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
//console.info("search Content Providers: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||
this.results = data[1];
|
||||
|
||||
//ar errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
},
|
||||
err => {
|
||||
/*console.log(err);
|
||||
//TODO check erros (service not available, bad request)
|
||||
// if( ){
|
||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||
// }
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
//this.searchUtils.status = errorCodes.ERROR;
|
||||
if(err.status == '404') {
|
||||
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||
} else if(err.status == '500') {
|
||||
this.searchUtils.status = this.errorCodes.ERROR;
|
||||
} else {
|
||||
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||
}
|
||||
*/
|
||||
this.handleError("Error getting content providers for keyword: "+keyword, err);
|
||||
this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
|
||||
this.subResults = this._searchDataprovidersService.searchDataproviders(parameters, refineParams, page, size, [], properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
//console.info("search Content Providers: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||
this.results = data[1];
|
||||
|
||||
//ar errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
if (this.searchUtils.totalResults == 0) {
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
},
|
||||
err => {
|
||||
/*console.log(err);
|
||||
//TODO check erros (service not available, bad request)
|
||||
// if( ){
|
||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||
// }
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
//this.searchUtils.status = errorCodes.ERROR;
|
||||
if(err.status == '404') {
|
||||
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||
} else if(err.status == '500') {
|
||||
this.searchUtils.status = this.errorCodes.ERROR;
|
||||
} else {
|
||||
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||
}
|
||||
*/
|
||||
this.handleError("Error getting content providers for keyword: " + keyword, err);
|
||||
this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public getResultsForHome(size: number, properties:EnvProperties){
|
||||
|
||||
public getResultsForHome(size: number, properties: EnvProperties) {
|
||||
let page = 1;
|
||||
var parameters = "&sortBy=resultdateofacceptance,descending";//"orderby=date";
|
||||
|
||||
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
|
||||
this.subResults = this._searchDataprovidersService.searchDataproviders(parameters,null, page, size,[], properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
//console.info("search Content Providers: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||
this.results = data[1];
|
||||
|
||||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
},
|
||||
err => {
|
||||
/*console.log(err);
|
||||
//TODO check erros (service not available, bad request)
|
||||
if(err.status == '404') {
|
||||
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||
} else if(err.status == '500') {
|
||||
this.searchUtils.status = this.errorCodes.ERROR;
|
||||
} else {
|
||||
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||
}*/
|
||||
this.handleError("Error getting content providers with parameters: "+parameters + " for Home", err);
|
||||
this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
|
||||
|
||||
this.subResults = this._searchDataprovidersService.searchDataproviders(parameters, null, page, size, [], properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
//console.info("search Content Providers: [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||
this.results = data[1];
|
||||
|
||||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
if (this.searchUtils.totalResults == 0) {
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public getNumForEntity(entity: string, id:string, properties:EnvProperties) {
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
|
||||
if(id != "" && entity != "") {
|
||||
|
||||
this._searchDataprovidersService.numOfEntityDataproviders(id, entity, properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data;
|
||||
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
},
|
||||
err => {
|
||||
/*console.log(err);
|
||||
//TODO check erros (service not available, bad request)
|
||||
// if( ){
|
||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||
// }
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
//this.searchUtils.status = errorCodes.ERROR;
|
||||
if(err.status == '404') {
|
||||
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||
} else if(err.status == '500') {
|
||||
this.searchUtils.status = this.errorCodes.ERROR;
|
||||
} else {
|
||||
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||
}*/
|
||||
this.handleError("Error getting content providers for "+entity+" with id: "+id, err);
|
||||
this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
|
||||
}
|
||||
);
|
||||
},
|
||||
err => {
|
||||
/*console.log(err);
|
||||
//TODO check erros (service not available, bad request)
|
||||
if(err.status == '404') {
|
||||
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||
} else if(err.status == '500') {
|
||||
this.searchUtils.status = this.errorCodes.ERROR;
|
||||
} else {
|
||||
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||
}*/
|
||||
this.handleError("Error getting content providers with parameters: " + parameters + " for Home", err);
|
||||
this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
|
||||
}
|
||||
}
|
||||
|
||||
public getNumForSearch(keyword: string, properties:EnvProperties, refineParams:string=null) {
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
|
||||
this._searchDataprovidersService.numOfSearchDataproviders(keyword, properties, refineParams).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data;
|
||||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
|
||||
if(this.searchUtils.totalResults == 0) {
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
},
|
||||
err => {
|
||||
/*console.log(err);
|
||||
//TODO check erros (service not available, bad request)
|
||||
// if( ){
|
||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||
// }
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
//this.searchUtils.status = errorCodes.ERROR;
|
||||
if(err.status == '404') {
|
||||
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||
} else if(err.status == '500') {
|
||||
this.searchUtils.status = this.errorCodes.ERROR;
|
||||
} else {
|
||||
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||
}*/
|
||||
this.handleError("Error getting number of content providers for keyword: "+keyword, err);
|
||||
this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public getResultsForDeposit(id:string, type:string, page: number, size: number, properties:EnvProperties){
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
this.loadPaging = false;
|
||||
|
||||
if(id != "") {
|
||||
|
||||
this._searchDataprovidersService.searchDataprovidersForDeposit(id,type, page, size, properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
//console.info("search Dataproviders forDeposit: [id:"+id+", type:"+type+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||
this.results = data[1];
|
||||
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
|
||||
if(this.searchUtils.status == this.errorCodes.DONE) {
|
||||
// Page out of limit!!!
|
||||
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
||||
if(!(Number.isInteger(totalPages))) {
|
||||
totalPages = (parseInt(totalPages, 10) + 1);
|
||||
}
|
||||
if(totalPages < page) {
|
||||
this.searchUtils.totalResults = 0;
|
||||
this.searchUtils.status = this.errorCodes.OUT_OF_BOUND;
|
||||
}
|
||||
}
|
||||
this.loadPaging = true;
|
||||
this.oldTotalResults = this.searchUtils.totalResults;
|
||||
},
|
||||
err => {
|
||||
/*console.log(err);
|
||||
//TODO check erros (service not available, bad request)
|
||||
// if( ){
|
||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||
// }
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
//this.searchUtils.status = errorCodes.ERROR;
|
||||
if(err.status == '404') {
|
||||
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||
} else if(err.status == '500') {
|
||||
this.searchUtils.status = this.errorCodes.ERROR;
|
||||
} else {
|
||||
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||
}*/
|
||||
this.handleError("Error getting content providers in share "+type+" for organization with id: "+id, err);
|
||||
this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
|
||||
|
||||
this.loadPaging = true;
|
||||
this.oldTotalResults = 0;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
public getResultsBySubjectsForDeposit(subject:string, type:string, page: number, size: number, properties:EnvProperties){
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
this.loadPaging = false;
|
||||
|
||||
this._searchDataprovidersService.searchDataProvidersBySubjects(subject,type, page, size, properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
//console.info("search Dataproviders forDeposit: [subject:"+subject+", type:"+type+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||
this.results = data[1];
|
||||
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
if(this.searchUtils.status == this.errorCodes.DONE) {
|
||||
// Page out of limit!!!
|
||||
let totalPages:any = this.searchUtils.totalResults/(this.searchUtils.size);
|
||||
if(!(Number.isInteger(totalPages))) {
|
||||
totalPages = (parseInt(totalPages, 10) + 1);
|
||||
}
|
||||
if(totalPages < page) {
|
||||
this.searchUtils.totalResults = 0;
|
||||
this.searchUtils.status = this.errorCodes.OUT_OF_BOUND;
|
||||
}
|
||||
}
|
||||
this.loadPaging = true;
|
||||
this.oldTotalResults = this.searchUtils.totalResults;
|
||||
},
|
||||
err => {
|
||||
/*console.log(err);
|
||||
//TODO check erros (service not available, bad request)
|
||||
// if( ){
|
||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||
// }
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
//this.searchUtils.status = errorCodes.ERROR;
|
||||
if(err.status == '404') {
|
||||
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||
} else if(err.status == '500') {
|
||||
this.searchUtils.status = this.errorCodes.ERROR;
|
||||
} else {
|
||||
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||
}*/
|
||||
this.handleError("Error getting content providers in share "+type+" by subject: "+subject, err);
|
||||
this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
|
||||
|
||||
this.loadPaging = true;
|
||||
this.oldTotalResults = 0;
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
public getResultsForEntity(entity:string, id:string, page: number, size: number, properties:EnvProperties){
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
|
||||
var parameters = "";
|
||||
|
||||
if(entity == "organization") {
|
||||
parameters = "organizations/"+id;
|
||||
}
|
||||
|
||||
if(parameters != "") {
|
||||
|
||||
this._searchDataprovidersService.searchDataprovidersForEntity(parameters, page, size, properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
//console.info("search Dataproviders for "+entity+": [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||
this.results = data[1];
|
||||
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
},
|
||||
err => {
|
||||
/*console.log(err);
|
||||
//TODO check erros (service not available, bad request)
|
||||
// if( ){
|
||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||
// }
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
//this.searchUtils.status = errorCodes.ERROR;
|
||||
if(err.status == '404') {
|
||||
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||
} else if(err.status == '500') {
|
||||
this.searchUtils.status = this.errorCodes.ERROR;
|
||||
} else {
|
||||
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||
}*/
|
||||
this.handleError("Error getting content providers for "+entity+" with id: "+id, err);
|
||||
this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public getResultsForDataproviders(id:string, page: number, size: number, properties:EnvProperties){
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
|
||||
this._searchDataprovidersService.getDataProvidersforEntityRegistry(id, page, size, properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
//console.info("search Dataproviders for Entity Registry: [Id:"+id+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||
this.results = data[1];
|
||||
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
},
|
||||
err => {
|
||||
/*console.log(err);
|
||||
//TODO check erros (service not available, bad request)
|
||||
// if( ){
|
||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||
// }
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
//this.searchUtils.status = errorCodes.ERROR;
|
||||
if(err.status == '404') {
|
||||
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||
} else if(err.status == '500') {
|
||||
this.searchUtils.status = this.errorCodes.ERROR;
|
||||
} else {
|
||||
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||
}*/
|
||||
this.handleError("Error getting content providers for entity registry with id: "+id, err);
|
||||
this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public getNumForEntity(entity: string, id: string, properties: EnvProperties) {
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
|
||||
if (id != "" && entity != "") {
|
||||
|
||||
this._searchDataprovidersService.numOfEntityDataproviders(id, entity, properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data;
|
||||
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
if (this.searchUtils.totalResults == 0) {
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
},
|
||||
err => {
|
||||
/*console.log(err);
|
||||
//TODO check erros (service not available, bad request)
|
||||
// if( ){
|
||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||
// }
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
//this.searchUtils.status = errorCodes.ERROR;
|
||||
if(err.status == '404') {
|
||||
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||
} else if(err.status == '500') {
|
||||
this.searchUtils.status = this.errorCodes.ERROR;
|
||||
} else {
|
||||
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||
}*/
|
||||
this.handleError("Error getting content providers for " + entity + " with id: " + id, err);
|
||||
this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public getNumForSearch(keyword: string, properties: EnvProperties, refineParams: string = null) {
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
|
||||
this._searchDataprovidersService.numOfSearchDataproviders(keyword, properties, refineParams).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data;
|
||||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
|
||||
if (this.searchUtils.totalResults == 0) {
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
},
|
||||
err => {
|
||||
/*console.log(err);
|
||||
//TODO check erros (service not available, bad request)
|
||||
// if( ){
|
||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||
// }
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
//this.searchUtils.status = errorCodes.ERROR;
|
||||
if(err.status == '404') {
|
||||
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||
} else if(err.status == '500') {
|
||||
this.searchUtils.status = this.errorCodes.ERROR;
|
||||
} else {
|
||||
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||
}*/
|
||||
this.handleError("Error getting number of content providers for keyword: " + keyword, err);
|
||||
this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
public getResultsForDeposit(id: string, type: string, page: number, size: number, properties: EnvProperties) {
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
this.loadPaging = false;
|
||||
|
||||
if (id != "") {
|
||||
|
||||
this._searchDataprovidersService.searchDataprovidersForDeposit(id, type, page, size, properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
//console.info("search Dataproviders forDeposit: [id:"+id+", type:"+type+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||
this.results = data[1];
|
||||
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
if (this.searchUtils.totalResults == 0) {
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
|
||||
if (this.searchUtils.status == this.errorCodes.DONE) {
|
||||
// Page out of limit!!!
|
||||
let totalPages: any = this.searchUtils.totalResults / (this.searchUtils.size);
|
||||
if (!(Number.isInteger(totalPages))) {
|
||||
totalPages = (parseInt(totalPages, 10) + 1);
|
||||
}
|
||||
if (totalPages < page) {
|
||||
this.searchUtils.totalResults = 0;
|
||||
this.searchUtils.status = this.errorCodes.OUT_OF_BOUND;
|
||||
}
|
||||
}
|
||||
this.loadPaging = true;
|
||||
this.oldTotalResults = this.searchUtils.totalResults;
|
||||
},
|
||||
err => {
|
||||
/*console.log(err);
|
||||
//TODO check erros (service not available, bad request)
|
||||
// if( ){
|
||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||
// }
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
//this.searchUtils.status = errorCodes.ERROR;
|
||||
if(err.status == '404') {
|
||||
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||
} else if(err.status == '500') {
|
||||
this.searchUtils.status = this.errorCodes.ERROR;
|
||||
} else {
|
||||
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||
}*/
|
||||
this.handleError("Error getting content providers in share " + type + " for organization with id: " + id, err);
|
||||
this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
|
||||
|
||||
this.loadPaging = true;
|
||||
this.oldTotalResults = 0;
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public getResultsBySubjectsForDeposit(subject: string, type: string, page: number, size: number, properties: EnvProperties) {
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
this.results = [];
|
||||
this.searchUtils.totalResults = 0;
|
||||
this.loadPaging = false;
|
||||
|
||||
this._searchDataprovidersService.searchDataProvidersBySubjects(subject, type, page, size, properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
//console.info("search Dataproviders forDeposit: [subject:"+subject+", type:"+type+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||
this.results = data[1];
|
||||
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
if (this.searchUtils.totalResults == 0) {
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
if (this.searchUtils.status == this.errorCodes.DONE) {
|
||||
// Page out of limit!!!
|
||||
let totalPages: any = this.searchUtils.totalResults / (this.searchUtils.size);
|
||||
if (!(Number.isInteger(totalPages))) {
|
||||
totalPages = (parseInt(totalPages, 10) + 1);
|
||||
}
|
||||
if (totalPages < page) {
|
||||
this.searchUtils.totalResults = 0;
|
||||
this.searchUtils.status = this.errorCodes.OUT_OF_BOUND;
|
||||
}
|
||||
}
|
||||
this.loadPaging = true;
|
||||
this.oldTotalResults = this.searchUtils.totalResults;
|
||||
},
|
||||
err => {
|
||||
/*console.log(err);
|
||||
//TODO check erros (service not available, bad request)
|
||||
// if( ){
|
||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||
// }
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
//this.searchUtils.status = errorCodes.ERROR;
|
||||
if(err.status == '404') {
|
||||
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||
} else if(err.status == '500') {
|
||||
this.searchUtils.status = this.errorCodes.ERROR;
|
||||
} else {
|
||||
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||
}*/
|
||||
this.handleError("Error getting content providers in share " + type + " by subject: " + subject, err);
|
||||
this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
|
||||
|
||||
this.loadPaging = true;
|
||||
this.oldTotalResults = 0;
|
||||
}
|
||||
);
|
||||
|
||||
}
|
||||
|
||||
public getResultsForEntity(entity: string, id: string, page: number, size: number, properties: EnvProperties) {
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
|
||||
var parameters = "";
|
||||
|
||||
if (entity == "organization") {
|
||||
parameters = "organizations/" + id;
|
||||
}
|
||||
|
||||
if (parameters != "") {
|
||||
|
||||
this._searchDataprovidersService.searchDataprovidersForEntity(parameters, page, size, properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
//console.info("search Dataproviders for "+entity+": [Parameters:"+parameters+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||
this.results = data[1];
|
||||
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
if (this.searchUtils.totalResults == 0) {
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
},
|
||||
err => {
|
||||
/*console.log(err);
|
||||
//TODO check erros (service not available, bad request)
|
||||
// if( ){
|
||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||
// }
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
//this.searchUtils.status = errorCodes.ERROR;
|
||||
if(err.status == '404') {
|
||||
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||
} else if(err.status == '500') {
|
||||
this.searchUtils.status = this.errorCodes.ERROR;
|
||||
} else {
|
||||
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||
}*/
|
||||
this.handleError("Error getting content providers for " + entity + " with id: " + id, err);
|
||||
this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public getResultsForDataproviders(id: string, page: number, size: number, properties: EnvProperties) {
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
|
||||
this._searchDataprovidersService.getDataProvidersforEntityRegistry(id, page, size, properties).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0];
|
||||
//console.info("search Dataproviders for Entity Registry: [Id:"+id+" ] [total results:"+this.searchUtils.totalResults+"]");
|
||||
this.results = data[1];
|
||||
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = this.errorCodes.DONE;
|
||||
if (this.searchUtils.totalResults == 0) {
|
||||
this.searchUtils.status = this.errorCodes.NONE;
|
||||
}
|
||||
},
|
||||
err => {
|
||||
/*console.log(err);
|
||||
//TODO check erros (service not available, bad request)
|
||||
// if( ){
|
||||
// this.searchUtils.status = ErrorCodes.ERROR;
|
||||
// }
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
//this.searchUtils.status = errorCodes.ERROR;
|
||||
if(err.status == '404') {
|
||||
this.searchUtils.status = this.errorCodes.NOT_FOUND;
|
||||
} else if(err.status == '500') {
|
||||
this.searchUtils.status = this.errorCodes.ERROR;
|
||||
} else {
|
||||
this.searchUtils.status = this.errorCodes.NOT_AVAILABLE;
|
||||
}*/
|
||||
this.handleError("Error getting content providers for entity registry with id: " + id, err);
|
||||
this.searchUtils.status = this.errorMessages.getErrorCode(err.status);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
private handleError(message: string, error) {
|
||||
console.error("Fetch Content Providers (class): "+message, error);
|
||||
console.error("Fetch Content Providers (class): " + message, error);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,11 +4,12 @@ import {ErrorMessagesComponent} from '../../utils/errorMessages.component';
|
|||
import {SearchCustomFilter, SearchUtilsClass} from '../../searchPages/searchUtils/searchUtils.class';
|
||||
import{EnvProperties} from '../../utils/properties/env-properties';
|
||||
import {StringUtils} from '../../utils/string-utils.class';
|
||||
import {SearchResult} from "../entities/searchResult";
|
||||
export class FetchProjects{
|
||||
private errorCodes: ErrorCodes;
|
||||
private errorMessages: ErrorMessagesComponent;
|
||||
|
||||
public results =[];
|
||||
public results: SearchResult[] =[];
|
||||
|
||||
public filters; // for getResultsForOrganizations
|
||||
public funders:any = []; // for getResultsForOrganizations // this is filled with the initial query - before filtering
|
||||
|
@ -179,7 +180,6 @@ export class FetchProjects{
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(filterquery == ""){
|
||||
this.searchUtils.totalResultsNoFilters = this.searchUtils.totalResults;
|
||||
this.funders = [];
|
||||
|
@ -187,7 +187,6 @@ export class FetchProjects{
|
|||
//console.log("this.filters[i].filterId:"+this.filters[i].filterId);
|
||||
if(this.filters[i].filterId == "funder"){
|
||||
this.funders = (this.filters[i].values);
|
||||
|
||||
}
|
||||
}
|
||||
//console.log(" this.funders:"+ this.funders);
|
||||
|
|
|
@ -183,11 +183,13 @@ export class FetchResearchResults {
|
|||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
|
||||
var parameters;
|
||||
if(resultsFrom == "collectedFrom") {
|
||||
parameters = this.getEntityName(resultType,true)+"?fq=collectedfromdatasourceid exact "+'"'+id+'"';
|
||||
} else if(resultsFrom == "hostedBy") {
|
||||
parameters = this.getEntityName(resultType,true)+"?fq=resulthostingdatasourceid exact "+'"'+id+'"';
|
||||
}
|
||||
// if(resultsFrom == "collectedFrom") {
|
||||
// parameters = this.getEntityName(resultType,true)+"?fq=collectedfromdatasourceid exact "+'"'+id+'"';
|
||||
// } else if(resultsFrom == "hostedBy") {
|
||||
// parameters = this.getEntityName(resultType,true)+"?fq=resulthostingdatasourceid exact "+'"'+id+'"';
|
||||
// }
|
||||
|
||||
parameters = this.getEntityName(resultType,true)+"?fq=collectedfromdatasourceid exact "+'"'+id+'"' + "or resulthostingdatasourceid exact "+'"'+id+'"';
|
||||
|
||||
if(parameters != "") {
|
||||
|
||||
|
@ -226,7 +228,8 @@ export class FetchResearchResults {
|
|||
public getAggregatorResults(resultType: string, id:string, page: number, size: number, properties:EnvProperties){
|
||||
this.searchUtils.status = this.errorCodes.LOADING;
|
||||
|
||||
this.subResults = this._searchResearchResultsService.searchAggregators(this.getEntityName(resultType,false), id, '&fq=collectedfromdatasourceid exact "'+id+'"',"&refine=true&fields=resulthostingdatasource" , page, size, properties).subscribe(
|
||||
// this.getEntityName(resultType,false)
|
||||
this.subResults = this._searchResearchResultsService.searchAggregators(resultType, id, '&fq=(collectedfromdatasourceid exact "'+id+'" or resulthostingdatasourceid exact "'+id+'")',"&refine=true&fields=resulthostingdatasource&type="+resultType , page, size, properties).subscribe(
|
||||
data => {
|
||||
this.results = data;
|
||||
this.searchUtils.totalResults = this.results.length;
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<div class="uk-h5 uk-margin-remove">
|
||||
|
||||
<a *ngIf="result.id && !(result.resultType == 'dataprovider' && result.compatibilityUNKNOWN) "
|
||||
(click)="onTitleClick()" [queryParams]="routerHelper.createQueryParam(urlParam,result.id)"
|
||||
(click)="onClick()" [queryParams]="routerHelper.createQueryParam(urlParam,result.id)"
|
||||
routerLink="/search/{{result.resultType}}" class="portal-link uk-width-expand">
|
||||
<div *ngIf="(result.title) || result.acronym">
|
||||
<span *ngIf="result.acronym">
|
||||
|
@ -90,7 +90,7 @@
|
|||
</div>
|
||||
<!-- Authors -->
|
||||
<div *ngIf="result.authors">
|
||||
<showAuthors [authors]="result.authors" [authorsLimit]=10 [showAll]=false></showAuthors>
|
||||
<showAuthors [authors]="result.authors" [authorsLimit]=10 [modal]="modal" [showAll]=false></showAuthors>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Funder -->
|
||||
|
|
|
@ -66,7 +66,7 @@ export class ResultPreviewComponent implements OnInit{
|
|||
}
|
||||
}
|
||||
|
||||
public onTitleClick() {
|
||||
public onClick() {
|
||||
if(this.modal) {
|
||||
this.modal.cancel();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue