Show results in Deposit Result Page (query for organization's name and url - query for data providers of this organization)

git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-services-portal/trunk@44274 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
konstantina.galouni 2016-10-20 10:37:43 +00:00
parent 8d34386a97
commit f07a66d9bc
6 changed files with 58 additions and 36 deletions

View File

@ -47,7 +47,6 @@
"bootstrap": "^4.0.0-alpha.4", "bootstrap": "^4.0.0-alpha.4",
"express": "^4.14.0", "express": "^4.14.0",
"methods": "~1.1.2", "methods": "~1.1.2",
"ng2-webstorage": "^1.2.2",
"preboot": "~4.5.2", "preboot": "~4.5.2",
"rxjs": "5.0.0-beta.12", "rxjs": "5.0.0-beta.12",
"zone.js": "~0.6.25" "zone.js": "~0.6.25"

View File

@ -43,6 +43,7 @@ import {TestComponent} from './app/test/test.component';
TestComponent TestComponent
], ],
providers: [ providers: [
] ]
}) })
export class MainModule { export class MainModule {

View File

@ -44,6 +44,7 @@ import {TestComponent} from './app/test/test.component';
TestComponent TestComponent
], ],
providers: [ providers: [
] ]
}) })
export class MainModule { export class MainModule {

View File

@ -47,6 +47,7 @@ import {OpenaireProperties} from '../utils/properties/openaireProperties';
export class DepositComponent { export class DepositComponent {
private keyword: string=''; private keyword: string='';
private organizationId: string='dedup_wf_001%3A%3A44cb3a714d104139c37beb7580070b96';
private openAccess: string; private openAccess: string;
private openAccessRepo: string; private openAccessRepo: string;
private fp7Guidlines: string; private fp7Guidlines: string;
@ -55,6 +56,8 @@ export class DepositComponent {
private helpdesk: string; private helpdesk: string;
constructor (private _router: Router) { constructor (private _router: Router) {
console.info("constructor deposit");
this.openAccess = OpenaireProperties.getOpenAccess(); this.openAccess = OpenaireProperties.getOpenAccess();
this.openAccessRepo = OpenaireProperties.getOpenAccessRepo(); this.openAccessRepo = OpenaireProperties.getOpenAccessRepo();
this.fp7Guidlines = OpenaireProperties.getFP7Guidlines(); this.fp7Guidlines = OpenaireProperties.getFP7Guidlines();
@ -65,7 +68,6 @@ export class DepositComponent {
keywordChanged() { keywordChanged() {
console.info("keywordChanged: "+this.keyword); console.info("keywordChanged: "+this.keyword);
this._router.navigate( ['deposit-results'], { queryParams: { "organizationId": this.organizationId } } );
this._router.navigate( ['deposit-results'] );//, {"name": this.keyword}] );
} }
} }

View File

@ -7,6 +7,8 @@ import { SearchDataprovidersComponent } from '../searchPages/searchDataproviders
import { SearchDataprovidersService } from '../services/searchDataproviders.service'; import { SearchDataprovidersService } from '../services/searchDataproviders.service';
import { SearchResultComponent } from '../searchPages/searchUtils/searchResult.component'; import { SearchResultComponent } from '../searchPages/searchUtils/searchResult.component';
import {OrganizationService} from '../services/organization.service';
@Component({ @Component({
selector: 'depositResult', selector: 'depositResult',
template: ` template: `
@ -23,10 +25,7 @@ import { SearchResultComponent } from '../searchPages/searchUtils/searchResult.c
</a> </a>
<span *ngIf="organization['url']==''">{{organization['name']}}</span> <span *ngIf="organization['url']==''">{{organization['name']}}</span>
</h2> </h2>
<h2 *ngIf="organization == undefined && organizationId != undefined">
<span>Data providers for institution with ID: </span>
<a href="{{url}}">{{organizationId}}</a>
</h2>
</div> </div>
<div *ngIf="searchDataprovidersComponent.totalResults > 0"> <div *ngIf="searchDataprovidersComponent.totalResults > 0">
@ -37,6 +36,7 @@ import { SearchResultComponent } from '../searchPages/searchUtils/searchResult.c
</div> </div>
<div *ngIf="searchDataprovidersComponent.totalResults == 0" class = "alert alert-warning"> <div *ngIf="searchDataprovidersComponent.totalResults == 0" class = "alert alert-warning">
<div *ngIf="organization != undefined">
No data providers found No data providers found
<span *ngIf="organization != undefined"> <span *ngIf="organization != undefined">
for institution: for institution:
@ -45,14 +45,12 @@ import { SearchResultComponent } from '../searchPages/searchUtils/searchResult.c
</a> </a>
<span *ngIf="organization['url']==''">{{organization['name']}}</span> <span *ngIf="organization['url']==''">{{organization['name']}}</span>
</span> </span>
<span *ngIf="organization == undefined && organizationId != undefined">
for institution with ID:
<a href="{{url}}">
<span>{{organizationId}}</span>
</a>
</span>
. .
<br> </div>
<div *ngIf="organization == undefined">
No organization with ID: {{organizationId}} found.
</div>
You can still deposit your publications and/or research data in You can still deposit your publications and/or research data in
<a href="{{zenodo}}">OpenAIRE's Zenodo catch-all repository </a> <a href="{{zenodo}}">OpenAIRE's Zenodo catch-all repository </a>
hosted by CERN. hosted by CERN.
@ -62,10 +60,10 @@ import { SearchResultComponent } from '../searchPages/searchUtils/searchResult.c
}) })
export class DepositResultComponent { export class DepositResultComponent {
@Input() organization: {"name": string, "url": string};// = {"name": "NTUA", "url": OpenaireProperties.getsearchLinkToOrganization()+"dedup_wf_001%3A%3A44cb3a714d104139c37beb7580070b96"}; private organization: {"name": string, "url": string};
@Input() organizationId: string;// = "dedup_wf_001%3A%3A44cb3a714d104139c37beb7580070b96"; private organizationId: string;
url: string;
sub: any;
subDataproviders: any; subDataproviders: any;
private searchDataprovidersComponent : SearchDataprovidersComponent; private searchDataprovidersComponent : SearchDataprovidersComponent;
@ -74,7 +72,8 @@ export class DepositResultComponent {
private zenodo: string; private zenodo: string;
constructor (private route: ActivatedRoute, constructor (private route: ActivatedRoute,
private _searchDataprovidersService: SearchDataprovidersService) { private _searchDataprovidersService: SearchDataprovidersService,
private _organizationService: OrganizationService) {
console.info("depositResult constructor"); console.info("depositResult constructor");
this.zenodo = OpenaireProperties.getZenodoURL(); this.zenodo = OpenaireProperties.getZenodoURL();
@ -84,18 +83,21 @@ export class DepositResultComponent {
ngOnInit() { ngOnInit() {
console.info('depositResult init'); console.info('depositResult init');
if(this.organizationId != undefined) { this.sub = this.route.queryParams.subscribe(params => {
this.url = OpenaireProperties.getsearchLinkToOrganization()+this.organizationId; this.organizationId = params['organizationId'];
console.info("Id is :"+this.organizationId);
if(this.organizationId){
this.getOrganizationInfo();
} }
this.subDataproviders = this.route.queryParams.subscribe(params => {
this.searchDataproviders();
}); });
} }
ngOnDestroy() { ngOnDestroy() {
this.sub.unsubscribe();
if(this.subDataproviders != undefined) {
this.subDataproviders.unsubscribe(); this.subDataproviders.unsubscribe();
} }
}
private searchDataproviders() { private searchDataproviders() {
if(this.organization != undefined) { if(this.organization != undefined) {
@ -105,4 +107,21 @@ export class DepositResultComponent {
} }
this.linkToSearchDataproviders = OpenaireProperties.getLinkToSearchDataProviders(); this.linkToSearchDataproviders = OpenaireProperties.getLinkToSearchDataProviders();
} }
private getOrganizationInfo () {
console.info("inside getOrganizationInfo of component");
this._organizationService.getOrganizationInfo(this.organizationId).subscribe(
data => {
this.organization = data.title;
this.subDataproviders = this.route.queryParams.subscribe(params => {
this.searchDataproviders();
});
},
err => {
console.error(err)
console.info("error");
}
);
}
} }

View File

@ -47,7 +47,7 @@ export class OrganizationComponent {
if(this.organizationId){ if(this.organizationId){
this.getOrganizationInfo(); this.getOrganizationInfo();
}else{ }else{
this.warningMessage="No valid project id"; this.warningMessage="No valid organization id";
} }
}); });
@ -63,7 +63,7 @@ export class OrganizationComponent {
} }
private getOrganizationInfo () { private getOrganizationInfo () {
console.info("inside getProjectInfo of component"); console.info("inside getOrganizationInfo of component");
this.warningMessage = ''; this.warningMessage = '';
this.errorMessage="" this.errorMessage=""