From 8a426cc52d5524e6dd8dd34b9338657135fd5045 Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Tue, 6 Dec 2016 14:24:54 +0000 Subject: [PATCH] Make class fields public for ngfactory | use new refine fields in order to display names - not git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@44826 d315682c-612b-4755-9ff5-7f18f6832af3 --- .../claim-utils/claimContext.component.ts | 4 +- .../claim-utils/claimDataset.component.ts | 16 +- .../claim-utils/claimProject.component.ts | 6 +- .../inlineClaimContext.component.ts | 8 +- .../inlineClaimProject.component.ts | 14 +- .../inlineClaimResult.component.ts | 14 +- .../linking/bulkClaim/bulkClaim.component.ts | 2 +- .../insertClaim/insertClaim.component.ts | 14 +- .../selected/selectedDatasets.component.ts | 4 +- .../selectedPublications.component.ts | 4 +- portal-2/src/app/deposit/deposit.component.ts | 20 +- .../app/deposit/depositResult.component.ts | 14 +- portal-2/src/app/error/errorPage.component.ts | 2 +- portal-2/src/app/home/home.component.ts | 2 +- .../dataProvider/datasetsTab.component.ts | 2 +- .../dataProvider/datasourcesTab.component.ts | 2 +- .../dataProvider/projectsTab.component.ts | 2 +- .../dataProvider/publicationsTab.component.ts | 2 +- .../dataProvider/tabs.component.ts | 18 +- .../publication/publication.component.ts | 26 +- .../src/app/searchAll/searchAll.component.ts | 266 +++++++++--------- .../advancedSearchDataProviders.component.ts | 22 +- .../advancedSearchDatasets.component.ts | 22 +- .../advancedSearchOrganizations.component.ts | 22 +- .../advancedSearchPeople.component.ts | 22 +- .../advancedSearchProjects.component.ts | 22 +- .../advancedSearchPublications.component.ts | 18 +- .../compatibleDataProviders.component.ts | 35 ++- .../datasourceTableView.component.ts | 4 +- .../entityRegistries.component.ts | 34 +-- .../app/searchPages/find/search.component.ts | 74 ++--- .../app/searchPages/search-routing.module.ts | 2 +- .../src/app/searchPages/search.component.ts | 16 +- portal-2/src/app/searchPages/search.module.ts | 6 +- .../advancedSearchForm.component.ts | 4 +- .../advancedSearchPage.component.ts | 23 +- .../searchUtils/searchFilter.component.ts | 6 +- .../searchUtils/searchPage.component.ts | 10 +- .../searchUtils/searchResult.component.ts | 25 +- .../simple/searchDataproviders.component.ts | 28 +- .../simple/searchDatasets.component.ts | 6 +- .../simple/searchOrganizations.component.ts | 27 +- .../simple/searchPeople.component.ts | 18 +- .../simple/searchProjects.component.ts | 27 +- .../simple/searchPublications.component.ts | 33 ++- portal-2/src/app/services/contexts.service.ts | 6 +- portal-2/src/app/test/test.component.ts | 31 +- .../utils/entitiesAutoComplete.component.ts | 18 +- portal-2/src/app/utils/iframe.component.ts | 2 +- .../src/app/utils/modal/open.component.ts | 4 +- .../utils/projectTitleFormatter.component.ts | 2 +- .../utils/properties/openaireProperties.ts | 3 + .../src/app/utils/properties/searchFields.ts | 80 +++--- .../app/utils/staticAutoComplete.component.ts | 17 +- 54 files changed, 528 insertions(+), 583 deletions(-) diff --git a/portal-2/src/app/claimPages/claim-utils/claimContext.component.ts b/portal-2/src/app/claimPages/claim-utils/claimContext.component.ts index 2397d925..76ea6f35 100644 --- a/portal-2/src/app/claimPages/claim-utils/claimContext.component.ts +++ b/portal-2/src/app/claimPages/claim-utils/claimContext.component.ts @@ -84,10 +84,10 @@ public filteredList = []; public elementRef; public communities:string[]; -private selectedCommunityLabel:string = "Community:"; +public selectedCommunityLabel:string = "Community:"; public categories:string[]; -private selectedCategoryLabel:string ="Category:"; +public selectedCategoryLabel:string ="Category:"; public concepts = []; public warningMessage = ""; public infoMessage = ""; diff --git a/portal-2/src/app/claimPages/claim-utils/claimDataset.component.ts b/portal-2/src/app/claimPages/claim-utils/claimDataset.component.ts index dde05b8f..ebadfa2f 100644 --- a/portal-2/src/app/claimPages/claim-utils/claimDataset.component.ts +++ b/portal-2/src/app/claimPages/claim-utils/claimDataset.component.ts @@ -91,11 +91,11 @@ export class ClaimDatasetComponent { @Input() public keyword:string = ''; @Input() public selectedDatasets = [] ; @Output() datasetsChange = new EventEmitter(); - private size:number = 10; - private navigateTo: string = "Search"; - private source: string = "datacite"; - private type : string = "dataset"; - private errorCodes:ErrorCodes = new ErrorCodes(); + public size:number = 10; + public navigateTo: string = "Search"; + public source: string = "datacite"; + public type : string = "dataset"; + public errorCodes:ErrorCodes = new ErrorCodes(); dataciteResults=[]; dataciteResultsNum : Observable = null; @@ -110,9 +110,9 @@ export class ClaimDatasetComponent { public warningMessage = ""; public infoMessage = ""; - private todayDate = ''; - private nextDate = ''; - private DOIs:string[] = []; + public todayDate = ''; + public nextDate = ''; + public DOIs:string[] = []; public search(term: string, size : number, page : number){ this.DOIs = DOI.getDOIsFromString(term); diff --git a/portal-2/src/app/claimPages/claim-utils/claimProject.component.ts b/portal-2/src/app/claimPages/claim-utils/claimProject.component.ts index c0741a77..fbf2e58b 100644 --- a/portal-2/src/app/claimPages/claim-utils/claimProject.component.ts +++ b/portal-2/src/app/claimPages/claim-utils/claimProject.component.ts @@ -80,12 +80,12 @@ export class ClaimProjectsComponent { public warningMessage = ""; public infoMessage = ""; - private searchTermStream = new Subject(); + public searchTermStream = new Subject(); filtered: Observable<{}> = this.searchTermStream .debounceTime(300).distinctUntilChanged() .switchMap((term: string) => this._projectService.searchForProjectsObs(term, this.selectedFunderId)); - private tries:number = 0 ; - private keywordlimit = 3; + public tries:number = 0 ; + public keywordlimit = 3; constructor(private _service: ProjectService, private _projectService: SearchProjectsService, myElement: ElementRef) { this.elementRef = myElement; diff --git a/portal-2/src/app/claimPages/inlineClaims/inlineClaimContext.component.ts b/portal-2/src/app/claimPages/inlineClaims/inlineClaimContext.component.ts index fcbe50ea..a03d9a18 100644 --- a/portal-2/src/app/claimPages/inlineClaims/inlineClaimContext.component.ts +++ b/portal-2/src/app/claimPages/inlineClaims/inlineClaimContext.component.ts @@ -37,10 +37,10 @@ import {ClaimInsertComponent} from '../linking/insertClaim/insertClaim.component contexts=[]; publications; datasets; - private show = 'context'; - private showComp:boolean = false; - private enableButton:boolean=true; - keyword: string = ""; + public show = 'context'; + public showComp:boolean = false; + public enableButton:boolean=true; + public keyword: string = ""; @Output() contextAdded = new EventEmitter(); diff --git a/portal-2/src/app/claimPages/inlineClaims/inlineClaimProject.component.ts b/portal-2/src/app/claimPages/inlineClaims/inlineClaimProject.component.ts index dc22088e..4f8cd392 100644 --- a/portal-2/src/app/claimPages/inlineClaims/inlineClaimProject.component.ts +++ b/portal-2/src/app/claimPages/inlineClaims/inlineClaimProject.component.ts @@ -33,13 +33,13 @@ import {ClaimInsertComponent} from '../linking/insertClaim/insertClaim.component @Input() public inlineType:string; - projects=[]; - publications; - datasets; - private show = 'project'; - private showComp:boolean = false; - private enableButton:boolean=true; - keyword: string = ""; + public projects=[]; + public publications; + public datasets; + public show = 'project'; + public showComp:boolean = false; + public enableButton:boolean=true; + public keyword: string = ""; @Output() projectAdded = new EventEmitter(); diff --git a/portal-2/src/app/claimPages/inlineClaims/inlineClaimResult.component.ts b/portal-2/src/app/claimPages/inlineClaims/inlineClaimResult.component.ts index 4f217f1f..cc14b9c7 100644 --- a/portal-2/src/app/claimPages/inlineClaims/inlineClaimResult.component.ts +++ b/portal-2/src/app/claimPages/inlineClaims/inlineClaimResult.component.ts @@ -35,16 +35,16 @@ import {ClaimInsertComponent} from '../linking/insertClaim/insertClaim.component // This is the component from the landing page @Input() public inlineEntity:any; @Input() public inlineType:string; - private hideType:string; + public hideType:string; - publications = []; - datasets = []; - private show = 'project'; - private showComp:boolean = false; - private enableButton:boolean=true; - keyword: string = ""; + public publications = []; + public datasets = []; + public show = 'project'; + public showComp:boolean = false; + public enableButton:boolean=true; + public keyword: string = ""; @Output() datasetAdded = new EventEmitter(); @Output() publicationAdded = new EventEmitter(); diff --git a/portal-2/src/app/claimPages/linking/bulkClaim/bulkClaim.component.ts b/portal-2/src/app/claimPages/linking/bulkClaim/bulkClaim.component.ts index 6d55b36c..230453f4 100644 --- a/portal-2/src/app/claimPages/linking/bulkClaim/bulkClaim.component.ts +++ b/portal-2/src/app/claimPages/linking/bulkClaim/bulkClaim.component.ts @@ -65,7 +65,7 @@ export class BulkClaimComponent { @ViewChild (ModalLoading) loading : ModalLoading ; errorMessage = ""; infoMEssage = ""; - private enableUpload:boolean = true; + enableUpload:boolean = true; constructor(private _searchCrossrefService: SearchCrossrefService) { this.filesToUpload = []; diff --git a/portal-2/src/app/claimPages/linking/insertClaim/insertClaim.component.ts b/portal-2/src/app/claimPages/linking/insertClaim/insertClaim.component.ts index d175ae25..8fb9c5c4 100644 --- a/portal-2/src/app/claimPages/linking/insertClaim/insertClaim.component.ts +++ b/portal-2/src/app/claimPages/linking/insertClaim/insertClaim.component.ts @@ -42,13 +42,13 @@ export class ClaimInsertComponent { @ViewChild (ModalLoading) loading : ModalLoading ; @ViewChild(AlertModal) alert; - private claiming =false; - private error = false; - private errorMessage = ""; - private warningMessage = ""; - private claimsTODO:number = 0; - private claims:number = 0; - private errorclaims:number = 0; + public claiming =false; + public error = false; + public errorMessage = ""; + public warningMessage = ""; + public claimsTODO:number = 0; + public claims:number = 0; + public errorclaims:number = 0; public validateInsertions(){ // console.info("Inlineentity:" +(this.inlineEntity)?this.inlineEntity+(this.inlineEntity.id)?this.inlineEntity.id:"no id":"null"+ + " show "+ (!this.claiming && this.showButton) ); diff --git a/portal-2/src/app/claimPages/linking/selected/selectedDatasets.component.ts b/portal-2/src/app/claimPages/linking/selected/selectedDatasets.component.ts index 3628677e..978a6b98 100644 --- a/portal-2/src/app/claimPages/linking/selected/selectedDatasets.component.ts +++ b/portal-2/src/app/claimPages/linking/selected/selectedDatasets.component.ts @@ -62,8 +62,8 @@ export class ClaimSelectedDatasetsComponent { todayDate = ''; nextDate = ''; @ViewChild(AlertModal) alertApplyAll; - private commonAccessRights = "OPEN"; // for access rights- changes when user apply a change to every result - private commonEmbargoEndDate; // for access rights: embargoEndDate - changes when user apply a change to every result + public commonAccessRights = "OPEN"; // for access rights- changes when user apply a change to every result + public commonEmbargoEndDate; // for access rights: embargoEndDate - changes when user apply a change to every result removeDataset(item:any){ var index:number =this.datasets.indexOf(item); diff --git a/portal-2/src/app/claimPages/linking/selected/selectedPublications.component.ts b/portal-2/src/app/claimPages/linking/selected/selectedPublications.component.ts index 40ce24b6..3747b737 100644 --- a/portal-2/src/app/claimPages/linking/selected/selectedPublications.component.ts +++ b/portal-2/src/app/claimPages/linking/selected/selectedPublications.component.ts @@ -63,8 +63,8 @@ export class ClaimSelectedPublicationsComponent { nextDate = ''; @ViewChild(AlertModal) alertApplyAll; -private commonAccessRights = "OPEN"; // for access rights- changes when user apply a change to every result -private commonEmbargoEndDate; // for access rights: embargoEndDate - changes when user apply a change to every result +public commonAccessRights = "OPEN"; // for access rights- changes when user apply a change to every result +public commonEmbargoEndDate; // for access rights: embargoEndDate - changes when user apply a change to every result removePublication(item:any){ var index:number =this.publications.indexOf(item); diff --git a/portal-2/src/app/deposit/deposit.component.ts b/portal-2/src/app/deposit/deposit.component.ts index 04a4de9d..7f6fad8c 100644 --- a/portal-2/src/app/deposit/deposit.component.ts +++ b/portal-2/src/app/deposit/deposit.component.ts @@ -72,19 +72,19 @@ import {SearchOrganizationsService} from '../services/searchOrganizations.servic }) export class DepositComponent { - private keyword: string=''; - private openAccess: string; - private openAccessRepo: string; - private fp7Guidlines: string; - private h2020Guidlines: string; - private ercGuidlines: string; - private helpdesk: string; - private organizations: {"name": string, "id": string}[] = []; + public keyword: string=''; + public openAccess: string; + public openAccessRepo: string; + public fp7Guidlines: string; + public h2020Guidlines: string; + public ercGuidlines: string; + public helpdesk: string; + public organizations: {"name": string, "id": string}[] = []; @Input() compatibility: string = ''; @Input() requestFor: string = "Publications"; - private status: number; - private errorCodes:ErrorCodes = new ErrorCodes(); + public status: number; + public errorCodes:ErrorCodes = new ErrorCodes(); constructor (private _router: Router, private _searchOrganizationsService: SearchOrganizationsService) { diff --git a/portal-2/src/app/deposit/depositResult.component.ts b/portal-2/src/app/deposit/depositResult.component.ts index 36150414..66979822 100644 --- a/portal-2/src/app/deposit/depositResult.component.ts +++ b/portal-2/src/app/deposit/depositResult.component.ts @@ -69,18 +69,18 @@ import {OrganizationService} from '../services/organization.service'; }) export class DepositResultComponent { - private organization: {"name": string, "url": string}; - private organizationId: string = ""; + public organization: {"name": string, "url": string}; + public organizationId: string = ""; - private status: number; - private errorCodes:ErrorCodes = new ErrorCodes(); + public status: number; + public errorCodes:ErrorCodes = new ErrorCodes(); sub: any; subDataproviders: any; - private searchDataprovidersComponent : SearchDataprovidersComponent; - private linkToSearchDataproviders = ""; - private zenodo: string; + public searchDataprovidersComponent : SearchDataprovidersComponent; + public linkToSearchDataproviders = ""; + public zenodo: string; @Input() compatibility: string = ''; @Input() requestFor: string = "Publications"; diff --git a/portal-2/src/app/error/errorPage.component.ts b/portal-2/src/app/error/errorPage.component.ts index 29473f84..a59c7037 100644 --- a/portal-2/src/app/error/errorPage.component.ts +++ b/portal-2/src/app/error/errorPage.component.ts @@ -25,7 +25,7 @@ import { Location } from '@angular/common'; }) export class ErrorPageComponent { - private page: string; + public page: string; constructor (private _location: Location) { this.page = _location.path(true); diff --git a/portal-2/src/app/home/home.component.ts b/portal-2/src/app/home/home.component.ts index f8501acb..a7569980 100644 --- a/portal-2/src/app/home/home.component.ts +++ b/portal-2/src/app/home/home.component.ts @@ -55,6 +55,6 @@ console.log('ngAfterViewChecked: Execution time: ' + time); searchTerm(term: string) { - window.location.href="/search?keyword="+term; + window.location.href="/search/find?keyword="+term; } } diff --git a/portal-2/src/app/landingPages/dataProvider/datasetsTab.component.ts b/portal-2/src/app/landingPages/dataProvider/datasetsTab.component.ts index b95be74c..6a1d594b 100644 --- a/portal-2/src/app/landingPages/dataProvider/datasetsTab.component.ts +++ b/portal-2/src/app/landingPages/dataProvider/datasetsTab.component.ts @@ -27,7 +27,7 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties'; export class DatasetsTabComponent { @Input() paramsForSearchLink: string = ""; @Input() searchDatasetsComponent : SearchDatasetsComponent; - private linkToSearchDatasets = ""; + public linkToSearchDatasets = ""; constructor () {} diff --git a/portal-2/src/app/landingPages/dataProvider/datasourcesTab.component.ts b/portal-2/src/app/landingPages/dataProvider/datasourcesTab.component.ts index ce1bf7cb..d3cc7953 100644 --- a/portal-2/src/app/landingPages/dataProvider/datasourcesTab.component.ts +++ b/portal-2/src/app/landingPages/dataProvider/datasourcesTab.component.ts @@ -27,7 +27,7 @@ export class DatasourcesTabComponent { @Input() paramsForSearchLink: string = ""; @Input() searchDataprovidersComponent : SearchDataprovidersComponent; - private linkToSearchDataproviders = ""; + public linkToSearchDataproviders = ""; constructor () {} diff --git a/portal-2/src/app/landingPages/dataProvider/projectsTab.component.ts b/portal-2/src/app/landingPages/dataProvider/projectsTab.component.ts index c161676b..4de909ab 100644 --- a/portal-2/src/app/landingPages/dataProvider/projectsTab.component.ts +++ b/portal-2/src/app/landingPages/dataProvider/projectsTab.component.ts @@ -28,7 +28,7 @@ export class ProjectsTabComponent { @Input() paramsForSearchLink: string = ""; @Input() searchProjectsComponent : SearchProjectsComponent; - private linkToSearchProjects = ""; + public linkToSearchProjects = ""; constructor () {} diff --git a/portal-2/src/app/landingPages/dataProvider/publicationsTab.component.ts b/portal-2/src/app/landingPages/dataProvider/publicationsTab.component.ts index 56961a5d..a576fb15 100644 --- a/portal-2/src/app/landingPages/dataProvider/publicationsTab.component.ts +++ b/portal-2/src/app/landingPages/dataProvider/publicationsTab.component.ts @@ -27,7 +27,7 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties'; export class PublicationsTabComponent { @Input() paramsForSearchLink: string = ""; @Input() searchPublicationsComponent : SearchPublicationsComponent; - private linkToSearchPublications = ""; + public linkToSearchPublications = ""; constructor () {} diff --git a/portal-2/src/app/landingPages/dataProvider/tabs.component.ts b/portal-2/src/app/landingPages/dataProvider/tabs.component.ts index e7870ea2..f44d490b 100644 --- a/portal-2/src/app/landingPages/dataProvider/tabs.component.ts +++ b/portal-2/src/app/landingPages/dataProvider/tabs.component.ts @@ -122,17 +122,17 @@ export class TabsComponent { //@Input() datasources; @Input() organizations: {"name": string, "url": string}[]; - private paramsForSearchLink: string = ""; + public paramsForSearchLink: string = ""; - private reloadPublications: boolean = true; - private reloadDatasets: boolean = true; - private reloadProjects: boolean = true; - private reloadDataproviders: boolean = true; + public reloadPublications: boolean = true; + public reloadDatasets: boolean = true; + public reloadProjects: boolean = true; + public reloadDataproviders: boolean = true; - private searchPublicationsComponent : SearchPublicationsComponent; - private searchDatasetsComponent: SearchDatasetsComponent; - private searchProjectsComponent: SearchProjectsComponent; - private searchDataprovidersComponent: SearchDataprovidersComponent; + public searchPublicationsComponent : SearchPublicationsComponent; + public searchDatasetsComponent: SearchDatasetsComponent; + public searchProjectsComponent: SearchProjectsComponent; + public searchDataprovidersComponent: SearchDataprovidersComponent; constructor (private route: ActivatedRoute, private _searchPublicationsService: SearchPublicationsService, diff --git a/portal-2/src/app/landingPages/publication/publication.component.ts b/portal-2/src/app/landingPages/publication/publication.component.ts index 7dc82289..e24fba98 100644 --- a/portal-2/src/app/landingPages/publication/publication.component.ts +++ b/portal-2/src/app/landingPages/publication/publication.component.ts @@ -15,12 +15,12 @@ import {InlineClaimResultComponent} from '../../claimPages/inlineClaims/inlineCl }) export class PublicationComponent { - private showAllCollectedFrom: boolean = false; - private showAllDownloadFrom: boolean = false; - private showAllFundedBy: boolean = false; - private showAllPublishedIn: boolean = false; + public showAllCollectedFrom: boolean = false; + public showAllDownloadFrom: boolean = false; + public showAllFundedBy: boolean = false; + public showAllPublishedIn: boolean = false; - private start ;private end ; + public start ;public end ; constructor (private _publicationService: PublicationService, private route: ActivatedRoute) { this.start = new Date().getTime(); } @@ -62,15 +62,15 @@ ngAfterViewChecked() { articleId: string; private publicationInfo: PublicationInfo; - private showAllReferences: boolean = false; - private showAllRelResData: boolean = false; - private showAllSimilPubl: boolean = false; - private showAllBioentities: boolean = false; - private showFundingDetails: boolean = false; + public showAllReferences: boolean = false; + public showAllRelResData: boolean = false; + public showAllSimilPubl: boolean = false; + public showAllBioentities: boolean = false; + public showFundingDetails: boolean = false; - private bioentitiesNum: number = 0; + public bioentitiesNum: number = 0; - private result ; + public result ; @ViewChild (InlineClaimProjectComponent) inlineClaimProject : InlineClaimProjectComponent ; @ViewChild (InlineClaimContextComponent) inlineClaimContext : InlineClaimContextComponent ; @@ -79,7 +79,7 @@ ngAfterViewChecked() { public warningMessage = ""; public errorMessage = ""; - private activeTab: string = ''; + public activeTab: string = ''; public myfunct(tab: string) { this.activeTab = tab; diff --git a/portal-2/src/app/searchAll/searchAll.component.ts b/portal-2/src/app/searchAll/searchAll.component.ts index 9c9ed5ce..3fe28978 100644 --- a/portal-2/src/app/searchAll/searchAll.component.ts +++ b/portal-2/src/app/searchAll/searchAll.component.ts @@ -1,133 +1,133 @@ -import {Component, Input, Output, EventEmitter} from '@angular/core'; -import {Observable} from 'rxjs/Observable'; -import {ActivatedRoute, Router} from '@angular/router'; -import {SearchCrossrefService} from '../services/searchCrossref.service'; -import {Publication} from '../utils/entities/publication'; -import {PagingFormatter} from '../utils/pagingFormatter.component'; -import {PublicationTitleFormatter} from '../utils/publicationTitleFormatter.component'; - -import {Location} from '@angular/common'; - -@Component({ - selector: 'search-all', - template: ` - - -
-

Selected publications:

-

{{item.DOI}} --{{item.publisher}}

-
- -

Search

-
- - -
-
-
-

{{resultsNum }} Total Results

- -
-
- -

{{item.DOI}} --{{item.publisher}}

- -
-
- - ` -}) -export class SearchAllComponent { - constructor (private _searchService: SearchCrossrefService, - private route: ActivatedRoute, private _location: Location) {} - ngOnInit() { - console.log("Path: " + this._location.path()); - this.sub = this.route.queryParams.subscribe(params => { - - let page = (params['page']=== undefined)?1:+params['page']; - let size = (params['size']=== undefined)?10:+params['size']; - this.page = page; - this.size = size; - this.keyword = params['keyword']; - if(this.keyword !=null){ - this.searchCrossref(this.keyword,this.size,this.page); - } - }); - - } - ngOnDestroy() { - this.sub.unsubscribe(); - } - sub: any; - page : number; - size:number; - keyword:string; - navigateTo: string = "Search"; - - @Input() public claim:boolean = true ; // add selection for claiming - @Input() public publication:boolean = true ; // true for publication/ false for dataset - @Input() public source:string = 'openaire' ; // other values : crossref/ datacite/orcid - @Input() public selected = [] ; - @Output() selectedChange = new EventEmitter(); - results:string[]; - resultsNum : Observable ; - search(term: string, size : number, page : number) { - // if(this.source == 'crossref' && this.publication){ - this.searchCrossref(term,10,1); - // }else if(this.source == 'openaire' && this.publication){ - // - // }else if(this.source == 'openaire' && this.publication){ - // - // }else if(this.source == 'openaire' && !this.publication){ - // - // }else if(this.source == 'orcid' && this.publication){ - // - // }else if(this.source == 'datacite' && !this.publication){ - // - // } - } - searchCrossref (term: string, size : number, page : number) { - this._searchService.searchCrossrefResults(term, size, page).subscribe( - data => { - this.results = data.items; - this.page=page; - this.resultsNum = data['total-results']; - }, - err => console.error(err) - ); - } - searchOpenaire (term2: string) { - //this.items = this._searchService.httpSearchOpenaire(term2); - } - - - - add(item){ - this.selected.push(item); - console.info("Select:"+this.selected); - for (var i = 0; i < this.selected.length; i++) { - console.log(this.selected[i]); - } - - - var index:number =this.results.indexOf(item); - if (index > -1) { - this.results.splice(index, 1); - } - console.info("Item removed "+this.selected.indexOf(item)); - this.selectedChange.emit({ - value: this.selected - }); - } - remove(item){ - var index:number =this.selected.indexOf(item); - if (index > -1) { - this.selected.splice(index, 1); - } - this.selectedChange.emit({ - value: this.selected - }); - - } - -} +// import {Component, Input, Output, EventEmitter} from '@angular/core'; +// import {Observable} from 'rxjs/Observable'; +// import {ActivatedRoute, Router} from '@angular/router'; +// import {SearchCrossrefService} from '../services/searchCrossref.service'; +// import {Publication} from '../utils/entities/publication'; +// import {PagingFormatter} from '../utils/pagingFormatter.component'; +// import {PublicationTitleFormatter} from '../utils/publicationTitleFormatter.component'; +// +// import {Location} from '@angular/common'; +// +// @Component({ +// selector: 'search-all', +// template: ` +// +// +//
+//

Selected publications:

+//

{{item.DOI}} --{{item.publisher}}

+//
+// +//

Search

+//
+// +// +//
+//
+//
+//

{{resultsNum }} Total Results

+// +//
+//
+// +//

{{item.DOI}} --{{item.publisher}}

+// +//
+//
+// +// ` +// }) +// export class SearchAllComponent { +// constructor (private _searchService: SearchCrossrefService, +// private route: ActivatedRoute, private _location: Location) {} +// ngOnInit() { +// console.log("Path: " + this._location.path()); +// this.sub = this.route.queryParams.subscribe(params => { +// +// let page = (params['page']=== undefined)?1:+params['page']; +// let size = (params['size']=== undefined)?10:+params['size']; +// this.page = page; +// this.size = size; +// this.keyword = params['keyword']; +// if(this.keyword !=null){ +// this.searchCrossref(this.keyword,this.size,this.page); +// } +// }); +// +// } +// ngOnDestroy() { +// this.sub.unsubscribe(); +// } +// sub: any; +// page : number; +// size:number; +// keyword:string; +// navigateTo: string = "Search"; +// +// @Input() public claim:boolean = true ; // add selection for claiming +// @Input() public publication:boolean = true ; // true for publication/ false for dataset +// @Input() public source:string = 'openaire' ; // other values : crossref/ datacite/orcid +// @Input() public selected = [] ; +// @Output() selectedChange = new EventEmitter(); +// results:string[]; +// resultsNum : Observable ; +// search(term: string, size : number, page : number) { +// // if(this.source == 'crossref' && this.publication){ +// this.searchCrossref(term,10,1); +// // }else if(this.source == 'openaire' && this.publication){ +// // +// // }else if(this.source == 'openaire' && this.publication){ +// // +// // }else if(this.source == 'openaire' && !this.publication){ +// // +// // }else if(this.source == 'orcid' && this.publication){ +// // +// // }else if(this.source == 'datacite' && !this.publication){ +// // +// // } +// } +// searchCrossref (term: string, size : number, page : number) { +// this._searchService.searchCrossrefResults(term, size, page).subscribe( +// data => { +// this.results = data.items; +// this.page=page; +// this.resultsNum = data['total-results']; +// }, +// err => console.error(err) +// ); +// } +// searchOpenaire (term2: string) { +// //this.items = this._searchService.httpSearchOpenaire(term2); +// } +// +// +// +// add(item){ +// this.selected.push(item); +// console.info("Select:"+this.selected); +// for (var i = 0; i < this.selected.length; i++) { +// console.log(this.selected[i]); +// } +// +// +// var index:number =this.results.indexOf(item); +// if (index > -1) { +// this.results.splice(index, 1); +// } +// console.info("Item removed "+this.selected.indexOf(item)); +// this.selectedChange.emit({ +// value: this.selected +// }); +// } +// remove(item){ +// var index:number =this.selected.indexOf(item); +// if (index > -1) { +// this.selected.splice(index, 1); +// } +// this.selectedChange.emit({ +// value: this.selected +// }); +// +// } +// +// } diff --git a/portal-2/src/app/searchPages/advanced/advancedSearchDataProviders.component.ts b/portal-2/src/app/searchPages/advanced/advancedSearchDataProviders.component.ts index c3a900e2..90ec3685 100644 --- a/portal-2/src/app/searchPages/advanced/advancedSearchDataProviders.component.ts +++ b/portal-2/src/app/searchPages/advanced/advancedSearchDataProviders.component.ts @@ -25,20 +25,14 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class'; }) export class AdvancedSearchDataProvidersComponent { - private results =[]; - private filters =[]; - // private totalResults:number = 0 ; - // private page :number = 1; - // private size :number = 10; - // public status:number; - private searchUtils:SearchUtilsClass = new SearchUtilsClass(); + public results =[]; + public filters =[]; + public searchUtils:SearchUtilsClass = new SearchUtilsClass(); + public searchFields:SearchFields = new SearchFields(); - // private baseUrl: string; - private searchFields:SearchFields = new SearchFields(); - - private fieldIds: string[] = this.searchFields.ADVANCED_DATAPROVIDER_PARAM; - private fieldIdsMap: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} = this.searchFields.DATAPROVIDER_FIELDS_MAP; - private selectedFields:AdvancedField[] = []; + public fieldIds: string[] = this.searchFields.ADVANCED_DATAPROVIDER_PARAM; + public fieldIdsMap: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} = this.searchFields.DATAPROVIDER_FIELDS_MAP; + public selectedFields:AdvancedField[] = []; @ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ; @@ -97,7 +91,7 @@ export class AdvancedSearchDataProvidersComponent { ); } - private queryChanged($event) { + public queryChanged($event) { var parameters = $event.value; this.getResults(parameters, this.searchUtils.page,this.searchUtils.size); console.info("queryChanged: Execute search query "+parameters); diff --git a/portal-2/src/app/searchPages/advanced/advancedSearchDatasets.component.ts b/portal-2/src/app/searchPages/advanced/advancedSearchDatasets.component.ts index c893a33a..e88cf82c 100644 --- a/portal-2/src/app/searchPages/advanced/advancedSearchDatasets.component.ts +++ b/portal-2/src/app/searchPages/advanced/advancedSearchDatasets.component.ts @@ -24,20 +24,16 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class'; }) export class AdvancedSearchDatasetsComponent { - private results =[]; - private filters =[]; - // private totalResults:number = 0 ; - // private page :number = 1; - // private size :number = 10; - // public status:number; - private searchUtils:SearchUtilsClass = new SearchUtilsClass(); + public results =[]; + public filters =[]; - // private searchUtils.baseUrl: string; - private searchFields:SearchFields = new SearchFields(); + public searchUtils:SearchUtilsClass = new SearchUtilsClass(); - private fieldIds: string[] = this.searchFields.ADVANCED_SEARCH_DATASET_PARAM; - private fieldIdsMap: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} = this.searchFields.DATASET_FIELDS_MAP; - private selectedFields:AdvancedField[] = []; + public searchFields:SearchFields = new SearchFields(); + + public fieldIds: string[] = this.searchFields.ADVANCED_SEARCH_DATASET_PARAM; + public fieldIdsMap: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} = this.searchFields.DATASET_FIELDS_MAP; + public selectedFields:AdvancedField[] = []; @ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ; @@ -102,7 +98,7 @@ export class AdvancedSearchDatasetsComponent { //TODO set filters from } - private queryChanged($event) { + public queryChanged($event) { var parameters = $event.value; this.getResults(parameters, this.searchUtils.page,this.searchUtils.size); console.info("queryChanged: Execute search query "+parameters); diff --git a/portal-2/src/app/searchPages/advanced/advancedSearchOrganizations.component.ts b/portal-2/src/app/searchPages/advanced/advancedSearchOrganizations.component.ts index 8624cf84..5937f22c 100644 --- a/portal-2/src/app/searchPages/advanced/advancedSearchOrganizations.component.ts +++ b/portal-2/src/app/searchPages/advanced/advancedSearchOrganizations.component.ts @@ -24,20 +24,14 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class'; }) export class AdvancedSearchOrganizationsComponent { - private results =[]; - private filters =[]; - // private totalResults:number = 0 ; - // private page :number = 1; - // private size :number = 10; - // public status:number; - private searchUtils:SearchUtilsClass = new SearchUtilsClass(); + public results =[]; + public filters =[]; + public searchUtils:SearchUtilsClass = new SearchUtilsClass(); + public searchFields:SearchFields = new SearchFields(); - // private baseUrl: string; - private searchFields:SearchFields = new SearchFields(); - - private fieldIds: string[] = this.searchFields.ADVANCED_SEARCH_ORGANIZATION_PARAM; - private fieldIdsMap: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} = this.searchFields.ORGANIZATION_FIELDS_MAP; - private selectedFields:AdvancedField[] = []; + public fieldIds: string[] = this.searchFields.ADVANCED_SEARCH_ORGANIZATION_PARAM; + public fieldIdsMap: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} = this.searchFields.ORGANIZATION_FIELDS_MAP; + public selectedFields:AdvancedField[] = []; @ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ; @@ -102,7 +96,7 @@ export class AdvancedSearchOrganizationsComponent { //TODO set filters from } - private queryChanged($event) { + public queryChanged($event) { var parameters = $event.value; this.getResults(parameters, this.searchUtils.page,this.searchUtils.size); console.info("queryChanged: Execute search query "+parameters); diff --git a/portal-2/src/app/searchPages/advanced/advancedSearchPeople.component.ts b/portal-2/src/app/searchPages/advanced/advancedSearchPeople.component.ts index 853792e0..9fc6d779 100644 --- a/portal-2/src/app/searchPages/advanced/advancedSearchPeople.component.ts +++ b/portal-2/src/app/searchPages/advanced/advancedSearchPeople.component.ts @@ -24,20 +24,16 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class'; }) export class AdvancedSearchPeopleComponent { - private results =[]; - private filters =[]; - // private totalResults:number = 0 ; - // private page :number = 1; - // private size :number = 10; - // public status:number; - private searchUtils:SearchUtilsClass = new SearchUtilsClass(); + public results =[]; + public filters =[]; - // private baseUrl: string; - private searchFields:SearchFields = new SearchFields(); + public searchUtils:SearchUtilsClass = new SearchUtilsClass(); - private fieldIds: string[] = this.searchFields.ADVANCED_SEARCH_PERSON_PARAM; - private fieldIdsMap: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} = this.searchFields.PERSON_FIELDS_MAP; - private selectedFields:AdvancedField[] = []; + public searchFields:SearchFields = new SearchFields(); + + public fieldIds: string[] = this.searchFields.ADVANCED_SEARCH_PERSON_PARAM; + public fieldIdsMap: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} = this.searchFields.PERSON_FIELDS_MAP; + public selectedFields:AdvancedField[] = []; @ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ; @@ -102,7 +98,7 @@ export class AdvancedSearchPeopleComponent { //TODO set filters from } - private queryChanged($event) { + public queryChanged($event) { var parameters = $event.value; this.getResults(parameters, this.searchUtils.page,this.searchUtils.size); console.info("queryChanged: Execute search query "+parameters); diff --git a/portal-2/src/app/searchPages/advanced/advancedSearchProjects.component.ts b/portal-2/src/app/searchPages/advanced/advancedSearchProjects.component.ts index 47e18cc6..15802df2 100644 --- a/portal-2/src/app/searchPages/advanced/advancedSearchProjects.component.ts +++ b/portal-2/src/app/searchPages/advanced/advancedSearchProjects.component.ts @@ -23,20 +23,16 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class'; }) export class AdvancedSearchProjectsComponent { - private results =[]; - private filters =[]; - // private totalResults:number = 0 ; - // private page :number = 1; - // private size :number = 10; - // public status:number; - private searchUtils:SearchUtilsClass = new SearchUtilsClass(); + public results =[]; + public filters =[]; - // private baseUrl: string; - private searchFields:SearchFields = new SearchFields(); + public searchUtils:SearchUtilsClass = new SearchUtilsClass(); - private fieldIds: string[] = this.searchFields.ADVANCED_PROJECTS_PARAM; - private fieldIdsMap: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} = this.searchFields.PROJECT_FIELDS_MAP; - private selectedFields:AdvancedField[] = []; + public searchFields:SearchFields = new SearchFields(); + + public fieldIds: string[] = this.searchFields.ADVANCED_PROJECTS_PARAM; + public fieldIdsMap: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} = this.searchFields.PROJECT_FIELDS_MAP; + public selectedFields:AdvancedField[] = []; @ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ; @@ -101,7 +97,7 @@ export class AdvancedSearchProjectsComponent { //TODO set filters from } - private queryChanged($event) { + public queryChanged($event) { var parameters = $event.value; this.getResults(parameters, this.searchUtils.page,this.searchUtils.size); console.info("queryChanged: Execute search query "+parameters); diff --git a/portal-2/src/app/searchPages/advanced/advancedSearchPublications.component.ts b/portal-2/src/app/searchPages/advanced/advancedSearchPublications.component.ts index 29d36bdd..776896c1 100644 --- a/portal-2/src/app/searchPages/advanced/advancedSearchPublications.component.ts +++ b/portal-2/src/app/searchPages/advanced/advancedSearchPublications.component.ts @@ -24,17 +24,15 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class'; }) export class AdvancedSearchPublicationsComponent { - private results =[]; - private filters =[]; - // private totalResults:number = 0 ; - private searchUtils:SearchUtilsClass = new SearchUtilsClass(); + public results =[]; + public filters =[]; + public searchUtils:SearchUtilsClass = new SearchUtilsClass(); - // private baseUrl: string; - private searchFields:SearchFields = new SearchFields(); + public searchFields:SearchFields = new SearchFields(); - private fieldIds: string[] = this.searchFields.ADVANCED_SEARCH_PUBLICATIONS_PARAM; - private fieldIdsMap: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} = this.searchFields.PUBLICATION_FIELDS_MAP; - private selectedFields:AdvancedField[] = []; + public fieldIds: string[] = this.searchFields.ADVANCED_SEARCH_PUBLICATIONS_PARAM; + public fieldIdsMap: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} = this.searchFields.PUBLICATION_FIELDS_MAP; + public selectedFields:AdvancedField[] = []; @ViewChild (AdvancedSearchPageComponent) searchPage : AdvancedSearchPageComponent ; @@ -96,7 +94,7 @@ export class AdvancedSearchPublicationsComponent { ); } - private queryChanged($event) { + public queryChanged($event) { var parameters = $event.value; this.getResults(parameters, this.searchUtils.page,this.searchUtils.size); console.info("queryChanged: Execute search query "+parameters); diff --git a/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.component.ts b/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.component.ts index ef53f42c..ee7a9ee7 100644 --- a/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.component.ts +++ b/portal-2/src/app/searchPages/dataProviders/compatibleDataProviders.component.ts @@ -27,24 +27,23 @@ import {ExportCSVComponent} from '../../utils/exportCSV.component'; }) export class SearchCompatibleDataprovidersComponent { public results =[]; - private filters =[]; - // public totalResults:number = 0 ; - private baseUrl:string; - private searchUtils:SearchUtilsClass = new SearchUtilsClass(); - private sub: any; private subResults: any; - private _location:Location; - private searchFields:SearchFields = new SearchFields(); - private refineFields: string[] = this.searchFields.DATAPROVIDER_INDEX; - private indexIdsMap: { [key:string]:string } = this.searchFields.DATAPROVIDER_INDEX_PARAM_MAP; - private fieldIdsMap: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} = this.searchFields.DATAPROVIDER_FIELDS_MAP; - private _prefixQueryFields: {field:string,opName:string,opValue:string,values:string[]}[] =[{field:"compatibility",opName:"cm",opValue:"not", values:["UNKNOWN","hostedBy","notCompatible"]},{field:"type",opName:"tp",opValue:"not",values: ["other"]}]; + public filters =[]; + public baseUrl:string; + public searchUtils:SearchUtilsClass = new SearchUtilsClass(); + public sub: any; public subResults: any; + public _location:Location; + public searchFields:SearchFields = new SearchFields(); + public refineFields: string[] = this.searchFields.DATAPROVIDER_INDEX; + public indexIdsMap: { [key:string]:string } = this.searchFields.DATAPROVIDER_INDEX_PARAM_MAP; + public fieldIdsMap: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} = this.searchFields.DATAPROVIDER_FIELDS_MAP; + public _prefixQueryFields: {field:string,opName:string,opValue:string,values:string[]}[] =[{field:"compatibility",opName:"cm",opValue:"not", values:["UNKNOWN","hostedBy","notCompatible"]},{field:"type",opName:"tp",opValue:"not",values: ["other"]}]; // ["entityregistry","entityregistry::projects","entityregistry::repositories"]}]; - private _prefixQuery: string = ""; + public _prefixQuery: string = ""; - private CSV: any = { "columnNames": [ "Title", "Type", "Coutries", "Compatibility" ], + public CSV: any = { "columnNames": [ "Title", "Type", "Coutries", "Compatibility" ], "export":[] }; - private CSVDownloaded = false; + public CSVDownloaded = false; @ViewChild (SearchPageComponent) searchPage : SearchPageComponent ; @@ -62,7 +61,7 @@ export class SearchCompatibleDataprovidersComponent { this._prefixQuery+="&"; } - private ngOnInit() { + public ngOnInit() { this.searchPage.refineFields = this.refineFields; this.searchPage.indexIdsMap = this.indexIdsMap; this.searchPage.fieldIdsMap = this.fieldIdsMap; @@ -75,7 +74,7 @@ export class SearchCompatibleDataprovidersComponent { }); } - private ngOnDestroy() { + public ngOnDestroy() { if(this.sub){ this.sub.unsubscribe(); } @@ -112,7 +111,7 @@ export class SearchCompatibleDataprovidersComponent { //TODO set filters from } - private queryChanged($event) { + public queryChanged($event) { var parameters = $event.index; console.info("queryChanged: Execute search query "+parameters); @@ -148,7 +147,7 @@ export class SearchCompatibleDataprovidersComponent { return filters; } - private downloadClicked($event) { + public downloadClicked($event) { if(!this.CSVDownloaded) { this.CSVDownloaded = false; diff --git a/portal-2/src/app/searchPages/dataProviders/datasourceTableView.component.ts b/portal-2/src/app/searchPages/dataProviders/datasourceTableView.component.ts index 7d557dd8..06b4fc90 100644 --- a/portal-2/src/app/searchPages/dataProviders/datasourceTableView.component.ts +++ b/portal-2/src/app/searchPages/dataProviders/datasourceTableView.component.ts @@ -54,7 +54,7 @@ export class DatasourceTableViewComponent { } - private ngOnInit() { + public ngOnInit() { // // var results:{name:string, type:string, organizations:string, countries:string, compatibility:string}[] = [] // for(var i =0; i < this.datasources.length; i++){ // var datasource: {name:string, type:string, organizations:string, countries:string, compatibility:string} = {name:"",type:"",organizations:"", countries:"", compatibility:""}; @@ -64,7 +64,7 @@ export class DatasourceTableViewComponent { // } } - private ngOnDestroy() { + public ngOnDestroy() { } sort(){ diff --git a/portal-2/src/app/searchPages/dataProviders/entityRegistries.component.ts b/portal-2/src/app/searchPages/dataProviders/entityRegistries.component.ts index 26a67bc9..5c646ffd 100644 --- a/portal-2/src/app/searchPages/dataProviders/entityRegistries.component.ts +++ b/portal-2/src/app/searchPages/dataProviders/entityRegistries.component.ts @@ -26,24 +26,24 @@ import {ExportCSVComponent} from '../../utils/exportCSV.component'; }) export class SearchEntityRegistriesComponent { public results =[]; - private filters =[]; - private baseUrl:string; - private searchUtils:SearchUtilsClass = new SearchUtilsClass(); - private sub: any; private subResults: any; - private _location:Location; - private searchFields:SearchFields = new SearchFields(); - private refineFields: string[] = this.searchFields.DATAPROVIDER_INDEX; - private indexIdsMap: { [key:string]:string } = this.searchFields.DATAPROVIDER_INDEX_PARAM_MAP; - private fieldIdsMap: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} = this.searchFields.DATAPROVIDER_FIELDS_MAP; - private _prefixQueryFields: {field:string,opName:string,opValue:string,values:string[]}[] =[ + public filters =[]; + public baseUrl:string; + public searchUtils:SearchUtilsClass = new SearchUtilsClass(); + public sub: any; public subResults: any; + public _location:Location; + public searchFields:SearchFields = new SearchFields(); + public refineFields: string[] = this.searchFields.DATAPROVIDER_INDEX; + public indexIdsMap: { [key:string]:string } = this.searchFields.DATAPROVIDER_INDEX_PARAM_MAP; + public fieldIdsMap: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} = this.searchFields.DATAPROVIDER_FIELDS_MAP; + public _prefixQueryFields: {field:string,opName:string,opValue:string,values:string[]}[] =[ {field:"type",opName:"tp",opValue:"and",values: ["other"]}]; // ["entityregistry","entityregistry::projects","entityregistry::repositories"]}]; - private _prefixQuery: string = ""; + public _prefixQuery: string = ""; - private CSV: any = { "columnNames": [ "Title", "Type", "Coutries", "Compatibility" ], + public CSV: any = { "columnNames": [ "Title", "Type", "Coutries", "Compatibility" ], "export":[] }; - private CSVDownloaded = false; + public CSVDownloaded = false; @ViewChild (SearchPageComponent) searchPage : SearchPageComponent ; @@ -61,7 +61,7 @@ export class SearchEntityRegistriesComponent { this._prefixQuery+="&"; } - private ngOnInit() { + public ngOnInit() { this.searchPage.refineFields = this.refineFields; this.searchPage.indexIdsMap = this.indexIdsMap; this.searchPage.fieldIdsMap = this.fieldIdsMap; @@ -75,7 +75,7 @@ export class SearchEntityRegistriesComponent { }); } - private ngOnDestroy() { + public ngOnDestroy() { if(this.sub){ this.sub.unsubscribe(); } @@ -111,7 +111,7 @@ export class SearchEntityRegistriesComponent { //TODO set filters from } - private queryChanged($event) { + public queryChanged($event) { var parameters = $event.index; console.info("queryChanged: Execute search query "+parameters); this._getResults(parameters, false, this.searchUtils.page, this.searchUtils.size); @@ -145,7 +145,7 @@ export class SearchEntityRegistriesComponent { - private downloadClicked($event) { + public downloadClicked($event) { if(!this.CSVDownloaded) { this.CSVDownloaded = false; diff --git a/portal-2/src/app/searchPages/find/search.component.ts b/portal-2/src/app/searchPages/find/search.component.ts index 568fa260..36ded8bc 100644 --- a/portal-2/src/app/searchPages/find/search.component.ts +++ b/portal-2/src/app/searchPages/find/search.component.ts @@ -98,47 +98,47 @@ import {OpenaireProperties} from '../../utils/properties/openaireProperties'; ` }) export class SearchComponent { - private sub: any; - private subPublicationsCount: any; - private subDatasetsCount: any; - private subProjectsCount: any; - private subDataprovidersCount: any; - private subOrganizationsCount: any; - private subPeopleCount: any; + public sub: any; + public subPublicationsCount: any; + public subDatasetsCount: any; + public subProjectsCount: any; + public subDataprovidersCount: any; + public subOrganizationsCount: any; + public subPeopleCount: any; - private reloadPublications: boolean; - private reloadDatasets: boolean; - private reloadProjects: boolean; - private reloadDataproviders: boolean; - private reloadOrganizations: boolean; - private reloadPeople: boolean; + public reloadPublications: boolean; + public reloadDatasets: boolean; + public reloadProjects: boolean; + public reloadDataproviders: boolean; + public reloadOrganizations: boolean; + public reloadPeople: boolean; - private pageTitle = "Search in OpenAIRE" - private keyword:string = ""; - private publications:string[]; - private datasets:string[]; - private projectsTab:string[]; - private dataproviders:string[]; - private organizations:string[]; - private people:string[]; + public pageTitle = "Search in OpenAIRE" + public keyword:string = ""; + public publications:string[]; + public datasets:string[]; + public projectsTab:string[]; + public dataproviders:string[]; + public organizations:string[]; + public people:string[]; - private activeTab = "publications"; - private linkToSearchPublications = ""; - private linkToSearchProjects = ""; - private linkToSearchDataproviders = ""; - private linkToSearchDatasets = ""; - private linkToSearchOrganizations = ""; - private linkToSearchPeople = ""; + public activeTab = "publications"; + public linkToSearchPublications = ""; + public linkToSearchProjects = ""; + public linkToSearchDataproviders = ""; + public linkToSearchDatasets = ""; + public linkToSearchOrganizations = ""; + public linkToSearchPeople = ""; - private searchPublicationsComponent : SearchPublicationsComponent; - private searchDataProvidersComponent : SearchDataprovidersComponent; - private searchProjectsComponent : SearchProjectsComponent; - private searchDatasetsComponent: SearchDatasetsComponent; - private searchOrganizationsComponent: SearchOrganizationsComponent; - private searchPeopleComponent: SearchPeopleComponent; + public searchPublicationsComponent : SearchPublicationsComponent; + public searchDataProvidersComponent : SearchDataprovidersComponent; + public searchProjectsComponent : SearchProjectsComponent; + public searchDatasetsComponent: SearchDatasetsComponent; + public searchOrganizationsComponent: SearchOrganizationsComponent; + public searchPeopleComponent: SearchPeopleComponent; -private subPub;private subData;private subProjects;private subOrg;private subPeople; private subDataPr; +public subPub;public subData;public subProjects;public subOrg;public subPeople; public subDataPr; constructor ( private route: ActivatedRoute, private _searchPublicationsService: SearchPublicationsService, private _searchDataprovidersService: SearchDataprovidersService, @@ -155,7 +155,7 @@ private subPub;private subData;private subProjects;private subOrg;private subPeo this.searchPeopleComponent = new SearchPeopleComponent(this.route, this._searchPeopleService); } - private ngOnInit() { + public ngOnInit() { this.sub = this.route.queryParams.subscribe(params => { this.keyword = (params['keyword'])?params['keyword']:""; if(this.keyword !=null && this.keyword.length > 0){ @@ -165,7 +165,7 @@ private subPub;private subData;private subProjects;private subOrg;private subPeo } }); } - private ngOnDestroy() { + public ngOnDestroy() { this.sub.unsubscribe(); if(this.keyword !=null && this.keyword.length > 0){ if(this.subPub){ diff --git a/portal-2/src/app/searchPages/search-routing.module.ts b/portal-2/src/app/searchPages/search-routing.module.ts index d1f48722..3169ceb7 100644 --- a/portal-2/src/app/searchPages/search-routing.module.ts +++ b/portal-2/src/app/searchPages/search-routing.module.ts @@ -22,7 +22,7 @@ import { SearchEntityRegistriesComponent } from './dataProviders/entityRegistrie { path: 'search/data-providers', component: SearchCompatibleDataprovidersComponent}, { path: 'search/entity-registries', component: SearchEntityRegistriesComponent}, { path: 'search/find', component: SearchComponent }, - { path: 'search', component: SearchComponent }, + // { path: 'search', component: SearchComponent }, { path: 'search/find/publications', component: SearchPublicationsComponent }, { path: 'search/find/dataproviders', component: SearchDataprovidersComponent }, { path: 'search/find/projects', component: SearchProjectsComponent }, diff --git a/portal-2/src/app/searchPages/search.component.ts b/portal-2/src/app/searchPages/search.component.ts index 291af73b..f6695c00 100644 --- a/portal-2/src/app/searchPages/search.component.ts +++ b/portal-2/src/app/searchPages/search.component.ts @@ -47,15 +47,15 @@ export class SearchComponent { ngOnDestroy() { this.sub.unsubscribe(); } - private sub: any; - private page : number; - private size:number; - private keyword:string; - private navigateTo: string = "./search"; + public sub: any; + public page : number; + public size:number; + public keyword:string; + public navigateTo: string = "./search"; - private results : String[]; - private orcidresults : String[]; - private resultsNum : number ; + public results : String[]; + public orcidresults : String[]; + public resultsNum : number ; search (term: string, size : number, page : number) { this.getCrossrefResults(term,size,page); } diff --git a/portal-2/src/app/searchPages/search.module.ts b/portal-2/src/app/searchPages/search.module.ts index 3f2c26ba..37817407 100644 --- a/portal-2/src/app/searchPages/search.module.ts +++ b/portal-2/src/app/searchPages/search.module.ts @@ -11,7 +11,7 @@ import {SearchResult} from '../utils/entities/searchResult'; import {AdvancedSearchPageComponent} from './searchUtils/advancedSearchPage.component'; -import {SearchAllComponent} from '../searchAll/searchAll.component';//helpers +// import {SearchAllComponent} from '../searchAll/searchAll.component';//helpers import {SearchPageComponent} from './searchUtils/searchPage.component'; import {SearchFormComponent} from './searchUtils/searchForm.component'; import {SearchPagingComponent} from './searchUtils/searchPaging.component'; @@ -52,7 +52,7 @@ import { SearchRoutingModule } from './search-routing.module'; declarations: [ AdvancedSearchPageComponent, - SearchAllComponent, + // SearchAllComponent, SearchPageComponent, SearchFormComponent, SearchResultComponent, @@ -78,7 +78,7 @@ import { SearchRoutingModule } from './search-routing.module'; // SearchPublicationsService ], exports: [ - SearchAllComponent, + // SearchAllComponent, AdvancedSearchPublicationsComponent, AdvancedSearchDataProvidersComponent, AdvancedSearchProjectsComponent, diff --git a/portal-2/src/app/searchPages/searchUtils/advancedSearchForm.component.ts b/portal-2/src/app/searchPages/searchUtils/advancedSearchForm.component.ts index 38e3e657..298947a8 100644 --- a/portal-2/src/app/searchPages/searchUtils/advancedSearchForm.component.ts +++ b/portal-2/src/app/searchPages/searchUtils/advancedSearchForm.component.ts @@ -104,9 +104,9 @@ export class AdvancedSearchFormComponent { @Output() queryChange = new EventEmitter(); newFieldId:string; fieldList:{[id:string]:any[]} = {}; - private searchFields:SearchFields = new SearchFields(); + public searchFields:SearchFields = new SearchFields(); - private operators: [{name:string, id:string}] = this.searchFields.ADVANCED_SEARCH_OPERATORS; + public operators: [{name:string, id:string}] = this.searchFields.ADVANCED_SEARCH_OPERATORS; constructor () { console.log("Constr: Advanced search form"); } diff --git a/portal-2/src/app/searchPages/searchUtils/advancedSearchPage.component.ts b/portal-2/src/app/searchPages/searchUtils/advancedSearchPage.component.ts index df172b30..2e4fe18b 100644 --- a/portal-2/src/app/searchPages/searchUtils/advancedSearchPage.component.ts +++ b/portal-2/src/app/searchPages/searchUtils/advancedSearchPage.component.ts @@ -54,17 +54,12 @@ export class AdvancedSearchPageComponent { @Input() results = []; @Input() entityType; @Input() searchUtils:SearchUtilsClass = new SearchUtilsClass(); - // @Input() totalResults: number = 0; @Input() fieldIds: string[]; @Input() fieldIdsMap:{ [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} ; @Input() selectedFields:AdvancedField[]; - // @Input() baseUrl:string = ''; @Input() simpleSearchUrl: string; - private baseURLWithParameters:string = ''; - - // private searchFields:SearchFields = new SearchFields(); - + public baseURLWithParameters:string = ''; @Output() queryChange = new EventEmitter(); constructor (private location: Location) { @@ -121,17 +116,21 @@ export class AdvancedSearchPageComponent { } public createQueryParameters(){ var params=""; + var countParams = 0; for(var i = 0; i< this.selectedFields.length; i++){ if(this.fieldIdsMap[this.selectedFields[i].id] != undefined && this.selectedFields[i].value != ""){ if(this.selectedFields[i].id == "q"){ - params += (i == 0 ? "" : this.selectedFields[i].operatorId) + " " + '"' + encodeURIComponent(this.selectedFields[i].value) + '"' + " "; + var op = ""; + // if() + params += (countParams == 0 ? "" : this.selectedFields[i].operatorId) + " " + '"' + encodeURIComponent(this.selectedFields[i].value) + '"' + " "; + }else if(countParams == 0 && this.selectedFields[i].operatorId == "not"){ + params += " "+ this.fieldIdsMap[this.selectedFields[i].id].indexField + " <> "+'"' + encodeURIComponent(this.selectedFields[i].value) +'"' + " "; }else{ - params += (i == 0 ? "" : this.selectedFields[i].operatorId + " " ) + this.fieldIdsMap[this.selectedFields[i].id].indexField + this.fieldIdsMap[this.selectedFields[i].id].equalityOperator+'"' + encodeURIComponent(this.selectedFields[i].value) +'"' + " "; + params += (countParams == 0 ? "" : this.selectedFields[i].operatorId + " " ) + this.fieldIdsMap[this.selectedFields[i].id].indexField + this.fieldIdsMap[this.selectedFields[i].id].equalityOperator+'"' + encodeURIComponent(this.selectedFields[i].value) +'"' + " "; } - // params +="&"+ this.selectedFields[i].id - // + "="+ encodeURIComponent(this.selectedFields[i].value)+"&"+this.fieldIdsMap[this.selectedFields[i].id].operator - // + "=" + this.selectedFields[i].operatorId; + + countParams++; } } @@ -163,7 +162,7 @@ export class AdvancedSearchPageComponent { /* * Update the url with proper parameters. This is used as base url in Paging Component */ - public updateBaseUrlWithParameters(){ + public updateBaseUrlWithParameters(){ this.baseURLWithParameters = this.searchUtils.baseUrl + this.createUrlParameters(false); } } diff --git a/portal-2/src/app/searchPages/searchUtils/searchFilter.component.ts b/portal-2/src/app/searchPages/searchUtils/searchFilter.component.ts index 66bbeb07..79272043 100644 --- a/portal-2/src/app/searchPages/searchUtils/searchFilter.component.ts +++ b/portal-2/src/app/searchPages/searchUtils/searchFilter.component.ts @@ -63,8 +63,8 @@ export class SearchFilterComponent { @Input() filter:Filter; @Input() showResultCount:boolean = true; - private showAll:boolean = false; - private _maxCharacters:number =30; + public showAll:boolean = false; + public _maxCharacters:number =30; constructor () { @@ -73,7 +73,7 @@ export class SearchFilterComponent { ngOnInit() { } - private _formatTitle(title,length){ + public _formatTitle(title,length){ return (((title+" ("+length+")").length >this._maxCharacters)?(title.substring(0,(this._maxCharacters - (" ("+length+")").length - ('...').length))+"..."):title+" ("+length+")") } private _formatName(value){ diff --git a/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts b/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts index 53886eea..9159a6e5 100644 --- a/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts +++ b/portal-2/src/app/searchPages/searchUtils/searchPage.component.ts @@ -165,7 +165,7 @@ export class SearchPageComponent { parameters+= ((countvalues == 1)?" and (":" or ")+ filterId+ '='+ value; fq+=(fq.length > 0 ? " " + "or" + " ":"" ) + filterId + " exact " + this.quote(value); } - parameters+= " ) " + parameters+= " ) "; if(countvalues > 0){ fq="&fq="+fq; } @@ -185,10 +185,10 @@ export class SearchPageComponent { doisParams+=(doisParams.length > 0?" or ":"")+'((pidclassid exact doi) and (pid exact "'+ DOIs[i]+'"))'; } if(doisParams.length > 0){ - doiQuery += "q=("+doisParams+")" + doiQuery += "and ("+doisParams+")" } }else{ - keywordQuery += "q=("+this.quote(keyword) +")" + keywordQuery += "and ("+this.quote(keyword) +")" } } @@ -323,10 +323,10 @@ export class SearchPageComponent { doisParams+=(doisParams.length > 0?" or ":"")+'((pidclassid exact doi) and (pid exact "'+ DOIs[i]+'"))'; } if(doisParams.length > 0){ - doiQuery += "q=("+doisParams+")" + doiQuery += " and ("+doisParams+")" } }else{ - keywordQuery += "q=("+this.quote(this.searchUtils.keyword) +")" + keywordQuery += " and ("+this.quote(this.searchUtils.keyword) +")" } } diff --git a/portal-2/src/app/searchPages/searchUtils/searchResult.component.ts b/portal-2/src/app/searchPages/searchUtils/searchResult.component.ts index 52ac4957..5e263047 100644 --- a/portal-2/src/app/searchPages/searchUtils/searchResult.component.ts +++ b/portal-2/src/app/searchPages/searchUtils/searchResult.component.ts @@ -127,29 +127,8 @@ export class SearchResultComponent { @Input() status: number; errorCodes:ErrorCodes = new ErrorCodes(); - private errorMessage: string = "No results found"; -/* - @Input() title; - @Input() id; - //publications & organizations: - @Input() projects; - //datasets & publications - @Input() description; - @Input() year; - @Input() authors; - //datasets: - @Input() publisher; - //dataproviders & projects: - @Input() organizations; - //projects: - @Input() funders; - //organizations: - @Input() country; - //dataproviders: - @Input() type; - @Input() websiteURL; - @Input() OAIPMHURL; -*/ + public errorMessage: string = "No results found"; + constructor () { } diff --git a/portal-2/src/app/searchPages/simple/searchDataproviders.component.ts b/portal-2/src/app/searchPages/simple/searchDataproviders.component.ts index 21cea78f..6e6a644d 100644 --- a/portal-2/src/app/searchPages/simple/searchDataproviders.component.ts +++ b/portal-2/src/app/searchPages/simple/searchDataproviders.component.ts @@ -23,20 +23,20 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class'; }) export class SearchDataprovidersComponent { public results =[]; - private filters =[]; + public filters =[]; public totalResults:number = 0 ; - private baseUrl:string; + public baseUrl:string; public searchUtils:SearchUtilsClass = new SearchUtilsClass(); - private sub: any; private subResults: any; - private _location:Location; - private searchFields:SearchFields = new SearchFields(); - private refineFields: string[] = this.searchFields.DATAPROVIDER_INDEX; - private indexIdsMap: { [key:string]:string } = this.searchFields.DATAPROVIDER_INDEX_PARAM_MAP; - private fieldIdsMap: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} = this.searchFields.DATAPROVIDER_FIELDS_MAP; - private CSV: any = { "columnNames": [ "Title", "Type", "Coutries", "Compatibility" ], + public sub: any; public subResults: any; + public _location:Location; + public searchFields:SearchFields = new SearchFields(); + public refineFields: string[] = this.searchFields.DATAPROVIDER_INDEX; + public indexIdsMap: { [key:string]:string } = this.searchFields.DATAPROVIDER_INDEX_PARAM_MAP; + public fieldIdsMap: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} = this.searchFields.DATAPROVIDER_FIELDS_MAP; + public CSV: any = { "columnNames": [ "Title", "Type", "Coutries", "Compatibility" ], "export":[] }; - private CSVDownloaded = false; + public CSVDownloaded = false; @ViewChild (SearchPageComponent) searchPage : SearchPageComponent ; @@ -46,7 +46,7 @@ export class SearchDataprovidersComponent { this.baseUrl = OpenaireProperties.getLinkToSearchDataProviders(); } - private ngOnInit() { + public ngOnInit() { this.searchPage.refineFields = this.refineFields; this.searchPage.indexIdsMap = this.indexIdsMap; this.searchPage.fieldIdsMap = this.fieldIdsMap; @@ -61,7 +61,7 @@ console.info("PAGE init = "+this.searchUtils.page); }); } - private ngOnDestroy() { + public ngOnDestroy() { if(this.sub){ this.sub.unsubscribe(); } @@ -249,13 +249,13 @@ public getResultsForDeposit(id:string, type:string, page: number, size: number) //TODO set filters from } - private queryChanged($event) { + public queryChanged($event) { var parameters = $event.value; console.info("PAGE queryChanged = "+this.searchUtils.page); this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size); } - private downloadClicked($event) { + public downloadClicked($event) { if(!this.CSVDownloaded) { this.CSVDownloaded = false; diff --git a/portal-2/src/app/searchPages/simple/searchDatasets.component.ts b/portal-2/src/app/searchPages/simple/searchDatasets.component.ts index 8928c35c..90556e4a 100644 --- a/portal-2/src/app/searchPages/simple/searchDatasets.component.ts +++ b/portal-2/src/app/searchPages/simple/searchDatasets.component.ts @@ -49,7 +49,7 @@ export class SearchDatasetsComponent { } - private ngOnInit() { + public ngOnInit() { this.searchPage.refineFields = this.refineFields; this.searchPage.indexIdsMap = this.indexIdsMap; this.searchPage.fieldIdsMap = this.fieldIdsMap; @@ -65,7 +65,7 @@ export class SearchDatasetsComponent { }); } - private ngOnDestroy() { + public ngOnDestroy() { if(this.sub){ this.sub.unsubscribe(); } @@ -199,7 +199,7 @@ private _getResults(parameters:string,refine:boolean, page: number, size: number //TODO set filters from } - private queryChanged($event) { + public queryChanged($event) { var parameters = $event.value; //this.getResults(parameters, this.searchUtils.page, this.searchUtils.size, "searchPage"); this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size); diff --git a/portal-2/src/app/searchPages/simple/searchOrganizations.component.ts b/portal-2/src/app/searchPages/simple/searchOrganizations.component.ts index 8b0370e5..46ac191b 100644 --- a/portal-2/src/app/searchPages/simple/searchOrganizations.component.ts +++ b/portal-2/src/app/searchPages/simple/searchOrganizations.component.ts @@ -23,18 +23,17 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class'; }) export class SearchOrganizationsComponent { public results =[]; - private filters =[]; - // public totalResults:number = 0 ; - private baseUrl:string; + public filters =[]; + public baseUrl:string; public searchUtils:SearchUtilsClass = new SearchUtilsClass(); - private sub: any; - private subResults: any; - private searchFields:SearchFields = new SearchFields(); - private refineFields: string[] = this.searchFields.ORGANIZATION_INDEX; - private indexIdsMap: { [key:string]:string } = this.searchFields.ORGANIZATION_INDEX_PARAM_MAP; - private fieldIdsMap: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} = this.searchFields.ORGANIZATION_FIELDS_MAP; - private urlParams : Map; - private _location:Location; + public sub: any; + public subResults: any; + public searchFields:SearchFields = new SearchFields(); + public refineFields: string[] = this.searchFields.ORGANIZATION_INDEX; + public indexIdsMap: { [key:string]:string } = this.searchFields.ORGANIZATION_INDEX_PARAM_MAP; + public fieldIdsMap: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} = this.searchFields.ORGANIZATION_FIELDS_MAP; + public urlParams : Map; + public _location:Location; @ViewChild (SearchPageComponent) searchPage : SearchPageComponent ; @@ -46,7 +45,7 @@ export class SearchOrganizationsComponent { } - private ngOnInit() { + public ngOnInit() { this.searchPage.refineFields = this.refineFields; this.searchPage.indexIdsMap = this.indexIdsMap; this.searchPage.fieldIdsMap = this.fieldIdsMap; @@ -60,7 +59,7 @@ export class SearchOrganizationsComponent { }); } - private ngOnDestroy() { + public ngOnDestroy() { if(this.sub){ this.sub.unsubscribe(); } @@ -109,7 +108,7 @@ export class SearchOrganizationsComponent { } - private queryChanged($event) { + public queryChanged($event) { var parameters = $event.value; console.info("queryChanged: Execute search query "+parameters); this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size); diff --git a/portal-2/src/app/searchPages/simple/searchPeople.component.ts b/portal-2/src/app/searchPages/simple/searchPeople.component.ts index abf06f82..4e94611e 100644 --- a/portal-2/src/app/searchPages/simple/searchPeople.component.ts +++ b/portal-2/src/app/searchPages/simple/searchPeople.component.ts @@ -25,13 +25,13 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class'; }) export class SearchPeopleComponent { public results =[]; - private filters =[]; - private baseUrl:string; + public filters =[]; + public baseUrl:string; public searchUtils:SearchUtilsClass = new SearchUtilsClass(); - private sub: any; - private _location:Location; - private refineFields = []; - private searchFields:SearchFields = new SearchFields(); + public sub: any; + public _location:Location; + public refineFields = []; + public searchFields:SearchFields = new SearchFields(); @ViewChild (SearchPageComponent) searchPage : SearchPageComponent ; @@ -47,7 +47,7 @@ export class SearchPeopleComponent { } } - private ngOnInit() { + public ngOnInit() { this.searchPage.refineFields = this.refineFields; //TODO make it work as a directive this.sub = this.route.queryParams.subscribe(params => { this.searchUtils.keyword = (params['keyword']?params['keyword']:''); @@ -112,7 +112,7 @@ export class SearchPeopleComponent { }); } - private ngOnDestroy() { + public ngOnDestroy() { this.sub.unsubscribe(); } /* @@ -182,7 +182,7 @@ private _getResults(parameters:string,refine:boolean, page: number, size: number //TODO set filters from } - private queryChanged($event) { + public queryChanged($event) { var parameters = $event.value; console.info("queryChanged: Execute search query "+parameters); this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size); diff --git a/portal-2/src/app/searchPages/simple/searchProjects.component.ts b/portal-2/src/app/searchPages/simple/searchProjects.component.ts index 66db822f..f93d9c89 100644 --- a/portal-2/src/app/searchPages/simple/searchProjects.component.ts +++ b/portal-2/src/app/searchPages/simple/searchProjects.component.ts @@ -23,18 +23,17 @@ import {SearchUtilsClass } from '../searchUtils/searchUtils.class'; }) export class SearchProjectsComponent { public results =[]; - private filters: Filter[] =[]; - // public totalResults:number = 0 ; - private baseUrl:string; + public filters: Filter[] =[]; + public baseUrl:string; public searchUtils:SearchUtilsClass = new SearchUtilsClass(); - private sub: any; - private subResults: any; - private searchFields:SearchFields = new SearchFields(); - private refineFields: string[] = this.searchFields.PROJECT_INDEX; - private indexIdsMap: { [key:string]:string } = this.searchFields.PROJECT_INDEX_PARAM_MAP; - private fieldIdsMap: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} = this.searchFields.PROJECT_FIELDS_MAP; - private urlParams : Map; - private _location:Location; + public sub: any; + public subResults: any; + public searchFields:SearchFields = new SearchFields(); + public refineFields: string[] = this.searchFields.PROJECT_INDEX; + public indexIdsMap: { [key:string]:string } = this.searchFields.PROJECT_INDEX_PARAM_MAP; + public fieldIdsMap: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} = this.searchFields.PROJECT_FIELDS_MAP; + public urlParams : Map; + public _location:Location; @ViewChild (SearchPageComponent) searchPage : SearchPageComponent ; @@ -47,7 +46,7 @@ export class SearchProjectsComponent { } - private ngOnInit() { + public ngOnInit() { this.searchPage.refineFields = this.refineFields; this.searchPage.indexIdsMap = this.indexIdsMap; this.searchPage.fieldIdsMap = this.fieldIdsMap; @@ -67,7 +66,7 @@ export class SearchProjectsComponent { }); } - private ngOnDestroy() { + public ngOnDestroy() { if(this.sub){ this.sub.unsubscribe(); } @@ -141,7 +140,7 @@ export class SearchProjectsComponent { } - private queryChanged($event) { + public queryChanged($event) { this.urlParams = undefined; var parameters = $event.value; this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size); diff --git a/portal-2/src/app/searchPages/simple/searchPublications.component.ts b/portal-2/src/app/searchPages/simple/searchPublications.component.ts index 533b4973..41ed2a7a 100644 --- a/portal-2/src/app/searchPages/simple/searchPublications.component.ts +++ b/portal-2/src/app/searchPages/simple/searchPublications.component.ts @@ -28,26 +28,25 @@ import {DOI} from '../../utils/string-utils.class'; }) export class SearchPublicationsComponent { public results =[]; - private filters =[]; - // public totalResults:number = 0 ; + public filters =[]; public searchUtils:SearchUtilsClass = new SearchUtilsClass(); - private baseUrl:string = ""; - private sub: any; - private subResults: any; - private searchFields:SearchFields = new SearchFields(); - private refineFields: string[] = this.searchFields.PUBLICATION_INDEX; - private indexIdsMap: { [key:string]:string } = this.searchFields.PUBLICATION_INDEX_PARAM_MAP; - private fieldIdsMap: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} = this.searchFields.PUBLICATION_FIELDS_MAP; - private urlParams : Map; + public baseUrl:string = ""; + public sub: any; + public subResults: any; + public searchFields:SearchFields = new SearchFields(); + public refineFields: string[] = this.searchFields.PUBLICATION_INDEX; + public indexIdsMap: { [key:string]:string } = this.searchFields.PUBLICATION_INDEX_PARAM_MAP; + public fieldIdsMap: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} = this.searchFields.PUBLICATION_FIELDS_MAP; + public urlParams : Map; @ViewChild (SearchPageComponent) searchPage : SearchPageComponent ; - private _location:Location; + public _location:Location; - private CSV: any = { "columnNames": ["Title", "Authors", "Publication Year", "DOI", + public CSV: any = { "columnNames": ["Title", "Authors", "Publication Year", "DOI", /*"Download From", "Publication type", "Journal",*/ "Funder", "Project Name (GA Number)", "Access"], "export":[] }; - private CSVDownloaded = false; + public CSVDownloaded = false; constructor (private route: ActivatedRoute, private _searchPublicationsService: SearchPublicationsService ) { var errorCodes:ErrorCodes = new ErrorCodes(); @@ -56,7 +55,7 @@ export class SearchPublicationsComponent { } - private ngOnInit() { + public ngOnInit() { this.searchPage.refineFields = this.refineFields; this.searchPage.indexIdsMap = this.indexIdsMap; this.searchPage.fieldIdsMap = this.fieldIdsMap; @@ -72,7 +71,7 @@ export class SearchPublicationsComponent { }); } - private ngOnDestroy() { + public ngOnDestroy() { if(this.sub){ this.sub.unsubscribe(); } @@ -224,14 +223,14 @@ private _getResults(parameters:string,refine:boolean, page: number, size: number - private queryChanged($event) { + public queryChanged($event) { var parameters = $event.value; console.info("queryChanged: Execute search query "+parameters); console.info("Search Pubs::page "+this.searchUtils.page); this._getResults(parameters, true, this.searchUtils.page, this.searchUtils.size); } - private downloadClicked($event) { + public downloadClicked($event) { if(!this.CSVDownloaded) { this.CSVDownloaded = false; diff --git a/portal-2/src/app/services/contexts.service.ts b/portal-2/src/app/services/contexts.service.ts index 5b3b68c1..ecc40dca 100644 --- a/portal-2/src/app/services/contexts.service.ts +++ b/portal-2/src/app/services/contexts.service.ts @@ -27,7 +27,7 @@ export class ContextsService { console.info('ContextsService: request communities '+url); return this.http.get( url) .map(request => request.json().data) - .do(request => console.info("Get claims: offset = ")) + // .do(request => console.info("Get claims: offset = ")) .catch(this.handleError) .do(res => { this._cache.set(key, res); @@ -43,7 +43,7 @@ export class ContextsService { return this.http.get( url) .map(request => request.json().data) - .do(request => console.info("Get claims: offset = " )) + // .do(request => console.info("Get claims: offset = " )) .catch(this.handleError) .do(res => { this._cache.set(key, res); @@ -60,7 +60,7 @@ export class ContextsService { return this.http.get( url) .map(request => request.json().data) .map(res => this.parse(res.concept)) - .do(res => console.info(res )) + // .do(res => console.info(res )) .catch(this.handleError) .do(res => { this._cache.set(key, res); diff --git a/portal-2/src/app/test/test.component.ts b/portal-2/src/app/test/test.component.ts index ba05e015..9ebf1cbb 100644 --- a/portal-2/src/app/test/test.component.ts +++ b/portal-2/src/app/test/test.component.ts @@ -48,31 +48,22 @@ Selected:: - {{errorMsg}} - ` -//[(filtered)] =filteredObs [(selected)] =selectedObs -// [(searchTermStream)] = searchTermStream -//(keywordChange)="keywordChanged($event)" + }) export class TestComponent { - // for auto complete observable: - // searchTermStream = new Subject(); - // private selectedObs = []; - // filteredObs: Observable<{}> = this.searchTermStream - // .debounceTime(300).distinctUntilChanged() - // .switchMap((term: string) => this.service(term)); - private lan; - private types; - private user:{password:string,email:string} = {password:"",email:""}; + public lan; + public types; + + public user:{password:string,email:string} = {password:"",email:""}; constructor(private _projectService: OpenaireProjectsService,private _searchProjectsService:SearchProjectsService,private _searchPubService:SearchPublicationsService,private _searchDataService:SearchDatasetsService, private _vocabulariesService: ISVocabulariesService) { - // this.elementRef = myElement; - } + } ngOnInit() { // this.lan = this._vocabulariesService.getLanguages(); this.lan = this._vocabulariesService.getLanguagesJsonFile(); @@ -80,7 +71,7 @@ export class TestComponent { this.user.email = localStorage.getItem("email"); this.user.password = localStorage.getItem("password"); //&collectedFrom=openaire____::4a39de251a65e801bb88d3e75b47623f&cl=and - this._searchDataService.searchDatasets("&collectedFrom=openaire____::fdb035c8b3e0540a8d9a561a6c44f4de&cl=and" ,"&refine=true&fields=resulthostingdatasourceid", 1, 0, ["resulthostingdatasourceid"]).subscribe( + this._searchDataService.searchDatasets('&fq=collectedfromdatasourceid exact "openaire____::fdb035c8b3e0540a8d9a561a6c44f4de"' ,"&refine=true&fields=resulthostingdatasourceid", 1, 0, ["resulthostingdatasourceid"]).subscribe( data => { console.info("done" +data[0]); @@ -91,7 +82,7 @@ export class TestComponent { } ); - this._searchPubService.searchPublications("&fq=collectedfromdatasourceid exact openaire____::fdb035c8b3e0540a8d9a561a6c44f4de","&refine=true&fields=resulthostingdatasourceid" , 0, 0, ["resulthostingdatasourceid"]).subscribe( + this._searchPubService.searchPublications('&fq=collectedfromdatasourceid exact "openaire____::fdb035c8b3e0540a8d9a561a6c44f4de"',"&refine=true&fields=resulthostingdatasourceid" , 1, 0, ["resulthostingdatasourceid"]).subscribe( data => { console.info("done" +data[0]); @@ -129,8 +120,8 @@ export class TestComponent { return projects; } - private filtered = []; - private selected = []; + public filtered = []; + public selected = []; keywordChanged($event) { console.log("keyword Changed"+this.lan.length+" "+this.lan[0].id+"-"+this.lan[0].label); var keyword = $event.value; diff --git a/portal-2/src/app/utils/entitiesAutoComplete.component.ts b/portal-2/src/app/utils/entitiesAutoComplete.component.ts index 83e3ca7c..68a6efbd 100644 --- a/portal-2/src/app/utils/entitiesAutoComplete.component.ts +++ b/portal-2/src/app/utils/entitiesAutoComplete.component.ts @@ -56,17 +56,17 @@ export class EntitiesAutocompleteComponent { @Input() public selectedValue:string = ''; @Input() public keyword = ''; - private warningMessage = ""; - private infoMessage = ""; + public warningMessage = ""; + public infoMessage = ""; - private tries = 0; - private showInput = true; - private sub; - private done = false; - private showLoading:boolean = false; - private searchTermStream = new Subject(); + public tries = 0; + public showInput = true; + public sub; + public done = false; + public showLoading:boolean = false; + public searchTermStream = new Subject(); filtered: Observable<{}> ; - private numFilteredResults:number = 0; + public numFilteredResults:number = 0; @Input() public funderId:string; @Input() public entityType:string ; diff --git a/portal-2/src/app/utils/iframe.component.ts b/portal-2/src/app/utils/iframe.component.ts index cbc76267..302f6431 100644 --- a/portal-2/src/app/utils/iframe.component.ts +++ b/portal-2/src/app/utils/iframe.component.ts @@ -8,7 +8,7 @@ import { SafeResourceUrl, DomSanitizer } from '@angular/platform-browser'; ` }) export class IFrameComponent { - private safeUrl: SafeResourceUrl; + public safeUrl: SafeResourceUrl; @Input() url ; @Input() width = '100%'; @Input() height = '300'; diff --git a/portal-2/src/app/utils/modal/open.component.ts b/portal-2/src/app/utils/modal/open.component.ts index 95add08d..ca3f535d 100644 --- a/portal-2/src/app/utils/modal/open.component.ts +++ b/portal-2/src/app/utils/modal/open.component.ts @@ -5,10 +5,10 @@ import {Directive, Input, HostBinding} from '@angular/core'; @Directive({selector: '[open]'}) export class Open { @HostBinding('style.display') - private display:string; + public display:string; @HostBinding('class.in') @HostBinding('attr.aria-expanded') - private isExpanded:boolean = true; + public isExpanded:boolean = true; @Input() private set open(value:boolean) { diff --git a/portal-2/src/app/utils/projectTitleFormatter.component.ts b/portal-2/src/app/utils/projectTitleFormatter.component.ts index 43db0c0a..42ed5529 100644 --- a/portal-2/src/app/utils/projectTitleFormatter.component.ts +++ b/portal-2/src/app/utils/projectTitleFormatter.component.ts @@ -14,7 +14,7 @@ import {OpenaireProperties} from '../utils/properties/openaireProperties'; export class ProjectTitleFormatter { @Input() project: string[]; - private url:string; + public url:string; constructor () {} ngOnInit() { diff --git a/portal-2/src/app/utils/properties/openaireProperties.ts b/portal-2/src/app/utils/properties/openaireProperties.ts index 1220d9ab..37279aca 100644 --- a/portal-2/src/app/utils/properties/openaireProperties.ts +++ b/portal-2/src/app/utils/properties/openaireProperties.ts @@ -36,8 +36,11 @@ export class OpenaireProperties { // private searchAPIURL = "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2.0/api/"; // private static searchAPIURL = "http://scoobydoo.di.uoa.gr:8181/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/"; + // private static searchAPIURLLAst = "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/" + private static searchAPIURLLAst = "http://scoobydoo.di.uoa.gr:8181/dnet-functionality-services-2.0.0-SNAPSHOT-new/rest/v2/api/"; + // private static searchResourcesAPIURL = "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/rest/v2/api/resources"; private static searchResourcesAPIURL = "http://scoobydoo.di.uoa.gr:8181/dnet-functionality-services-2.0.0-SNAPSHOT-new/rest/v2/api/resources"; //private static searchServiveURL = "http://astero.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/"; diff --git a/portal-2/src/app/utils/properties/searchFields.ts b/portal-2/src/app/utils/properties/searchFields.ts index 487e4fd6..88afbdaf 100644 --- a/portal-2/src/app/utils/properties/searchFields.ts +++ b/portal-2/src/app/utils/properties/searchFields.ts @@ -1,37 +1,37 @@ export class SearchFields { //main Entities //PUBLICATIONS - public PUBLICATION_INDEX:string[] = ["instancetypenameid", "resultlanguageid", "communityid","relprojectid", "relfunderid", + public PUBLICATION_INDEX:string[] = ["instancetypename", "resultlanguagename", "community","relproject", "relfunderid", "relfundinglevel0_id","relfundinglevel1_id","relfundinglevel2_id", - "resultacceptanceyear","resultbestlicenseid","resulthostingdatasourceid","collectedfromdatasourceid"]; + "resultacceptanceyear","resultbestlicense","collectedfrom"]; public ADVANCED_SEARCH_PUBLICATIONS_PARAM:string[] = ["q","title","author","publisher","type", "lang","project", "funder", "funderlv0", "funderlv1","funderlv2","community","access","pid","hostedBy","collectedFrom", "person"]; - public PUBLICATION_INDEX_PARAM_MAP:{ [key:string]:string } = {["instancetypenameid"]:"type", ["resultlanguageid"]:"lang",["communityid"]:"community", - [ "relprojectid"]:"project",[ "relfunderid"]:"funder", + public PUBLICATION_INDEX_PARAM_MAP:{ [key:string]:string } = {["instancetypename"]:"type", ["resultlanguagename"]:"lang",["community"]:"community", + [ "relproject"]:"project",[ "relfunderid"]:"funder", ["relfundinglevel0_id"]:"funderlv0",["relfundinglevel1_id"]:"funderlv1",["relfundinglevel2_id"]:"funderlv2", - ["resultacceptanceyear"]:"year",["resultbestlicenseid"]:"access",["resulthostingdatasourceid"]:"hostedBy",["collectedfromdatasourceid"]:"collectedFrom", + ["resultacceptanceyear"]:"year",["resultbestlicense"]:"access",["resulthostingdatasourceid"]:"hostedBy",["collectedfrom"]:"collectedFrom", ["pid"]:"pid",["relpersonid"]:"person"}; public PUBLICATION_FIELDS_MAP: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} ={ ["q"]:{name:"All fields",operator:"op", type:"keyword", indexField:null, equalityOperator: "="}, ["title"]:{name:"Title",operator:"tt", type:"keyword" , indexField:"resulttitle", equalityOperator: "="}, ["author"]:{name:"Author",operator:"at", type:"keyword", indexField:"relperson", equalityOperator: "="}, ["publisher"]:{name:"Publisher",operator:"pb", type:"keyword", indexField:"resultpublisher", equalityOperator: "="}, - ["project"]:{name:"Project",operator:"po", type:"refine", indexField:"relprojectid", equalityOperator: " exact "}, + ["project"]:{name:"Project",operator:"po", type:"refine", indexField:"relproject", equalityOperator: " exact "}, ["funder"]:{name:"Funder",operator:"fn", type:"refine", indexField:"relfunderid", equalityOperator: " exact "}, ["funderlv0"]:{name:"Funding Stream",operator:"fn0", type:"refine", indexField:"relfundinglevel0_id", equalityOperator: " exact "}, ["funderlv1"]:{name:"Funding Substream Level 1",operator:"fn1", type:"refine", indexField:"relfundinglevel1_id", equalityOperator: " exact "}, ["funderlv2"]:{name:"Funding Substream Level 2",operator:"fn2", type:"refine", indexField:"relfundinglevel2_id", equalityOperator: " exact "}, - ["type"]:{name:"Type",operator:"tp", type:"vocabulary", indexField:"instancetypenameid", equalityOperator: " exact "}, - ["lang"]: {name:"Language",operator:"ln", type:"vocabulary", indexField:"resultlanguageid", equalityOperator: " exact "}, - ["community"]: {name:"Community",operator:"cm", type:"refine", indexField:"communityid", equalityOperator: " exact "}, - ["access"]: {name:"Access Mode",operator:"ac", type:"vocabulary", indexField:'resultbestlicenseid', equalityOperator: " exact "}, + ["type"]:{name:"Type",operator:"tp", type:"vocabulary", indexField:"instancetypename", equalityOperator: " exact "}, + ["lang"]: {name:"Language",operator:"ln", type:"vocabulary", indexField:"resultlanguagename", equalityOperator: " exact "}, + ["community"]: {name:"Community",operator:"cm", type:"refine", indexField:"community", equalityOperator: " exact "}, + ["access"]: {name:"Access Mode",operator:"ac", type:"vocabulary", indexField:'resultbestlicense', equalityOperator: " exact "}, ["hostedBy"]: {name:"Hosted by data provider",operator:"hs", type:"refine", indexField:"resulthostingdatasourceid", equalityOperator: " exact "}, - ["collectedFrom"]: {name:"Collected from data provider",operator:"cl", type:"refine", indexField:"collectedfromdatasourceid", equalityOperator: " exact "}, + ["collectedFrom"]: {name:"Collected from data provider",operator:"cl", type:"refine", indexField:"collectedfrom", equalityOperator: " exact "}, ["pid"]: {name:"PID",operator:"pd", type:"keyword", indexField:"pid", equalityOperator: " exact "}, ["person"]: {name:"Person",operator:"pr", type:"entity", indexField:"relpersonid", equalityOperator: " exact "} - - }; + + //PROJECT public PROJECT_INDEX:string[] = ["funderid","fundinglevel0_id","fundinglevel1_id","fundinglevel2_id","projectstartyear","projectendyear","projectecsc39"]; @@ -59,24 +59,24 @@ export class SearchFields { }; //DATAPROVIDERS - public DATAPROVIDER_INDEX:string[] = ["datasourcetypeuiid", "datasourceodlanguages", "datasourceodcontenttypes", - "datasourcecompatibilityid"];; + public DATAPROVIDER_INDEX:string[] = ["datasourcetypeuiname", "datasourceodlanguages", "datasourceodcontenttypes", + "datasourcecompatibilityname"];; public ADVANCED_DATAPROVIDER_PARAM:string[] = ["q", "officialname", "engname","subjects", "datasourcetype","lang","contenttype", "compatibility","organization"]; public DATAPROVIDER_INDEX_PARAM_MAP:{ [key:string]:string } = { - [ "datasourcetypeuiid"]:"type", [ "datasourcetypeid"]:"datasourcetype", ["datasourceodlanguages"]:"lang",["datasourceodcontenttypes"]:"contenttype", - ["datasourcecompatibilityid"]:"compatibility",["relorganizationid"]:"organization"}; + [ "datasourcetypeuiname"]:"type", [ "datasourcetypeid"]:"datasourcetype", ["datasourceodlanguages"]:"lang",["datasourceodcontenttypes"]:"contenttype", + ["datasourcecompatibilityname"]:"compatibility",["relorganizationid"]:"organization"}; public DATAPROVIDER_FIELDS_MAP: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} ={ ["q"]:{name:"All fields",operator:"op", type:"keyword", indexField:null, equalityOperator:"="}, ["officialname"]:{name:"Official Name",operator:"of", type:"keyword", indexField:"datasourceofficialname", equalityOperator:"="}, ["engname"]:{name:"English name",operator:"eg", type:"keyword", indexField:"datasourceenglishname", equalityOperator:"="}, ["subjects"]: {name:"Subject",operator:"sb", type:"keyword", indexField:"datasourceodsubjects", equalityOperator:"="}, - ["type"]:{name:"Type",operator:"tp", type:"vocabulary" , indexField:"datasourcetypeuiid", equalityOperator: " exact "}, + ["type"]:{name:"Type",operator:"tp", type:"vocabulary" , indexField:"datasourcetypeuiname", equalityOperator: " exact "}, ["datasourcetype"]:{name:"Type",operator:"tp", type:"vocabulary" , indexField:"datasourcetypeid", equalityOperator: " exact "}, ["lang"]:{name:"Language",operator:"ln", type:"vocabulary", indexField:"datasourceodlanguages", equalityOperator: " exact "}, - ["contenttype"]:{name:"Content Type",operator:"cn", type:"refine", indexField:"datasourceodcontenttypes", equalityOperator: " exact "}, - ["compatibility"]:{name:"Compatibility Level",operator:"cm", type:"vocabulary", indexField:"datasourcecompatibilityid", equalityOperator: " exact "}, + ["contenttype"]:{name:"Content",operator:"cn", type:"refine", indexField:"datasourceodcontenttypes", equalityOperator: " exact "}, + ["compatibility"]:{name:"Compatibility Level",operator:"cm", type:"vocabulary", indexField:"datasourcecompatibilityname", equalityOperator: " exact "}, ["organization"]: {name:"Organization",operator:"og", type:"entity", indexField:"relorganizationid", equalityOperator: " exact "} }; @@ -86,47 +86,47 @@ export class SearchFields { //DATASET - public DATASET_INDEX:string[] = ["instancetypenameid", "resultlanguageid","relprojectid", //"communityid", + public DATASET_INDEX:string[] = ["instancetypename", "resultlanguagename","relproject", //"community", "relfunderid", "relfundinglevel0_id","relfundinglevel1_id","relfundinglevel2_id", - "resultacceptanceyear","resultbestlicenseid","resulthostingdatasourceid","collectedfromdatasourceid"]; + "resultacceptanceyear","resultbestlicense","collectedfrom"]; public ADVANCED_SEARCH_DATASET_PARAM:string[] = ["q","title","author","publisher","type", "lang", "funder", "funderlv0", "funderlv1","funderlv2","community","access","pid","hostedBy","collectedFrom","person"]; - public DATASET_INDEX_PARAM_MAP:{ [key:string]:string } = {["instancetypenameid"]:"type", ["resultlanguageid"]:"lang",["communityid"]:"community", - [ "relprojectid"]:"project", [ "relfunderid"]:"funder", + public DATASET_INDEX_PARAM_MAP:{ [key:string]:string } = {["instancetypename"]:"type", ["resultlanguagename"]:"lang",["community"]:"community", + [ "relproject"]:"project", [ "relfunderid"]:"funder", ["relfundinglevel0_id"]:"funderlv0",["relfundinglevel1_id"]:"funderlv1",["relfundinglevel2_id"]:"funderlv2", - ["resultacceptanceyear"]:"year",["resultbestlicenseid"]:"access",["resulthostingdatasourceid"]:"hostedBy",["collectedfromdatasourceid"]:"collectedFrom", + ["resultacceptanceyear"]:"year",["resultbestlicense"]:"access",["resulthostingdatasourceid"]:"hostedBy",["collectedfrom"]:"collectedFrom", ["pid"]:"pid",["relpersonid"]:"person"}; public DATASET_FIELDS_MAP: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} ={ ["q"]:{name:"All fields",operator:"op", type:"keyword", indexField:null, equalityOperator: "="}, ["title"]:{name:"Title",operator:"tt", type:"keyword" , indexField:"resulttitle", equalityOperator: "="}, ["author"]:{name:"Author",operator:"at", type:"keyword", indexField:"relperson", equalityOperator: "="}, ["publisher"]:{name:"Publisher",operator:"pb", type:"keyword", indexField:"resultpublisher", equalityOperator: "="}, - ["project"]:{name:"Project",operator:"po", type:"refine", indexField:"relprojectid", equalityOperator: " exact "}, + ["project"]:{name:"Project",operator:"po", type:"refine", indexField:"relproject", equalityOperator: " exact "}, ["funder"]:{name:"Funder",operator:"fn", type:"refine", indexField:"relfunderid", equalityOperator: " exact "}, ["funderlv0"]:{name:"Funding Stream",operator:"fn0", type:"refine", indexField:"relfundinglevel0_id", equalityOperator: " exact "}, ["funderlv1"]:{name:"Funding Substream Level 1",operator:"fn1", type:"refine", indexField:"relfundinglevel1_id", equalityOperator: " exact "}, ["funderlv2"]:{name:"Funding Substream Level 2",operator:"fn2", type:"refine", indexField:"relfundinglevel2_id", equalityOperator: " exact "}, - ["type"]:{name:"Type",operator:"tp", type:"vocabulary", indexField:"instancetypenameid", equalityOperator: " exact "}, - ["lang"]: {name:"Language",operator:"ln", type:"vocabulary", indexField:"resultlanguageid", equalityOperator: " exact "}, - ["community"]: {name:"Community",operator:"cm", type:"refine", indexField:"communityid", equalityOperator: " exact "}, - ["access"]: {name:"Access Mode",operator:"ac", type:"vocabulary", indexField:'resultbestlicenseid', equalityOperator: " exact "}, + ["type"]:{name:"Type",operator:"tp", type:"vocabulary", indexField:"instancetypename", equalityOperator: " exact "}, + ["lang"]: {name:"Language",operator:"ln", type:"vocabulary", indexField:"resultlanguagename", equalityOperator: " exact "}, + ["community"]: {name:"Community",operator:"cm", type:"refine", indexField:"community", equalityOperator: " exact "}, + ["access"]: {name:"Access Mode",operator:"ac", type:"vocabulary", indexField:'resultbestlicense', equalityOperator: " exact "}, ["hostedBy"]: {name:"Hosted by data provider",operator:"hs", type:"refine", indexField:"resulthostingdatasourceid", equalityOperator: " exact "}, - ["collectedFrom"]: {name:"Collected from data provider",operator:"cl", type:"refine", indexField:"collectedfromdatasourceid", equalityOperator: " exact "}, + ["collectedFrom"]: {name:"Collected from data provider",operator:"cl", type:"refine", indexField:"collectedfrom", equalityOperator: " exact "}, ["pid"]: {name:"PID",operator:"pd", type:"keyword", indexField:"pid", equalityOperator: " exact "}, ["person"]: {name:"Person",operator:"pr", type:"entity", indexField:"relpersonid", equalityOperator: " exact "} }; //ORGANIZATION - public ORGANIZATION_INDEX:string[] = ["organizationcountryid","organizationeclegalbody"]; + public ORGANIZATION_INDEX:string[] = ["organizationcountryname"]//,"organizationeclegalbody"]; public ADVANCED_SEARCH_ORGANIZATION_PARAM:string[] = ["q","contenttype","compatibility","country","type"]; public ORGANIZATION_INDEX_PARAM_MAP:{ [key:string]:string } = {["organizationlegalname"]:"contenttype", ["organizationlegalshortname"]:"type", - ["organizationcountryid"]:"country",["organizationeclegalbody"]:"type"}; + ["organizationcountryname"]:"country"};//,["organizationeclegalbody"]:"type"}; public ORGANIZATION_FIELDS_MAP: { [key:string]:{ name:string, operator:string, type:string, indexField:string , equalityOperator:string}} ={ ["q"]:{name:"All fields",operator:"op", type:"keyword", indexField:null, equalityOperator: "="}, ["contenttype"]:{name:"Legal Name",operator:"cn", type:"keyword" , indexField:"organizationlegalname", equalityOperator: "="}, ["compatibility"]:{name:"Legal Short Name",operator:"cm", type:"keyword", indexField:"organizationlegalshortname", equalityOperator: "="}, - ["country"]:{name:"Country",operator:"cu", type:"vocabulary", indexField:"organizationcountryid", equalityOperator: " exact "}, + ["country"]:{name:"Country",operator:"cu", type:"vocabulary", indexField:"organizationcountryname", equalityOperator: " exact "}, ["type"]:{name:"Type",operator:"tp", type:"refine", indexField:"organizationeclegalbody", equalityOperator: " exact "}, }; @@ -135,7 +135,7 @@ export class SearchFields { //PERSON public PERSON_INDEX:string[] = []; - public ADVANCED_SEARCH_PERSON_PARAM:string[] = ["q","contenttype","compatibility","country","type"]; + public ADVANCED_SEARCH_PERSON_PARAM:string[] = ["q","surname","name","fullname"]; public PERSON_INDEX_PARAM_MAP:{ [key:string]:string } = {["personsecondnames"]:"surname", ["personfirstname"]:"name", ["personfullname"]:"fullname"}; public PERSON_FIELDS_MAP: { [key:string]:{ name:string, operator:string, type:string, indexField:string, equalityOperator:string }} ={ @@ -154,13 +154,13 @@ export class SearchFields { // public PROJECT_PARAM_FIELDS:string[] = ["funder","fl0","fl1", "fl2", "start","end","sc39"]; - public FIELDS_NAMES: { [key:string]:string } = {["relprojectid"]:"Project",["funderid"]:"Funder",["fundinglevel0_id"]:"Funding Stream", + public FIELDS_NAMES: { [key:string]:string } = {["relproject"]:"Project",["funderid"]:"Funder",["fundinglevel0_id"]:"Funding Stream", ["fundinglevel1_id"]:"Funding Substream Level 1", ["fundinglevel2_id"]:"Funding Substream Level 2", ["relfunderid"]:"Funder", ["relfundinglevel0_id"]:"Funding Stream",["relfundinglevel1_id"]:"Funding Substream Level 1", ["relfundinglevel2_id"]:"Funding Substream Level 2", - ["instancetypenameid"]:"Type",["resultlanguageid"]: "Language",["communityid"]: "Context",["resultacceptanceyear"]:"Year", - ["resultbestlicenseid"]:"Access Mode",["resulthostingdatasourceid"]:"Hosting Data provider", - ["collectedfromdatasourceid"]:"Collected from", ["datasourcetypeuiid"]:"Compatibility Type", ["datasourceodlanguages"]:"Language", - ["datasourceodcontenttypes"]: "Type", ["datasourcecompatibilityid"]:"Compatibility Type", ["organizationcountryid"]:"Country", + ["instancetypename"]:"Type",["resultlanguagename"]: "Language",["community"]: "Community",["resultacceptanceyear"]:"Year", + ["resultbestlicense"]:"Access Mode",["resulthostingdatasourceid"]:"Hosting Data provider", + ["collectedfrom"]:"Data Provider", ["datasourcetypeuiname"]:"Type", ["datasourceodlanguages"]:"Language", + ["datasourceodcontenttypes"]: "Content", ["datasourcecompatibilityname"]:"Compatibility Level", ["organizationcountryname"]:"Country", ["organizationeclegalbody"]:"Type",["projectstartyear"]:"Start Year",["projectendyear"]:"End Year",["projectecsc39"]:"Special Clause 39"}; diff --git a/portal-2/src/app/utils/staticAutoComplete.component.ts b/portal-2/src/app/utils/staticAutoComplete.component.ts index 900aa008..061bfc21 100644 --- a/portal-2/src/app/utils/staticAutoComplete.component.ts +++ b/portal-2/src/app/utils/staticAutoComplete.component.ts @@ -59,13 +59,13 @@ export class StaticAutoCompleteComponent { @Input() public keyword = ''; @Input() public type = 'search' //search, result, context, project - private warningMessage = ""; - private infoMessage = ""; - private showLoading:boolean = false; - private tries = 0; - private showInput = true; - private sub; - private done = false; + public warningMessage = ""; + public infoMessage = ""; + public showLoading:boolean = false; + public tries = 0; + public showInput = true; + public sub; + public done = false; constructor ( private _vocabulariesService: ISVocabulariesService,private _refineService: RefineFieldResultsService, private myElement: ElementRef) { } ngOnDestroy(){ @@ -93,6 +93,9 @@ export class StaticAutoCompleteComponent { this.warningMessage = "An Error occured..." } ); + }else{ + this.showLoading = false; + } }else{ this.afterListFetchedActions();