From 14a766e9274cf90d3b01e55b1570441c8dd12b2f Mon Sep 17 00:00:00 2001 From: "argiro.kokogiannaki" Date: Thu, 19 Jan 2017 14:03:07 +0000 Subject: [PATCH] Clean up src - remove claims related files git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@45485 d315682c-612b-4755-9ff5-7f18f6832af3 --- portal-2/src/app/app.module.ts | 5 +- .../app/claimPages/claim-routing.module.ts | 22 - .../claim-utils/claimContext.component.ts | 184 ------- .../claim-utils/claimDataset.component.ts | 241 --------- .../claim-utils/claimProject.component.ts | 191 ------- .../claimPublication.component.html | 110 ---- .../claim-utils/claimPublication.component.ts | 400 -------------- .../claim-utils/claimResult.component.ts | 108 ---- .../claim-utils/claims.component.html | 111 ---- .../claim-utils/claims.component.ts | 490 ------------------ portal-2/src/app/claimPages/claim.module.ts | 68 --- .../app/claimPages/claim/claim.component.html | 10 - .../app/claimPages/claim/claim.component.ts | 43 -- .../claims/claimsAdmin.component.ts | 36 -- .../inlineClaimContext.component.ts | 94 ---- .../inlineClaimProject.component.ts | 107 ---- .../inlineClaimResult.component.ts | 117 ----- .../linking/bulkClaim/bulkClaim.component.ts | 206 -------- .../linking/bulkLinking.component.ts | 16 - .../insertClaim/insertClaim.component.ts | 264 ---------- .../claimPages/linking/linking.component.ts | 16 - .../linking/linkingGeneric.component.ts | 191 ------- .../linking/linkingHome.component.ts | 58 --- .../linking/selected/selected.component.ts | 209 -------- .../selected/selectedContexts.component.ts | 63 --- .../selected/selectedDatasets.component.ts | 119 ----- .../selected/selectedProjects.component.ts | 68 --- .../selectedPublications.component.ts | 124 ----- .../selected/selectedResults.component.ts | 81 --- .../claimPages/myClaims/myClaims.component.ts | 34 -- .../app/claimPages/myClaimsDemo.component.ts | 51 -- .../dataset/dataset.component.html | 9 +- .../landingPages/dataset/dataset.component.ts | 77 +-- .../src/app/landingPages/landing.module.ts | 3 - .../project/project.component.html | 12 +- .../landingPages/project/project.component.ts | 30 -- .../publication/publication.component.html | 13 +- .../publication/publication.component.ts | 78 +-- portal-2/src/app/services/claims.service.ts | 140 ----- portal-2/src/app/services/contexts.service.ts | 88 ---- portal-2/src/app/services/services.module.ts | 3 +- .../navigationBar.component.ts | 47 +- .../utils/claimEntityFormatter.component.ts | 36 -- portal-2/src/app/utils/entities/claim.ts | 15 - .../app/utils/entities/claimEntities.class.ts | 30 -- .../src/app/utils/entities/entities.module.ts | 2 - .../app/utils/pipes/claimTextFilter.pipe.ts | 21 - .../app/utils/pipes/claimTypeFilter.pipe.ts | 35 -- .../utils/properties/openaireProperties.ts | 2 +- portal-2/src/server.routes.ts | 2 +- 50 files changed, 13 insertions(+), 4467 deletions(-) delete mode 100644 portal-2/src/app/claimPages/claim-routing.module.ts delete mode 100644 portal-2/src/app/claimPages/claim-utils/claimContext.component.ts delete mode 100644 portal-2/src/app/claimPages/claim-utils/claimDataset.component.ts delete mode 100644 portal-2/src/app/claimPages/claim-utils/claimProject.component.ts delete mode 100644 portal-2/src/app/claimPages/claim-utils/claimPublication.component.html delete mode 100644 portal-2/src/app/claimPages/claim-utils/claimPublication.component.ts delete mode 100644 portal-2/src/app/claimPages/claim-utils/claimResult.component.ts delete mode 100644 portal-2/src/app/claimPages/claim-utils/claims.component.html delete mode 100644 portal-2/src/app/claimPages/claim-utils/claims.component.ts delete mode 100644 portal-2/src/app/claimPages/claim.module.ts delete mode 100644 portal-2/src/app/claimPages/claim/claim.component.html delete mode 100644 portal-2/src/app/claimPages/claim/claim.component.ts delete mode 100644 portal-2/src/app/claimPages/claims/claimsAdmin.component.ts delete mode 100644 portal-2/src/app/claimPages/inlineClaims/inlineClaimContext.component.ts delete mode 100644 portal-2/src/app/claimPages/inlineClaims/inlineClaimProject.component.ts delete mode 100644 portal-2/src/app/claimPages/inlineClaims/inlineClaimResult.component.ts delete mode 100644 portal-2/src/app/claimPages/linking/bulkClaim/bulkClaim.component.ts delete mode 100644 portal-2/src/app/claimPages/linking/bulkLinking.component.ts delete mode 100644 portal-2/src/app/claimPages/linking/insertClaim/insertClaim.component.ts delete mode 100644 portal-2/src/app/claimPages/linking/linking.component.ts delete mode 100644 portal-2/src/app/claimPages/linking/linkingGeneric.component.ts delete mode 100644 portal-2/src/app/claimPages/linking/linkingHome.component.ts delete mode 100644 portal-2/src/app/claimPages/linking/selected/selected.component.ts delete mode 100644 portal-2/src/app/claimPages/linking/selected/selectedContexts.component.ts delete mode 100644 portal-2/src/app/claimPages/linking/selected/selectedDatasets.component.ts delete mode 100644 portal-2/src/app/claimPages/linking/selected/selectedProjects.component.ts delete mode 100644 portal-2/src/app/claimPages/linking/selected/selectedPublications.component.ts delete mode 100644 portal-2/src/app/claimPages/linking/selected/selectedResults.component.ts delete mode 100644 portal-2/src/app/claimPages/myClaims/myClaims.component.ts delete mode 100644 portal-2/src/app/claimPages/myClaimsDemo.component.ts delete mode 100644 portal-2/src/app/services/claims.service.ts delete mode 100644 portal-2/src/app/services/contexts.service.ts delete mode 100644 portal-2/src/app/utils/claimEntityFormatter.component.ts delete mode 100644 portal-2/src/app/utils/entities/claim.ts delete mode 100644 portal-2/src/app/utils/entities/claimEntities.class.ts delete mode 100644 portal-2/src/app/utils/pipes/claimTextFilter.pipe.ts delete mode 100644 portal-2/src/app/utils/pipes/claimTypeFilter.pipe.ts diff --git a/portal-2/src/app/app.module.ts b/portal-2/src/app/app.module.ts index 2fcb0386..0ddfbcd5 100755 --- a/portal-2/src/app/app.module.ts +++ b/portal-2/src/app/app.module.ts @@ -9,7 +9,6 @@ import { AppRoutingModule } from './app-routing.module'; import { AppComponent, XLargeDirective } from './app.component'; // custom modules:: -import {ClaimModule} from './claimPages/claim.module'; import {SearchModule} from './searchPages/search.module'; import {DepoditModule} from './deposit/deposit.module'; import {LandingModule} from './landingPages/landing.module'; @@ -26,9 +25,7 @@ import {ServicesModule} from './services/services.module'; imports: [ //MaterialModule.forRoot(), SharedModule, - HomeModule, - - ClaimModule, + HomeModule, SearchModule, DepoditModule, LandingModule, diff --git a/portal-2/src/app/claimPages/claim-routing.module.ts b/portal-2/src/app/claimPages/claim-routing.module.ts deleted file mode 100644 index 9dc1ee0b..00000000 --- a/portal-2/src/app/claimPages/claim-routing.module.ts +++ /dev/null @@ -1,22 +0,0 @@ -import { NgModule } from '@angular/core'; -import { RouterModule } from '@angular/router'; - -import {ClaimsAdminComponent} from './claims/claimsAdmin.component'; -import {ClaimComponent} from './claim/claim.component'; -import {MyClaimsComponent} from './myClaims/myClaims.component'; -import { LinkingComponent } from './linking/linking.component'; -import { BulkLinkingComponent } from './linking/bulkLinking.component'; - -@NgModule({ - imports: [ - RouterModule.forChild([ - { path: 'claims', component: ClaimsAdminComponent }, - { path: 'myclaims', component: MyClaimsComponent }, - { path: 'claim', component: ClaimComponent }, - { path: 'linking', component: LinkingComponent }, - { path: 'bulk-linking', component: BulkLinkingComponent}, - - ]) - ] -}) -export class ClaimRoutingModule { } diff --git a/portal-2/src/app/claimPages/claim-utils/claimContext.component.ts b/portal-2/src/app/claimPages/claim-utils/claimContext.component.ts deleted file mode 100644 index 6b678ba4..00000000 --- a/portal-2/src/app/claimPages/claim-utils/claimContext.component.ts +++ /dev/null @@ -1,184 +0,0 @@ -import {Component, Input,Output, EventEmitter, ViewChild} from '@angular/core'; -import {Observable} from 'rxjs/Observable'; -import {ContextsService} from '../../services/contexts.service'; -import {ClaimContext} from '../../utils/entities/claimEntities.class'; -import { StaticAutoCompleteComponent } from '../../utils/staticAutoComplete.component'; - -@Component({ - // moduleId: module.id, - selector: 'claim-contexts', - template: ` -
- -
-
- - -
-
- - -
- -
-
-
-
-
- - -
-
- - -
- - -
-
- - - - ` - -}) -export class ClaimContextComponent { -@Input() public inline:boolean = false ; // for claimed started from landing pages -@Input() public showComponent:boolean = true ; // for claimed started from landing pages -@Input() public selectedList = []; -@Input() public selectedCommunityId:string = "0"; -@Input() public selectedCategoryId:string ="0"; -@Output() cselectedCommunityChange = new EventEmitter(); -@Output() selectedCategoryChange = new EventEmitter(); -@ViewChild (StaticAutoCompleteComponent) autocomplete : StaticAutoCompleteComponent ; - -public query = ''; -public filteredList = []; -public communities:string[]; -public selectedCommunityLabel:string = "Community:"; - -public categories:string[]; -public selectedCategoryLabel:string ="Category:"; -public concepts = []; -public warningMessage = ""; -public infoMessage = ""; - -ngOnInit() { - this.getCommunities(); -} -constructor(private _contextService: ContextsService) { - -} - -select($event){ - var item = $event.value; - - var context: ClaimContext= { community: this.selectedCommunityLabel, category: this.selectedCategoryLabel, concept: item }; - var found:boolean = false; - this.warningMessage = ""; - for (var _i = 0; _i < this.selectedList.length; _i++) { - let item = this.selectedList[_i]; - if(item.concept.id == context.concept.id){ - found=true; - // this.warningMessage = "Concept already in selected list"; - } - } - if (!found) { - this.selectedList.push(context); - } -} - -getCommunities () { - this._contextService.getCommunities().subscribe( - data => { - this.communities = data.communities; - }, - err => console.log(err) - ); - } - getCategories () { - this.categories=[]; - if(this.selectedCommunityId != '0'){ - this._contextService.getCategories(this.selectedCommunityId).subscribe( - data => { - this.categories = data.category; - this.concepts = []; - this.filteredList = []; - if (this.query !== ""){ - var event = {value: ""}; - event.value = this.query; - } - - }, - err => console.log(err) - ); - } - } - getConcepts () { - if(this.selectedCategoryId != '0'){ - this._contextService.getConcepts(this.selectedCategoryId, "").subscribe( - data => { - this.concepts = data; - this.autocomplete.updateList(this.concepts); - if (this.query !== ""){ - var event = {value: ""}; - event.value = this.query; - // this.filter(event); - } - }, - err => console.log(err) - ); - }else{ - this.concepts=[]; - } - } - communityChanged(communityId:string, communityLabel:string){ - this.warningMessage = ""; - this.infoMessage = ""; - if(this.selectedCommunityId != communityId){ - this.selectedCommunityId = communityId; - this.selectedCommunityLabel = communityLabel; - this.getCategories(); - } - - } - categoryChanged(categoryId:string, categoryLabel:string){ - this.warningMessage = ""; - this.infoMessage = ""; - if(this.selectedCategoryId != categoryId){ - this.selectedCategoryId = categoryId; - this.selectedCategoryLabel = categoryLabel; - this.getConcepts(); - } - - } - -} diff --git a/portal-2/src/app/claimPages/claim-utils/claimDataset.component.ts b/portal-2/src/app/claimPages/claim-utils/claimDataset.component.ts deleted file mode 100644 index 0838a011..00000000 --- a/portal-2/src/app/claimPages/claim-utils/claimDataset.component.ts +++ /dev/null @@ -1,241 +0,0 @@ -import { Component, Input, Output, EventEmitter} from '@angular/core'; -import { SearchDataciteService } from '../../services/searchDatacite.service'; -import {SearchDatasetsService} from '../../services/searchDatasets.service'; -import {ClaimResult} from '../../utils/entities/claimEntities.class'; -import { ErrorCodes} from '../../utils/properties/openaireProperties'; -import{DOI} from '../../utils/string-utils.class'; - - -@Component({ - selector: 'claim-dataset', - template: ` - - - -
-
- - -
-
-
-
-

{{dataciteResultsNum }} Total Results

- -
- -
-
    -
  • -
    - {{item.title}} - {{item.title}} - -
    - Publisher: {{item.publisher}} -
    Authors: {{author}}{{(i < (item.creator.length-1))?"; ":""}}
    - -
  • -
- -
-
-
-
-
-
- -
-
-
    -
  • -
    - {{result['title'].name}} - {{result['title'].name}} - -
    - Publisher: {{result.publisher}}({{result.year}}) -
    Authors: {{author.name}}{{(i < (result.authors.length-1))?"; ":""}}
    - -
  • -
-
No results found
-
-
-
-
-
- - ` -}) -export class ClaimDatasetComponent { - constructor (private _searchDataciteService: SearchDataciteService, private _searchDatasetsService:SearchDatasetsService){ - var myDate = new Date(); - this.todayDate = myDate.getFullYear()+ "-" +(myDate.getMonth() + 1) + "-" + myDate.getDate() ; - this.nextDate = (myDate.getFullYear()+100)+ "-" +(myDate.getMonth() + 1) + "-" + myDate.getDate() ; - - } - ngOnInit() { - if(this.keyword !=null && this.keyword.length > 0){ - this.search(this.keyword,this.size,1); - } -} - -@Input() public select:boolean = true ; -@Input() public keyword:string = ''; -@Input() public selectedDatasets = [] ; -@Output() datasetsChange = new EventEmitter(); - public size:number = 10; - public navigateTo: string = "Search"; - public source: string = "datacite"; - public type : string = "dataset"; - public errorCodes:ErrorCodes = new ErrorCodes(); - - dataciteResults=[]; - dataciteResultsNum:number = null; - // dataciteResultsNum : Observable = null; - dataciteStatus = this.errorCodes.NONE; - datacitePage : number = 1; - - openaireResults=[]; - openaireResultsNum:number = 0 ; - openaireStatus = this.errorCodes.NONE; - openairePage : number = 1; - - public warningMessage = ""; - public infoMessage = ""; - - public todayDate = ''; - public nextDate = ''; - public DOIs:string[] = []; - - public search(term: string, size : number, page : number){ - this.DOIs = DOI.getDOIsFromString(term); - this.searchDatacite(term,10,1); - this.searchOpenaire(term,10,1); - } - private searchDatacite (term: string, size : number, page : number) { - this.getDataciteResults(term,size,page); - this.warningMessage = ""; - this.infoMessage = ""; - - } - private searchOpenaire (term: string, size : number, page : number) { - if(this.DOIs.length > 0 ){ - this.openaireStatus = this.errorCodes.LOADING; - this._searchDatasetsService.searchDatasetsByDois(this.DOIs, null, page, size, []).subscribe( - data => { - if(data != null) { - this.openairePage=page; - this.openaireResultsNum = data[0]; - this.openaireResults = data[1]; - this.openaireStatus = this.errorCodes.DONE; - if(this.openaireResultsNum == 0){ - this.openaireStatus = this.errorCodes.NONE; - } - } - }, - err => { - this.openaireStatus = this.errorCodes.ERROR; - console.log(err.status); - } - ); - }else{ - this._searchDatasetsService.searchDatasets('q="'+term+'"', null, page, size, []).subscribe( - data => { - if(data != null) { - this.openairePage=page; - this.openaireResultsNum = data[0]; - this.openaireResults = data[1]; - this.openaireStatus = this.errorCodes.DONE; - if(this.openaireResultsNum == 0){ - this.openaireStatus = this.errorCodes.NONE; - } - } - }, - err => { - this.openaireStatus = this.errorCodes.ERROR; - console.log(err.status); - } - ); - } - this.warningMessage = ""; - this.infoMessage = ""; - - } - private getDataciteResults (term: string, size : number, page : number) { - this._searchDataciteService.searchDataciteResults(term, size, page).subscribe( - data => { - this.dataciteResults = data.docs; - this.datacitePage=page; - this.dataciteResultsNum = data.numFound; - this.dataciteStatus = this.errorCodes.DONE; - - - }, - err => { - this.dataciteStatus = this.errorCodes.ERROR; - console.log(err); - } - - ); - } - - add(item, itemId,itemType,itemSource,itemTitle, itemUrl, date, accessmode){ - console.log(' adding dataset '+ itemSource+" "+ itemTitle); - var result: ClaimResult ; - if(itemSource == 'datacite'){ - result = {id: itemId, type :itemType, source : itemSource, title: itemTitle,url: itemUrl, result: item, accessRights: 'OPEN', embargoEndDate: this.nextDate, date : date}; - }else if (itemSource == 'openaire'){ - //TODO put right access rights - result = {id: itemId, type :itemType, source : itemSource, title: itemTitle,url: itemUrl, result: item, accessRights: accessmode, embargoEndDate: this.nextDate, date : date}; - } - var found:boolean = this.isSelected( result.id); - this.warningMessage = ""; - if (!found) { - this.selectedDatasets.push(result); - this.datasetsChange.emit({ - value: this.selectedDatasets - }); - }else{ - this.warningMessage = "Dataset already in selected list"; - } - - } - - - datacitePageChange($event) { - this.datacitePage=$event.value; - this.dataciteResults=[]; - this.searchDatacite(this.keyword,10,this.datacitePage); - this.warningMessage = ""; - this.infoMessage = ""; - - } - openairePageChange($event) { - this.openairePage=$event.value; - this.openaireResults=[]; - this.searchOpenaire(this.keyword,10,this.openairePage); - this.warningMessage = ""; - this.infoMessage = ""; - - } - isSelected(id:string){ - - var found:boolean = false; - this.warningMessage = ""; - for (var _i = 0; _i < this.selectedDatasets.length; _i++) { - let item = this.selectedDatasets[_i]; - if(item.id == id){ - found=true; - break; - } - } - return found; - } -} diff --git a/portal-2/src/app/claimPages/claim-utils/claimProject.component.ts b/portal-2/src/app/claimPages/claim-utils/claimProject.component.ts deleted file mode 100644 index 9a71f201..00000000 --- a/portal-2/src/app/claimPages/claim-utils/claimProject.component.ts +++ /dev/null @@ -1,191 +0,0 @@ -import {Component, Input,Output, ElementRef, EventEmitter, ViewChild} from '@angular/core'; -import {Observable} from 'rxjs/Observable'; -import {SearchProjectsService} from '../../services/searchProjects.service'; -import {ProjectService} from '../../services/project.service'; -import {ModalLoading} from '../../utils/modal/loading.component'; -import { Subject } from 'rxjs/Subject'; -import {ClaimProject} from '../../utils/entities/claimEntities.class'; - -@Component({ - selector: 'claim-projects', - // styleUrls: ['/autoComplete.component.css'], - - template: ` -
-
-
-
- - -
- - - -
-
- - - -
- - - ` - -}) -export class ClaimProjectsComponent { - ngOnInit() { - this.getFunders(); - } - @ViewChild (ModalLoading) loading : ModalLoading ; - - @Input() public inline: boolean = false ; // for claimed started from landing pages - public query = ''; - @Input() public selectedProjects=[] ; - public elementRef; - - public funders:string[]; - @Input() public selectedFunderId:string ="0"; - selectedFunderName:string ="Select funder:"; - @Output() cselectedFunderChange = new EventEmitter(); - - public projects:string[]; - public warningMessage = ""; - public infoMessage = ""; - - public searchTermStream = new Subject(); - filtered: Observable<{}> = this.searchTermStream - .debounceTime(300).distinctUntilChanged() - .switchMap((term: string) => this._projectService.searchForProjectsObs(term, this.selectedFunderId)); - public tries:number = 0 ; - public keywordlimit = 3; - -constructor(private _service: ProjectService, private _projectService: SearchProjectsService, myElement: ElementRef) { - this.elementRef = myElement; -} - - -search() { - console.info("heeere "+this.query ); - this.infoMessage = ""; - // this.filtered = []; - if(this.query == ""){ - this.tries = 0; - this.warningMessage = ""; - } else if(this.query && this.query.length < this.keywordlimit){ - this.tries++; - if(this.tries == this.keywordlimit -1 ){ - this.warningMessage = "Type at least " + this.keywordlimit + " characters"; - this.tries = 0; - } - }else{ - console.info("doo the search "+this.query ); - - this.tries = 0; - this.warningMessage = ""; - this.searchTermStream.next(this.query); - - } - -} -select(item){ - this.query = ""; - this.searchTermStream.next(this.query); //clear - item = item.value; - var project: ClaimProject = { funderId: this.selectedFunderId,funderName: this.selectedFunderName, projectId: item.id, projectName: item.projectName , projectAcronym: item.projectAcronym, startDate: item.startDate, endDate: item.endDate }; - console.log(item); - // this._service.getProjectDates(project.projectId).subscribe( - // data => { - // project.startDate = data.startDate; - // project.endDate = data.endDate; - // }, - // err => console.log(err) - // ); - var index:number =this.selectedProjects.indexOf(project); - var found:boolean = false; - this.warningMessage = ""; - - for (var _i = 0; _i < this.selectedProjects.length; _i++) { - let item = this.selectedProjects[_i]; - if(item.projectId == project.projectId){ - found=true; - this.warningMessage = "Project already in selected list"; - } - } - if (!found) { - this.selectedProjects.push(project); - - } - -} -showItem(item):string{ - return ((item.field[1]['@value'])?item.field[1]['@value']+" - ":"" ) + item.field[3]['@value']; -} -remove(item){ - var index:number =this.selectedProjects.indexOf(item); - if (index > -1) { - this.selectedProjects.splice(index, 1); - } - -} -handleClick(event){ - var clickedComponent = event.target; - var inside = false; - do { - if (clickedComponent === this.elementRef.nativeElement) { - inside = true; - } - clickedComponent = clickedComponent.parentNode; - } while (clickedComponent); - -} -getFunders () { - console.info("Getting Funders...."); - this._projectService.getFunders().subscribe( - data => { - this.funders = data[1]; - }, - err => console.log(err) - ); - } - - getProjects () { - if(this.selectedFunderId != '0'){ - - } - } -funderChanged(funderId:string, funderName:string){ - this.selectedFunderId = funderId; - this.selectedFunderName = funderName; - console.info("Selected funder:"+this.selectedFunderId+ ' name:'+funderName ); - -} - -} diff --git a/portal-2/src/app/claimPages/claim-utils/claimPublication.component.html b/portal-2/src/app/claimPages/claim-utils/claimPublication.component.html deleted file mode 100644 index c3891156..00000000 --- a/portal-2/src/app/claimPages/claim-utils/claimPublication.component.html +++ /dev/null @@ -1,110 +0,0 @@ - -
- -
-
-
- - - - -
- -
-
-
    -
  • -
    - {{item.title}} - {{item.title}} - -
    - Publisher: {{item.publisher}}({{(item['published-print']['date-parts'][0][0])?item['published-print']['date-parts'][0][0]:item['published-print']['date-parts'][0]}}) -
    Authors: {{author.family}} {{author.given}}{{(i < (item.author.length-1))?"; ":""}}
    -
    Editors: {{author.family}} {{author.given}}{{(i < (item.editor.length-1))?"; ":""}}
    - -
  • -
-
-
-
-
-
- - - - -
- -
-
-
    -
  • -
    - {{result['title'].name}} - {{result['title'].name}} - -
    - Publisher: {{result.publisher}}({{result.year}}) -
    Authors: {{author.name}}{{(i < (result.authors.length-1))?"; ":""}}
    - -
  • -
-
-
-
-
-
- - - -
No results found
- -
-
Not the right author? Choose one of these: - - - - - - - -
- Results for - {{authorGivenName}} {{authorFamilyName}} - {{authorId}} : - - -
- - -
-
-
    -
  • -
    - {{item['work-title']['title'].value}} - -
    - Journal: {{item['journal-title'].value}} ({{item['publication-date'].year.value}}) -
    Authors: {{author}}{{(i < (item.contributors.length-1))?"; ":""}}
    - -
  • -
-
No results found
-
-
-
-
-
-
diff --git a/portal-2/src/app/claimPages/claim-utils/claimPublication.component.ts b/portal-2/src/app/claimPages/claim-utils/claimPublication.component.ts deleted file mode 100644 index fa19962d..00000000 --- a/portal-2/src/app/claimPages/claim-utils/claimPublication.component.ts +++ /dev/null @@ -1,400 +0,0 @@ -import {Component, Input, Output, EventEmitter} from '@angular/core'; -import { ActivatedRoute } from '@angular/router'; -import {SearchCrossrefService} from '../../services/searchCrossref.service'; -import {SearchOrcidService} from '../../services/searchOrcid.service'; -import {SearchPublicationsService} from '../../services/searchPublications.service'; -import { ErrorCodes} from '../../utils/properties/openaireProperties'; -import {ClaimResult} from '../../utils/entities/claimEntities.class'; -import{DOI} from '../../utils/string-utils.class'; - -@Component({ - selector: 'claim-publication', - templateUrl: 'claimPublication.component.html', - -}) -export class ClaimPublicationComponent { - constructor (private _searchCrossrefService: SearchCrossrefService,private _searchOrcidService: SearchOrcidService, private _searchPublicationsService: SearchPublicationsService, - private route: ActivatedRoute) { - var myDate = new Date(); - this.todayDate = myDate.getFullYear()+ "-" +(myDate.getMonth() + 1) + "-" + myDate.getDate() ; - this.nextDate = (myDate.getFullYear()+100)+ "-01-01" ; - - } - ngOnInit() { - this.sub = this.route.params.subscribe(params => { - if(this.keyword !=null && this.keyword.length > 0){ - this.search(this.keyword); - } - }); - -} -ngOnDestroy() { - this.sub.unsubscribe(); -} -@Input() public keyword:string = ""; -@Input() public select:boolean = true ; -@Input() public selectedPublications = [] ; -@Output() publicationsChange = new EventEmitter(); - sub: any; - size:number = 10; - source: string = "crossref"; - type : string = "publication"; - errorCodes:ErrorCodes = new ErrorCodes(); - - crossrefResults=[]; - crossrefResultsNum : number = null; - crossrefPage : number = 1; - crossrefStatus:number = this.errorCodes.NONE; - - openaireResults = []; - openaireResultsNum: number ; - openairePage : number = 1; - openaireStatus:number = this.errorCodes.NONE; - - orcidResults: string[]; - orcidResultsNum: number ; - totalPages: number; - orcidResultsToShow: string[]; - orcidPage : number = 1; - orcidStatus:number = this.errorCodes.NONE; - authorId: string; - authorGivenName: string; - authorFamilyName: string; - - authorIds: string[]; - authorGivenNames: string[]; - authorFamilyNames: string[]; - - authorsNum : number ; - - public warningMessage = ""; - public infoMessage = ""; - - todayDate = ''; - nextDate = ''; -private DOIs:string[] = []; - -public search(term: string){ - this.warningMessage = ""; - this.infoMessage = ""; - this.DOIs = DOI.getDOIsFromString(term); - this.getCrossrefResults(term, this.size,1); - this.searchOrcid(term); - this.searchOpenaire(term, this.size, 1); -} - - -private getCrossrefResults (term: string, size : number, page : number) { - this.crossrefStatus = this.errorCodes.LOADING; - if( this.DOIs.length > 0 ){ - this._searchCrossrefService.searchCrossrefByDOIs(this.DOIs).subscribe( - data => { - if(data != null) { - this.crossrefResults = data.items; - this.crossrefPage=page; - this.crossrefResultsNum = data['total-results']; - if(data.items == 0){ - this._searchCrossrefService.searchCrossrefResults(term, size, page).subscribe( - data => { - if(data != null) { - this.crossrefResults = data.items; - this.crossrefPage=page; - this.crossrefResultsNum = data['total-results']; - this.crossrefStatus = this.errorCodes.DONE; - - }else{ - this.crossrefStatus = this.errorCodes.ERROR; - } - }, - err =>{ - console.log(err.status); - this.crossrefStatus = this.errorCodes.ERROR; - } - - ); - }else{ - this.crossrefStatus = this.errorCodes.DONE; - } - } - }, - err => { - //console.log(err); - this._searchCrossrefService.searchCrossrefResults(term, size, page).subscribe( - data => { - this.crossrefResults = data.items; - this.crossrefPage=page; - this.crossrefResultsNum = data['total-results']; - this.crossrefStatus = this.errorCodes.DONE; - - }, - err => { - console.log(err.status); - this.crossrefStatus = this.errorCodes.ERROR; - } - - ); - } - ); - - }else{ - - - this._searchCrossrefService.searchCrossrefResults(term, size, page).subscribe( - data => { - if(data != null) { - this.crossrefResults = data.items; - this.crossrefPage=page; - this.crossrefResultsNum = data['total-results']; - this.crossrefStatus = this.errorCodes.DONE; - - }else{ - this.crossrefStatus = this.errorCodes.ERROR; - } - - }, - err => { - console.log(err.status); - this.crossrefStatus = this.errorCodes.ERROR; - } - ); - } - } - private searchOpenaire(term: string, size : number, page : number) { - - if(this.DOIs.length > 0 ){ - this.openaireStatus = this.errorCodes.LOADING; - this._searchPublicationsService.searchPublicationsByDois(this.DOIs, null, page, size, []).subscribe( - data => { - if(data != null) { - this.openairePage=page; - this.openaireResultsNum = data[0]; - this.openaireResults = data[1]; - this.openaireStatus = this.errorCodes.DONE; - if(this.openaireResultsNum == 0){ - this.openaireStatus = this.errorCodes.NONE; - } - }else { - this.openaireStatus = this.errorCodes.ERROR; - } - }, - err => { - this.openaireStatus = this.errorCodes.ERROR; - console.log(err.status); - } - ); - }else{ - this.openaireStatus = this.errorCodes.LOADING; - this._searchPublicationsService.searchPublications('q="'+term+'"', null, page, size, []).subscribe( - data => { - if(data != null) { - this.openairePage=page; - this.openaireResultsNum = data[0]; - this.openaireResults = data[1]; - this.openaireStatus = this.errorCodes.DONE; - if(this.openaireResultsNum == 0){ - this.openaireStatus = this.errorCodes.NONE; - } - }else { - this.openaireStatus = this.errorCodes.ERROR; - } - }, - err => { - this.openaireStatus = this.errorCodes.ERROR; - console.log(err.status); - } - ); - } - } - - private searchOrcid (term: string) { - if(this.DOIs.length > 0){ - this.orcidStatus = this.errorCodes.NONE; - return; - } - this.orcidStatus = this.errorCodes.LOADING; - this.authorIds = new Array(); - this.authorGivenNames = new Array(); - this.authorFamilyNames = new Array(); - - this.getOrcidAuthor(term); - - console.info('searchOrcid in searchOrcid file'); - } - - private readData(data: any) { - this.authorIds.push(data[2].path); - - if(data[0] != null) { - this.authorGivenNames.push(data[0].value); - } else { - this.authorGivenNames.push(""); - } - if(data[1] != null) { - this.authorFamilyNames.push(data[1].value); - } else { - this.authorFamilyNames.push(""); - } - } - - private getOrcidAuthor (term: string) { - this.orcidResultsNum = null; - - //passing structures in order to fill them in service - this._searchOrcidService.searchOrcidAuthor(term, this.authorIds, - this.authorGivenNames, this.authorFamilyNames).subscribe( - data => { - if(data != null && data == true) { - this.getOrcidResultsById(0); - } - - this.orcidStatus = this.errorCodes.NONE; - - }, - err => this.errorHandler(err, term) - - ); - } - - private errorHandler(err: any, term: string) { - if(err.status == 404){ - this.getOrcidAuthors(term); - } else { - this.orcidStatus = this.errorCodes.ERROR; - console.log(err.status); - - } - } - - private getOrcidAuthors (term: string) { - this.orcidResultsNum = null; - - //passing structures in order to fill them in service - this._searchOrcidService.searchOrcidAuthors(term, this.authorIds, - this.authorGivenNames, this.authorFamilyNames).subscribe( - data => { - if(data != null && data == true) { - this.getOrcidResultsById(0); - }else{ - this.orcidStatus = this.errorCodes.ERROR; - } - - }, - err => { - this.orcidStatus = this.errorCodes.ERROR; - console.log(err.status); - } - ); - } - - - private getOrcidResultsById (index:number) { - if(this.authorIds.length > index) { - let id = this.authorIds[index]; - - console.info("getOrcidResultsById: "+id); - this._searchOrcidService.searchOrcidPublications(id).subscribe( - data => { - if(data != null) { - this.orcidResults=data['orcid-work']; - this.orcidResultsNum = data['orcid-work'].length; - this.orcidPage = 1; - if((this.orcidResultsNum % this.size) == 0){ - this.totalPages=parseInt(''+(this.orcidResultsNum/this.size)); - } else{ - this.totalPages=parseInt(''+(this.orcidResultsNum/this.size+1)); - } - - this.orcidResultsToShow = this.orcidResults.slice(0,10); - - this.orcidStatus = this.errorCodes.DONE; - if(this.orcidResultsNum == 0){ - this.orcidStatus = this.errorCodes.NONE; - } - } else { - this.orcidResultsNum = 0; - this.totalPages=0; - this.orcidStatus = this.errorCodes.NONE; - } - this.authorGivenName = this.authorGivenNames[index]; - this.authorFamilyName = this.authorFamilyNames[index]; - this.authorId = id; - }, - err => { - console.log(err.status); - this.orcidStatus = this.errorCodes.ERROR; - } - ); - - } - } - private add(item, id, itemSource, itemType, itemUrl, itemTitle, date, accessMode){ - var result: ClaimResult ; - if(itemSource == 'crossref'){ - date = (date == null) ? null : date.substring(0,10); - result = {id: id, type :itemType, source : itemSource, title: itemTitle,url: itemUrl, result: item, accessRights: 'OPEN', embargoEndDate: this.nextDate, date}; - }else if (itemSource == 'orcid'){ - date = (date == null) ? null : date + "-01.-01" - result = {id:id, type :itemType, source : itemSource, title: itemTitle,url: itemUrl, result: item, accessRights: 'OPEN', embargoEndDate: this.nextDate, date}; - }else if (itemSource == 'openaire'){ - //TODO put right access rights - result = {id:id, type :itemType, source : itemSource, title: itemTitle,url: itemUrl, result: item, accessRights: accessMode, embargoEndDate: null, date}; - - } - console.info("Added result:"+result.date); - var found:boolean = this.isSelected(result.id); - this.warningMessage = ""; - if (!found) { - this.selectedPublications.push(result); - this.publicationsChange.emit({ - value: this.selectedPublications - }); - }else{ - this.warningMessage = "Publication already in selected list"; - } - - } - private remove(item){ - this.warningMessage = ""; - this.infoMessage = ""; - var index:number =this.selectedPublications.indexOf(item); - item.selected=false; - if (index > -1) { - this.selectedPublications.splice(index, 1); - this.publicationsChange.emit({ - value: this.selectedPublications - }); - } - - } -private crossrefPageChange($event) { - this.crossrefPage=$event.value; - this.crossrefResults=[]; - console.log("Crossref chaenged "+this.crossrefPage); - this.getCrossrefResults(this.keyword,this.size,this.crossrefPage); -} -private orcidPageChange($event) { - this.orcidPage=$event.value; - this.orcidResultsToShow=[]; - this.orcidResultsToShow = this.orcidResults.slice(($event.value-1)*this.size, $event.value*this.size); -} -private openairePageChange($event) { - this.openairePage=$event.value; - this.searchOpenaire(this.keyword,this.size,this.openairePage); -} - - private isSelected(id:string){ - - var found:boolean = false; - this.warningMessage = ""; - for (var _i = 0; _i < this.selectedPublications.length; _i++) { - let item = this.selectedPublications[_i]; - if(item.id == id){ - found=true; - this.warningMessage = "Publication already in selected list"; - } - } - return found; - - - } -} diff --git a/portal-2/src/app/claimPages/claim-utils/claimResult.component.ts b/portal-2/src/app/claimPages/claim-utils/claimResult.component.ts deleted file mode 100644 index cdaadcf8..00000000 --- a/portal-2/src/app/claimPages/claim-utils/claimResult.component.ts +++ /dev/null @@ -1,108 +0,0 @@ -import {Component, Input, Output, EventEmitter, ViewChild} from '@angular/core'; -import {ClaimPublicationComponent} from './claimPublication.component'; -import {ClaimDatasetComponent} from './claimDataset.component'; -import {SearchDataciteService} from '../../services/searchDatacite.service'; - -@Component({ - selector: 'claim-result', - template: ` - - -
-
-
- - -
- - Publication - Dataset - - - - - - - - -
-
-
-
-
-
- -
-
- -
-
- - `, -}) -export class ClaimResultComponent { - constructor (private _searchDataciteService: SearchDataciteService) { - var myDate = new Date(); - this.todayDate = myDate.getFullYear()+ "-" +(myDate.getMonth() + 1) + "-" + myDate.getDate() ; - this.nextDate = (myDate.getFullYear()+100)+ "-" +(myDate.getMonth() + 1) + "-" + myDate.getDate() ; - - } - ngOnInit() { - // if(this.keyword !=null && this.keyword.length > 0){ - // this.searchDatacite(this.keyword,this.size,this.page); - // } -} - @ViewChild (ClaimPublicationComponent) claimPublicationComponent : ClaimPublicationComponent ; - @ViewChild (ClaimDatasetComponent) claimDatasetComponent : ClaimDatasetComponent ; - - page : number = 1; - size:number = 10; - navigateTo: string = "Search"; - source: string = "datacite"; - type : string = "dataset"; - searchType ="publication"; - @Input() public select:boolean = true ; - @Input() public keyword:string = ''; - @Input() public selectedDatasets = [] ; - @Input() public selectedPublications = [] ; - @Output() datasetsChange = new EventEmitter(); - @Output() publicationsChange = new EventEmitter(); - - todayDate = ''; - nextDate = ''; - search(){ - if(this.searchType=='dataset'){ - this.claimDatasetComponent.search(this.keyword,10,1); - }else{ - this.claimPublicationComponent.search(this.keyword); - } - } - - typeChanged(type:string) { - this.searchType = type; - } - publicationsChanged($event) { - this.selectedPublications=$event.value; - this.publicationsChange.emit({ - value: this.selectedPublications - }); - - } - datasetsChanged($event) { - this.selectedDatasets=$event.value; - this.datasetsChange.emit({ - value: this.selectedDatasets - }); - } -} diff --git a/portal-2/src/app/claimPages/claim-utils/claims.component.html b/portal-2/src/app/claimPages/claim-utils/claims.component.html deleted file mode 100644 index f4468993..00000000 --- a/portal-2/src/app/claimPages/claim-utils/claims.component.html +++ /dev/null @@ -1,111 +0,0 @@ - -
- -
- Filter By: - - - - - -
- -
-
-
- Showing {{(size*page - size +1)}} to {{(size*page>resultsNum)?resultsNum:(size*page)}} of {{resultsNum}} claims -
-
- -
-
- - - -
-
-
- - -
...
- - -
...
- -
- -
- An Error occured. -
- - - - -
-
-
- You have selected {{selected.length}} claim(s) -
-
-
- -
- -
-
- - -
-
No entries found.
-
- -
- - - - - - - - - - - - - - - - - - - - - - - -
Research Result Link to Claimed by Claimed Date
{{claim.userMail}}{{claim.date}}
- - - - diff --git a/portal-2/src/app/claimPages/claim-utils/claims.component.ts b/portal-2/src/app/claimPages/claim-utils/claims.component.ts deleted file mode 100644 index 069ec2ad..00000000 --- a/portal-2/src/app/claimPages/claim-utils/claims.component.ts +++ /dev/null @@ -1,490 +0,0 @@ -import {Component, ViewChild, Input} from '@angular/core'; -import {Location} from '@angular/common'; -import {Observable} from 'rxjs/Observable'; -import {ActivatedRoute, Router} from '@angular/router'; -import {ClaimsService} from '../../services/claims.service'; -import {ModalLoading} from '../../utils/modal/loading.component'; -import {AlertModal} from '../../utils/modal/alert'; - - -@Component({ - selector: 'claims', - templateUrl: 'claims.component.html', - providers:[ ClaimsService] - -}) -export class ClaimsComponent { - constructor (private _claimService: ClaimsService, private route: ActivatedRoute, private _router:Router, private location: Location) { - } - - ngOnInit() { - this.sub = this.route.queryParams.subscribe(params => { - if( this.myClaims == 'true' ){ - this.fetchBy = "User"; - }else{ - - this.fetchBy = params['fetchBy']; - this.fetchBy = (this.types.indexOf(this.fetchBy) != -1)? this.fetchBy:'All'; - this.fetchId = params['fetchId']; - this.fetchId=this.fetchId?this.fetchId:''; - - } - - let page = (params['page']=== undefined)?1:+params['page']; - let size = (params['size']=== undefined)?10:+params['size']; - - this.keyword = (params['keyword']?params['keyword']:""); - this.inputkeyword = this.keyword; - this.page = ( page <= 0 ) ? 1 : page; - this.size = ( size <= 0 ) ? 10 : size; - this.entityTypes = []//(params['types']?params['types']:[]); - this.setTypes(params['types']); // check the appropriate checkboxes - this.setSortby(params['sort']); - this.getClaims(); - - }); - // this.sub = this.route.params.subscribe(params => { - // console.info(this.isAdmin+" "+this.myClaims+" Fetch by: "+this.fetchBy+" Fetch id: "+this.fetchId); - // if( this.myClaims == 'true' ){ - // console.info("Is myclaims"); - // this.fetchBy = "User"; - // }else{ - // console.info("Is admin"); - // - // console.info(this.isAdmin); - // - // this.fetchBy = params['fetchBy']; - // this.fetchBy = (this.types.indexOf(this.fetchBy) != -1)? this.fetchBy:'All'; - // this.fetchId = params['fetchId']; - // console.info("Fetch by:"+this.fetchBy+"Fetch id:"+this.fetchId); - // this.fetchId=this.fetchId?this.fetchId:''; - // - // } - // - // console.info(this.isAdmin+" "+this.myClaims+" Fetch by: "+this.fetchBy+" Fetch id: "+this.fetchId); - // let page = (params['page']=== undefined)?1:+params['page']; - // let size = (params['size']=== undefined)?10:+params['size']; - // - // this.keyword = (params['keyword']?params['keyword']:""); - // this.inputkeyword = this.keyword; - // this.page = ( page <= 0 ) ? 1 : page; - // this.size = ( size <= 0 ) ? 10 : size; - // this.entityTypes = []//(params['types']?params['types']:[]); - // this.setTypes(params['types']); // check the appropriate checkboxes - // this.setSortby(params['sort']); - // this.getClaims(); - // console.info("params: "+params['page']+" page "+page +" this.page: "+this.page ); - // }); - } - ngOnDestroy() { - this.sub.unsubscribe(); - } - sub: any; - //string because comes as input from component directive - @Input() enableDelete: string = 'false'; - @Input() myClaims: string= 'false' ; - @Input() isAdmin:string = 'false'; - page : number; - size:number; - keyword:string; // the keyword string to give to the request as parameter - inputkeyword:string; // the string written in the input field (keyword=inputkeyword when its length is bigger than 3 and the user stops typing) - lengths = [10,20,30,50]; - types = ["All","Project","Context","Result","User"]; - @Input() fetchBy:string; - @Input() fetchId:string; - - navigateTo: string = "Claims"; - resultsNum: number ; - claims: string[]; - - @ViewChild (ModalLoading) loading : ModalLoading ; - - //checkboxes: - publicationCB = false; - datasetCB = false; - contextCB = false; - projectCB = false; - entityTypes : string[] =[] ; - - descending = true; - sortby = "date"; - - selected=[]; - deleteMessage:string = ""; - showErrorMessage:boolean = false; - - //params for pagingFormatter to use when navigate to page - params; - @ViewChild(AlertModal) alert; - - claimsDeleted:number = 0; - - getClaims () { - this.selected=[]; - var types = ''; - this.showErrorMessage = false; - for (var type of this.entityTypes){ - types+=(types.length>0?'&':'')+"types="+type; - } - if(this.fetchBy =="Project" ){ - this._claimService.getClaimsByProject(this.size,this.page,this.fetchId,this.keyword,this.sortby,this.descending, types).subscribe( - data => { - this.claims = data.data; - this.resultsNum= data.total; - }, - err => { - console.log(err); - this.showErrorMessage = true; - } - ); - }else if(this.fetchBy =="User"){ - this._claimService.getClaimsByUser(this.size,this.page,this.fetchId,this.keyword,this.sortby,this.descending, types).subscribe( - data => { - this.claims = data.data; - this.resultsNum= data.total; - }, - err => { - console.log(err); - this.showErrorMessage = true; - } - ); - }else if(this.fetchBy =="Result"){ - this._claimService.getClaimsByResult(this.size,this.page,this.fetchId,this.keyword,this.sortby,this.descending, types).subscribe( - data => { - this.claims = data.data; - this.resultsNum= data.total; - }, - err => { - console.log(err); - this.showErrorMessage = true; - } - ); - }else if(this.fetchBy =="Context"){ - this._claimService.getClaimsBycontext(this.size,this.page,this.fetchId,this.keyword,this.sortby,this.descending, types).subscribe( - data => { - this.claims = data.data; - this.resultsNum= null; - this.resultsNum= data.total;//data.length; //TODO get the total results num - }, - err => { - console.log(err); - this.showErrorMessage = true; - } - ); - }else{ - this._claimService.getClaims(this.size,this.page,this.keyword,this.sortby,this.descending, types).subscribe( - data => { - this.claims = data.data; - this.resultsNum = null; - this.resultsNum= data.total;//data.length; //TODO get the total results num - }, - err => { - console.log(err); - this.showErrorMessage = true; - } - ); - } - } - - goToClaim(claimId: number){ - this._router.navigate( ['Claim', { id: claimId}] ); - } - goTo(page:number = 1){ - - this.page = page; - - this.location.go(location.pathname,this.getParametersString()); - this.getClaims(); - } - getParameters(){ - let params={ page: this.page, size: this.size, types: this.entityTypes, fetchBy: this.fetchBy, fetchId:this.fetchId, keyword : this.keyword, sort: this.getSortby() }; - return params; - } - getParametersString(){ - var params=''; - params+=(this.page==1?"":(params.length>0?'&':'')+"page="+this.page); - params+=(this.size==10?"":(params.length>0?'&':'')+"size="+this.size); - // params+=(this.entityTypes==''?"":(params.length>0?'&':'')+"types="+this.entityTypes); - var types=""; - for (var type of this.entityTypes){ - types+=(types.length>0?',':'')+type; - } - params+=(types.length>0)?"types="+types:""; - - if(this.isAdmin === 'true'){ - params+=(this.fetchBy=='All'?"":(params.length>0?'&':'')+"fetchBy="+this.fetchBy); - params+=(this.fetchId==''?"":(params.length>0?'&':'')+"fetchId="+this.fetchId); - } - params+=(this. getSortby()=='datedesc'?"":(params.length>0?'&':'')+"sort="+this. getSortby()); - params+=(this.keyword==''?"":(params.length>0?'&':'')+"keyword="+this.keyword); - return params; - } - changeSize(size: number ){ - this.size = size; - this.goTo(); - } - - clearFilters(){ - this.keyword = ''; - this.inputkeyword = ''; - this.publicationCB = false; - this.projectCB = false; - this.datasetCB = false; - this.contextCB = false; - this.entityTypes = []; - this.goTo(); - } - changeOrderby(sortby:string){ - if(sortby==this.sortby){ - this.descending = !this.descending; - }else{ - this.sortby = sortby; - this.descending = false; - } - this.goTo(); - } - setSortby(sortby:string){ - if(!sortby|| sortby == "datedesc"){ - this.descending = true; - this.sortby = "date"; - }else if(sortby == "dateasc"){ - this.descending = false; - this.sortby = "date"; - }else if(sortby == "userasc"){ - this.descending = false; - this.sortby = "user"; - }else if(sortby == "userdesc"){ - this.descending = true; - this.sortby = "user"; - }if(sortby =="sourceasc"){ - this.descending = false; - this.sortby = "source"; - }else if(sortby == "sourcedesc"){ - this.descending = true; - this.sortby = "source"; - }else if(sortby == "targetasc"){ - this.descending = false; - this.sortby = "target"; - }else if(sortby == "targetdesc"){ - this.descending = true; - this.sortby = "target"; - } - } - getSortby():string{ - if(this.descending){ - return this.sortby+"desc"; - }else{ - return this.sortby+"asc"; - } - - } - changeType(){ - this.entityTypes = []; - if(this.publicationCB){ - this.entityTypes.push('publication'); - } - if(this.datasetCB){ - this.entityTypes.push('dataset'); - } - if(this.projectCB){ - this.entityTypes.push('project'); - } - if(this.contextCB){ - this.entityTypes.push('context'); - } - - // if(this.publicationCB == true && this.datasetCB == true && this.contextCB == true && this.projectCB == true ){ - // this.entityTypes=""; - // }else{ - // this.entityTypes = ""; - // if(this.publicationCB == true){ - // this.entityTypes = "publication"; - // } - // if(this.datasetCB == true){ - // this.entityTypes += (this.entityTypes.length > 0?",":"")+"dataset"; - // } - // if(this.contextCB == true){ - // this.entityTypes += (this.entityTypes.length > 0?",":"")+"context"; - // } - // if(this.projectCB == true){ - // this.entityTypes += (this.entityTypes.length > 0?",":"")+"project"; - // } - // } - // console.debug("Type changed: "+this.entityTypes+" "+this.publicationCB+ this.datasetCB + this.contextCB + this.projectCB); - this.goTo(); - } - setTypes(types:string){ - if(!types){ - return; - } - if(types.length > 0){ - this.entityTypes = []; - if(types.indexOf("publication")!=-1){ - this.publicationCB = true; - this.entityTypes.push("publication"); - } - if(types.indexOf("dataset")!=-1){ - this.datasetCB = true; - this.entityTypes.push("dataset"); - } - if(types.indexOf("project")!=-1){ - this.projectCB = true; - this.entityTypes.push("project"); - } - if(types.indexOf("context")!=-1){ - this.contextCB = true; - this.entityTypes.push("context"); - } - } - if(this.publicationCB && this.datasetCB && this.contextCB && this.projectCB){ - this.entityTypes=[]; - } - } - changekeyword(){ - - if(this.inputkeyword.length >= 3 || this.inputkeyword.length == 0 ){ - this.keyword = this.inputkeyword; - this.page = 1; - this.goTo(); - } - - } - select(item:any,event){ - this.deleteMessage=""; - var value = event.currentTarget.checked; - if(value){ - this.selected.push(item); - }else{ - for (var _i = 0; _i < this.selected.length; _i++) { - let claim = this.selected[_i]; - if(claim['id'] == item.id){ - this.selected.splice(_i, 1); - } - } - - - } - } - selectAll(){ - this.selected = []; - for (var _i = 0; _i < this.claims.length; _i++) { - let claim = this.claims[_i]; - this.selected.push(claim); - } - this.deleteMessage = ""; - } - deselectAll(){ - this.selected = []; - this.deleteMessage=""; - } - isSelected(id:string){ - for (var _i = 0; _i < this.selected.length; _i++) { - let claim = this.selected[_i]; - if(claim['id'] == id){ - return true; - } - } - return false; - } - - - confirmOpen(){ - if(this.selected.length <= 0){ - - }else{ - this.alert.cancelButton = true; - this.alert.okButton = true; - this.alert.alertTitle = "Delete "+this.selected.length+" claim(s)"; - this.alert.message = this.selected.length+" claims will be deleted. Do you want to proceed? "; - this.alert.okButtonText = "Yes"; - this.alert.cancelButtonText = "No"; - this.alert.open(); - } - } - confirmClose(data){ - this.delete(); - } - delete(){ - this.deleteMessage=""; - this.loading.open(); - this.claimsDeleted = 0; - var ids = []; - for (var i = 0; i < this.selected.length; i++){ - var id =this.selected[i].id; - ids.push(id); - // var selected =this.selected[i].id; - // console.warn("Deleting claim with id:"+id); - // this.deleteById(id); - //TODO for multiple concurrent - } - this.batchDeleteById(ids); - } - - deleteById(id:string){ - - console.warn("Deleting claim with id:"+id); - // this._claimService.deleteClaimById(id); - this._claimService.deleteClaimById(id).subscribe( - res => { - console.info('Delete response'+res.code ); - console.warn("Deleted claim with id:"+ id); - //remove this claim from the - let newClaims=this.claims; - for (var _i = 0; _i < this.claims.length; _i++) { - let claim = this.claims[_i]; - if(claim['id'] == id){ - newClaims.splice(_i, 1); - } - } - //TODO should call getClaims??? - this.claimsDeleted++; - this.claims = newClaims; - if(this.claimsDeleted == this.selected.length){ - this.resultsNum = this.resultsNum - this.selected.length; - this.loading.close(); - this.selected = []; - } - - - }); - } - batchDeleteById(ids:string[]){ - - console.warn("Deleting claim with ids:"+ids); - this._claimService.deleteBulk(ids).subscribe( - res => { - console.info('Delete response'+res.code ); - console.warn("Deleted ids:"+ res.deletedIds); - console.warn("Not found ids:"+ res.notFoundIds); - //remove this claim from the - let newClaims=this.claims; - for(var id of res.deletedIds){ - for (var _i = 0; _i < this.claims.length; _i++) { - let claim = this.claims[_i]; - if(claim['id'] == id){ - newClaims.splice(_i, 1); - } - } - for (var _i = 0; _i < this.selected.length; _i++) { - let claim = this.selected[_i]; - if(claim['id'] == id){ - this.selected.splice(_i, 1); - } - } - } - this.claims = newClaims; - this.resultsNum = this.resultsNum - res.deletedIds.length; - this.loading.close(); - if(res.deletedIds.length>0){ - this.deleteMessage=this.deleteMessage+'
'+res.deletedIds.length+' claim(s) successfully deleted.
'; - } - if(res.notFoundIds.length>0){ - this.deleteMessage=this.deleteMessage+'
'+res.notFoundIds.length+' claim(s) couldn\'t be deleted.
'; - } - }); - } - pageChange($event) { - var page:number = +$event.value - this.goTo(page); - } -} diff --git a/portal-2/src/app/claimPages/claim.module.ts b/portal-2/src/app/claimPages/claim.module.ts deleted file mode 100644 index 42d9b836..00000000 --- a/portal-2/src/app/claimPages/claim.module.ts +++ /dev/null @@ -1,68 +0,0 @@ -import { NgModule} from '@angular/core'; -import { CommonModule } from '@angular/common'; -import { FormsModule } from '@angular/forms'; - -import {UtilsModule} from '../utils/utils.module'; -import {ServicesModule} from '../services/services.module'; - -import { ClaimsService} from '../services/claims.service'; -//main -import {ClaimComponent} from './claim/claim.component'; -import {ClaimsAdminComponent} from './claims/claimsAdmin.component'; -import {MyClaimsComponent} from './myClaims/myClaims.component'; -import {LinkingHomeComponent} from './linking/linkingHome.component'; -import {LinkingComponent} from './linking/linking.component'; -import { BulkLinkingComponent } from './linking/bulkLinking.component'; - -import {BulkClaimComponent} from './linking/bulkClaim/bulkClaim.component'; -import {ClaimsComponent} from './claim-utils/claims.component'; - -import {ClaimContextComponent} from './claim-utils/claimContext.component'; -import {ClaimProjectsComponent} from './claim-utils/claimProject.component'; -import {ClaimResultComponent} from './claim-utils/claimResult.component'; -import {ClaimPublicationComponent} from './claim-utils/claimPublication.component'; -import {ClaimDatasetComponent} from './claim-utils/claimDataset.component'; - -import {ClaimInsertComponent} from './linking/insertClaim/insertClaim.component'; - -import {ClaimSelectedContextsComponent} from './linking/selected/selectedContexts.component'; -import {ClaimSelectedComponent} from './linking/selected/selected.component'; -import {ClaimSelectedDatasetsComponent} from './linking/selected/selectedDatasets.component'; -import {ClaimSelectedResultsComponent} from './linking/selected/selectedResults.component'; -import {ClaimSelectedProjectsComponent} from './linking/selected/selectedProjects.component'; -import {ClaimSelectedPublicationsComponent} from './linking/selected/selectedPublications.component'; - -import {LinkingGenericComponent} from './linking/linkingGeneric.component'; - -import {InlineClaimContextComponent} from './inlineClaims/inlineClaimContext.component'; -import {InlineClaimProjectComponent} from './inlineClaims/inlineClaimProject.component'; -import {InlineClaimResultComponent} from './inlineClaims/inlineClaimResult.component'; -import {ClaimEntityFormatter} from '../utils/claimEntityFormatter.component'; - -import { Claim } from '../utils/entities/claim'; -//helpers - -import { ClaimRoutingModule } from './claim-routing.module'; -@NgModule({ - imports: [ - CommonModule, FormsModule, - UtilsModule, - ServicesModule, - ClaimRoutingModule - - ], - declarations: [ - ClaimsAdminComponent, MyClaimsComponent, ClaimComponent, ClaimsComponent, - BulkLinkingComponent, LinkingComponent, LinkingHomeComponent, LinkingGenericComponent, - InlineClaimContextComponent, InlineClaimProjectComponent, InlineClaimResultComponent, ClaimSelectedComponent, - ClaimContextComponent, ClaimSelectedContextsComponent, ClaimInsertComponent, ClaimProjectsComponent, ClaimSelectedProjectsComponent, - ClaimResultComponent, ClaimSelectedPublicationsComponent, ClaimSelectedDatasetsComponent, ClaimSelectedResultsComponent, ClaimPublicationComponent, - ClaimDatasetComponent, BulkClaimComponent, - ClaimEntityFormatter - ], - providers: [ ClaimsService ], - exports: [ - InlineClaimContextComponent, InlineClaimProjectComponent, InlineClaimResultComponent - ] -}) -export class ClaimModule { } diff --git a/portal-2/src/app/claimPages/claim/claim.component.html b/portal-2/src/app/claimPages/claim/claim.component.html deleted file mode 100644 index 41ecc151..00000000 --- a/portal-2/src/app/claimPages/claim/claim.component.html +++ /dev/null @@ -1,10 +0,0 @@ -
-

Here is the claim with id : {{id}}

-
- {{claim.id }} || {{claim.userMail }} || - {{claim | json}} {{claim | json}} -
-
-
-

No proper id...

-
diff --git a/portal-2/src/app/claimPages/claim/claim.component.ts b/portal-2/src/app/claimPages/claim/claim.component.ts deleted file mode 100644 index 786270cd..00000000 --- a/portal-2/src/app/claimPages/claim/claim.component.ts +++ /dev/null @@ -1,43 +0,0 @@ -import {Component} from '@angular/core'; -import {Observable} from 'rxjs/Observable'; -import {ActivatedRoute, Router} from '@angular/router'; - -import {ClaimsService} from '../../services/claims.service'; -// import {Claim} from '../../utils/entities/claim'; - -@Component({ - selector: 'claim', - templateUrl: 'claim.component.html', - -}) -export class ClaimComponent { - constructor (private _claimService: ClaimsService, - private route: ActivatedRoute, private _router:Router) {} - ngOnInit() { - this.sub = this.route.queryParams.subscribe(params => { - - this.id = params['id']; - console.info("Claim id:"+this.id +" " +params['id']); - if(this.id!=null){ - this.getClaim(this.id); - } - }); - - -} -ngOnDestroy() { - this.sub.unsubscribe(); -} - sub: any; - id : string; - claim : any; - getClaim (id: string) { - this._claimService.getClaim(id) - .then(data => { - this.claim = data; - console.log(data); - }) ; - } - - -} diff --git a/portal-2/src/app/claimPages/claims/claimsAdmin.component.ts b/portal-2/src/app/claimPages/claims/claimsAdmin.component.ts deleted file mode 100644 index 404817cc..00000000 --- a/portal-2/src/app/claimPages/claims/claimsAdmin.component.ts +++ /dev/null @@ -1,36 +0,0 @@ -import {Component, ViewChild, Input} from '@angular/core'; -import {Location} from '@angular/common'; -import {Observable} from 'rxjs/Observable'; - -@Component({ - selector: 'claims-admin', - template: ` -
- - -
- - -
- TODO login -
- `, - -}) -export class ClaimsAdminComponent { - constructor ( ) { - - } -user:string="argirok@di.uoa.gr"; - ngOnInit() { - - - } - - -} diff --git a/portal-2/src/app/claimPages/inlineClaims/inlineClaimContext.component.ts b/portal-2/src/app/claimPages/inlineClaims/inlineClaimContext.component.ts deleted file mode 100644 index f0f5cf93..00000000 --- a/portal-2/src/app/claimPages/inlineClaims/inlineClaimContext.component.ts +++ /dev/null @@ -1,94 +0,0 @@ -import {Component, Input, ViewChild, Output, EventEmitter} from '@angular/core'; -import {ClaimInsertComponent} from '../linking/insertClaim/insertClaim.component'; - -@Component({ - selector: 'inline-claim-context', - template: ` - - -
-
- - - -
- - - - -
-` - -}) - export class InlineClaimContextComponent { - constructor ( ) { - - } - - @Input() public inlineEntity:any; - @Input() public inlineType:string; - - - contexts=[]; - publications; - datasets; - public show = 'context'; - public showComp:boolean = false; - public enableButton:boolean=true; - public keyword: string = ""; - - @Output() contextAdded = new EventEmitter(); - -@ViewChild (ClaimInsertComponent) claimInsert : ClaimInsertComponent ; - ngOnInit() { - - } - showChange($event) { - this.show=$event.value; - if(this.show == "end"){ - //TODO - this.contextAdded.emit({ - value: this.contexts - }); - this.contexts = []; - this.showComponent(); - - }else if(this.show == "error"){ - this.showComponent(); - } - } - public toggle(){ - if(!this.showComp){ - this.showComponent(); - }else{ - this.hideComponent(); - } - } - private showComponent(){ - this.showComp=true; - this.enableButton = true; - - } - private hideComponent(){ - this.showComp=false; - } - private insert(){ - this.claimInsert.publications = []; - this.claimInsert.publications.push(this.inlineEntity); - this.publications = []; - this.publications.push(this.inlineEntity); - console.info(" result: :targetId: " +this.publications[0].id + "targetType :"+ this.publications[0].type+" targetCollectedFrom:"+ this.publications[0].source+ "targetAccessRights :"+this.publications[0].accessRights+ " targetEmbargoEndDate:"+this.publications[0].embargoEndDate); - this.enableButton = false; - if (!this.claimInsert.validateInsertions()){ - this.enableButton = true; - } - - - } - private cancel(){ - this.contexts = []; - - this.hideComponent(); - } -} diff --git a/portal-2/src/app/claimPages/inlineClaims/inlineClaimProject.component.ts b/portal-2/src/app/claimPages/inlineClaims/inlineClaimProject.component.ts deleted file mode 100644 index 4f8cd392..00000000 --- a/portal-2/src/app/claimPages/inlineClaims/inlineClaimProject.component.ts +++ /dev/null @@ -1,107 +0,0 @@ -import {Component, Input, ViewChild, Output, EventEmitter} from '@angular/core'; -import {Observable} from 'rxjs/Observable'; -import {ClaimInsertComponent} from '../linking/insertClaim/insertClaim.component'; - -@Component({ - selector: 'inline-claim-project', - template: ` - - -
-
- - - -
- - - -
- - - -` - -}) - export class InlineClaimProjectComponent { - constructor () { - - } - - @Input() public inlineEntity:any; - @Input() public inlineType: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(); - -@ViewChild (ClaimInsertComponent) claimInsert : ClaimInsertComponent ; - ngOnInit() { - - } - - showChange($event) { - this.show=$event.value; - if(this.show == "end"){ - //TODO - this.projectAdded.emit({ - value: this.projects - }); - this.projects = []; - this.showComponent(); - }else if(this.show == "error"){ - this.showComponent(); - } - } - public toggle(){ - console.info("TOOGLE pr "); - if(!this.showComp){ - console.info("TOOGLE show "); - this.showComponent(); - }else{ - console.info("TOOGLE hide "); - this.hideComponent(); - } - } - private showComponent(){ - this.showComp=true; - this.enableButton = true; - - } - private hideComponent(){ - this.showComp=false; - } - private insert(){ - if(this.inlineType === 'dataset'){ - this.datasets = []; - this.datasets.push(this.inlineEntity); - this.claimInsert.datasets = []; - this.claimInsert.datasets.push(this.inlineEntity); - }else if(this.inlineType === 'publication'){ - this.claimInsert.publications = []; - this.claimInsert.publications.push(this.inlineEntity); - this.publications = []; - this.publications.push(this.inlineEntity); - console.info(" result: :targetId: " +this.publications[0].id + "targetType :"+ this.publications[0].type+" targetCollectedFrom:"+ this.publications[0].source+ "targetAccessRights :"+this.publications[0].accessRights+ " targetEmbargoEndDate:"+this.publications[0].embargoEndDate); - } - this.enableButton = false; - if (!this.claimInsert.validateInsertions()){ - this.enableButton = true; - } - - - } - private cancel(){ - this.projects = []; - - this.hideComponent(); - } -} diff --git a/portal-2/src/app/claimPages/inlineClaims/inlineClaimResult.component.ts b/portal-2/src/app/claimPages/inlineClaims/inlineClaimResult.component.ts deleted file mode 100644 index cc14b9c7..00000000 --- a/portal-2/src/app/claimPages/inlineClaims/inlineClaimResult.component.ts +++ /dev/null @@ -1,117 +0,0 @@ -import {Component, Input, ViewChild, Output, EventEmitter} from '@angular/core'; -import {Observable} from 'rxjs/Observable'; -import {ClaimInsertComponent} from '../linking/insertClaim/insertClaim.component'; -// import {ClaimResultComponent} from '../linking/claimResult/claimResult.component'; -// import {ClaimSelectedResultsComponent} from '../linking/selected/selectedResults.component'; - -@Component({ - selector: 'inline-claim-result', - template: ` - - -
-
- - - - -
- - - -
- - - -` - -}) - export class InlineClaimResultComponent { - constructor () { - - } - // This is the component from the landing page - @Input() public inlineEntity:any; - @Input() public inlineType:string; - public hideType: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(); - -@ViewChild (ClaimInsertComponent) claimInsert : ClaimInsertComponent ; - ngOnInit() { - console.info("Inline entity:"+this.inlineEntity.id); - this.hideType = this.inlineType; - if(this.inlineType == 'dataset' || this.inlineType == 'publication' ){ - this.hideType = ""; - } - } - - datasetsChange($event) { - this.datasets=$event.value; - console.log($event.value); - } - publicationsChange($event) { - this.publications=$event.value; - console.log($event.value); - } - showChange($event) { - this.show=$event.value; - if(this.show == "end"){ - this.datasetAdded.emit({ - value: this.datasets - }); - this.publicationAdded.emit({ - value: this.publications - }); - this.datasets = []; - this.publications = []; - this.showComponent(); - }else if(this.show == "error"){ - this.showComponent(); - } - } - public toggle(){ - if(!this.showComp){ - this.showComponent(); - }else{ - this.hideComponent(); - } - } - private showComponent(){ - this.showComp=true; - this.enableButton = true; - - } - private hideComponent(){ - this.showComp=false; - } - private insert(){ - if(this.inlineType === 'project'){ //TODO check if neccessary - this.claimInsert.projects = []; - this.claimInsert.projects.push(this.inlineEntity); - } - - this.enableButton = false; - if (!this.claimInsert.validateInsertions()){ - this.enableButton = true; - } - - } - private cancel(){ - this.datasets = []; - this.publications = []; - this.hideComponent(); - } -} diff --git a/portal-2/src/app/claimPages/linking/bulkClaim/bulkClaim.component.ts b/portal-2/src/app/claimPages/linking/bulkClaim/bulkClaim.component.ts deleted file mode 100644 index bdd78f51..00000000 --- a/portal-2/src/app/claimPages/linking/bulkClaim/bulkClaim.component.ts +++ /dev/null @@ -1,206 +0,0 @@ -import {Component, Input, Output, EventEmitter,ViewChild} from '@angular/core'; -import {Observable} from 'rxjs/Observable'; -import {SearchCrossrefService} from '../../../services/searchCrossref.service'; -import {ModalLoading} from '../../../utils/modal/loading.component'; -import {Dates, DOI} from '../../../utils/string-utils.class'; - - -@Component({ - selector: 'bulk-claim', - template: ` -
-
- - -
-
- -
-
-
Upload a csv file containing DOIs. For each DOI found in file, metadata will be fetched from CrossRef. - Available results can be linked with the selected Projects and Contexts. - More information -
- CSV format: -
    -
  • The format of CSV file should be "DOI","ACCESS_MODE","DATE".
  • -
  • Access mode column should have values: "OPEN","CLOSED" or "EMBARGO".
  • -
  • Date column valid format is YYYY-MM-DD and is required when access mode has value EMBARGO.
  • -
  • In case access mode is not available default value is "OPEN".
  • -
-
-
- - - - ` - -}) -//[(ngModel)]="date" -export class BulkClaimComponent { - filesToUpload: Array; - navigateTo: string = "Search"; - source: string = "crossref"; - type : string = "publication"; - resultsFromSearch:number; - @Input() public select:boolean = true ; - @Input() public publications; - all:number = 0; - allIds:string[] = []; - found:number = 0; - foundIds:string[] = []; - duplicate:number = 0; - duplicateIds:string[] = []; - notFound:number = 0; - notFoundIds:string[] = []; - showReport:boolean = false; - showInfo :boolean = false; - @ViewChild (ModalLoading) loading : ModalLoading ; - errorMessage = ""; - infoMEssage = ""; - enableUpload:boolean = true; - constructor(private _searchCrossrefService: SearchCrossrefService) { - this.filesToUpload = []; - - - } - ngOnInit() {} - - upload() { - this.enableUpload = false; - this.showReport = false; - this.errorMessage = ""; - if(this.filesToUpload.length == 0){ - this.errorMessage = "There is no selected file to upload."; - return ; - } - this.makeFileRequest("http://localhost:8000/upload", [], this.filesToUpload).then((result) => { - var rows = (result as any).split('\n'); // I have used space, you can use any thing. - var i = 0; - this.all = 0; - this.duplicate = 0; - this.duplicateIds = []; - this.allIds = []; - this.found = 0; - this.foundIds = []; - this.publications.slice(0,this.publications.length); - this.notFound = 0; - this.notFoundIds = []; - - for(i=0;i-1){ - this.duplicate++; - this.duplicateIds.push(id); - }else{ - this.allIds.push(id); - this.fetchResult(id,accessMode,embargoDate); - } - } - } - - } - - }, (error) => { - this.enableUpload = true; - console.log(error); - // this.loading.close(); - this.errorMessage = "An error occured while uploading..."; - }); - } - private removeDoubleQuotes(value){ - if(value.indexOf('"')== 0){ - value = value.substring(1,value.length); - } - var index =+value.indexOf('"'); - if(index == (value.length - 1) || index == (value.length - 2) ){ - value = value.substring(0,index); - } - return value; - } - private validateAccessMode(value){ - var accessModes = ["OPEN", "CLOSED", "EMBARGO"]; - if(accessModes.indexOf(value) > -1){ - return true; - } - - return false; - } - - fileChangeEvent(fileInput: any){ - this.filesToUpload = > fileInput.target.files; - } - - makeFileRequest(url: string, params: Array, files: Array) { - return new Promise((resolve, reject) => { - var formData: any = new FormData(); - var xhr = new XMLHttpRequest(); - for(var i = 0; i < files.length; i++) { - formData.append("uploads[]", files[i], files[i].name); - } - xhr.onreadystatechange = function () { - if (xhr.readyState == 4) { - if (xhr.status == 200) { - resolve(xhr.response); - } else { - reject(xhr.response); - } - } - } - xhr.open("POST", url, true); - xhr.send(formData); - }); - } - - fetchResult(id:string,accessMode:string,date:string){ - this._searchCrossrefService.searchCrossrefByDOIs([id]).subscribe( - data => { - - var crossrefResult = data.items[0]; - if(data.items.length > 0){ - this.found++; - this.foundIds.push(id); - var result = {id: id, type :'publication', source : 'crossref', - title: crossrefResult.title,url: crossrefResult.URL, result: crossrefResult, accessRights: accessMode, embargoEndDate: date, date : crossrefResult.created['date-time']}; - this.publications.push(result); - - - }else{ - this.notFound++; - this.notFoundIds.push(id); - } - this.endOfFetching(); - }, - err => { - console.log(err); - this.notFound++; - this.notFoundIds.push(id); - this.endOfFetching(); - } - ); - } - - endOfFetching(){ - if(this.all == this.found+this.notFound+ this.duplicate ){ - this.showReport = true; - this.enableUpload = true; - } - - } -} diff --git a/portal-2/src/app/claimPages/linking/bulkLinking.component.ts b/portal-2/src/app/claimPages/linking/bulkLinking.component.ts deleted file mode 100644 index 42c04446..00000000 --- a/portal-2/src/app/claimPages/linking/bulkLinking.component.ts +++ /dev/null @@ -1,16 +0,0 @@ -import {Component, Input} from '@angular/core'; -import {Observable} from 'rxjs/Observable'; - -@Component({ - selector: 'bulk-linking', - //providers: [MdRadioDispatcher], - template: ` - - ` - -}) -//[(ngModel)]="date" -export class BulkLinkingComponent { - constructor () { - } -} diff --git a/portal-2/src/app/claimPages/linking/insertClaim/insertClaim.component.ts b/portal-2/src/app/claimPages/linking/insertClaim/insertClaim.component.ts deleted file mode 100644 index aba97aa3..00000000 --- a/portal-2/src/app/claimPages/linking/insertClaim/insertClaim.component.ts +++ /dev/null @@ -1,264 +0,0 @@ -import {Component, Input, Output, EventEmitter, ViewChild} from '@angular/core'; -import {Observable} from 'rxjs/Observable'; -import {Router} from '@angular/router'; -import {ClaimsService} from '../../../services/claims.service'; -import {ModalLoading} from '../../../utils/modal/loading.component'; -import {AlertModal} from '../../../utils/modal/alert'; - - -@Component({ - selector: 'claim-insert', - template: ` - - -
- -
-
- -
- - - - ` -}) -export class ClaimInsertComponent { - constructor (private claimService: ClaimsService, private _router:Router) {} - ngOnInit() { - // console.info("Inlineentity:" +(this.inlineEntity)?this.inlineEntity+(this.inlineEntity.id)?this.inlineEntity.id:"no id":"null"+ + " show "+ (!this.claiming && this.showButton) ); - } - - - @Input() public contexts; - @Input() public projects; - @Input() public publications; - @Input() public datasets; - @Input() public showButton:boolean = true; - @Input() show='claim'; - @Input() inline: boolean = false; // link from landing page? - @Input() inlineEntity; // the entity from the landing page - @Output() showChange = new EventEmitter(); - - @ViewChild (ModalLoading) loading : ModalLoading ; - @ViewChild(AlertModal) alert; - - 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) ); - if(this.validate()){ - if(this.validateDates()){ - this.insert(); - return true; - } - } - return -} -private insert(){ - this.claiming = true; - var user="argirok@di.uoa.gr" - this.loading.open(); - var claims = []; - if(this.publications){ - console.info("publications: "+this.publications.length); - - for (var i = 0; i < this.publications.length; i++) { - - var result=this.publications[i]; - if(this.contexts){ - for (var j = 0; j < this.contexts.length; j++) { - var context = this.contexts[j]; - var claim = this.createContextClaim(result, context, user); - claims.push(claim); - } - } - if(this.projects){ - for (var k = 0; k < this.projects.length; k++) { - var project = this.projects[k]; - var projectClaim = this.createProjectClaim(result, project, user); - claims.push(projectClaim); - } - } - if(this.inline && this.inlineEntity){ - var resultClaim = this.createResultClaim(this.inlineEntity, result, user); - claims.push(resultClaim); - } - - } - } - if(this.datasets){ - for (var i = 0; i < this.datasets.length; i++) { - var result=this.datasets[i]; - if(this.contexts){ - for (var j = 0; j < this.contexts.length; j++) { - var context = this.contexts[j]; - var claim = this.createContextClaim(result, context, user); - claims.push(claim); - } - } - if(this.projects){ - for (var k = 0; k < this.projects.length; k++) { - var project = this.projects[k]; - var projectClaim = this.createProjectClaim(result, project, user); - claims.push(projectClaim); - } - } - if(this.inline && this.inlineEntity){ - var resultClaim = this.createResultClaim(this.inlineEntity, result, user); - claims.push(resultClaim); - } - - } - } - console.info("try to insert "+claims.length+" claims"); - this.claimService.insertBulkClaims(claims).subscribe( - data => { - var inserted = data.insertedIds.length; - - var inserted = data.insertedIds.length; - this.afterclaimsInsertion(data.insertedIds,data.errorInClaims); - }, - err => { - console.log(err); - this.errorsInClaimsInsertion(err.insertedIds,err.errorInClaims); - } - ); -} -private validate(){ - this.warningMessage = ""; - this.errorMessage = ""; - if(this.datasets && this.datasets.length == 0 && this.publications && this.publications.length == 0){ - this.warningMessage = "There are no publications or datasets selected."; - }else if((!this.contexts|| this.contexts.length==0 )&&(!this.projects|| this.projects.length==0 )&& ( !this.inlineEntity)){ - this.warningMessage = "There are no projects or concepts to link."; - // }else if (this.inline && !this.inlineEntity){ - // this.errorMessage = "No inline entity"; - // console.log(this.inline + " "+ this.inlineEntity); - }else{ - return true; - } - return false; -} -private validateDates(){ - if(this.projects){ - for (var k = 0; k < this.projects.length; k++) { - var project = this.projects[k]; - console.info(project.startDate+" "+project.endDate + " "+project.projectAcronym); - if(this.publications){ - for (var i = 0; i < this.publications.length; i++) { - var result = this.publications[i]; - if(result.date && result.date != null){ - console.info("Date :"+ result.date + " & embargoEndDate :" +result.embargoEndDate ); - if((project.startDate && result.date < project.startDate) || ( project.endDate && result.date > project.endDate) ){ - this.confirmOpen(); - return false; - } - } - } - } - if(this.datasets){ - for (var i = 0; i < this.datasets.length; i++) { - var result = this.datasets[i]; - if(result.date && result.date != null){ - console.info("Date :"+ result.date + " & embargoEndDate :" +result.embargoEndDate ); - if((project.startDate && result.date < project.startDate) || ( project.endDate && result.date > project.endDate) ){ - this.confirmOpen(); - return false; - } - } - } - } - - - } - } - if(this.publications){ - for (var i = 0; i < this.publications.length; i++) { - var result = this.publications[i]; - if(result.date && result.date != null){ - console.info("Date :"+ result.date + " & embargoEndDate :" +result.embargoEndDate ); - if((result.embargoEndDate && result.embargoEndDate != null) && result.date >result.embargoEndDate ){ - this.confirmOpen(); - return false; - } - } - } - } - if(this.datasets){ - for (var i = 0; i < this.datasets.length; i++) { - var result = this.datasets[i]; - if(result.date && result.date != null){ - console.info("Date :"+ result.date + " & embargoEndDate :" +result.embargoEndDate ); - if((result.embargoEndDate && result.embargoEndDate != null) && result.date >result.embargoEndDate ){ - this.confirmOpen(); - return false; - } - } - } - } - return true; -} -private afterclaimsInsertion(insertedIds, errorInClaims){ - this.loading.close(); - if(errorInClaims.length == 0){ - if(this.inline){ - this.show = "end"; - }else{ - this._router.navigate( ['/myclaims'] ); - } - this.showChange.emit({ - value: this.show - }); - }else{ - this.errorsInClaimsInsertion(insertedIds, errorInClaims); - } -} -private errorsInClaimsInsertion(insertedIds, errorInClaims){ - this.errorMessage = "An Error Occured."; - this.loading.close(); - this.error = true; - if(this.inline){ - this.show = "error"; - this.showChange.emit({ - value: this.show - }); - } - -} - - - - private createContextClaim(result:any, context:any, user:any){ - var claim = { claimedBy : user, sourceId : context.concept.id, sourceType : "context", sourceCollectedFrom:"openaire", sourceAccessRights:"OPEN", sourceEmbargoEndDate:"no", targetId : result.id , targetType : result.type, targetCollectedFrom: result.source, targetAccessRights:result.accessRights, targetEmbargoEndDate: (result.embargoEndDate == null?"":result.embargoEndDate)}; - return claim; - } - private createProjectClaim(result:any, project:any, user:any){ - //project.projectId - // var dummyID = "dummyID"; - var claim = { claimedBy : user, sourceId : project.projectId, sourceType : "project", sourceCollectedFrom:"openaire", sourceAccessRights:"OPEN", sourceEmbargoEndDate:"", targetId : result.id , targetType : result.type, targetCollectedFrom: result.source, targetAccessRights:result.accessRights, targetEmbargoEndDate: (result.embargoEndDate == null?"":result.embargoEndDate)}; - return claim; - } - private createResultClaim(inlineResult:any, result:any, user:any){ - var claim = { claimedBy : user, sourceId : result.id, sourceType : result.type, sourceCollectedFrom: result.source, sourceAccessRights: result.accessRights, sourceEmbargoEndDate: result.embargoEndDate, targetId : inlineResult.id , targetType : inlineResult.type, targetCollectedFrom: inlineResult.source, targetAccessRights: inlineResult.accessRights, targetEmbargoEndDate: (inlineResult.embargoEndDate == null?"":inlineResult.embargoEndDate)}; - return claim; - } - - confirmOpen(){ - this.alert.cancelButton = true; - this.alert.okButton = true; - this.alert.alertTitle = "Invalid dates"; - this.alert.message = "There is a research result whose publication date is after project end date or before project start date. Or embargo end date of a research result is before research result's publication date."; - this.alert.okButtonText = "Procceed anyway"; - this.alert.cancelButtonText = "Cancel"; - this.alert.open(); - } - confirmClose(data){ - this.insert(); - } -} diff --git a/portal-2/src/app/claimPages/linking/linking.component.ts b/portal-2/src/app/claimPages/linking/linking.component.ts deleted file mode 100644 index 99c7acc1..00000000 --- a/portal-2/src/app/claimPages/linking/linking.component.ts +++ /dev/null @@ -1,16 +0,0 @@ -import {Component, Input} from '@angular/core'; -import {Observable} from 'rxjs/Observable'; -import {LinkingGenericComponent} from './linkingGeneric.component'; - -@Component({ - selector: 'linking', - template: ` - -` - -}) -export class LinkingComponent { - constructor () { - } - -} diff --git a/portal-2/src/app/claimPages/linking/linkingGeneric.component.ts b/portal-2/src/app/claimPages/linking/linkingGeneric.component.ts deleted file mode 100644 index bf419da7..00000000 --- a/portal-2/src/app/claimPages/linking/linkingGeneric.component.ts +++ /dev/null @@ -1,191 +0,0 @@ -import {Component, Input} from '@angular/core'; -import {Observable} from 'rxjs/Observable'; -import { Router } from '@angular/router'; - -@Component({ - selector: 'linking-generic', - //providers: [MdRadioDispatcher], - template: ` -
- - -
- - -
-
- -
- - - -
- -
- -
-
-

TODO software

-
-
- -
- -
-
- - - - -
-
-
- - - - - - - - - -
- - -
-
- - -` - -}) -//[(ngModel)]="date" -export class LinkingGenericComponent { - constructor ( private _router: Router) { - } - @Input() bulkMode: boolean = false; - sourceType:string; - targetType:string; - step:number = 1; - contexts=[]; - projects=[]; - publications=[]; - datasets=[]; - show = "home"; - searchType="publication"; //publication or dataset - date='8-6-2016'; - keyword: string = ""; - linkType:string ="project"; // link type (selected in home page) : project, context, software, etc - ngOnInit() { - - } - next(){ - - if((this.show == 'project' || this.show == 'context' || this.show == 'software')){ - if(!this.bulkMode){ - this.show='result'; - }else{ - this.show='claim'; - } - }else if((this.show == 'result' && this.keyword == '')||(this.show == 'dataset' || this.show == 'publication')){ - this.show='claim'; - - } - } - prev(){ - if(this.show == 'result'){ - this.show = this.linkType; - }else if(this.show == 'context' || this.show == 'project' || this.show == 'software' ){ - this.show='home'; - } else if(this.show == 'claim'){ - // this.show='result'; - if(!this.bulkMode){ - this.show='result'; - }else{ - this.show = this.linkType; - } - } - } - goto(term: string) { - this._router.navigate( ['Search', { keyword: term }] ); - } - - search() { - if(this.searchType == 'publication' ){ - this.show="publication"; - }else{ - this.show="dataset"; - } - - } - - sourceTypeChange($event) { - this.sourceType=$event.value; - console.log($event.value); - } - targetTypeChange($event) { - this.targetType=$event.value; - console.log($event.value); - } - // contextsChange($event) { - // this.contexts=$event.value; - // console.log($event.value); - // } - publicationsChange($event) { - this.publications=$event.value; - } - datasetsChange($event) { - this.datasets=$event.value; - } - projectsChange($event) { - this.projects=$event.value; - } - typeChanged(type:string) { - this.searchType = type; - } - linkTypeChange($event) { - this.linkType =$event.value; - this.show=$event.value; - - } - showChange($event) { - this.show=$event.value; - this.showChangedType($event.value); - - - } - showChangedType(type:string) { - this.show=type; - if(this.show == 'project' || this.show == 'context' || this.show == 'software'){ - this.linkType = this.show; - } - - - } -} diff --git a/portal-2/src/app/claimPages/linking/linkingHome.component.ts b/portal-2/src/app/claimPages/linking/linkingHome.component.ts deleted file mode 100644 index 78e9a574..00000000 --- a/portal-2/src/app/claimPages/linking/linkingHome.component.ts +++ /dev/null @@ -1,58 +0,0 @@ -import {Component, Output, EventEmitter, Input} from '@angular/core'; -import {Observable} from 'rxjs/Observable'; - -@Component({ - selector: 'linking-home', - template: ` -
-
-
- -
-

Link with project

-

Link your research result with funded projects.

- Link with project - -
-
-
-
-

Link with Community

-

Link your research result with research communities.

- Link with community - -
-
-
-
-

Link with Software

-

....

- Link with software - -
-
- -
-
-

Bulk mode linking

-

Link Research Results to projects,contects, etc, providing a CSV file with research results' DOIs

- Bulk mode linking -
-
- - ` - -}) - -export class LinkingHomeComponent { - @Output() linkTypeChange = new EventEmitter(); - @Input() bulkMode:boolean = false; - linkType:string = "project"; - select(type:string){ - this.linkType = type; - this.linkTypeChange.emit({ - value: this.linkType - }); - } - -} diff --git a/portal-2/src/app/claimPages/linking/selected/selected.component.ts b/portal-2/src/app/claimPages/linking/selected/selected.component.ts deleted file mode 100644 index 4a9eb2fc..00000000 --- a/portal-2/src/app/claimPages/linking/selected/selected.component.ts +++ /dev/null @@ -1,209 +0,0 @@ -import {Component, Input,Output, EventEmitter} from '@angular/core'; -import {ClaimResult,ClaimProject, ClaimContext} from '../../../utils/entities/claimEntities.class'; - -@Component({ - selector: 'claim-selected', - template: ` - -
- -
- -
-
    -
  • Selected Concepts ({{(contexts.length)}}) - -
  • -
  • - {{context.community }} > {{context.category}} > {{context.concept.label}} - - -
  • -
  • There are no contexts
  • -
-
- -
-
- -
-
    -
  • Selected Projects ({{(projects.length)}}) - -
  • -
  • - - {{project.funderName}} | {{project.projectName}} {{(project.projectAcronym)?'('+project.projectAcronym+')':''}} - -
  • -
  • There are no projects
  • -
-
- -
-
- - -
-
    - -
  • There are no Research Results
  • -
  • {{publications. length }} Selected Publications: - -
  • -
  • - - - {{pub.title}} - {{pub.title}}({{pub.date.substring(0,4)}}) - - - - - - - - - - -
  • -
  • {{datasets.length}} Selected Research Data: - -
  • -
  • - - - {{dataset.title}} - {{dataset.title}} - ({{dataset.date.substring(0,4)}}) - - - - - - - - - - -
  • - -
-
- -
- -
- ` - - -}) -export class ClaimSelectedComponent { - ngOnInit() { - console.info("Show accessRights selection? :"+this.showAccessRights); - var myDate = new Date(); - this.todayDate=( myDate.getFullYear()+ "-" +myDate.getMonth() + 1) + "-" + myDate.getDate() ; - this.nextDate= ( (myDate.getFullYear()+100)+ "-" +myDate.getMonth() + 1) + "-" + myDate.getDate() ; - //2015-05-01 -} - - - @Input() contexts: ClaimContext[]; - @Input() projects: ClaimProject[]; - @Input() publications: ClaimResult[]; - @Input() datasets: ClaimResult[]; - @Input() showAccessRights:boolean = false; - @Input() show='home'; - @Input() inline:boolean = false; - @Input() hideType; - @Input() bulkMode:boolean = false; - @Input() linkToResults:boolean = true; - @Output() projectsChange = new EventEmitter(); - @Output()publicationsChange = new EventEmitter(); - @Output() datasetsChange = new EventEmitter(); - @Output() contextsChange = new EventEmitter(); - - @Output() showChange = new EventEmitter(); - - todayDate = ''; - nextDate = ''; - removeContext(item:any){ - var index:number =this.contexts.indexOf(item); - if (index > -1) { - this.contexts.splice(index, 1); - } - this.contextsChange.emit({ - value: this.contexts - }); - } - removePublication(item:any){ - var index:number =this.publications.indexOf(item); - if (index > -1) { - this.publications.splice(index, 1); - } - this.publicationsChange.emit({ - value: this.publications - }); - } - removeDataset(item:any){ - var index:number =this.datasets.indexOf(item); - if (index > -1) { - this.datasets.splice(index, 1); - } - this.datasetsChange.emit({ - value: this.datasets - }); - } - removeProject(item:any){ - var index:number =this.projects.indexOf(item); - if (index > -1) { - this.projects.splice(index, 1); - } - this.projectsChange.emit({ - value: this.projects - }); - } - showType(type){ - if(type != this.show){ - this.show = type; - this.showChange.emit({ - value: this.show - }); - } - } - accessTypes = ["OPEN","CLOSED","EMBARGO","RESTRICTED"]; - - dateChanged (event:any, item:any) { - item.embargoEndDate = event.target.value ; - } - publicationsChanged($event) { - this.publications=$event.value; - this.publicationsChange.emit({ - value: this.publications - }); - } -} - - - -// @Component({ -// selector: 'add-more', -// template: `` -// }) -// export class Addmore { -// @Input() type = 'publication'; -// } diff --git a/portal-2/src/app/claimPages/linking/selected/selectedContexts.component.ts b/portal-2/src/app/claimPages/linking/selected/selectedContexts.component.ts deleted file mode 100644 index 42976998..00000000 --- a/portal-2/src/app/claimPages/linking/selected/selectedContexts.component.ts +++ /dev/null @@ -1,63 +0,0 @@ -import {Component, Input,Output, EventEmitter} from '@angular/core'; -import {ClaimContext} from '../../../utils/entities/claimEntities.class'; -@Component({ - selector: 'claim-selected-contexts', - template: ` -
- - -
-
    -
  • Selected Concepts ({{(contexts.length)}}) - -
  • -
  • - {{context.community }} > {{context.category}} > {{context.concept.label}} - - -
  • -
  • There are no contexts
  • -
-
-
- ` -}) -export class ClaimSelectedContextsComponent { - ngOnInit() { - var myDate = new Date(); - this.todayDate=( myDate.getFullYear()+ "-" +myDate.getMonth() + 1) + "-" + myDate.getDate() ; - this.nextDate= ( (myDate.getFullYear()+100)+ "-" +myDate.getMonth() + 1) + "-" + myDate.getDate() ; - //2015-05-01 -} - - - @Input() contexts:ClaimContext[]; - @Input() componentClass:string = ""; //"" or "col-sm-6" for horizontal display (besides projects) - @Input() show='home'; - @Input() inline:boolean = false; - @Input() hideType; - @Input() bulkMode:boolean = false; - @Output() showChange = new EventEmitter(); - - todayDate = ''; - nextDate = ''; - - showType(type){ - if(type != this.show){ - this.show = type; - this.showChange.emit({ - value: this.show - }); - } - } - - - removeContext(item:any){ - var index:number =this.contexts.indexOf(item); - if (index > -1) { - this.contexts.splice(index, 1); - } - - } - -} diff --git a/portal-2/src/app/claimPages/linking/selected/selectedDatasets.component.ts b/portal-2/src/app/claimPages/linking/selected/selectedDatasets.component.ts deleted file mode 100644 index bd0c4751..00000000 --- a/portal-2/src/app/claimPages/linking/selected/selectedDatasets.component.ts +++ /dev/null @@ -1,119 +0,0 @@ -import {Component, Input,Output, EventEmitter,ViewChild} from '@angular/core'; -import {AlertModal} from '../../../utils/modal/alert'; -import {ClaimResult} from '../../../utils/entities/claimEntities.class'; -@Component({ - selector: 'claim-selected-datasets', - template: ` - -
  • -
    - -
    - - {{dataset.title}} - {{dataset.title}} - ({{dataset.date.substring(0,4)}}) - -
    -
    - - - - - - - - -
    - -
    -
  • - - - - - ` -}) -export class ClaimSelectedDatasetsComponent { - ngOnInit() { - var myDate = new Date(); - this.todayDate=( myDate.getFullYear()+ "-" +myDate.getMonth() + 1) + "-" + myDate.getDate() ; - this.nextDate= ( (myDate.getFullYear()+100)+ "-" +myDate.getMonth() + 1) + "-" + myDate.getDate() ; - //2015-05-01 -} - - - - - @Input() datasets: ClaimResult[]; - @Input() showAccessRights:boolean = false; - @Input() inline:boolean = false; - @Input() hideType; - @Input() bulkMode:boolean = false; - @Input() linkToResults:boolean = true; - @Output() datasetsChange = new EventEmitter(); - - todayDate = ''; - nextDate = ''; - @ViewChild(AlertModal) alertApplyAll; - 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); - if (index > -1) { - this.datasets.splice(index, 1); - } - this.datasetsChange.emit({ - value: this.datasets - }); - } - - accessTypes = ["OPEN","CLOSED","EMBARGO","RESTRICTED"]; - - dateChanged (event:any, item:any) { - item.embargoEndDate = event.target.value ; - - this.confirmOpen(); - } - /* The following methods: - *typeChanged - *confirmOpen - *confirmClose - implement the functionality: change accessRights of a publication - apply to all if asked */ - accessRightsTypeChanged (type:any, item:any) { - item.accessRights = type; - if(this.datasets.length > 1 ){ - this.commonAccessRights = type; - if(this.commonAccessRights == "EMBARGO"){ - this.commonEmbargoEndDate = item.embargoEndDate; - } - this.confirmOpen(); - } - - } - confirmOpen(){ - this.alertApplyAll.cancelButton = true; - this.alertApplyAll.okButton = true; - this.alertApplyAll.alertTitle = "Change access rights"; - this.alertApplyAll.message = "Do you wish to apply the change to every dataset?"; - this.alertApplyAll.okButtonText = "Yes"; - this.alertApplyAll.cancelButtonText = "No"; - this.alertApplyAll.open(); - } - confirmClose(data){ - for (var i = 0; i < this.datasets.length; i++) { - this.datasets[i].accessRights = this.commonAccessRights; - if(this.commonAccessRights == "EMBARGO"){ - this.datasets[i].embargoEndDate = this.commonEmbargoEndDate; - } - } - } - -} diff --git a/portal-2/src/app/claimPages/linking/selected/selectedProjects.component.ts b/portal-2/src/app/claimPages/linking/selected/selectedProjects.component.ts deleted file mode 100644 index 9d855b54..00000000 --- a/portal-2/src/app/claimPages/linking/selected/selectedProjects.component.ts +++ /dev/null @@ -1,68 +0,0 @@ -import {Component, Input,Output, EventEmitter} from '@angular/core'; -import {ClaimProject} from '../../../utils/entities/claimEntities.class'; - -@Component({ - selector: 'claim-selected-projects', - template: ` -
    -
    -
      -
    • Selected Projects ({{(projects.length)}}) - -
    • -
    • - - {{project.funderName}} | {{project.projectName}} {{(project.projectAcronym)?'('+project.projectAcronym+')':''}} - -
    • -
    • There are no projects
    • -
    -
    -
    - - ` -}) -export class ClaimSelectedProjectsComponent { - - -ngOnInit() { - var myDate = new Date(); - this.todayDate=( myDate.getFullYear()+ "-" +myDate.getMonth() + 1) + "-" + myDate.getDate() ; - this.nextDate= ( (myDate.getFullYear()+100)+ "-" +myDate.getMonth() + 1) + "-" + myDate.getDate() ; - //2015-05-01 -} - - -@Input() projects: ClaimProject[]; -@Input() show='home'; -@Input() inline:boolean = false; -@Input() hideType; -@Input() bulkMode:boolean = false; -@Input() linkToResults:boolean = true; -@Output() projectsChange = new EventEmitter(); - -@Output() showChange = new EventEmitter(); - -todayDate = ''; -nextDate = ''; - -removeProject(item:any){ - var index:number =this.projects.indexOf(item); - if (index > -1) { - this.projects.splice(index, 1); - } - this.projectsChange.emit({ - value: this.projects - }); -} -showType(type){ -if(type != this.show){ - this.show = type; - this.showChange.emit({ - value: this.show - }); -} -} - -} diff --git a/portal-2/src/app/claimPages/linking/selected/selectedPublications.component.ts b/portal-2/src/app/claimPages/linking/selected/selectedPublications.component.ts deleted file mode 100644 index c3a27400..00000000 --- a/portal-2/src/app/claimPages/linking/selected/selectedPublications.component.ts +++ /dev/null @@ -1,124 +0,0 @@ -import {Component, Input,Output, EventEmitter, ViewChild} from '@angular/core'; -import {AlertModal} from '../../../utils/modal/alert'; -import {ClaimResult} from '../../../utils/entities/claimEntities.class'; - -@Component({ - selector: 'claim-selected-publications', - template: ` - -
  • -
    -
    - - {{pub.title}} - {{pub.title}}({{pub.date.substring(0,4)}}) - -
    -
    - - - - - - -
    -
    - - - -
    -
    -
  • - - - - ` - -}) -export class ClaimSelectedPublicationsComponent { - ngOnInit() { - var myDate = new Date(); - this.todayDate=( myDate.getFullYear()+ "-" +myDate.getMonth() + 1) + "-" + myDate.getDate() ; - this.nextDate= ( (myDate.getFullYear()+100)+ "-" +myDate.getMonth() + 1) + "-" + myDate.getDate() ; - //2015-05-01 -} - - @Input() publications: ClaimResult[]; - @Input() showAccessRights:boolean = false; - @Input() inline:boolean = false; - @Input() hideType; - @Input() bulkMode:boolean = false; - @Input() linkToResults:boolean = true; - @Output()publicationsChange = new EventEmitter(); - - @Output() showChange = new EventEmitter(); - - todayDate = ''; - nextDate = ''; - @ViewChild(AlertModal) alertApplyAll; - -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); - if (index > -1) { - this.publications.splice(index, 1); - } - this.publicationsChange.emit({ - value: this.publications - }); - } - - - accessTypes = ["OPEN","CLOSED","EMBARGO","RESTRICTED"]; - - dateChanged (event:any, item:any) { - item.embargoEndDate = event.target.value ; - } - publicationsChanged($event) { - this.publications=$event.value; - this.publicationsChange.emit({ - value: this.publications - }); - } - /* The following methods: - *typeChanged - *confirmOpen - *confirmClose - implement the functionality: change accessRights of a publication - apply to all if asked */ - accessRightsTypeChanged (type:any, item:any) { - item.accessRights = type; - if(this.publications.length > 1 ){ - this.commonAccessRights = type; - if(this.commonAccessRights == "EMBARGO"){ - this.commonEmbargoEndDate = item.embargoEndDate; - } - this.confirmOpen(); - } - - } - confirmOpen(){ - this.alertApplyAll.cancelButton = true; - this.alertApplyAll.okButton = true; - this.alertApplyAll.alertTitle = "Change access rights"; - this.alertApplyAll.message = "Do you wish to apply the change to every publication?"; - this.alertApplyAll.okButtonText = "Yes"; - this.alertApplyAll.cancelButtonText = "No"; - this.alertApplyAll.open(); - } - confirmClose(data){ - for (var i = 0; i < this.publications.length; i++) { - this.publications[i].accessRights = this.commonAccessRights; - if(this.commonAccessRights == "EMBARGO"){ - this.publications[i].embargoEndDate = this.commonEmbargoEndDate; - } - } - } -} diff --git a/portal-2/src/app/claimPages/linking/selected/selectedResults.component.ts b/portal-2/src/app/claimPages/linking/selected/selectedResults.component.ts deleted file mode 100644 index 9480bee2..00000000 --- a/portal-2/src/app/claimPages/linking/selected/selectedResults.component.ts +++ /dev/null @@ -1,81 +0,0 @@ -import {Component, Input,Output, EventEmitter} from '@angular/core'; -import {ClaimResult} from '../../../utils/entities/claimEntities.class'; - -@Component({ - selector: 'claim-selected-results', - template: ` - - - - -
    -
      - -
    • There are no Research Results
    • -
    • {{publications. length }} Selected Publications: - -
    • - - - - - -
    • {{datasets.length}} Selected Research Data: - -
    • - - - - - -
    -
    - - ` - -}) -export class ClaimSelectedResultsComponent { - ngOnInit() { - var myDate = new Date(); - this.todayDate=( myDate.getFullYear()+ "-" +myDate.getMonth() + 1) + "-" + myDate.getDate() ; - this.nextDate= ( (myDate.getFullYear()+100)+ "-" +myDate.getMonth() + 1) + "-" + myDate.getDate() ; - //2015-05-01 -} - - - - @Input() publications:ClaimResult[]; - @Input() datasets:ClaimResult[]; - @Input() showAccessRights:boolean = false; - @Input() show='home'; - @Input() inline:boolean = false; - @Input() hideType; - @Input() bulkMode:boolean = false; - @Input() linkToResults:boolean = true; - @Output() showChange = new EventEmitter(); - - todayDate = ''; - nextDate = ''; - showType(type){ - if(type != this.show){ - this.show = type; - this.showChange.emit({ - value: this.show - }); - } - } - showChanged($event) { - this.show=$event.value; - - this.showChange.emit({ - value: this.show - }); - - } - - -} diff --git a/portal-2/src/app/claimPages/myClaims/myClaims.component.ts b/portal-2/src/app/claimPages/myClaims/myClaims.component.ts deleted file mode 100644 index 957bd3b2..00000000 --- a/portal-2/src/app/claimPages/myClaims/myClaims.component.ts +++ /dev/null @@ -1,34 +0,0 @@ -import {Component, Input} from '@angular/core'; -import {Observable} from 'rxjs/Observable'; - - - -@Component({ - selector: 'my-claims', - template: ` -
    - - -
    - - -
    - TODO login -
    -` - -}) - export class MyClaimsComponent { - constructor () { - } - user:string="argirok@di.uoa.gr"; - ngOnInit() { - - } - -} diff --git a/portal-2/src/app/claimPages/myClaimsDemo.component.ts b/portal-2/src/app/claimPages/myClaimsDemo.component.ts deleted file mode 100644 index 91392f30..00000000 --- a/portal-2/src/app/claimPages/myClaimsDemo.component.ts +++ /dev/null @@ -1,51 +0,0 @@ -import {Component, Input} from '@angular/core'; -import {Observable} from 'rxjs/Observable'; -import { Router } from '@angular/router'; - - - -@Component({ - selector: 'my-claims-demo', - template: ` -
    - - -
    - - - -` -//(click)="changeOrderby('target')" -//od_______908::3a5b2885656a91307156325644e73b92 - -}) - export class MyClaimsDemoComponent { - constructor ( private _router: Router ) { - } - user:string="argirok@di.uoa.gr"; - ngOnInit() { - - } - goToPub(id: number){ - this._router.navigate( ['Publication', { articleId: id}] ); - } -} diff --git a/portal-2/src/app/landingPages/dataset/dataset.component.html b/portal-2/src/app/landingPages/dataset/dataset.component.html index c64e90ea..022da3e7 100644 --- a/portal-2/src/app/landingPages/dataset/dataset.component.html +++ b/portal-2/src/app/landingPages/dataset/dataset.component.html @@ -37,10 +37,6 @@
    {{datasetInfo.description}}
    -
    • @@ -169,8 +165,7 @@
      Funded By
      - +
    • @@ -191,8 +186,6 @@
      Related to
      -
    diff --git a/portal-2/src/app/landingPages/dataset/dataset.component.ts b/portal-2/src/app/landingPages/dataset/dataset.component.ts index 7258e859..50b07cfb 100644 --- a/portal-2/src/app/landingPages/dataset/dataset.component.ts +++ b/portal-2/src/app/landingPages/dataset/dataset.component.ts @@ -4,9 +4,7 @@ import {DatasetService} from '../../services/dataset.service'; import {DatasetInfo} from '../../utils/entities/datasetInfo'; import {ActivatedRoute} from '@angular/router'; import {OpenaireProperties} from '../../utils/properties/openaireProperties' -import {InlineClaimContextComponent} from '../../claimPages/inlineClaims/inlineClaimContext.component'; -import {InlineClaimProjectComponent} from '../../claimPages/inlineClaims/inlineClaimProject.component'; -import {InlineClaimResultComponent} from '../../claimPages/inlineClaims/inlineClaimResult.component'; + @Component({ selector: 'dataset', templateUrl: 'dataset.component.html', @@ -26,10 +24,7 @@ export class DatasetComponent { private viewsFrameUrl: string; private downloadsFrameUrl: string; - /*@ViewChild (InlineClaimProjectComponent) inlineClaimProject : InlineClaimProjectComponent ; - @ViewChild (InlineClaimContextComponent) inlineClaimContext : InlineClaimContextComponent ; - @ViewChild (InlineClaimResultComponent) inlineClaimResult : InlineClaimResultComponent ; - */ + public warningMessage = ""; public errorMessage = ""; @@ -76,73 +71,7 @@ export class DatasetComponent { ); } - - /********** Methods for Inline Claim of project / dataset ******/ - /* toggleClaimProject(){ - this.inlineClaimProject.toggle(); - } - projectAdded($event){ - var projects =$event.value; - if(projects){ - for(var i=0; i < projects.length; i++){ - - if(this.datasetInfo.fundedByProjects == undefined) { - this.datasetInfo.fundedByProjects = new Array< - { "url": string, "acronym": string, "title": string, - "funderShortname": string, "funderName": string, - "funding": string, "inline": boolean - }>(); - } - var project =projects[i]; - - let counter = this.datasetInfo.fundedByProjects.length; - this.datasetInfo.fundedByProjects[counter] = { - "url": "", "acronym": "", "title": "", - "funderShortname": "", "funderName": "", - "funding": "", "inline": true - } - this.datasetInfo.fundedByProjects[counter]['url'] = - OpenaireProperties.getsearchLinkToProject()+project.projectId; - this.datasetInfo.fundedByProjects[counter]['acronym'] = project.projectAcronym; - this.datasetInfo.fundedByProjects[counter]['title'] = project.projectName; - this.datasetInfo.fundedByProjects[counter]['funderShortname'] = project.funderName; - } - } - } - toggleClaimContext(){ - this.inlineClaimContext.toggle(); - } - contextAdded($event){ - var contexts =$event.value; - - if(contexts){ - for(var i=0; i < contexts.length; i++){ - var context = contexts[i]; - if(!this.datasetInfo.contexts){ - this.datasetInfo.contexts = new Array< - { "labelContext": string, "labelCategory": string, "labelConcept": string, "inline": boolean}>(); - - } - var position:number = this.datasetInfo.contexts.length; - - this.datasetInfo.contexts[ position] = {"labelContext": "", "labelCategory": "", "labelConcept": "", "inline": true }; - this.datasetInfo.contexts[position]['labelContext'] = context.community; - this.datasetInfo.contexts[position]['labelCategory'] = context.category; - this.datasetInfo.contexts[position]['labelConcept'] = context.concept.label; - - - } - } - } - toggleClaimResult(){ - this.inlineClaimResult.toggle(); - } - resultsAdded($event, isPublication:boolean){ - var results =$event.value; - - //TODO - } - */ + showChange($event) { this.showAllReferences=$event.value; } diff --git a/portal-2/src/app/landingPages/landing.module.ts b/portal-2/src/app/landingPages/landing.module.ts index b43baf4e..032a99e6 100644 --- a/portal-2/src/app/landingPages/landing.module.ts +++ b/portal-2/src/app/landingPages/landing.module.ts @@ -4,7 +4,6 @@ import { CommonModule } from '@angular/common'; import { FormsModule } from '@angular/forms'; import {UtilsModule} from '../utils/utils.module'; -import {ClaimModule} from '../claimPages/claim.module'; import {ServicesModule} from '../services/services.module'; import {SearchModule} from '../searchPages/search.module'; @@ -40,7 +39,6 @@ import { LandingRoutingModule } from './landing-routing.module'; //MaterialModule.forRoot(), CommonModule, FormsModule, UtilsModule, - ClaimModule, ServicesModule, SearchModule, LandingRoutingModule @@ -55,7 +53,6 @@ import { LandingRoutingModule } from './landing-routing.module'; ], exports: [ DataProviderComponent, PersonComponent, ProjectComponent, PublicationComponent, OrganizationComponent, DatasetComponent, - // TabPagingComponent, TabTableComponent, ShowTitleComponent, ShowAuthorsComponent, ShowAuthorsComponent, ShowIdentifiersComponent, ShowIdentifiersComponent,ShowSubjectsComponent, ] }) export class LandingModule { } diff --git a/portal-2/src/app/landingPages/project/project.component.html b/portal-2/src/app/landingPages/project/project.component.html index b649d778..2efd32cc 100644 --- a/portal-2/src/app/landingPages/project/project.component.html +++ b/portal-2/src/app/landingPages/project/project.component.html @@ -49,10 +49,6 @@ - - - - - -
    OpenAIRE
    @@ -128,7 +85,7 @@ import 'rxjs/Rx'; - +
    diff --git a/portal-2/src/app/utils/claimEntityFormatter.component.ts b/portal-2/src/app/utils/claimEntityFormatter.component.ts deleted file mode 100644 index f2611255..00000000 --- a/portal-2/src/app/utils/claimEntityFormatter.component.ts +++ /dev/null @@ -1,36 +0,0 @@ -import {Component, Input} from '@angular/core'; - -//Usage Example " " - -//externalUrl -@Component({ - selector: 'claim-entity', - template: ` - -
    - ({{type}}) - -
    -
    - (Project) - -
    -
    - (Context) -
    {{entity.title}}
    -
    - ` -}) - -export class ClaimEntityFormatter { - @Input() entity: string[]; - @Input() type: string; - - constructor () {} - - ngOnInit() { - - } - - -} diff --git a/portal-2/src/app/utils/entities/claim.ts b/portal-2/src/app/utils/entities/claim.ts deleted file mode 100644 index b5378c5f..00000000 --- a/portal-2/src/app/utils/entities/claim.ts +++ /dev/null @@ -1,15 +0,0 @@ -export class Claim { - id: string; - sourceType: string; - targetType: string; - sourceId: string; - targetId: string; - date: string; - DOI: string; - project: Project - userMail: string; - -} -export class Project{ - -} diff --git a/portal-2/src/app/utils/entities/claimEntities.class.ts b/portal-2/src/app/utils/entities/claimEntities.class.ts deleted file mode 100644 index 8af32621..00000000 --- a/portal-2/src/app/utils/entities/claimEntities.class.ts +++ /dev/null @@ -1,30 +0,0 @@ -//Classes used in linking / inlinelinking when selecting an entity -export class ClaimResult{ - public id: string; - public type: string; - public source: string; - public title: string; - public url: string; - public result: any; - public accessRights: string = "OPEN"; - public embargoEndDate: string; - public date: string; - -} -export class ClaimProject{ - public funderId: string; - public funderName: string; - public projectId: string; - public projectName: string; - public projectAcronym: string; - public startDate: string; - public endDate: string; - -} - -export class ClaimContext{ - public community: string; - public category: string; - public concept:any; - -} diff --git a/portal-2/src/app/utils/entities/entities.module.ts b/portal-2/src/app/utils/entities/entities.module.ts index 2ff4c21b..5415a147 100644 --- a/portal-2/src/app/utils/entities/entities.module.ts +++ b/portal-2/src/app/utils/entities/entities.module.ts @@ -14,8 +14,6 @@ import {SearchResult} from './searchResult'; import {DataProviderInfo} from './dataProviderInfo'; import {Metrics} from './metrics'; -import {ClaimResult, ClaimProject, ClaimContext} from './claimEntities.class'; - @NgModule({ imports: [ CommonModule, FormsModule ], declarations: [ diff --git a/portal-2/src/app/utils/pipes/claimTextFilter.pipe.ts b/portal-2/src/app/utils/pipes/claimTextFilter.pipe.ts deleted file mode 100644 index e1d402f0..00000000 --- a/portal-2/src/app/utils/pipes/claimTextFilter.pipe.ts +++ /dev/null @@ -1,21 +0,0 @@ -import {Pipe, PipeTransform} from '@angular/core'; - -@Pipe({ - name: 'claimTextFilter' -}) -export class ClaimTextFilterPipe implements PipeTransform { - - transform(value: any, filter: string): any { - console.info('ClaimTextFilterPipe word to filter : '+filter); - filter = filter?filter.toLocaleLowerCase():''; - return filter ? value.filter(claim=> ( - claim.sourceType.toLocaleLowerCase().indexOf(filter)!=-1|| //sourceType - claim.targetType.toLocaleLowerCase().indexOf(filter)!=-1|| //targetType - claim.userMail.toLocaleLowerCase().indexOf(filter)!=-1|| //mail - ((claim.source.title && claim.source.title.toLocaleLowerCase().indexOf(filter)!=-1)||(claim.source.name && claim.source.name.toLocaleLowerCase().indexOf(filter)!=-1))|| //source title - ((claim.target.title && claim.target.title.toLocaleLowerCase().indexOf(filter)!=-1)||(claim.target.name && claim.target.name.toLocaleLowerCase().indexOf(filter)!=-1))|| //target title - ((claim.source.funderName && claim.source.funderName.toLocaleLowerCase().indexOf(filter)!=-1)||(claim.source.funderName && claim.source.funderName.toLocaleLowerCase().indexOf(filter)!=-1))|| //source funder name - ((claim.target.funderName && claim.target.funderName.toLocaleLowerCase().indexOf(filter)!=-1)||(claim.target.funderName && claim.target.funderName.toLocaleLowerCase().indexOf(filter)!=-1)) //target funder name - )) : value; - } -} diff --git a/portal-2/src/app/utils/pipes/claimTypeFilter.pipe.ts b/portal-2/src/app/utils/pipes/claimTypeFilter.pipe.ts deleted file mode 100644 index 0c386c76..00000000 --- a/portal-2/src/app/utils/pipes/claimTypeFilter.pipe.ts +++ /dev/null @@ -1,35 +0,0 @@ - -import {Pipe, PipeTransform} from '@angular/core'; - -@Pipe({name: 'claimTypeFilter'}) -export class ClaimTypeFilterPipe implements PipeTransform { - transform(value: any, publication:boolean,dataset:boolean,project:boolean,context:boolean) : any { - let filter = publication; - console.info('ClaimTypeFilterPipe types to show : '+(publication?'publication ':' ')+(dataset?'dataset ':' ')+(project?'project ':' ')+(context?'context ':' ')); - return (value)?value.filter((claim) =>{ - let filter =publication; - if(publication||dataset||project||context) { - let filter = publication - if(filter && (claim.sourceType.toLocaleLowerCase().indexOf('publication')!=-1 || claim.targetType.toLocaleLowerCase().indexOf('publication')!=-1 )) { - return true; - } - filter = dataset; - if(filter && (claim.sourceType.toLocaleLowerCase().indexOf('dataset')!=-1 || claim.targetType.toLocaleLowerCase().indexOf('dataset')!=-1 )) { - return true; - } - filter = project; - if(filter && (claim.sourceType.toLocaleLowerCase().indexOf('project')!=-1 || claim.targetType.toLocaleLowerCase().indexOf('project')!=-1 )) { - return true; - } - filter = context; - if(filter && (claim.sourceType.toLocaleLowerCase().indexOf('context')!=-1 || claim.targetType.toLocaleLowerCase().indexOf('context')!=-1 )) { - return true; - } - return false; - }else{ - return true; - } - }):value; - } - -} diff --git a/portal-2/src/app/utils/properties/openaireProperties.ts b/portal-2/src/app/utils/properties/openaireProperties.ts index 5bebb27d..ff1b7b92 100644 --- a/portal-2/src/app/utils/properties/openaireProperties.ts +++ b/portal-2/src/app/utils/properties/openaireProperties.ts @@ -50,7 +50,7 @@ export class OpenaireProperties { //private static searchServiveURL = "http://astero.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/"; private static searchServiveURL = "http://beta.services.openaire.eu:8480/search/"; // private static searchServiveURL = "http://services.openaire.eu:8380/search/"; - private static searchServiveURL = "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/"; + // private static searchServiveURL = "http://rudie.di.uoa.gr:8080/dnet-functionality-services-2.0.0-SNAPSHOT/"; private static csvAPIURL = "http://beta.services.openaire.eu:8480/search/rest/v2/api/";//publications?format=csv diff --git a/portal-2/src/server.routes.ts b/portal-2/src/server.routes.ts index 980ec0d3..b6869d81 100644 --- a/portal-2/src/server.routes.ts +++ b/portal-2/src/server.routes.ts @@ -10,7 +10,7 @@ * ]; **/ export const routes: string[] = [ - 'claims','claim','myclaims','linking','bulk-linking','search/find', + 'search/find', 'search/person','search/publication','search/project','search/dataset','search/dataprovider','search/organization', 'search/find/people','search/find/publications','search/find/projects','search/find/datasets','search/find/dataproviders','search/find/organizations', 'search/advanced/people','search/advanced/publications','search/advanced/projects','search/advanced/datasets','search/advanced/dataproviders','search/advanced/organizations',