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",
"express": "^4.14.0",
"methods": "~1.1.2",
"ng2-webstorage": "^1.2.2",
"preboot": "~4.5.2",
"rxjs": "5.0.0-beta.12",
"zone.js": "~0.6.25"

View File

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

View File

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

View File

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

View File

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