[Trunk | Connect]: Remove old, unused folders "deposit/datasets" and "deposit/publications".
git-svn-id: https://svn.driver.research-infrastructures.eu/driver/dnet40/modules/uoa-connect-portal/trunk@59132 d315682c-612b-4755-9ff5-7f18f6832af3
This commit is contained in:
parent
2204b06920
commit
988bbc570f
|
@ -1,19 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
import { OpenaireDepositBySubjectResultComponent } from './depositBySubjectResult.component';
|
||||
import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard';
|
||||
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
|
||||
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{ path: '', component: OpenaireDepositBySubjectResultComponent, canActivate: [FreeGuard, IsRouteEnabled], data: {
|
||||
redirect: '/error'
|
||||
},canDeactivate: [PreviousRouteRecorder] }
|
||||
|
||||
])
|
||||
]
|
||||
})
|
||||
export class DepositBySubjectResultsRoutingModule { }
|
|
@ -1,73 +0,0 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import {ActivatedRoute} from '@angular/router';
|
||||
|
||||
import {PiwikHelper} from '../../utils/piwikHelper';
|
||||
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
|
||||
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
|
||||
|
||||
import {ZenodoCommunitiesService} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service';
|
||||
import {SearchZenodoCommunitiesService} from '../../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunities.service';
|
||||
import {CommunityService} from '../../openaireLibrary/connect/community/community.service';
|
||||
|
||||
import {ZenodoInformationClass} from '../../openaireLibrary/deposit/utils/zenodoInformation.class';
|
||||
import {FetchZenodoInformation} from '../utils/fetchZenodoInformation.class';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'openaire-deposit-by-subject-result',
|
||||
template:`<deposit-by-subject-result [piwikSiteId]=piwikSiteId [zenodoInformation]="zenodoInformation"></deposit-by-subject-result>`
|
||||
})
|
||||
|
||||
export class OpenaireDepositBySubjectResultComponent {
|
||||
public zenodoInformation: ZenodoInformationClass = new ZenodoInformationClass();
|
||||
properties:EnvProperties;
|
||||
fetchZenodoInformation: FetchZenodoInformation;
|
||||
|
||||
piwikSiteId = null;
|
||||
|
||||
constructor ( private route: ActivatedRoute,
|
||||
private _ΖenodoCommunitieService: ZenodoCommunitiesService,
|
||||
private _communityService: CommunityService,private _searchZenodoCommunitiesService: SearchZenodoCommunitiesService ) {
|
||||
this.fetchZenodoInformation = new FetchZenodoInformation(this._ΖenodoCommunitieService, this._searchZenodoCommunitiesService);
|
||||
}
|
||||
|
||||
public ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.route.queryParams.subscribe(params => {
|
||||
let communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
if(!communityId) {
|
||||
communityId = params['communityId'];
|
||||
}
|
||||
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[communityId];
|
||||
|
||||
if(communityId) {
|
||||
|
||||
if (communityId != null && communityId != '') {
|
||||
|
||||
this._communityService.getCommunity(this.properties, this.properties.communityAPI+communityId).subscribe (
|
||||
community => {
|
||||
var community = community;
|
||||
var masterZenodoCommunityId = community.zenodoCommunity;
|
||||
if(masterZenodoCommunityId){
|
||||
this.fetchZenodoInformation.getZenodoCommunityNameAndUrlById(masterZenodoCommunityId, this.properties, this.zenodoInformation);
|
||||
}
|
||||
this.fetchZenodoInformation.searchNumberOfZCommunities(communityId, this.properties, this.zenodoInformation);
|
||||
},
|
||||
error => {
|
||||
//console.error("Community couldn't be loaded");
|
||||
this.handleError("Error getting community with id: "+communityId, error);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private handleError(message: string, error) {
|
||||
console.error("Deposit by subect Result Page: "+message, error);
|
||||
}
|
||||
}
|
|
@ -1,35 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { OpenaireDepositBySubjectResultComponent } from './depositBySubjectResult.component';
|
||||
|
||||
import {DepositBySubjectResultsRoutingModule} from './depositBySubjectResult-routing.module';
|
||||
import {DepositBySubjectResultsModule } from '../../openaireLibrary/deposit/datasets/depositBySubjectResults.module';
|
||||
import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard';
|
||||
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
|
||||
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard';
|
||||
|
||||
import {ZenodoCommunitiesServiceModule} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communitiesService.module';
|
||||
import {SearchZenodoCommunitiesServiceModule} from '../../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunitiesService.module';
|
||||
|
||||
import {CommunityService} from '../../openaireLibrary/connect/community/community.service';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule, FormsModule,
|
||||
DepositBySubjectResultsModule,
|
||||
DepositBySubjectResultsRoutingModule,
|
||||
ZenodoCommunitiesServiceModule, SearchZenodoCommunitiesServiceModule
|
||||
],
|
||||
declarations: [
|
||||
|
||||
OpenaireDepositBySubjectResultComponent
|
||||
|
||||
],
|
||||
exports: [
|
||||
OpenaireDepositBySubjectResultComponent
|
||||
],
|
||||
providers: [FreeGuard,PreviousRouteRecorder, IsRouteEnabled, CommunityService]
|
||||
})
|
||||
export class LibDepositBySubjectResultsModule { }
|
|
@ -1,19 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
|
||||
import { OpenaireDepositDatasetsComponent } from './depositDatasets.component';
|
||||
|
||||
import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard';
|
||||
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
|
||||
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard'
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{ path: '', component: OpenaireDepositDatasetsComponent, canActivate: [FreeGuard, IsRouteEnabled], data: {
|
||||
redirect: '/error'
|
||||
},canDeactivate: [PreviousRouteRecorder] }
|
||||
|
||||
])
|
||||
]
|
||||
})
|
||||
export class DepositDatasetsRoutingModule { }
|
|
@ -1,75 +0,0 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import {ActivatedRoute} from '@angular/router';
|
||||
|
||||
import {PiwikHelper} from '../../utils/piwikHelper';
|
||||
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
|
||||
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
|
||||
|
||||
import {ZenodoCommunitiesService} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service';
|
||||
import {SearchZenodoCommunitiesService} from '../../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunities.service';
|
||||
import {CommunityService} from '../../openaireLibrary/connect/community/community.service';
|
||||
|
||||
import {ZenodoInformationClass} from '../../openaireLibrary/deposit/utils/zenodoInformation.class';
|
||||
import {FetchZenodoInformation} from '../utils/fetchZenodoInformation.class';
|
||||
|
||||
@Component({
|
||||
selector: 'openaire-deposit-datasets',
|
||||
template: `
|
||||
<deposit-datasets [piwikSiteId]=piwikSiteId [zenodoInformation]="zenodoInformation">
|
||||
|
||||
</deposit-datasets>
|
||||
`
|
||||
})
|
||||
|
||||
export class OpenaireDepositDatasetsComponent {
|
||||
public zenodoInformation: ZenodoInformationClass = new ZenodoInformationClass();
|
||||
properties:EnvProperties;
|
||||
fetchZenodoInformation: FetchZenodoInformation;
|
||||
|
||||
piwikSiteId = null;
|
||||
constructor ( private route: ActivatedRoute,
|
||||
private _ΖenodoCommunitieService: ZenodoCommunitiesService,
|
||||
private _communityService: CommunityService,private _searchZenodoCommunitiesService: SearchZenodoCommunitiesService ) {
|
||||
this.fetchZenodoInformation = new FetchZenodoInformation(this._ΖenodoCommunitieService, this._searchZenodoCommunitiesService);
|
||||
}
|
||||
|
||||
public ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.route.queryParams.subscribe(params => {
|
||||
let communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
if(!communityId) {
|
||||
communityId = params['communityId'];
|
||||
}
|
||||
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[communityId];
|
||||
|
||||
if(communityId) {
|
||||
|
||||
if (communityId != null && communityId != '') {
|
||||
|
||||
this._communityService.getCommunity(this.properties, this.properties.communityAPI+communityId).subscribe (
|
||||
community => {
|
||||
var community = community;
|
||||
var masterZenodoCommunityId = community.zenodoCommunity;
|
||||
if(masterZenodoCommunityId){
|
||||
this.fetchZenodoInformation.getZenodoCommunityNameAndUrlById(masterZenodoCommunityId, this.properties, this.zenodoInformation);
|
||||
}
|
||||
this.fetchZenodoInformation.searchNumberOfZCommunities(communityId, this.properties, this.zenodoInformation);
|
||||
},
|
||||
error => {
|
||||
//console.error("Community couldn't be loaded");
|
||||
this.handleError("Error getting community with id: "+communityId, error);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private handleError(message: string, error) {
|
||||
console.error("Deposit Research Data Page: "+message, error);
|
||||
}
|
||||
}
|
|
@ -1,34 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { OpenaireDepositDatasetsComponent } from './depositDatasets.component';
|
||||
import {DepositDatasetsRoutingModule} from './depositDatasets-routing.module';
|
||||
import {DepositDatasetsModule} from '../../openaireLibrary/deposit/datasets/depositDatasets.module';
|
||||
import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard';
|
||||
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
|
||||
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard';
|
||||
|
||||
import {ZenodoCommunitiesServiceModule} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communitiesService.module';
|
||||
import {SearchZenodoCommunitiesServiceModule} from '../../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunitiesService.module';
|
||||
|
||||
import {CommunityService} from '../../openaireLibrary/connect/community/community.service';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule, FormsModule,
|
||||
DepositDatasetsModule,
|
||||
DepositDatasetsRoutingModule,
|
||||
ZenodoCommunitiesServiceModule, SearchZenodoCommunitiesServiceModule
|
||||
],
|
||||
declarations: [
|
||||
|
||||
OpenaireDepositDatasetsComponent
|
||||
|
||||
],
|
||||
exports: [
|
||||
OpenaireDepositDatasetsComponent
|
||||
],
|
||||
providers: [FreeGuard,PreviousRouteRecorder, IsRouteEnabled, CommunityService]
|
||||
})
|
||||
export class LibDepositDatasetsModule { }
|
|
@ -1,74 +0,0 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import {ActivatedRoute} from '@angular/router';
|
||||
|
||||
import {PiwikHelper} from '../../utils/piwikHelper';
|
||||
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
|
||||
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
|
||||
|
||||
import {ZenodoCommunitiesService} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service';
|
||||
import {SearchZenodoCommunitiesService} from '../../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunities.service';
|
||||
import {CommunityService} from '../../openaireLibrary/connect/community/community.service';
|
||||
|
||||
import {ZenodoInformationClass} from '../../openaireLibrary/deposit/utils/zenodoInformation.class';
|
||||
import {FetchZenodoInformation} from '../utils/fetchZenodoInformation.class';
|
||||
|
||||
@Component({
|
||||
selector: 'openaire-deposit-datasets-result',
|
||||
template: `
|
||||
<deposit-datasets-result [piwikSiteId]=piwikSiteId [zenodoInformation]="zenodoInformation"></deposit-datasets-result>
|
||||
`
|
||||
})
|
||||
|
||||
export class OpenaireDepositDatasetsResultComponent {
|
||||
public zenodoInformation: ZenodoInformationClass = new ZenodoInformationClass();
|
||||
properties:EnvProperties;
|
||||
fetchZenodoInformation: FetchZenodoInformation;
|
||||
|
||||
piwikSiteId = null;
|
||||
|
||||
constructor ( private route: ActivatedRoute,
|
||||
private _ΖenodoCommunitieService: ZenodoCommunitiesService,
|
||||
private _communityService: CommunityService,private _searchZenodoCommunitiesService: SearchZenodoCommunitiesService ) {
|
||||
this.fetchZenodoInformation = new FetchZenodoInformation(this._ΖenodoCommunitieService, this._searchZenodoCommunitiesService);
|
||||
}
|
||||
|
||||
public ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.route.queryParams.subscribe(params => {
|
||||
let communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
if(!communityId) {
|
||||
communityId = params['communityId'];
|
||||
}
|
||||
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[communityId];
|
||||
|
||||
if(communityId) {
|
||||
|
||||
if (communityId != null && communityId != '') {
|
||||
|
||||
this._communityService.getCommunity(this.properties, this.properties.communityAPI+communityId).subscribe (
|
||||
community => {
|
||||
var community = community;
|
||||
var masterZenodoCommunityId = community.zenodoCommunity;
|
||||
if(masterZenodoCommunityId){
|
||||
this.fetchZenodoInformation.getZenodoCommunityNameAndUrlById(masterZenodoCommunityId, this.properties, this.zenodoInformation);
|
||||
}
|
||||
this.fetchZenodoInformation.searchNumberOfZCommunities(communityId, this.properties, this.zenodoInformation);
|
||||
},
|
||||
error => {
|
||||
//console.error("Community couldn't be loaded");
|
||||
this.handleError("Error getting community with id: "+communityId, error);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private handleError(message: string, error) {
|
||||
console.error("Deposit Research Data Result Page: "+message, error);
|
||||
}
|
||||
}
|
|
@ -1,18 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { OpenaireDepositDatasetsResultComponent } from './depositDatasetsResult.component';
|
||||
import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard';
|
||||
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
|
||||
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{ path: '', component: OpenaireDepositDatasetsResultComponent, canActivate: [FreeGuard, IsRouteEnabled], data: {
|
||||
redirect: '/error'
|
||||
},canDeactivate: [PreviousRouteRecorder] }
|
||||
|
||||
])
|
||||
]
|
||||
})
|
||||
export class DepositDatasetsResultsRoutingModule { }
|
|
@ -1,35 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { OpenaireDepositDatasetsResultComponent } from './depositDatasetsResult.component';
|
||||
|
||||
import {DepositDatasetsResultsRoutingModule} from './depositDatasetsResults-routing.module';
|
||||
import {DepositDatasetsResultsModule} from '../../openaireLibrary/deposit/datasets/depositDatasetsResults.module';
|
||||
import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard';
|
||||
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
|
||||
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard';
|
||||
|
||||
import {ZenodoCommunitiesServiceModule} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communitiesService.module';
|
||||
import {SearchZenodoCommunitiesServiceModule} from '../../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunitiesService.module';
|
||||
|
||||
import {CommunityService} from '../../openaireLibrary/connect/community/community.service';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule, FormsModule,
|
||||
DepositDatasetsResultsModule,
|
||||
DepositDatasetsResultsRoutingModule,
|
||||
ZenodoCommunitiesServiceModule, SearchZenodoCommunitiesServiceModule
|
||||
],
|
||||
declarations: [
|
||||
|
||||
OpenaireDepositDatasetsResultComponent,
|
||||
|
||||
],
|
||||
exports: [
|
||||
OpenaireDepositDatasetsResultComponent,
|
||||
],
|
||||
providers: [FreeGuard,PreviousRouteRecorder, IsRouteEnabled, CommunityService]
|
||||
})
|
||||
export class LibDepositDatasetsResultsModule { }
|
|
@ -1,18 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { OpenaireDepositPublicationsComponent } from './depositPublications.component';
|
||||
import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard';
|
||||
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
|
||||
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard'
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{ path: '', component: OpenaireDepositPublicationsComponent, canActivate: [FreeGuard, IsRouteEnabled], data: {
|
||||
redirect: '/error'
|
||||
}, canDeactivate: [PreviousRouteRecorder] }
|
||||
|
||||
])
|
||||
]
|
||||
})
|
||||
export class DepositPublicationsRoutingModule { }
|
|
@ -1,103 +0,0 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import {ActivatedRoute} from '@angular/router';
|
||||
|
||||
import {PiwikHelper} from '../../utils/piwikHelper';
|
||||
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
|
||||
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
|
||||
|
||||
import {ZenodoCommunitiesService} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service';
|
||||
import {SearchZenodoCommunitiesService} from '../../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunities.service';
|
||||
import {CommunityService} from '../../openaireLibrary/connect/community/community.service';
|
||||
|
||||
import {ZenodoInformationClass} from '../../openaireLibrary/deposit/utils/zenodoInformation.class';
|
||||
import {FetchZenodoInformation} from '../utils/fetchZenodoInformation.class';
|
||||
|
||||
@Component({
|
||||
selector: 'openaire-deposit-publications',
|
||||
template: `
|
||||
<deposit-publications [piwikSiteId]=piwikSiteId [zenodoInformation]="zenodoInformation"></deposit-publications>
|
||||
`
|
||||
})
|
||||
|
||||
export class OpenaireDepositPublicationsComponent {
|
||||
public zenodoInformation: ZenodoInformationClass = new ZenodoInformationClass();
|
||||
properties:EnvProperties;
|
||||
fetchZenodoInformation: FetchZenodoInformation;
|
||||
|
||||
piwikSiteId = null;
|
||||
|
||||
constructor ( private route: ActivatedRoute,
|
||||
private _ΖenodoCommunitieService: ZenodoCommunitiesService,
|
||||
private _communityService: CommunityService,private _searchZenodoCommunitiesService: SearchZenodoCommunitiesService ) {
|
||||
this.fetchZenodoInformation = new FetchZenodoInformation(this._ΖenodoCommunitieService, this._searchZenodoCommunitiesService);
|
||||
}
|
||||
|
||||
public ngOnInit() {
|
||||
//this.zenodoSearchUtils.status = this.errorCodes.LOADING;;
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.route.queryParams.subscribe(params => {
|
||||
let communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
if(!communityId) {
|
||||
communityId = params['communityId'];
|
||||
}
|
||||
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[communityId];
|
||||
|
||||
if(communityId) {
|
||||
|
||||
if (communityId != null && communityId != '') {
|
||||
|
||||
this._communityService.getCommunity(this.properties, this.properties.communityAPI+communityId).subscribe (
|
||||
community => {
|
||||
var community = community;
|
||||
var masterZenodoCommunityId = community.zenodoCommunity;
|
||||
if(masterZenodoCommunityId){
|
||||
this.fetchZenodoInformation.getZenodoCommunityNameAndUrlById(masterZenodoCommunityId, this.properties, this.zenodoInformation);
|
||||
}
|
||||
this.fetchZenodoInformation.searchNumberOfZCommunities(communityId, this.properties, this.zenodoInformation);
|
||||
|
||||
/*
|
||||
if(masterZenodoCommunityId){
|
||||
this._ΖenodoCommunitieService.getZenodoCommunityById(this.properties, this.properties.zenodoCommunities+masterZenodoCommunityId, null).subscribe(
|
||||
result => {
|
||||
var masterZenodoCommunity = result;
|
||||
this.zenodoInformation.name = masterZenodoCommunity.title;
|
||||
this.zenodoInformation.url = masterZenodoCommunity.link;
|
||||
},
|
||||
error => {
|
||||
console.log("Master Zenodo community'"+masterZenodoCommunityId+"' couldn't be loaded");
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
this._searchZenodoCommunitiesService.searchZCommunities(this.properties,communityId).subscribe (
|
||||
result => {
|
||||
var CommunityIds = result;
|
||||
var totalResults = CommunityIds.length;
|
||||
if(totalResults > 0) {
|
||||
this.zenodoInformation.shareInZenodoUrl = "http://duffy.di.uoa.gr:4200/participate/share-zenodo?communityId="+communityId;
|
||||
}
|
||||
},
|
||||
error => {
|
||||
console.log("list of zenodo communities couldn't be loaded");
|
||||
}
|
||||
);
|
||||
*/
|
||||
},
|
||||
error => {
|
||||
//console.error("Community couldn't be loaded");
|
||||
this.handleError("Error getting community with id: "+communityId, error);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private handleError(message: string, error) {
|
||||
console.error("Deposit Publications Page: "+message, error);
|
||||
}
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { OpenaireDepositPublicationsComponent } from './depositPublications.component';
|
||||
|
||||
import {DepositPublicationsRoutingModule} from './depositPublications-routing.module';
|
||||
import {DepositPublicationsModule} from '../../openaireLibrary/deposit/publications/depositPublications.module';
|
||||
import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard';
|
||||
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
|
||||
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard';
|
||||
import {ZenodoCommunitiesServiceModule} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communitiesService.module';
|
||||
import {SearchZenodoCommunitiesServiceModule} from '../../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunitiesService.module';
|
||||
|
||||
import {CommunityService} from '../../openaireLibrary/connect/community/community.service';
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule, FormsModule,
|
||||
DepositPublicationsModule,
|
||||
DepositPublicationsRoutingModule,
|
||||
ZenodoCommunitiesServiceModule, SearchZenodoCommunitiesServiceModule
|
||||
],
|
||||
declarations: [
|
||||
OpenaireDepositPublicationsComponent
|
||||
],
|
||||
exports: [
|
||||
OpenaireDepositPublicationsComponent,
|
||||
],
|
||||
providers: [FreeGuard,PreviousRouteRecorder, IsRouteEnabled, CommunityService]
|
||||
})
|
||||
export class LibDepositPublicationsModule { }
|
|
@ -1,18 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { RouterModule } from '@angular/router';
|
||||
import { OpenaireDepositPublicationsResultComponent } from './depositPublicationsResult.component';
|
||||
import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard';
|
||||
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
|
||||
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard'
|
||||
|
||||
@NgModule({
|
||||
imports: [
|
||||
RouterModule.forChild([
|
||||
{ path: '', component: OpenaireDepositPublicationsResultComponent, canActivate: [FreeGuard, IsRouteEnabled], data: {
|
||||
redirect: '/error'
|
||||
}, canDeactivate: [PreviousRouteRecorder] }
|
||||
|
||||
])
|
||||
]
|
||||
})
|
||||
export class DepositPublicationsResultRoutingModule { }
|
|
@ -1,72 +0,0 @@
|
|||
import {Component, Input} from '@angular/core';
|
||||
import {ActivatedRoute} from '@angular/router';
|
||||
import {PiwikHelper} from '../../utils/piwikHelper';
|
||||
import {ConnectHelper} from '../../openaireLibrary/connect/connectHelper';
|
||||
import {EnvProperties} from '../../openaireLibrary/utils/properties/env-properties';
|
||||
|
||||
import {ZenodoCommunitiesService} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communities.service';
|
||||
import {SearchZenodoCommunitiesService} from '../../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunities.service';
|
||||
import {CommunityService} from '../../openaireLibrary/connect/community/community.service';
|
||||
|
||||
import {ZenodoInformationClass} from '../../openaireLibrary/deposit/utils/zenodoInformation.class';
|
||||
import {FetchZenodoInformation} from '../utils/fetchZenodoInformation.class';
|
||||
|
||||
|
||||
@Component({
|
||||
selector: 'openaire-deposit-publications-result',
|
||||
template: `
|
||||
<deposit-publications-result [piwikSiteId]=piwikSiteId [zenodoInformation]="zenodoInformation"></deposit-publications-result>
|
||||
`
|
||||
})
|
||||
|
||||
export class OpenaireDepositPublicationsResultComponent {
|
||||
public zenodoInformation: ZenodoInformationClass = new ZenodoInformationClass();
|
||||
properties:EnvProperties;
|
||||
fetchZenodoInformation: FetchZenodoInformation;
|
||||
|
||||
piwikSiteId = null;
|
||||
|
||||
constructor ( private route: ActivatedRoute,
|
||||
private _ΖenodoCommunitieService: ZenodoCommunitiesService,
|
||||
private _communityService: CommunityService,private _searchZenodoCommunitiesService: SearchZenodoCommunitiesService ) {
|
||||
this.fetchZenodoInformation = new FetchZenodoInformation(this._ΖenodoCommunitieService, this._searchZenodoCommunitiesService);
|
||||
}
|
||||
|
||||
public ngOnInit() {
|
||||
this.route.data
|
||||
.subscribe((data: { envSpecific: EnvProperties }) => {
|
||||
this.properties = data.envSpecific;
|
||||
this.route.queryParams.subscribe(params => {
|
||||
let communityId = ConnectHelper.getCommunityFromDomain(this.properties.domain);
|
||||
if(!communityId) {
|
||||
communityId = params['communityId'];
|
||||
}
|
||||
|
||||
this.piwikSiteId = PiwikHelper.siteIDs[communityId];
|
||||
|
||||
if(communityId) {
|
||||
if (communityId != null && communityId != '') {
|
||||
this._communityService.getCommunity(this.properties, this.properties.communityAPI+communityId).subscribe (
|
||||
community => {
|
||||
var community = community;
|
||||
var masterZenodoCommunityId = community.zenodoCommunity;
|
||||
if(masterZenodoCommunityId){
|
||||
this.fetchZenodoInformation.getZenodoCommunityNameAndUrlById(masterZenodoCommunityId, this.properties, this.zenodoInformation);
|
||||
}
|
||||
this.fetchZenodoInformation.searchNumberOfZCommunities(communityId, this.properties, this.zenodoInformation);
|
||||
},
|
||||
error => {
|
||||
//console.error("Community couldn't be loaded");
|
||||
this.handleError("Error getting community with id: "+communityId, error);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
private handleError(message: string, error) {
|
||||
console.error("Deposit Publications Result Page: "+message, error);
|
||||
}
|
||||
}
|
|
@ -1,32 +0,0 @@
|
|||
import { NgModule } from '@angular/core';
|
||||
import { CommonModule } from '@angular/common';
|
||||
import { FormsModule } from '@angular/forms';
|
||||
|
||||
import { OpenaireDepositPublicationsResultComponent } from './depositPublicationsResult.component';
|
||||
|
||||
import {DepositPublicationsResultRoutingModule} from './depositPublicationsResult-routing.module';
|
||||
import {DepositPublicationsResultsModule} from '../../openaireLibrary/deposit/publications/depositPublicationsResults.module';
|
||||
import {FreeGuard} from '../../openaireLibrary/login/freeGuard.guard';
|
||||
import {PreviousRouteRecorder} from '../../openaireLibrary/utils/piwik/previousRouteRecorder.guard';
|
||||
import {IsRouteEnabled} from '../../openaireLibrary/error/isRouteEnabled.guard';
|
||||
|
||||
import {ZenodoCommunitiesServiceModule} from '../../openaireLibrary/connect/zenodoCommunities/zenodo-communitiesService.module';
|
||||
import {SearchZenodoCommunitiesServiceModule} from '../../openaireLibrary/connect/zenodoCommunities/searchZenodoCommunitiesService.module';
|
||||
|
||||
import {CommunityService} from '../../openaireLibrary/connect/community/community.service';
|
||||
@NgModule({
|
||||
imports: [
|
||||
CommonModule, FormsModule,
|
||||
DepositPublicationsResultsModule,
|
||||
DepositPublicationsResultRoutingModule,
|
||||
ZenodoCommunitiesServiceModule, SearchZenodoCommunitiesServiceModule
|
||||
],
|
||||
declarations: [
|
||||
OpenaireDepositPublicationsResultComponent
|
||||
],
|
||||
exports: [
|
||||
OpenaireDepositPublicationsResultComponent
|
||||
],
|
||||
providers: [FreeGuard,PreviousRouteRecorder, IsRouteEnabled, CommunityService]
|
||||
})
|
||||
export class LibDepositPublicationsResultsModule { }
|
Loading…
Reference in New Issue