Lazy Routing everywhere (including all tabs & navigating from one entity to another instance of the same entity) -> Problems in Dataprovider landing tabs | Hide unidentified projects from search and tab results when they are not main results (e.g. do not hide them in project tabs, but hide them in publication tabs)
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@46513 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
2de6b6e712
commit
f52ff453bd
|
@ -1,4 +1,4 @@
|
|||
import {Component, ViewChild} from '@angular/core';
|
||||
import {Component, ViewChild, ElementRef} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {DataProviderService} from './dataProvider.service';
|
||||
import {DataProviderInfo} from '../../utils/entities/dataProviderInfo';
|
||||
|
@ -14,12 +14,18 @@ import{TabsComponent} from './tabs.component';
|
|||
})
|
||||
|
||||
export class DataProviderComponent {
|
||||
constructor (private _dataproviderService: DataProviderService, private route: ActivatedRoute, private _meta: Meta) {
|
||||
this.updateTitle("Data provider");
|
||||
this.updateDescription("Data provider, search, repositories, open access");
|
||||
constructor (private element: ElementRef,
|
||||
private _dataproviderService: DataProviderService,
|
||||
private route: ActivatedRoute,
|
||||
private _meta: Meta) {
|
||||
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.sub = this.route.queryParams.subscribe(data => {
|
||||
this.updateTitle("Data provider");
|
||||
this.updateDescription("Data provider, search, repositories, open access");
|
||||
|
||||
this.datasourceId = data['datasourceId'];
|
||||
// console.info("Datasource id is :"+this.datasourceId);
|
||||
if(this.datasourceId){
|
||||
|
@ -28,6 +34,10 @@ export class DataProviderComponent {
|
|||
// console.info("Datasource id not found");
|
||||
}
|
||||
|
||||
if (typeof document !== 'undefined') {
|
||||
this.element.nativeElement.scrollIntoView();
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
|
||||
|
|
|
@ -66,6 +66,7 @@ export class DataProviderService {
|
|||
if(this.dataProviderInfo.tabs == undefined) {
|
||||
this.dataProviderInfo.tabs = new Array<{"name": string, "content": string}>();
|
||||
}
|
||||
|
||||
if(this.dataProviderInfo.tabsInTypes.publicationsTab.has(data[1].classid)) {
|
||||
this.dataProviderInfo.tabs.push({"name": "Publications", "content": "publicationsTab"});
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
|
||||
import { FetchPublications } from '../../utils/fetchEntitiesClasses/fetchPublications.class';
|
||||
import { FetchDatasets } from '../../utils/fetchEntitiesClasses/fetchDatasets.class';
|
||||
|
||||
import {OpenaireProperties} from '../../utils/properties/openaireProperties';
|
||||
import {RouterHelper} from '../../utils/routerHelper.class';
|
||||
|
@ -9,11 +10,11 @@ import {RouterHelper} from '../../utils/routerHelper.class';
|
|||
selector: 'relatedDatasourcesTab',
|
||||
template: `
|
||||
|
||||
<div *ngIf="fetchPublications.results.length == 0" class = "uk-alert">
|
||||
<div *ngIf="fetchResults.results.length == 0" class = "uk-alert">
|
||||
There are no related dataproviders
|
||||
</div>
|
||||
|
||||
<div *ngIf="fetchPublications.results.length > 0">
|
||||
<div *ngIf="fetchResults.results.length > 0">
|
||||
<p>
|
||||
The results below are discovered through our pilot algorithms.
|
||||
<a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
|
||||
|
@ -23,22 +24,22 @@ import {RouterHelper} from '../../utils/routerHelper.class';
|
|||
<thead>
|
||||
<tr>
|
||||
<th class="uk-text-center">Data Provider Name</th>
|
||||
<th class="uk-text-center">Number of publications/ datasets</th>
|
||||
<th class="uk-text-center">Number of {{type}}</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr *ngFor="let item of fetchPublications.results">
|
||||
<tr *ngFor="let item of fetchResults.results">
|
||||
<td class="uk-text-center">
|
||||
<!--a href="{{item.url}}"-->
|
||||
<!--a [queryParams]="{datasourceId: item.id}" routerLinkActive="router-link-active" routerLink="/search/dataprovider"-->
|
||||
<a href="{{searchLinkToDataProvider}}{{item.id}}">
|
||||
<a [queryParams]="{datasourceId: item.id}" routerLinkActive="router-link-active" routerLink="/search/dataprovider">
|
||||
<!--a href="{{searchLinkToDataProvider}}{{item.id}}"-->
|
||||
{{item.name}}
|
||||
</a>
|
||||
</td>
|
||||
<td class="uk-text-center">
|
||||
<!--a href="{{linkToSearchPublications}}{{item.id}}&ho=and&collectedFrom={{dataproviderId}}&co=and"-->
|
||||
<a [queryParams]="routerHelper.createQueryParams(['hostedBy', 'ho', 'collectedFrom', 'co'], [item.id, 'and', dataproviderId, 'and'])"
|
||||
routerLinkActive="router-link-active" [routerLink]="linkToSearchPublications">
|
||||
routerLinkActive="router-link-active" [routerLink]="linkToSearchResults">
|
||||
{{item.count}}
|
||||
</a>
|
||||
</td>
|
||||
|
@ -50,9 +51,10 @@ import {RouterHelper} from '../../utils/routerHelper.class';
|
|||
})
|
||||
|
||||
export class RelatedDatasourcesTabComponent {
|
||||
@Input() type: string;
|
||||
@Input() dataproviderId: string;
|
||||
@Input() fetchPublications : FetchPublications;
|
||||
public linkToSearchPublications: string = "";
|
||||
@Input() fetchResults : any;
|
||||
public linkToSearchResults: string = "";
|
||||
public searchLinkToDataProvider: string = "";
|
||||
public routerHelper:RouterHelper = new RouterHelper();
|
||||
|
||||
|
@ -63,7 +65,11 @@ export class RelatedDatasourcesTabComponent {
|
|||
|
||||
ngOnInit() {
|
||||
console.info("related datasources tab: init");
|
||||
this.linkToSearchPublications = OpenaireProperties.getLinkToAdvancedSearchPublications();//+"?&hostedBy=";//+ +"&ho=and&collectedFrom="+ +"&co=and";
|
||||
if(this.type == "publications") {
|
||||
this.linkToSearchResults = OpenaireProperties.getLinkToAdvancedSearchPublications();//+"?&hostedBy=";//+ +"&ho=and&collectedFrom="+ +"&co=and";
|
||||
} else {
|
||||
this.linkToSearchResults = OpenaireProperties.getLinkToAdvancedSearchDatasets();
|
||||
}
|
||||
this.searchLinkToDataProvider = OpenaireProperties.getsearchLinkToDataProvider();
|
||||
/*queryParams.push("hostedBy");
|
||||
queryParams.push("ho");
|
||||
|
|
|
@ -95,7 +95,8 @@ import {RouterHelper} from '../../utils/routerHelper.class';
|
|||
[organizations]="organizations">
|
||||
</organizationsTab>
|
||||
<relatedDatasourcesTab *ngIf="tabs[0].content=='relatedDatasourcesTab'"
|
||||
[fetchPublications]="fetchPublicationsAggregators">
|
||||
[fetchResults]="fetchResultsAggregators"
|
||||
[type]="relatedDataprovidersResultsType">
|
||||
</relatedDatasourcesTab>
|
||||
|
||||
<div *ngIf="tabs[0].content=='statisticsTab' && statsClicked">
|
||||
|
@ -185,7 +186,8 @@ import {RouterHelper} from '../../utils/routerHelper.class';
|
|||
</organizationsTab>
|
||||
<relatedDatasourcesTab *ngIf="i>0 && tab.content=='relatedDatasourcesTab'"
|
||||
[dataproviderId]="id"
|
||||
[fetchPublications]="fetchPublicationsAggregators">
|
||||
[fetchResults]="fetchResultsAggregators"
|
||||
[type]="relatedDataprovidersResultsType">
|
||||
</relatedDatasourcesTab>
|
||||
|
||||
<!--statisticsTab *ngIf="i>0 && tab.content=='statisticsTab'"
|
||||
|
@ -258,6 +260,8 @@ export class TabsComponent {
|
|||
|
||||
@Input() _dataproviderService;
|
||||
|
||||
public relatedDataprovidersResultsType: string;
|
||||
|
||||
public paramsForSearchLink = {};//: string = "";
|
||||
|
||||
public reloadPublications: boolean = true;
|
||||
|
@ -282,12 +286,14 @@ export class TabsComponent {
|
|||
public fetchDatasets: FetchDatasets;
|
||||
public fetchProjects: FetchProjects;
|
||||
public fetchDataproviders: FetchDataproviders;
|
||||
public fetchPublicationsAggregators: FetchPublications;
|
||||
public fetchResultsAggregators: any;
|
||||
|
||||
private nativeElement : Node;
|
||||
|
||||
public routerHelper:RouterHelper = new RouterHelper();
|
||||
|
||||
private sub: any;
|
||||
|
||||
constructor (private renderer : Renderer, private element : ElementRef,private route: ActivatedRoute,
|
||||
private _searchPublicationsService: SearchPublicationsService,
|
||||
private _searchDatasetsService: SearchDatasetsService,
|
||||
|
@ -297,11 +303,10 @@ export class TabsComponent {
|
|||
this.fetchDatasets = new FetchDatasets(this._searchDatasetsService);
|
||||
this.fetchProjects = new FetchProjects(this._searchProjectsService);
|
||||
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
|
||||
this.fetchPublicationsAggregators = new FetchPublications(this._searchPublicationsService);
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.sub = this.route.queryParams.subscribe(data => {
|
||||
if(this.tabs != undefined && this.tabs.length > 0) {
|
||||
this.reloadPublications = true;
|
||||
this.reloadDatasets = true;
|
||||
|
@ -323,6 +328,16 @@ export class TabsComponent {
|
|||
this.dataProjectsUrl ='https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"dtsrcProjData","dtsrcName":"'+this.id+'", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "bar", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Datasets"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=600&h=250';
|
||||
this.pubsProjectsUrl ='https://beta.openaire.eu/stats/chart.php?com=query&persistent=false&data={"query":"dtsrcProjPubs","dtsrcName":"'+this.id+'", "table": "result", "fields": [{"fld": "number", "agg": "count", "type": "bar", "yaxis":1, "c":false}], "xaxis":{"name": "result_classifications-type", "agg": "avg"}, "group": "", "color": "", "type": "chart", "size":30, "sort": "xaxis", "xStyle":{"r": "-", "s": "-", "l": "-", "ft": "-", "wt": "-"}, "yaxisheaders": [""], "fieldsheaders": ["Publications"], "in": [], "filters": [{"name": "result_datasources-datasource-name", "values": [""], "to": "-1"}], "having": [], "incfilters": [], "inchaving": [], "title": "", "subtitle": "", "xaxistitle": ""}&w=600&h=250';
|
||||
|
||||
//if({"name": "Publications", "content": "publicationsTab"} in this.tabs) {
|
||||
if(this.tabs.some(function (tab) {
|
||||
return tab.name === 'Publications';
|
||||
})) {
|
||||
this.relatedDataprovidersResultsType = 'publications';
|
||||
this.fetchResultsAggregators = new FetchPublications(this._searchPublicationsService);
|
||||
} else {
|
||||
this.relatedDataprovidersResultsType = 'datasets';
|
||||
this.fetchResultsAggregators = new FetchDatasets(this._searchDatasetsService);
|
||||
}
|
||||
}
|
||||
|
||||
if(this.resultsBy == "collectedFrom") {
|
||||
|
@ -332,6 +347,11 @@ export class TabsComponent {
|
|||
//this.paramsForSearchLink = "?hostedBy="+this.id+"&ho=and";
|
||||
this.paramsForSearchLink = this.routerHelper.createQueryParams(['hostedBy', 'ho'], [this.id, 'and']);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
//this.sub.unsubscribe();
|
||||
}
|
||||
|
||||
// ngOnChanges() {
|
||||
|
@ -418,7 +438,10 @@ export class TabsComponent {
|
|||
}
|
||||
|
||||
private searchPublications(page: number, size: number) {
|
||||
console.info("Search publications???");
|
||||
if(this.reloadPublications) {
|
||||
console.info("Search publications!");
|
||||
|
||||
this.fetchPublications.getResultsForDataproviders(this.id, this.resultsBy, page, size);
|
||||
}
|
||||
this.reloadPublications = false;
|
||||
|
@ -466,14 +489,14 @@ export class TabsComponent {
|
|||
|
||||
private searchRelatedDatasources(page: number, size: number) {
|
||||
if(this.reloadRelatedDatasources) {
|
||||
this.fetchPublicationsAggregators.getAggregatorResults(this.id, page, size);
|
||||
console.info("my id is: "+this.id);
|
||||
this.fetchResultsAggregators.getAggregatorResults(this.id, page, size);
|
||||
}
|
||||
this.reloadRelatedDatasources = false;
|
||||
}
|
||||
|
||||
private countRelatedDatasources(page: number, size: number) {
|
||||
//fetchPublicationsAggregator
|
||||
this.fetchPublicationsAggregators.getAggregatorResults(this.id, page, size);
|
||||
this.fetchResultsAggregators.getAggregatorResults(this.id, page, size);
|
||||
}
|
||||
|
||||
public metricsResults($event) {
|
||||
|
|
|
@ -82,7 +82,7 @@
|
|||
<a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
|
||||
</p>
|
||||
|
||||
<tabTable from="dataset" [info]="datasetInfo.relatedResearchResults.get(provenanceaction)"></tabTable>
|
||||
<tabTable [info]="datasetInfo.relatedResearchResults.get(provenanceaction)"></tabTable>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
@ -97,7 +97,7 @@
|
|||
<a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
|
||||
</p>
|
||||
|
||||
<tabTable from="dataset" [info]="datasetInfo.similarResearchResults"></tabTable>
|
||||
<tabTable [info]="datasetInfo.similarResearchResults"></tabTable>
|
||||
</div>
|
||||
</li>
|
||||
<li class="uk-animation-fade">
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {Component, ViewChild} from '@angular/core';
|
||||
import {Component, ViewChild, ElementRef} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {DatasetService} from './dataset.service';
|
||||
import {DatasetInfo} from '../../utils/entities/datasetInfo';
|
||||
|
@ -39,25 +39,36 @@ export class DatasetComponent {
|
|||
public errorMessage = "";
|
||||
public routerHelper:RouterHelper = new RouterHelper();
|
||||
|
||||
constructor (private _datasetService: DatasetService, private route: ActivatedRoute, private _meta: Meta) {}
|
||||
constructor (private element: ElementRef,
|
||||
private _datasetService: DatasetService,
|
||||
private route: ActivatedRoute,
|
||||
private _meta: Meta) {}
|
||||
|
||||
ngOnInit() {
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
this.datasetId = params['datasetId'];
|
||||
console.info("Id is :"+this.datasetId);
|
||||
this.datasetInfo = null;
|
||||
this.updateTitle("Dataset");
|
||||
this.updateDescription("Dataset, search, open access");
|
||||
|
||||
this.datasetId = params['datasetId'];
|
||||
console.info("Id is :"+this.datasetId);
|
||||
|
||||
if(this.datasetId){
|
||||
this.getDatasetInfo(this.datasetId);
|
||||
}else{
|
||||
this.warningMessage="No valid dataset id";
|
||||
}
|
||||
});
|
||||
|
||||
this.metricsClicked = false;
|
||||
//this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resOpenAIRETimeline", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"OpenAIRE","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]},{"query":"resRepoTimeline", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":[""],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column","column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
|
||||
this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resViewsTimeline", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
this.downloadsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resRepoDownloadTimeline", "resTitle":"'+this.datasetId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
|
||||
|
||||
if (typeof document !== 'undefined') {
|
||||
this.element.nativeElement.scrollIntoView();
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
|
|
|
@ -58,7 +58,7 @@
|
|||
|
||||
<ul id="tab-content" class="uk-switcher uk-margin custom-tab-content">
|
||||
<li class="uk-animation-fade">
|
||||
<searchingProjectsTab [organizationId]=organizationId ></searchingProjectsTab>
|
||||
<searchingProjectsTab></searchingProjectsTab>
|
||||
<!--div *ngIf="organizationInfo.projects == undefined" class = "uk-alert">
|
||||
There are no projects
|
||||
</div>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {Component, ViewChild} from '@angular/core';
|
||||
import {Component, ViewChild, ElementRef} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {ActivatedRoute} from '@angular/router';
|
||||
|
||||
|
@ -56,14 +56,14 @@ export class OrganizationComponent {
|
|||
private funderId: string;
|
||||
private count: number;
|
||||
|
||||
constructor (private _organizationService: OrganizationService,
|
||||
constructor (private element: ElementRef,
|
||||
private _organizationService: OrganizationService,
|
||||
private route: ActivatedRoute,
|
||||
private _searchDataprovidersService: SearchDataprovidersService,
|
||||
private _reportsService: ReportsService,
|
||||
private _searchPublicationsService: SearchPublicationsService,
|
||||
private _searchProjectsService: SearchProjectsService, private _meta: Meta) {
|
||||
this.updateTitle("Organization");
|
||||
this.updateDescription("Organization, country, projects, search, repositories, open access");
|
||||
|
||||
console.info('organization constructor');
|
||||
this.fetchDataproviders = new FetchDataproviders(this._searchDataprovidersService);
|
||||
}
|
||||
|
@ -71,18 +71,29 @@ export class OrganizationComponent {
|
|||
ngOnInit() {
|
||||
console.info('organization init');
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
this.organizationInfo=null;
|
||||
this.updateTitle("Organization");
|
||||
this.updateDescription("Organization, country, projects, search, repositories, open access");
|
||||
|
||||
this.organizationId = params['organizationId'];
|
||||
console.info("Id is :"+this.organizationId);
|
||||
|
||||
if(this.organizationId){
|
||||
this.getOrganizationInfo();
|
||||
}else{
|
||||
this.warningMessage="No valid organization id";
|
||||
}
|
||||
|
||||
if (typeof document !== 'undefined') {
|
||||
this.element.nativeElement.scrollIntoView();
|
||||
}
|
||||
|
||||
this.csvParamsTail = '" and relorganizationid exact "'+this.organizationId+'" ))';
|
||||
|
||||
});
|
||||
|
||||
this.downloadURLAPI = OpenaireProperties.getCsvAPIURL();
|
||||
this.csvProjectParamsHead = 'format=csv&type=projects&page=0&query=( (oaftype exact project)and (funderid exact "';
|
||||
this.csvParamsTail = '" and relorganizationid exact "'+this.organizationId+'" ))';
|
||||
//this.csvPublicationParamsHead = 'format=csv-special&type=publications&page=0&query=((((oaftype exact result) and (resulttypeid exact publication)) and (funderid exact ';
|
||||
/*
|
||||
this.subDataprovidersCount = this.route.queryParams.subscribe(params => {
|
||||
|
@ -97,7 +108,6 @@ export class OrganizationComponent {
|
|||
);
|
||||
})
|
||||
*/
|
||||
this.fetchDataproviders.getNumForEntity("organization", this.organizationId);
|
||||
}
|
||||
|
||||
|
||||
|
@ -122,7 +132,11 @@ export class OrganizationComponent {
|
|||
this.organizationInfo = data;
|
||||
this.updateTitle(this.organizationInfo.title.name);
|
||||
this.updateDescription("Organization, country, projects, search, repositories, open access"+this.organizationInfo.title.name);
|
||||
let projectsNum = 0;
|
||||
|
||||
this.fetchDataproviders.getNumForEntity("organization", this.organizationId);
|
||||
|
||||
/*let projectsNum = 0;
|
||||
|
||||
if(this.organizationInfo.projects != undefined) {
|
||||
this.fundersSet = new Set<string>();
|
||||
this.organizationInfo.projects.forEach(function (value, key, map) {
|
||||
|
@ -130,7 +144,8 @@ export class OrganizationComponent {
|
|||
this.fundersSet.add(key);
|
||||
}.bind(this));
|
||||
}
|
||||
this.projectsNum = projectsNum;
|
||||
|
||||
this.projectsNum = projectsNum;*/
|
||||
}
|
||||
},
|
||||
err => {
|
||||
|
|
|
@ -48,15 +48,13 @@
|
|||
</p>
|
||||
|
||||
<div class = "uk-text-right" *ngIf = "fetchPublications.searchUtils.totalResults > 10" >
|
||||
<!--a [href] = "linkToSearchPublications"-->
|
||||
<a [queryParams]="{personId: personId, pe: 'and'}" routerLinkActive="router-link-active" [routerLink]="linkToSearchPublications">
|
||||
View all {{fetchPublications.searchUtils.totalResults}} results
|
||||
</a>
|
||||
</div>
|
||||
<tab-result [(results)]="fetchPublications.results"
|
||||
[(status)]= "fetchPublications.searchUtils.status"
|
||||
type="publication" urlParam="articleId"
|
||||
from="person">
|
||||
type="publication" urlParam="articleId">
|
||||
</tab-result>
|
||||
</div>
|
||||
</li>
|
||||
|
@ -73,15 +71,13 @@
|
|||
</p>
|
||||
|
||||
<div class = "uk-text-right" *ngIf = "fetchDatasets.searchUtils.totalResults > 10" >
|
||||
<!--a [href] = "linkToSearchDatasets"-->
|
||||
<a [queryParams]="{personId: personId, pe: 'and'}" routerLinkActive="router-link-active" [routerLink]="linkToSearchDatasets">
|
||||
View all {{fetchDatasets.searchUtils.totalResults}} results
|
||||
</a>
|
||||
</div>
|
||||
<tab-result [(results)]="fetchDatasets.results"
|
||||
[(status)]= "fetchDatasets.status"
|
||||
type="dataset" urlParam="datasetId"
|
||||
from="person">
|
||||
type="dataset" urlParam="datasetId">
|
||||
</tab-result>
|
||||
</div>
|
||||
</li>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {Component} from '@angular/core';
|
||||
import {Component, ElementRef} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import { ActivatedRoute } from '@angular/router';
|
||||
import {PersonService} from './person.service';
|
||||
|
@ -33,12 +33,11 @@ export class PersonComponent {
|
|||
public warningMessage = "";
|
||||
public errorMessage = "";
|
||||
|
||||
constructor (private _personService: PersonService,
|
||||
constructor (private element: ElementRef,
|
||||
private _personService: PersonService,
|
||||
private route: ActivatedRoute,
|
||||
private _searchPublicationsService: SearchPublicationsService,
|
||||
private _searchDatasetsService: SearchDatasetsService, private _meta: Meta) {
|
||||
this.updateTitle("Person");
|
||||
this.updateDescription("person, publication, research data, search, open access");
|
||||
|
||||
console.info('person constructor');
|
||||
this.fetchPublications = new FetchPublications( this._searchPublicationsService);
|
||||
|
@ -48,8 +47,13 @@ export class PersonComponent {
|
|||
ngOnInit() {
|
||||
console.info('person init');
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
this.personInfo = null;
|
||||
this.updateTitle("Person");
|
||||
this.updateDescription("person, publication, research data, search, open access");
|
||||
|
||||
this.personId = params['personId'];
|
||||
console.info("Id is :"+this.personId);
|
||||
|
||||
if(this.personId){
|
||||
this.fetchPersonInfo();
|
||||
this.searchPublications();
|
||||
|
@ -58,10 +62,13 @@ export class PersonComponent {
|
|||
this.warningMessage="No valid person id";
|
||||
}
|
||||
|
||||
if (typeof document !== 'undefined') {
|
||||
this.element.nativeElement.scrollIntoView();
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
this.subDatasetsCount = this.route.queryParams.subscribe(params => {
|
||||
/*this.subDatasetsCount = this.route.queryParams.subscribe(params => {
|
||||
this._searchDatasetsService.numOfEntityDatasets(this.personId, "people/").subscribe(
|
||||
data => {
|
||||
this.fetchDatasets.searchUtils.totalResults = data;
|
||||
|
@ -70,7 +77,7 @@ export class PersonComponent {
|
|||
console.log(err);
|
||||
}
|
||||
);
|
||||
})
|
||||
})*/
|
||||
}
|
||||
|
||||
private searchDatasetsInit() {
|
||||
|
@ -96,13 +103,21 @@ export class PersonComponent {
|
|||
|
||||
this.warningMessage = '';
|
||||
this.errorMessage=""
|
||||
console.info("do request");
|
||||
|
||||
this._personService.getPersonInfo(this.personId).subscribe(
|
||||
data => {
|
||||
this.personInfo = data;
|
||||
this.updateTitle(this.personInfo.fullname);
|
||||
this.updateDescription("person, publication, research data, search, open access, "+this.personInfo.fullname);
|
||||
|
||||
this._searchDatasetsService.numOfEntityDatasets(this.personId, "people/").subscribe(
|
||||
data => {
|
||||
this.fetchDatasets.searchUtils.totalResults = data;
|
||||
},
|
||||
err => {
|
||||
console.log(err);
|
||||
}
|
||||
);
|
||||
},
|
||||
err => {
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {Component, ViewChild} from '@angular/core';
|
||||
import {Component, ViewChild, ElementRef} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {ActivatedRoute, Params} from '@angular/router';
|
||||
import {ProjectService} from './project.service';
|
||||
|
@ -60,25 +60,26 @@ export class ProjectComponent{
|
|||
|
||||
@ViewChild (ModalLoading) loading : ModalLoading ;
|
||||
|
||||
constructor (private _projectService: ProjectService,
|
||||
constructor ( private element: ElementRef,
|
||||
private _projectService: ProjectService,
|
||||
private route: ActivatedRoute,
|
||||
private _searchPublicationsService: SearchPublicationsService,
|
||||
private _searchDatasetsService: SearchDatasetsService,
|
||||
private _reportsService: ReportsService, private _meta: Meta) {
|
||||
console.info('project constructor.');
|
||||
|
||||
this.fetchPublications = new FetchPublications( this._searchPublicationsService);
|
||||
this.fetchDatasets = new FetchDatasets(this._searchDatasetsService);
|
||||
this.updateTitle("Project");
|
||||
this.updateDescription("project, funding, open access, publications, datasets, ");
|
||||
}
|
||||
|
||||
ngOnInit() {
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
|
||||
this.metricsClicked = false;
|
||||
this.statsClicked = false;
|
||||
|
||||
this.fetchPublications = new FetchPublications( this._searchPublicationsService);
|
||||
this.fetchDatasets = new FetchDatasets(this._searchDatasetsService);
|
||||
|
||||
this.updateTitle("Project");
|
||||
this.updateDescription("project, funding, open access, publications, datasets, ");
|
||||
|
||||
this.projectId = params['projectId'];
|
||||
console.info("Id is :"+this.projectId);
|
||||
if(this.projectId){
|
||||
|
@ -123,6 +124,9 @@ export class ProjectComponent{
|
|||
this.createClipboard();
|
||||
this.csvParams = "format=csv-special&page=0&type=publications&query=(((oaftype exact result) and (resulttypeid exact publication)) and (relprojectid exact "+this.projectId+"))&size=";
|
||||
|
||||
if (typeof document !== 'undefined') {
|
||||
this.element.nativeElement.scrollIntoView();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -174,7 +174,7 @@
|
|||
<a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
|
||||
</p>
|
||||
|
||||
<tabTable from="publication" [info]="publicationInfo.relatedResearchResults.get(provenanceaction)"></tabTable>
|
||||
<tabTable [info]="publicationInfo.relatedResearchResults.get(provenanceaction)"></tabTable>
|
||||
</div>
|
||||
</div>
|
||||
</li>
|
||||
|
@ -190,7 +190,7 @@
|
|||
<a href="mailto:feedback@openaire.eu">Let us know how we are doing!</a>
|
||||
</p>
|
||||
|
||||
<tabTable from="publication" [info]="publicationInfo.similarResearchResults"></tabTable>
|
||||
<tabTable [info]="publicationInfo.similarResearchResults"></tabTable>
|
||||
</div>
|
||||
</li>
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import {Component, ViewChild} from '@angular/core';
|
||||
import {Component, ViewChild, ElementRef} from '@angular/core';
|
||||
import {Observable} from 'rxjs/Observable';
|
||||
import {PublicationService} from './publication.service';
|
||||
import {PublicationInfo} from '../../utils/entities/publicationInfo';
|
||||
|
@ -48,16 +48,19 @@ export class PublicationComponent {
|
|||
public errorMessage = "";
|
||||
public routerHelper:RouterHelper = new RouterHelper();
|
||||
|
||||
constructor (private _publicationService: PublicationService,
|
||||
constructor ( private element: ElementRef,
|
||||
private _publicationService: PublicationService,
|
||||
private route: ActivatedRoute, private _meta: Meta) { }
|
||||
|
||||
ngOnInit() {
|
||||
this.sub = this.route.queryParams.subscribe(data => {
|
||||
this.publicationInfo = null;
|
||||
this.updateTitle("Publication");
|
||||
this.updateDescription("Publication, open access, collected from");
|
||||
|
||||
this.articleId = data['articleId'];
|
||||
console.info("Article id is :"+this.articleId);
|
||||
this.updateTitle("Publication");
|
||||
this.updateDescription("Publication, open access, collected from");
|
||||
|
||||
if(this.articleId){
|
||||
|
||||
this.getPublicationInfo(this.articleId);
|
||||
|
@ -65,13 +68,16 @@ export class PublicationComponent {
|
|||
// switcher(UIkit);
|
||||
// }
|
||||
}else{
|
||||
console.info("Article id not found");
|
||||
this.warningMessage="No valid publication id";
|
||||
}
|
||||
this.metricsClicked = false;
|
||||
//this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resOpenAIRETimeline", "resTitle":"'+this.articleId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":"","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"OpenAIRE","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]},{"query":"resRepoTimeline", "resTitle":"'+this.articleId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":[""],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column","column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
|
||||
this.viewsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resViewsTimeline", "resTitle":"'+this.articleId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly views"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(124, 181, 236, 1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true&persistent=false';
|
||||
this.downloadsFrameUrl = OpenaireProperties.getFramesAPIURL()+'merge.php?com=query&data=[{"query":"resRepoDownloadTimeline", "resTitle":"'+this.articleId+'", "table":"","fields":[{"fld":"sum","agg":"sum","type":"column","yaxis":1,"c":false}],"xaxis":{"name":"month","agg":"sum"},"group":" ","color":"","type":"chart","size":30,"sort":"xaxis","xStyle":{"r":-30,"s":"0","l":"-","ft":"-","wt":"-"},"title":"","subtitle":"","xaxistitle":"Repository","yaxisheaders":["Monthly downloads"],"generalxaxis":"","theme":0,"in":[],"filters":[{"name":"","values":[""],"to":"-1"}]}]&info_types=["column"]&stacking=normal&steps=false&fontFamily=Courier&spacing=[5,0,0,0]&style=[{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"rgba(0, 0, 0, 1)","size":"18"},{"color":"000000","size":""},{"color":"000000","size":""}]&backgroundColor=rgba(255,255,255,1)&colors[]=rgba(67, 67, 72, 1)&colors[]=rgba(144, 237, 125, 1)&colors[]=rgba(247, 163, 92, 1)&colors[]=rgba(128, 133, 233, 1)&colors[]=rgba(241, 92, 128, 1)&colors[]=rgba(228, 211, 84, 1)&colors[]=rgba(43, 144, 143, 1)&colors[]=rgba(244, 91, 91, 1)&colors[]=rgba(145, 232, 225, 1)&xlinew=0&ylinew=1&legends=true&tooltips=true';
|
||||
|
||||
if (typeof document !== 'undefined') {
|
||||
this.element.nativeElement.scrollIntoView();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
@ -92,6 +98,7 @@ export class PublicationComponent {
|
|||
// this.result = {id: id, type :"dataset", source : "openaire", title: this.publicationInfo.title,url: '', result: '', accessRights: this.publicationInfo.bestlicense, embargoEndDate: ''};
|
||||
this.updateTitle(this.publicationInfo.title.name);
|
||||
this.updateDescription("Dataset, search, repositories, open access,"+this.publicationInfo.title.name);
|
||||
|
||||
let bioentitiesNum = 0;
|
||||
if(this.publicationInfo.bioentities != undefined) {
|
||||
this.publicationInfo.bioentities.forEach(function (value, key, map) {
|
||||
|
@ -146,7 +153,7 @@ export class PublicationComponent {
|
|||
if(item.title) {
|
||||
tooltipContent += "<h4>"+item.title+"</h4>";
|
||||
}
|
||||
if(item.code && item.code != "unidentified") {
|
||||
if(item.code) {
|
||||
tooltipContent += "Project Code: "+item.code;
|
||||
}
|
||||
if(item.funderName || item.funderShortname) {
|
||||
|
@ -166,7 +173,7 @@ export class PublicationComponent {
|
|||
tooltipContent += "<div>Funding: "+ item.funding + "</div>";
|
||||
}
|
||||
|
||||
if(tooltipContent != "") {
|
||||
if(tooltipContent) {
|
||||
tooltipContent = "<div>" + tooltipContent + "</div>";
|
||||
}
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import {Component} from '@angular/core';
|
||||
import {ActivatedRoute} from '@angular/router';
|
||||
|
||||
import { FetchProjects } from '../utils/fetchEntitiesClasses/fetchProjects.class';
|
||||
import { SearchProjectsService } from '../services/searchProjects.service';
|
||||
|
@ -54,25 +55,36 @@ import {RouterHelper} from '../utils/routerHelper.class';
|
|||
|
||||
export class SearchingProjectsTabComponent {
|
||||
public fetchProjects : FetchProjects;
|
||||
@Input() organizationId:string = "";
|
||||
public organizationId:string = "";
|
||||
public page :number = 1;
|
||||
public size :number = 10;
|
||||
public linkToSearchProjects;
|
||||
private filterQuery:string = "";
|
||||
private sub: any;
|
||||
|
||||
public routerHelper:RouterHelper = new RouterHelper();
|
||||
|
||||
constructor (private _searchProjectsService: SearchProjectsService) {
|
||||
this.fetchProjects = new FetchProjects(this._searchProjectsService);
|
||||
|
||||
constructor (private route: ActivatedRoute,
|
||||
private _searchProjectsService: SearchProjectsService) {
|
||||
}
|
||||
|
||||
|
||||
ngOnInit() {
|
||||
this.sub = this.route.queryParams.subscribe(params => {
|
||||
this.organizationId = params['organizationId'];
|
||||
|
||||
if(this.organizationId) {
|
||||
this.fetchProjects = new FetchProjects(this._searchProjectsService);
|
||||
|
||||
this.linkToSearchProjects = OpenaireProperties.getLinkToAdvancedSearchProjects();//+"?organization="+this.organizationId+"or=and";;
|
||||
this.search(true,"");
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
ngOnDestroy() {
|
||||
this.sub.unsubscribe();
|
||||
}
|
||||
|
||||
search(refine:boolean, filterQuery:string){
|
||||
var refineFields:string [] = ["funderid"];
|
||||
|
|
|
@ -19,17 +19,12 @@ import {OpenaireProperties} from '../utils/properties/openaireProperties';
|
|||
|
||||
</span>
|
||||
<!--a *ngIf="item['url'] != '' && item['name'] != ''" href="{{item['url']}}"-->
|
||||
<a *ngIf="item['id'] != '' && item['name'] != '' && item['class'] == 'dataset' && from == 'publication'"
|
||||
<a *ngIf="item['id'] != '' && item['name'] != '' && item['class'] == 'dataset'"
|
||||
[queryParams]="{datasetId: item.id}" routerLinkActive="router-link-active" routerLink="/search/dataset">
|
||||
{{item['name']}}
|
||||
</a>
|
||||
|
||||
<a *ngIf="item['id'] != '' && item['name'] != '' && item['class'] == 'dataset' && from == 'dataset'"
|
||||
href="{{searchLinkToDataset}}{{item['id']}}">
|
||||
{{item['name']}}
|
||||
</a>
|
||||
|
||||
<a *ngIf="item['id'] != '' && item['name'] != '' && item['class'] == 'publication' && from == 'dataset'"
|
||||
<a *ngIf="item['id'] != '' && item['name'] != '' && item['class'] == 'publication'"
|
||||
[queryParams]="{articleId: item.id}" routerLinkActive="router-link-active" routerLink="/search/publication">
|
||||
<!--a *ngIf="item['url'] != '' && item['name'] != '' && item['class'] == 'publication'"
|
||||
href="http://astero.di.uoa.gr:3000/search/publication?articleId={{item['id']}}"-->
|
||||
|
@ -37,11 +32,6 @@ import {OpenaireProperties} from '../utils/properties/openaireProperties';
|
|||
{{item['name']}}
|
||||
</a>
|
||||
|
||||
<a *ngIf="item['id'] != '' && item['name'] != '' && item['class'] == 'publication' && from == 'publication'"
|
||||
href="{{searchLinkToPublication}}{{item['id']}}">
|
||||
{{item['name']}}
|
||||
</a>
|
||||
|
||||
<p *ngIf="item['id'] == '' && item['name'] != ''">{{item['name']}}</p>
|
||||
<span *ngIf="item['date'] != ''">
|
||||
({{item['date']}})
|
||||
|
@ -66,7 +56,6 @@ import {OpenaireProperties} from '../utils/properties/openaireProperties';
|
|||
})
|
||||
|
||||
export class TabTableComponent {
|
||||
@Input() from: string = "publication";
|
||||
@Input() info: { "name": string, "url": string, "date": string, "trust": string}[];//Map<string, string[]>;
|
||||
|
||||
public routerHelper:RouterHelper = new RouterHelper();
|
||||
|
|
|
@ -50,14 +50,13 @@ import {RouterHelper} from '../../utils/routerHelper.class';
|
|||
<span> Projects: </span>
|
||||
<span *ngFor="let project of result['projects'].slice(0,15) let i=index">
|
||||
<!--a *ngIf="project.url != undefined" href="{{project.url}}"-->
|
||||
<span>
|
||||
<a *ngIf="project.id != undefined" [queryParams]="{projectId: project.id}" routerLinkActive="router-link-active" routerLink="/search/project">
|
||||
<a *ngIf="project.id" [queryParams]="{projectId: project.id}" routerLinkActive="router-link-active" routerLink="/search/project">
|
||||
{{project['funderShortname']?project['funderShortname']:project['funderName']}}
|
||||
| {{ project['acronym']?project['acronym']:project['title']}} ({{project.code}})</a><p
|
||||
| {{ project['acronym']?project['acronym']:project['title']}} ({{project.code}})</a><span
|
||||
|
||||
*ngIf="project.id == undefined">
|
||||
{{project['funderShortname']?project['funderShortname']:project['funderName']}}
|
||||
| {{ project['acronym']?project['acronym']:project['title']}} ({{project.code}})</p></span><span
|
||||
*ngIf="!project.id">{{project['funderShortname']?project['funderShortname']:project['funderName']}}<span
|
||||
*ngIf="project['acronym'] || project['title']"> | {{ project['acronym']?project['acronym']:project['title']}}</span><span
|
||||
*ngIf="project.code">({{project.code}})</span></span><span
|
||||
|
||||
*ngIf="i < result['projects'].length-1">,</span>
|
||||
</span>
|
||||
|
@ -88,10 +87,10 @@ import {RouterHelper} from '../../utils/routerHelper.class';
|
|||
<span> Organizations: </span>
|
||||
<span *ngFor="let organization of result['organizations'] let i=index">
|
||||
<!--a *ngIf="organization.url != undefined" href="{{organization.url}}"-->
|
||||
<a *ngIf="organization.id != undefined" [queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active" routerLink="/search/organization">
|
||||
<a *ngIf="organization.id" [queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active" routerLink="/search/organization">
|
||||
{{organization.name}}</a><span
|
||||
|
||||
*ngIf="organization.id == undefined">
|
||||
*ngIf="!organization.id">
|
||||
{{organization.name}}</span><span
|
||||
|
||||
*ngIf="i < result['organizations'].length-1">,</span>
|
||||
|
@ -120,7 +119,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
|
|||
Compatibility: {{result.compatibility}}
|
||||
</div>
|
||||
|
||||
<div *ngIf="result['countries'] != undefined && result['countries'].length > 0">
|
||||
<div *ngIf="result['countries'] && result['countries'].length > 0">
|
||||
Countries: {{result.countries}}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
|
|||
<!--a href="{{result['title'].url}}"-->
|
||||
<!--a [queryParams]="{articleId: 'od_______908::3a5b2885656a91307156325644e73b92'}" routerLinkActive="router-link-active" routerLink="search/publication"-->
|
||||
|
||||
<a *ngIf="lazy=='true'" [queryParams]="routerHelper.createQueryParam(urlParam,result.id)" routerLinkActive="router-link-active" routerLink="/search/{{type}}">
|
||||
<a [queryParams]="routerHelper.createQueryParam(urlParam,result.id)" routerLinkActive="router-link-active" routerLink="/search/{{type}}">
|
||||
<p *ngIf="result['title'].name != undefined && result['title'].name != ''"
|
||||
[innerHTML]="result['title'].name">
|
||||
</p>
|
||||
|
@ -28,24 +28,12 @@ import {RouterHelper} from '../../utils/routerHelper.class';
|
|||
[no title available]
|
||||
</p>
|
||||
</a>
|
||||
|
||||
<a *ngIf="lazy=='false'" href="/search/{{type}}?{{urlParam}}={{result.id}}">
|
||||
<p *ngIf="result['title'].name != undefined && result['title'].name != ''"
|
||||
[innerHTML]="result['title'].name">
|
||||
</p>
|
||||
<p *ngIf="result['title'].name == undefined || result['title'].name == ''">
|
||||
[no title available]
|
||||
</p>
|
||||
</a>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<span *ngIf="result['authors'] != undefined">
|
||||
<span *ngFor="let author of result['authors'].slice(0,15)">
|
||||
<a *ngIf="from!='person'" [queryParams]="{personId: author.id}" routerLinkActive="router-link-active" routerLink="/search/person">
|
||||
{{author['name']}};
|
||||
</a>
|
||||
<a *ngIf="from=='person'" href="/search/person?personId={{author.id}}">
|
||||
<a [queryParams]="{personId: author.id}" routerLinkActive="router-link-active" routerLink="/search/person">
|
||||
{{author['name']}};
|
||||
</a>
|
||||
</span>
|
||||
|
@ -64,14 +52,13 @@ import {RouterHelper} from '../../utils/routerHelper.class';
|
|||
<span> Projects: </span>
|
||||
<span *ngFor="let project of result['projects'].slice(0,15) let i=index">
|
||||
<!--a *ngIf="project.url != undefined" href="{{project.url}}"-->
|
||||
<span>
|
||||
<a *ngIf="project.id != undefined" [queryParams]="{projectId: project.id}" routerLinkActive="router-link-active" routerLink="/search/project">
|
||||
<a *ngIf="project.id" [queryParams]="{projectId: project.id}" routerLinkActive="router-link-active" routerLink="/search/project">
|
||||
{{project['funderShortname']?project['funderShortname']:project['funderName']}}
|
||||
| {{ project['acronym']?project['acronym']:project['title']}} ({{project.code}})</a><p
|
||||
| {{ project['acronym']?project['acronym']:project['title']}} ({{project.code}})</a><span
|
||||
|
||||
*ngIf="project.id == undefined">
|
||||
{{project['funderShortname']?project['funderShortname']:project['funderName']}}
|
||||
| {{ project['acronym']?project['acronym']:project['title']}} ({{project.code}})</p></span><span
|
||||
*ngIf="!project.id">{{project['funderShortname']?project['funderShortname']:project['funderName']}}<span
|
||||
*ngIf="project['acronym'] || project['title']"> | {{ project['acronym']?project['acronym']:project['title']}}</span><span
|
||||
*ngIf="project.code">({{project.code}})</span></span><span
|
||||
|
||||
*ngIf="i < result['projects'].length-1">,</span>
|
||||
</span>
|
||||
|
@ -102,10 +89,10 @@ import {RouterHelper} from '../../utils/routerHelper.class';
|
|||
<span> Organizations: </span>
|
||||
<span *ngFor="let organization of result['organizations'] let i=index">
|
||||
<!--a *ngIf="organization.url != undefined" href="{{organization.url}}"-->
|
||||
<a *ngIf="organization.id != undefined" [queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active" routerLink="/search/organization">
|
||||
<a *ngIf="organization.id" [queryParams]="{organizationId: organization.id}" routerLinkActive="router-link-active" routerLink="/search/organization">
|
||||
{{organization.name}}</a><span
|
||||
|
||||
*ngIf="organization.id == undefined">
|
||||
*ngIf="!organization.id">
|
||||
{{organization.name}}</span><span
|
||||
|
||||
*ngIf="i < result['organizations'].length-1">,</span>
|
||||
|
@ -134,7 +121,7 @@ import {RouterHelper} from '../../utils/routerHelper.class';
|
|||
Compatibility: {{result.compatibility}}
|
||||
</div>
|
||||
|
||||
<div *ngIf="result['countries'] != undefined && result['countries'].length > 0">
|
||||
<div *ngIf="result['countries'] && result['countries'].length > 0">
|
||||
Countries: {{result.countries}}
|
||||
</div>
|
||||
|
||||
|
@ -149,8 +136,6 @@ export class TabResultComponent {
|
|||
@Input() type: string;
|
||||
@Input() urlParam: string;
|
||||
@Input() showLoading: boolean = false;
|
||||
@Input() lazy: string = "true";
|
||||
@Input() from: string = "";
|
||||
|
||||
public errorCodes:ErrorCodes = new ErrorCodes();
|
||||
public routerHelper:RouterHelper = new RouterHelper();
|
||||
|
|
|
@ -87,29 +87,6 @@ export class SearchPublicationsComponent {
|
|||
}
|
||||
}
|
||||
|
||||
public getCSVResultsForEntity(entity:string, id:string): any {
|
||||
let exportPublications = [];
|
||||
exportPublications.push(//[exportPublications.length] =
|
||||
[
|
||||
this.quote(["bli", "blo"]),
|
||||
this.quote("bla"),
|
||||
this.quote("bla"),
|
||||
this.quote("bla"),
|
||||
this.quote("bla"),
|
||||
this.quote("bla"),
|
||||
this.quote("bla"),
|
||||
this.quote("bla"),
|
||||
this.quote("bla"),
|
||||
this.quote("blaaaaa")
|
||||
]
|
||||
);
|
||||
return exportPublications;
|
||||
}
|
||||
|
||||
private quote(word: any): string {
|
||||
return '"'+word+'"';
|
||||
}
|
||||
|
||||
public getResultsForEntity(entity:string, id:string, page: number, size: number){
|
||||
var parameters = "";
|
||||
|
||||
|
|
|
@ -54,6 +54,33 @@ export class SearchDatasetsService {
|
|||
})
|
||||
.map(res => this.parseResults(res));
|
||||
}
|
||||
|
||||
searchAggregators (id: string, params: string, refineParams:string, page: number, size: number ):any {
|
||||
|
||||
let link = OpenaireProperties.getSearchAPIURLLast()+"datasets";
|
||||
|
||||
let url = link+"?"+"&format=json";
|
||||
if(params!= null && params != '' ) {
|
||||
url += params;
|
||||
}
|
||||
if(refineParams!= null && refineParams != '' ) {
|
||||
url += refineParams;
|
||||
}
|
||||
url += "&page="+(page-1)+"&size="+size;
|
||||
|
||||
let key = url;
|
||||
if (this._cache.has(key)) {
|
||||
return Observable.of(this._cache.get(key)).map(res => this.parseRefineResults(id, res['refineResults']));
|
||||
}
|
||||
|
||||
return this.http.get(url)
|
||||
.map(res => <any> res.json())
|
||||
.do(res => {
|
||||
this._cache.set(key, res);
|
||||
})
|
||||
.map(res => this.parseRefineResults(id, res['refineResults']));
|
||||
}
|
||||
|
||||
searchDatasetsByDois (DOIs: string[], refineParams:string, page: number, size: number, refineFields:string[] ):any {
|
||||
let link = OpenaireProperties.getSearchAPIURLLast()+"datasets";
|
||||
let url = link+"?";
|
||||
|
@ -192,11 +219,18 @@ export class SearchDatasetsService {
|
|||
"code": ""
|
||||
}
|
||||
|
||||
if(relation.title != 'unidentified') {
|
||||
result['projects'][countProjects]['id'] =
|
||||
/*OpenaireProperties.getsearchLinkToProject() + */relation['to'].content;
|
||||
result['projects'][countProjects]['acronym'] = relation.acronym;
|
||||
result['projects'][countProjects]['title'] = relation.title;
|
||||
result['projects'][countProjects]['code'] = relation.code;
|
||||
} else {
|
||||
result['projects'][countProjects]['id'] = "";
|
||||
result['projects'][countProjects]['acronym'] = "";
|
||||
result['projects'][countProjects]['title'] = "";
|
||||
result['projects'][countProjects]['code'] = "";
|
||||
}
|
||||
|
||||
if(relation.hasOwnProperty("funding")) {
|
||||
let fundingLength = Array.isArray(relation['funding']) ? relation['funding'].length : 1;
|
||||
|
@ -247,6 +281,28 @@ export class SearchDatasetsService {
|
|||
return results;
|
||||
}
|
||||
|
||||
parseRefineResults(id: string, data: any): any {
|
||||
var results:any = [];
|
||||
if(data.hasOwnProperty("resulthostingdatasource")) {
|
||||
let length = Array.isArray(data['resulthostingdatasource']) ? data['resulthostingdatasource'].length : 1;
|
||||
|
||||
for(let i=0; i<length; i++) {
|
||||
let datasource = Array.isArray(data['resulthostingdatasource']) ? data['resulthostingdatasource'][i] : data['resulthostingdatasource'];
|
||||
|
||||
let result: {"name": string, "id": string, "count": number} = {"name": "", "id": "", "count": 0};
|
||||
result['name'] = datasource.name;
|
||||
result['id'] = datasource.id.split("||")[0];
|
||||
//result['url'] = OpenaireProperties.getsearchLinkToDataProvider()+result['id'];
|
||||
result['count'] = datasource.count;
|
||||
|
||||
if(result['id'] != id && result['name'] != "Unknown Repository") {
|
||||
results.push(result);
|
||||
}
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
|
||||
numOfEntityDatasets(id: string, entity: string):any {
|
||||
|
||||
//OpenaireProperties.getSearchAPIURLLast()
|
||||
|
|
|
@ -132,11 +132,18 @@ export class SearchOrganizationsService {
|
|||
"code": ""
|
||||
}
|
||||
|
||||
if(relation.title != 'unidentified') {
|
||||
result['projects'][countProjects]['id'] =
|
||||
/*OpenaireProperties.getsearchLinkToProject() + */relation['to'].content;
|
||||
result['projects'][countProjects]['acronym'] = relation.acronym;
|
||||
result['projects'][countProjects]['title'] = relation.title;
|
||||
result['projects'][countProjects]['code'] = relation.code;
|
||||
} else {
|
||||
result['projects'][countProjects]['id'] = "";
|
||||
result['projects'][countProjects]['acronym'] = "";
|
||||
result['projects'][countProjects]['title'] = "";
|
||||
result['projects'][countProjects]['code'] = "";
|
||||
}
|
||||
|
||||
if(relation.hasOwnProperty("funding")) {
|
||||
let fundingLength = Array.isArray(relation['funding']) ? relation['funding'].length : 1;
|
||||
|
|
|
@ -259,11 +259,18 @@ export class SearchPublicationsService {
|
|||
"code": ""
|
||||
}
|
||||
|
||||
if(relation.title != 'unidentified') {
|
||||
result['projects'][countProjects]['id'] =
|
||||
/*OpenaireProperties.getsearchLinkToProject() + */relation['to'].content;
|
||||
result['projects'][countProjects]['acronym'] = relation.acronym;
|
||||
result['projects'][countProjects]['title'] = relation.title;
|
||||
result['projects'][countProjects]['code'] = relation.code;
|
||||
} else {
|
||||
result['projects'][countProjects]['id'] = "";
|
||||
result['projects'][countProjects]['acronym'] = "";
|
||||
result['projects'][countProjects]['title'] = "";
|
||||
result['projects'][countProjects]['code'] = "";
|
||||
}
|
||||
|
||||
if(relation.hasOwnProperty("funding")) {
|
||||
let fundingLength = Array.isArray(relation['funding']) ? relation['funding'].length : 1;
|
||||
|
|
|
@ -115,8 +115,9 @@ export class FetchDataproviders {
|
|||
}
|
||||
|
||||
public getResultsForDeposit(id:string, type:string, page: number, size: number){
|
||||
//var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
//this.status = errorCodes.LOADING;
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.LOADING;
|
||||
|
||||
if(id != "") {
|
||||
|
||||
this._searchDataprovidersService.searchDataprovidersForDeposit(id,type, page, size).subscribe(
|
||||
|
@ -144,6 +145,9 @@ public getResultsForDeposit(id:string, type:string, page: number, size: number)
|
|||
}
|
||||
}
|
||||
public getResultsForEntity(entity:string, id:string, page: number, size: number){
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.LOADING;
|
||||
|
||||
var parameters = "";
|
||||
|
||||
if(entity == "organization") {
|
||||
|
@ -178,6 +182,8 @@ public getResultsForDeposit(id:string, type:string, page: number, size: number)
|
|||
}
|
||||
|
||||
public getResultsForDataproviders(id:string, page: number, size: number){
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.LOADING;
|
||||
|
||||
this._searchDataprovidersService.getDataProvidersforEntityRegistry(id, page, size).subscribe(
|
||||
data => {
|
||||
|
|
|
@ -76,6 +76,9 @@ export class FetchDatasets{
|
|||
|
||||
|
||||
public getResultsForEntity(entity:string, id:string, page: number, size: number){
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.LOADING;
|
||||
|
||||
var parameters = "";
|
||||
|
||||
if(entity == "project") {
|
||||
|
@ -112,6 +115,9 @@ public getResultsForEntity(entity:string, id:string, page: number, size: number)
|
|||
}
|
||||
|
||||
public getResultsForDataproviders(id:string, resultsFrom:string, page: number, size: number){
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.LOADING;
|
||||
|
||||
var parameters;
|
||||
if(resultsFrom == "collectedFrom") {
|
||||
parameters = "datasets?fq=collectedfromdatasourceid exact "+'"'+id+'"';
|
||||
|
@ -146,4 +152,30 @@ public getResultsForDataproviders(id:string, resultsFrom:string, page: number, s
|
|||
}
|
||||
}
|
||||
|
||||
public getAggregatorResults(id:string, page: number, size: number){
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.LOADING;
|
||||
|
||||
this.subResults = this._searchDatasetsService.searchAggregators(id, '&fq=collectedfromdatasourceid exact "'+id+'"',"&refine=true&fields=resulthostingdatasource" , page, size).subscribe(
|
||||
data => {
|
||||
this.results = data;
|
||||
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.DONE;
|
||||
if(this.searchUtils.totalResults == 0 ){
|
||||
this.searchUtils.status = 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;
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -63,6 +63,8 @@ export class FetchProjects{
|
|||
}
|
||||
|
||||
public getResultsForDataproviders(id:string, page: number, size: number){
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.LOADING;
|
||||
|
||||
this._searchProjectsService.getProjectsforDataProvider(id, page, size).subscribe(
|
||||
data => {
|
||||
|
@ -89,6 +91,9 @@ export class FetchProjects{
|
|||
}
|
||||
|
||||
public getResultsForOrganizations(organizationId:string, filterquery:string, page: number, size: number, refineFields:string[]){
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.LOADING;
|
||||
|
||||
this._searchProjectsService.getProjectsForOrganizations(organizationId,filterquery, page, size,refineFields).subscribe(
|
||||
data => {
|
||||
this.searchUtils.totalResults = data[0]; // the results can be filtered so this number can be no total results
|
||||
|
|
|
@ -88,30 +88,10 @@ export class FetchPublications {
|
|||
);
|
||||
}
|
||||
|
||||
public getCSVResultsForEntity(entity:string, id:string): any {
|
||||
let exportPublications = [];
|
||||
exportPublications.push(//[exportPublications.length] =
|
||||
[
|
||||
this.quote(["bli", "blo"]),
|
||||
this.quote("bla"),
|
||||
this.quote("bla"),
|
||||
this.quote("bla"),
|
||||
this.quote("bla"),
|
||||
this.quote("bla"),
|
||||
this.quote("bla"),
|
||||
this.quote("bla"),
|
||||
this.quote("bla"),
|
||||
this.quote("blaaaaa")
|
||||
]
|
||||
);
|
||||
return exportPublications;
|
||||
}
|
||||
|
||||
private quote(word: any): string {
|
||||
return '"'+word+'"';
|
||||
}
|
||||
|
||||
public getResultsForEntity(entity:string, id:string, page: number, size: number){
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.LOADING;
|
||||
|
||||
var parameters = "";
|
||||
if(entity == "project") {
|
||||
parameters = "projects/"+id;
|
||||
|
@ -147,6 +127,9 @@ public getResultsForEntity(entity:string, id:string, page: number, size: number)
|
|||
}
|
||||
|
||||
public getResultsForDataproviders(id:string, resultsFrom:string, page: number, size: number){
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.LOADING;
|
||||
|
||||
var parameters;
|
||||
if(resultsFrom == "collectedFrom") {
|
||||
parameters = "publications?fq=collectedfromdatasourceid exact "+'"'+id+'"';
|
||||
|
@ -182,6 +165,9 @@ public getResultsForDataproviders(id:string, resultsFrom:string, page: number, s
|
|||
}
|
||||
|
||||
public getAggregatorResults(id:string, page: number, size: number){
|
||||
var errorCodes:ErrorCodes = new ErrorCodes();
|
||||
this.searchUtils.status = errorCodes.LOADING;
|
||||
|
||||
this.subResults = this._searchPublicationsService.searchAggregators(id, '&fq=collectedfromdatasourceid exact "'+id+'"',"&refine=true&fields=resulthostingdatasource" , page, size).subscribe(
|
||||
data => {
|
||||
this.results = data;
|
||||
|
|
Loading…
Reference in New Issue