cleanup code, add authorizationUrl and recordUrl in repositories config
This commit is contained in:
parent
59e26dbb8d
commit
6b2bc3c1e0
|
@ -33,10 +33,12 @@ public class RepositoryDepositConfiguration {
|
|||
private String repositoryId;
|
||||
private String accessToken;
|
||||
private String repositoryUrl;
|
||||
private String repositoryAuthorizationUrl;
|
||||
private String repositoryRecordUrl;
|
||||
private String repositoryLoginAccessTokenUrl;
|
||||
private String repositoryLoginClientId;
|
||||
private String repositoryLoginClientSecret;
|
||||
private String repositoryLoginRedirectUri; //
|
||||
private String repositoryLoginRedirectUri;
|
||||
|
||||
public int getDepositAccountStatus() {
|
||||
return depositAccountStatus;
|
||||
|
@ -66,6 +68,20 @@ public class RepositoryDepositConfiguration {
|
|||
this.repositoryUrl = repositoryUrl;
|
||||
}
|
||||
|
||||
public String getRepositoryAuthorizationUrl() {
|
||||
return repositoryAuthorizationUrl;
|
||||
}
|
||||
public void setRepositoryAuthorizationUrl(String repositoryAuthorizationUrl) {
|
||||
this.repositoryAuthorizationUrl = repositoryAuthorizationUrl;
|
||||
}
|
||||
|
||||
public String getRepositoryRecordUrl() {
|
||||
return repositoryRecordUrl;
|
||||
}
|
||||
public void setRepositoryRecordUrl(String repositoryRecordUrl) {
|
||||
this.repositoryRecordUrl = repositoryRecordUrl;
|
||||
}
|
||||
|
||||
public String getRepositoryLoginAccessTokenUrl() {
|
||||
return repositoryLoginAccessTokenUrl;
|
||||
}
|
||||
|
|
|
@ -38,17 +38,9 @@ public class DepositManager {
|
|||
|
||||
public List<RepositoryDepositConfiguration> getAvailableRepos() {
|
||||
List<RepositoryDepositConfiguration> repos = new ArrayList<>();
|
||||
|
||||
// logger.info("-------------REPOS------------");
|
||||
// for (RepositoryDeposit r: this.repositories) {
|
||||
// logger.info("...Loaded Class: "
|
||||
// + r.getClass());
|
||||
// }
|
||||
// logger.info("-------------------------------");
|
||||
for (RepositoryDeposit r: this.repositories) {
|
||||
repos.add(r.getConfiguration());
|
||||
}
|
||||
|
||||
return repos;
|
||||
}
|
||||
|
||||
|
|
|
@ -177,6 +177,8 @@ public class ZenodoDeposit implements RepositoryDeposit {
|
|||
conf.setRepositoryId("Zenodo");
|
||||
conf.setAccessToken("pcqw4LGLrhp17FF5GoXNCXakkEi82ThchZw7Tk4qh74VrDE3EmliG3UlhYtd");
|
||||
conf.setRepositoryUrl("https://sandbox.zenodo.org/api/");
|
||||
conf.setRepositoryAuthorizationUrl("https://sandbox.zenodo.org/oauth/authorize");
|
||||
conf.setRepositoryRecordUrl("https://sandbox.zenodo.org/record/");
|
||||
conf.setRepositoryLoginAccessTokenUrl("https://sandbox.zenodo.org/oauth/token");
|
||||
conf.setRepositoryLoginClientId("hEmVRNc1OzRmWyi2GDR3XVKbhG3OtfJXLXkkOGXx");
|
||||
conf.setRepositoryLoginClientSecret("7VSU0NjiAg0P3mv14wemMYy2XhvlmV6F7xoszxPH4ZDx98v8FdMpBbxlncqr");
|
||||
|
|
|
@ -5,7 +5,10 @@ export class DepositConfigurationModel {
|
|||
repositoryId: string;
|
||||
accessToken: string;
|
||||
repositoryUrl: string;
|
||||
repositoryAuthorizationUrl: string;
|
||||
repositoryRecordUrl: string;
|
||||
repositoryLoginAccessTokenUrl: string;
|
||||
repositoryLoginClientId: string;
|
||||
repositoryLoginClientSecret: string;
|
||||
repositoryLoginRedirectUri: string;
|
||||
}
|
||||
|
|
|
@ -66,11 +66,6 @@ export class ConfigurationService extends BaseComponent {
|
|||
return this._allowOrganizationCreator;
|
||||
}
|
||||
|
||||
private _doiLink: string;
|
||||
get doiLink(): string {
|
||||
return this._doiLink;
|
||||
}
|
||||
|
||||
private _useSplash: string;
|
||||
get useSplash(): string {
|
||||
return this._useSplash;
|
||||
|
@ -137,7 +132,6 @@ export class ConfigurationService extends BaseComponent {
|
|||
this._lockInterval = config.lockInterval;
|
||||
this._guideAssets = config.guideAssets;
|
||||
this._allowOrganizationCreator = config.allowOrganizationCreator;
|
||||
this._doiLink = config.doiLink;
|
||||
this._useSplash = config.useSplash;
|
||||
this._orcidPath = config.orcidPath;
|
||||
if (config.matomo) {
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<button mat-list-item *ngFor="let repo of inputRepos" (click)="deposit(repo)"> {{ repo.repositoryId }} </button>
|
||||
</mat-action-list>
|
||||
</div>
|
||||
<div *ngIf="inputRepos.length === 0" class="emptyList">No publishing repositories so far</div>
|
||||
<div *ngIf="inputRepos.length === 0" class="emptyList">{{'DMP-OVERVIEW.DEPOSIT.NO-REPOSITORIES' | translate}}</div>
|
||||
|
||||
<div mat-dialog-actions class="d-flex justify-content-end mb-1">
|
||||
<div class="col-auto">
|
||||
|
|
|
@ -5,11 +5,9 @@ import { DepositConfigurationModel } from '@app/core/model/deposit/deposit-confi
|
|||
import { DmpOverviewModel } from '@app/core/model/dmp/dmp-overview';
|
||||
import { DoiModel } from '@app/core/model/doi/doi';
|
||||
import { DepositRepositoriesService } from '@app/core/services/deposit-repositories/deposit-repositories.service';
|
||||
import { DmpService } from '@app/core/services/dmp/dmp.service';
|
||||
import { SnackBarNotificationLevel, UiNotificationService } from '@app/core/services/notification/ui-notification-service';
|
||||
import { Oauth2DialogService } from '@app/ui/misc/oauth2-dialog/service/oauth2-dialog.service';
|
||||
import { BaseComponent } from '@common/base/base.component';
|
||||
import { ConfirmationDialogComponent } from '@common/modules/confirmation-dialog/confirmation-dialog.component';
|
||||
import { MultipleChoiceDialogComponent } from '@common/modules/multiple-choice-dialog/multiple-choice-dialog.component';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import { takeUntil } from 'rxjs/operators';
|
||||
|
@ -24,13 +22,14 @@ export class DmpDepositDialogComponent extends BaseComponent implements OnInit {
|
|||
inputRepos: DepositConfigurationModel[];
|
||||
outputRepos: DoiModel[];
|
||||
dmp: DmpOverviewModel;
|
||||
private oauthLock: boolean;
|
||||
|
||||
constructor(
|
||||
private dmpService: DmpService,
|
||||
private depositRepositoriesService: DepositRepositoriesService,
|
||||
public dialogRef: MatDialogRef<DmpDepositDialogComponent>,
|
||||
private dialog: MatDialog,
|
||||
private language: TranslateService,
|
||||
private translate: TranslateService,
|
||||
private uiNotificationService: UiNotificationService,
|
||||
private oauth2DialogService: Oauth2DialogService,
|
||||
@Inject(MAT_DIALOG_DATA) public data: any
|
||||
|
@ -67,16 +66,16 @@ export class DmpDepositDialogComponent extends BaseComponent implements OnInit {
|
|||
maxWidth: '600px',
|
||||
restoreFocus: false,
|
||||
data: {
|
||||
message: 'Which account would you like to use?',//this.language.instant('GENERAL.ERRORS.HTTP-REQUEST-ERROR'),
|
||||
titles: ['Login with ' + repo.repositoryId/*this.language.instant('DMP-OVERVIEW.MULTIPLE-DIALOG.ZENODO-LOGIN')*/, this.language.instant('DMP-OVERVIEW.MULTIPLE-DIALOG.USE-DEFAULT')]
|
||||
message: this.language.instant('DMP-OVERVIEW.DEPOSIT.ACCOUNT-LOGIN'),
|
||||
titles: [this.language.instant('DMP-OVERVIEW.DEPOSIT.LOGIN', { 'repository': repo.repositoryId }), this.language.instant('DMP-OVERVIEW.MULTIPLE-DIALOG.USE-DEFAULT')]
|
||||
}
|
||||
});
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||
switch (result) {
|
||||
case 0:
|
||||
this.showOauth2Dialog('https://sandbox.zenodo.org/oauth/authorize'+ '?client_id=' + repo.repositoryLoginClientId
|
||||
this.showOauth2Dialog(repo.repositoryAuthorizationUrl + '?client_id=' + repo.repositoryLoginClientId
|
||||
+ '&response_type=code&scope=deposit:write+deposit:actions+user:email&state=astate&redirect_uri='
|
||||
+ 'http://localhost:4200/login/external/zenodo', repo, this.dmp);
|
||||
+ repo.repositoryLoginRedirectUri, repo, this.dmp);
|
||||
break;
|
||||
case 1:
|
||||
this.depositRepositoriesService.createDoi(repo.repositoryId, this.dmp.id, null)
|
||||
|
@ -88,7 +87,7 @@ export class DmpDepositDialogComponent extends BaseComponent implements OnInit {
|
|||
if(this.inputRepos.length == 0){
|
||||
this.close();
|
||||
}
|
||||
}, error => this.onDeleteCallbackError(error));
|
||||
}, error => this.onDOICallbackError(error));
|
||||
break;
|
||||
}
|
||||
});
|
||||
|
@ -100,8 +99,8 @@ export class DmpDepositDialogComponent extends BaseComponent implements OnInit {
|
|||
this.uiNotificationService.snackBarNotification(this.language.instant('DMP-EDITOR.SNACK-BAR.SUCCESSFUL-DOI'), SnackBarNotificationLevel.Success);
|
||||
}
|
||||
|
||||
onDeleteCallbackError(error) {
|
||||
this.uiNotificationService.snackBarNotification(error.error.message ? this.language.instant(error.error.message) : this.language.instant('GENERAL.SNACK-BAR.UNSUCCESSFUL-DELETE'), SnackBarNotificationLevel.Error);
|
||||
onDOICallbackError(error) {
|
||||
this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('DMP-EDITOR.SNACK-BAR.UNSUCCESSFUL-DOI'), SnackBarNotificationLevel.Error);
|
||||
}
|
||||
|
||||
showOauth2Dialog(url: string, repo: DepositConfigurationModel, dmp: DmpOverviewModel) {
|
||||
|
@ -109,7 +108,7 @@ export class DmpDepositDialogComponent extends BaseComponent implements OnInit {
|
|||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(result => {
|
||||
if (result !== undefined) {
|
||||
if (result.oauthCode !== undefined && result.oauthCode !== null) {
|
||||
if (result.oauthCode !== undefined && result.oauthCode !== null && !this.oauthLock) {
|
||||
this.depositRepositoriesService.getAccessToken(repo.repositoryId, result.oauthCode)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(token => {
|
||||
|
@ -122,16 +121,14 @@ export class DmpDepositDialogComponent extends BaseComponent implements OnInit {
|
|||
if(this.inputRepos.length == 0){
|
||||
this.close();
|
||||
}
|
||||
}, error => this.onDeleteCallbackError(error));
|
||||
}, error => this.onDOICallbackError(error));
|
||||
});
|
||||
// this.userService.registerDOIToken(result.oauthCode, this.configurationService.app + 'oauth2')
|
||||
// .pipe(takeUntil(this._destroyed))
|
||||
// .subscribe(() => {
|
||||
// this.hasDOIToken = true;
|
||||
// this.showConfirmationDOIDialog(dmp);
|
||||
// });
|
||||
this.oauthLock = true;
|
||||
}
|
||||
}
|
||||
else{
|
||||
this.oauthLock = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -115,8 +115,8 @@
|
|||
<p class="doi-label">{{'DMP-EDITOR.TITLE.SUBTITLE' | translate}}</p>
|
||||
<div class="doi-panel">
|
||||
<mat-select class="mb-0 ml-3" placeholder="{{ dmp.dois[0].doi }}">
|
||||
<mat-option *ngFor="let x of dmp.dois">
|
||||
{{x.repositoryId}}
|
||||
<mat-option *ngFor="let doi of dmp.dois">
|
||||
{{doi.repositoryId}}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<div class="d-flex justify-content-end ml-3">
|
||||
|
@ -124,7 +124,7 @@
|
|||
<mat-icon class="mat-mini-fab-icon">content_copy</mat-icon>
|
||||
</button>
|
||||
<button mat-mini-fab class="mr-2 d-flex justify-content-center align-items-center" matTooltip="{{'GRANT-EDITOR.ACTIONS.VISIT-WEBSITE' | translate}}" matTooltipPosition="above">
|
||||
<a [href]="createDoiLink(dmp.dois[0].doi)" class="doi-link" target="_blank">
|
||||
<a [href]="createDoiLink(dmp.dois[0])" class="doi-link" target="_blank">
|
||||
<mat-icon class="mat-mini-fab-icon">launch</mat-icon>
|
||||
</a>
|
||||
</button>
|
||||
|
|
|
@ -18,16 +18,15 @@ import { BreadcrumbItem } from '@app/ui/misc/breadcrumb/definition/breadcrumb-it
|
|||
import { BaseComponent } from '@common/base/base.component';
|
||||
import { TranslateService } from '@ngx-translate/core';
|
||||
import * as FileSaver from 'file-saver';
|
||||
import { Observable, of as observableOf, interval } from 'rxjs';
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
import { takeUntil, map } from 'rxjs/operators';
|
||||
import { Role } from "@app/core/common/enum/role";
|
||||
import { DmpInvitationDialogComponent } from '../invitation/dmp-invitation-dialog.component';
|
||||
import { MultipleChoiceDialogComponent } from '@common/modules/multiple-choice-dialog/multiple-choice-dialog.component';
|
||||
import { ConfigurationService } from '@app/core/services/configuration/configuration.service';
|
||||
import { Oauth2DialogService } from '@app/ui/misc/oauth2-dialog/service/oauth2-dialog.service';
|
||||
import { UserService } from '@app/core/services/user/user.service';
|
||||
import { Location } from '@angular/common';
|
||||
import { FormGroup, FormArray, FormControl } from '@angular/forms';
|
||||
import { FormGroup } from '@angular/forms';
|
||||
import { LockService } from '@app/core/services/lock/lock.service';
|
||||
import { VersionListingModel } from '@app/core/model/version/version-listing.model';
|
||||
import { CloneDialogComponent } from '../clone/clone-dialog/clone-dialog.component';
|
||||
|
@ -67,7 +66,6 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
|||
textMessage: any;
|
||||
versions: VersionListingModel[];
|
||||
version: VersionListingModel;
|
||||
private oauthLock: boolean;
|
||||
|
||||
@ViewChild('doi')
|
||||
doi: ElementRef;
|
||||
|
@ -87,11 +85,8 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
|||
private language: TranslateService,
|
||||
private uiNotificationService: UiNotificationService,
|
||||
private configurationService: ConfigurationService,
|
||||
private oauth2DialogService: Oauth2DialogService,
|
||||
private userService: UserService,
|
||||
private location: Location,
|
||||
private lockService: LockService,
|
||||
private httpClient: HttpClient,
|
||||
private matomoService: MatomoService
|
||||
) {
|
||||
super();
|
||||
|
@ -460,25 +455,6 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
|||
return (this.dmp.dois == null || this.dmp.dois.length == 0) ? true : false;
|
||||
}
|
||||
|
||||
getAccessUrl(): string {
|
||||
const redirectUri = this.configurationService.app + 'oauth2';
|
||||
const url = this.configurationService.loginProviders.zenodoConfiguration.oauthUrl
|
||||
+ '?client_id=' + this.configurationService.loginProviders.zenodoConfiguration.clientId
|
||||
+ '&response_type=code&scope=deposit:write+deposit:actions+user:email&state=astate&redirect_uri='
|
||||
+ redirectUri;
|
||||
return url;
|
||||
}
|
||||
|
||||
getDoi(dmp: DmpOverviewModel) {
|
||||
this.userService.hasDOIToken().subscribe(response => {
|
||||
this.hasDOIToken = true;
|
||||
this.showConfirmationDOIDialog(dmp);
|
||||
}, error => {
|
||||
this.hasDOIToken = false;
|
||||
this.showErrorConfirmationDOIDialog(error.error.message, dmp);
|
||||
});
|
||||
}
|
||||
|
||||
getAllVersions(dmp: DmpOverviewModel) {
|
||||
this.dmpService.getAllVersions(dmp.groupId, this.isPublicView)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
|
@ -487,82 +463,6 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
|||
});
|
||||
}
|
||||
|
||||
showConfirmationDOIDialog(dmp: DmpOverviewModel) {
|
||||
const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
|
||||
maxWidth: '600px',
|
||||
restoreFocus: false,
|
||||
data: {
|
||||
message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ZENODO-DOI', { 'username': this.hasDOIToken ? this.authentication.current().zenodoEmail : 'default' }),
|
||||
confirmButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CONFIRM'),
|
||||
cancelButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CANCEL'),
|
||||
}
|
||||
});
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||
if (result) {
|
||||
this.dmpService.getDoi(dmp.id)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(
|
||||
complete => {
|
||||
this.onDOICallbackSuccess();
|
||||
this.dmp.doi = complete;
|
||||
},
|
||||
error => this.onDeleteCallbackError(error)
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
showErrorConfirmationDOIDialog(message: string, dmp: DmpOverviewModel) {
|
||||
const dialogRef = this.dialog.open(MultipleChoiceDialogComponent, {
|
||||
maxWidth: '600px',
|
||||
restoreFocus: false,
|
||||
data: {
|
||||
message: message ? this.language.instant(message) : this.language.instant('GENERAL.ERRORS.HTTP-REQUEST-ERROR'),
|
||||
titles: [this.language.instant('DMP-OVERVIEW.MULTIPLE-DIALOG.ZENODO-LOGIN'), this.language.instant('DMP-OVERVIEW.MULTIPLE-DIALOG.USE-DEFAULT')]
|
||||
}
|
||||
});
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||
switch (result) {
|
||||
case 0:
|
||||
// this.authentication.logout();
|
||||
// this.router.navigate(['/login/external/zenodo']);
|
||||
this.showOauth2Dialog(this.getAccessUrl(), dmp);
|
||||
break;
|
||||
case 1:
|
||||
this.showConfirmationDOIDialog(dmp);
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
showOauth2Dialog(url: string, dmp: DmpOverviewModel) {
|
||||
this.oauth2DialogService.login(url)
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(result => {
|
||||
if (result !== undefined) {
|
||||
if (result.oauthCode !== undefined && result.oauthCode !== null && !this.oauthLock) {
|
||||
this.userService.registerDOIToken(result.oauthCode, this.configurationService.app + 'oauth2')
|
||||
.pipe(takeUntil(this._destroyed))
|
||||
.subscribe(() => {
|
||||
this.hasDOIToken = true;
|
||||
this.showConfirmationDOIDialog(dmp);
|
||||
});
|
||||
this.oauthLock = true;
|
||||
}
|
||||
} else {
|
||||
this.oauthLock = false;
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
onDOICallbackSuccess(): void {
|
||||
this.uiNotificationService.snackBarNotification(this.language.instant('DMP-EDITOR.SNACK-BAR.SUCCESSFUL-DOI'), SnackBarNotificationLevel.Success);
|
||||
}
|
||||
|
||||
onDOICallbackError(error) {
|
||||
this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('DMP-EDITOR.SNACK-BAR.UNSUCCESSFUL-DOI'), SnackBarNotificationLevel.Error);
|
||||
}
|
||||
|
||||
showPublishButton(dmp: DmpOverviewModel) {
|
||||
return this.isFinalizedDmp(dmp) && !dmp.isPublic && this.hasPublishButton;
|
||||
}
|
||||
|
@ -599,9 +499,9 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
|||
autoFocus: false,
|
||||
data: {
|
||||
depositRepos: [this.depositRepos, this.dmp],
|
||||
message: "Select repositories to deposit",//this.language.instant('GENERAL.CONFIRMATION-DIALOG.FINALIZE-ITEM'),
|
||||
confirmButton: "Proceed to authentication",//this.language.instant('DMP-FINALISE-DIALOG.SUBMIT'),
|
||||
cancelButton: "Cancel",//this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CANCEL'),
|
||||
message: this.language.instant('DMP-OVERVIEW.DEPOSIT.SELECT-REPOSITORIES'),
|
||||
confirmButton: this.language.instant('DMP-OVERVIEW.DEPOSIT.AUTHORIZE'),
|
||||
cancelButton: this.language.instant('DMP-OVERVIEW.DEPOSIT.CANCEL'),
|
||||
}
|
||||
});
|
||||
dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe((result: DoiModel[]) => {
|
||||
|
@ -715,10 +615,10 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
|||
this.router.navigate(['/datasets', 'new', this.dmp.id]);
|
||||
}
|
||||
|
||||
createDoiLink(doi: string): string {
|
||||
const doiarr = doi.split('.');
|
||||
createDoiLink(doiModel: DoiModel): string {
|
||||
const doiarr = doiModel.doi.split('.');
|
||||
const id = doiarr[doiarr.length - 1];
|
||||
return this.configurationService.doiLink + id;
|
||||
return this.depositRepos.find(r => r.repositoryId == doiModel.repositoryId).repositoryRecordUrl + id;
|
||||
}
|
||||
|
||||
reverse() {
|
||||
|
@ -876,5 +776,99 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit {
|
|||
// });
|
||||
// }
|
||||
|
||||
// getAccessUrl(): string {
|
||||
// const redirectUri = this.configurationService.app + 'oauth2';
|
||||
// const url = this.configurationService.loginProviders.zenodoConfiguration.oauthUrl
|
||||
// + '?client_id=' + this.configurationService.loginProviders.zenodoConfiguration.clientId
|
||||
// + '&response_type=code&scope=deposit:write+deposit:actions+user:email&state=astate&redirect_uri='
|
||||
// + redirectUri;
|
||||
// return url;
|
||||
// }
|
||||
|
||||
// getDoi(dmp: DmpOverviewModel) {
|
||||
// this.userService.hasDOIToken().subscribe(response => {
|
||||
// this.hasDOIToken = true;
|
||||
// this.showConfirmationDOIDialog(dmp);
|
||||
// }, error => {
|
||||
// this.hasDOIToken = false;
|
||||
// this.showErrorConfirmationDOIDialog(error.error.message, dmp);
|
||||
// });
|
||||
// }
|
||||
|
||||
// showConfirmationDOIDialog(dmp: DmpOverviewModel) {
|
||||
// const dialogRef = this.dialog.open(ConfirmationDialogComponent, {
|
||||
// maxWidth: '600px',
|
||||
// restoreFocus: false,
|
||||
// data: {
|
||||
// message: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ZENODO-DOI', { 'username': this.hasDOIToken ? this.authentication.current().zenodoEmail : 'default' }),
|
||||
// confirmButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CONFIRM'),
|
||||
// cancelButton: this.language.instant('GENERAL.CONFIRMATION-DIALOG.ACTIONS.CANCEL'),
|
||||
// }
|
||||
// });
|
||||
// dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||
// if (result) {
|
||||
// this.dmpService.getDoi(dmp.id)
|
||||
// .pipe(takeUntil(this._destroyed))
|
||||
// .subscribe(
|
||||
// complete => {
|
||||
// this.onDOICallbackSuccess();
|
||||
// this.dmp.doi = complete;
|
||||
// },
|
||||
// error => this.onDeleteCallbackError(error)
|
||||
// );
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// showErrorConfirmationDOIDialog(message: string, dmp: DmpOverviewModel) {
|
||||
// const dialogRef = this.dialog.open(MultipleChoiceDialogComponent, {
|
||||
// maxWidth: '600px',
|
||||
// restoreFocus: false,
|
||||
// data: {
|
||||
// message: message ? this.language.instant(message) : this.language.instant('GENERAL.ERRORS.HTTP-REQUEST-ERROR'),
|
||||
// titles: [this.language.instant('DMP-OVERVIEW.MULTIPLE-DIALOG.ZENODO-LOGIN'), this.language.instant('DMP-OVERVIEW.MULTIPLE-DIALOG.USE-DEFAULT')]
|
||||
// }
|
||||
// });
|
||||
// dialogRef.afterClosed().pipe(takeUntil(this._destroyed)).subscribe(result => {
|
||||
// switch (result) {
|
||||
// case 0:
|
||||
// // this.authentication.logout();
|
||||
// // this.router.navigate(['/login/external/zenodo']);
|
||||
// this.showOauth2Dialog(this.getAccessUrl(), dmp);
|
||||
// break;
|
||||
// case 1:
|
||||
// this.showConfirmationDOIDialog(dmp);
|
||||
// break;
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// showOauth2Dialog(url: string, dmp: DmpOverviewModel) {
|
||||
// this.oauth2DialogService.login(url)
|
||||
// .pipe(takeUntil(this._destroyed))
|
||||
// .subscribe(result => {
|
||||
// if (result !== undefined) {
|
||||
// if (result.oauthCode !== undefined && result.oauthCode !== null && !this.oauthLock) {
|
||||
// this.userService.registerDOIToken(result.oauthCode, this.configurationService.app + 'oauth2')
|
||||
// .pipe(takeUntil(this._destroyed))
|
||||
// .subscribe(() => {
|
||||
// this.hasDOIToken = true;
|
||||
// this.showConfirmationDOIDialog(dmp);
|
||||
// });
|
||||
// this.oauthLock = true;
|
||||
// }
|
||||
// } else {
|
||||
// this.oauthLock = false;
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
|
||||
// onDOICallbackSuccess(): void {
|
||||
// this.uiNotificationService.snackBarNotification(this.language.instant('DMP-EDITOR.SNACK-BAR.SUCCESSFUL-DOI'), SnackBarNotificationLevel.Success);
|
||||
// }
|
||||
|
||||
// onDOICallbackError(error) {
|
||||
// this.uiNotificationService.snackBarNotification(error.error.message ? error.error.message : this.language.instant('DMP-EDITOR.SNACK-BAR.UNSUCCESSFUL-DOI'), SnackBarNotificationLevel.Error);
|
||||
// }
|
||||
|
||||
}
|
||||
|
|
|
@ -57,7 +57,6 @@
|
|||
"lockInterval": 60000,
|
||||
"guideAssets": "assets/images/guide",
|
||||
"allowOrganizationCreator": true,
|
||||
"doiLink": "https://sandbox.zenodo.org/record/",
|
||||
"useSplash": false,
|
||||
"orcidPath": "https://orcid.org/",
|
||||
"maxFileSizeInMB": 10
|
||||
|
|
|
@ -803,6 +803,14 @@
|
|||
"ZENODO-LOGIN": "Login with Zenodo",
|
||||
"USE-DEFAULT": "Use Default Token"
|
||||
},
|
||||
"DEPOSIT": {
|
||||
"ACCOUNT-LOGIN": "Which account would you like to use?",
|
||||
"LOGIN": "Login with {{repository}}",
|
||||
"NO-REPOSITORIES": "No publishing repositories",
|
||||
"SELECT-REPOSITORIES": "Select repositories to deposit",
|
||||
"AUTHORIZE": "Proceed to authorization",
|
||||
"CANCEL": "Cancel"
|
||||
},
|
||||
"LOCKED-DIALOG":{
|
||||
"TITLE": "DMP is locked",
|
||||
"MESSAGE":"Somebody else is modifying the DMP at this moment. If you would like to modify or view it, please come back later."
|
||||
|
|
|
@ -803,6 +803,14 @@
|
|||
"ZENODO-LOGIN": "Login with Zenodo",
|
||||
"USE-DEFAULT": "Use Default Token"
|
||||
},
|
||||
"DEPOSIT": {
|
||||
"ACCOUNT-LOGIN": "Which account would you like to use?",
|
||||
"LOGIN": "Login with {{repository}}",
|
||||
"NO-REPOSITORIES": "No publishing repositories",
|
||||
"SELECT-REPOSITORIES": "Select repositories to deposit",
|
||||
"AUTHORIZE": "Proceed to authorization",
|
||||
"CANCEL": "Cancel"
|
||||
},
|
||||
"LOCKED-DIALOG":{
|
||||
"TITLE": "DMP is locked",
|
||||
"MESSAGE":"Somebody else is modifying the DMP at this moment. If you would like to modify or view it, please come back later."
|
||||
|
|
|
@ -803,6 +803,14 @@
|
|||
"ZENODO-LOGIN": "Identificarse con Zenodo",
|
||||
"USE-DEFAULT": "Usar el token por defecto"
|
||||
},
|
||||
"DEPOSIT": {
|
||||
"ACCOUNT-LOGIN": "Which account would you like to use?",
|
||||
"LOGIN": "Login with {{repository}}",
|
||||
"NO-REPOSITORIES": "No publishing repositories",
|
||||
"SELECT-REPOSITORIES": "Select repositories to deposit",
|
||||
"AUTHORIZE": "Proceed to authorization",
|
||||
"CANCEL": "Cancel"
|
||||
},
|
||||
"LOCKED-DIALOG":{
|
||||
"TITLE": "PGD bloqeuado",
|
||||
"MESSAGE":"Alguien más está modificando el PGD. Si quiere modificarlo o visualizarlo, por favor, inténtelo más tarde."
|
||||
|
|
|
@ -803,6 +803,14 @@
|
|||
"ZENODO-LOGIN": "Σύνδεση με Zenodo",
|
||||
"USE-DEFAULT": "Χρήση Προκαθορισμένου Token"
|
||||
},
|
||||
"DEPOSIT": {
|
||||
"ACCOUNT-LOGIN": "Which account would you like to use?",
|
||||
"LOGIN": "Login with {{repository}}",
|
||||
"NO-REPOSITORIES": "No publishing repositories",
|
||||
"SELECT-REPOSITORIES": "Select repositories to deposit",
|
||||
"AUTHORIZE": "Proceed to authorization",
|
||||
"CANCEL": "Cancel"
|
||||
},
|
||||
"LOCKED-DIALOG":{
|
||||
"TITLE": "DMP is locked",
|
||||
"MESSAGE":"Somebody else is modifying the DMP at this moment. If you would like to modify or view it, please come back later."
|
||||
|
|
|
@ -803,6 +803,14 @@
|
|||
"ZENODO-LOGIN": "Prijavite se pomoću Zenodo korisničkog računa",
|
||||
"USE-DEFAULT": "Koristite zadanu opciju"
|
||||
},
|
||||
"DEPOSIT": {
|
||||
"ACCOUNT-LOGIN": "Which account would you like to use?",
|
||||
"LOGIN": "Login with {{repository}}",
|
||||
"NO-REPOSITORIES": "No publishing repositories",
|
||||
"SELECT-REPOSITORIES": "Select repositories to deposit",
|
||||
"AUTHORIZE": "Proceed to authorization",
|
||||
"CANCEL": "Cancel"
|
||||
},
|
||||
"LOCKED-DIALOG": {
|
||||
"TITLE": "PUP je zaključan",
|
||||
"MESSAGE": "U ovom trenutku netko drugi uređuje informacije o skupu podataka. Ako želite pregledati zapis ili napraviti izmjenu, pričekajte i pokušajte ponovo kasnije."
|
||||
|
|
|
@ -803,6 +803,14 @@
|
|||
"ZENODO-LOGIN": "Zaloguj się za pomocą Zenodo",
|
||||
"USE-DEFAULT": "Użyj domyślnego tokena"
|
||||
},
|
||||
"DEPOSIT": {
|
||||
"ACCOUNT-LOGIN": "Which account would you like to use?",
|
||||
"LOGIN": "Login with {{repository}}",
|
||||
"NO-REPOSITORIES": "No publishing repositories",
|
||||
"SELECT-REPOSITORIES": "Select repositories to deposit",
|
||||
"AUTHORIZE": "Proceed to authorization",
|
||||
"CANCEL": "Cancel"
|
||||
},
|
||||
"LOCKED-DIALOG": {
|
||||
"TITLE": "DMP jest zablokowany",
|
||||
"MESSAGE": "W tej chwili ktoś inny modyfikuje ten zbiór danych. Możesz przeglądać ten zbiór danych, ale nie możesz wprowadzać żadnych zmian. Jeśli chcesz go zmodyfikować, wróć później."
|
||||
|
|
|
@ -808,6 +808,14 @@
|
|||
"ZENODO-LOGIN": "Entre com o Zenodo",
|
||||
"USE-DEFAULT": "Use o Token"
|
||||
},
|
||||
"DEPOSIT": {
|
||||
"ACCOUNT-LOGIN": "Which account would you like to use?",
|
||||
"LOGIN": "Login with {{repository}}",
|
||||
"NO-REPOSITORIES": "No publishing repositories",
|
||||
"SELECT-REPOSITORIES": "Select repositories to deposit",
|
||||
"AUTHORIZE": "Proceed to authorization",
|
||||
"CANCEL": "Cancel"
|
||||
},
|
||||
"LOCKED-DIALOG":{
|
||||
"TITLE": "DMP is locked",
|
||||
"MESSAGE":"Somebody else is modifying the DMP at this moment. If you would like to modify or view it, please come back later."
|
||||
|
|
|
@ -803,6 +803,14 @@
|
|||
"ZENODO-LOGIN": "Prihlásiť sa do Zenodo",
|
||||
"USE-DEFAULT": "Použite predvolený token"
|
||||
},
|
||||
"DEPOSIT": {
|
||||
"ACCOUNT-LOGIN": "Which account would you like to use?",
|
||||
"LOGIN": "Login with {{repository}}",
|
||||
"NO-REPOSITORIES": "No publishing repositories",
|
||||
"SELECT-REPOSITORIES": "Select repositories to deposit",
|
||||
"AUTHORIZE": "Proceed to authorization",
|
||||
"CANCEL": "Cancel"
|
||||
},
|
||||
"LOCKED-DIALOG":{
|
||||
"TITLE": "DMP is locked",
|
||||
"MESSAGE":"Somebody else is modifying the DMP at this moment. If you would like to modify or view it, please come back later."
|
||||
|
|
|
@ -803,6 +803,14 @@
|
|||
"ZENODO-LOGIN": "Prijavite se pomoću Zenodo naloga",
|
||||
"USE-DEFAULT": "Koristite podrazumevani znak"
|
||||
},
|
||||
"DEPOSIT": {
|
||||
"ACCOUNT-LOGIN": "Which account would you like to use?",
|
||||
"LOGIN": "Login with {{repository}}",
|
||||
"NO-REPOSITORIES": "No publishing repositories",
|
||||
"SELECT-REPOSITORIES": "Select repositories to deposit",
|
||||
"AUTHORIZE": "Proceed to authorization",
|
||||
"CANCEL": "Cancel"
|
||||
},
|
||||
"LOCKED-DIALOG":{
|
||||
"TITLE": "DMP is locked",
|
||||
"MESSAGE":"Somebody else is modifying the DMP at this moment. If you would like to modify or view it, please come back later."
|
||||
|
|
|
@ -803,6 +803,14 @@
|
|||
"ZENODO-LOGIN": "Zenodo ile oturum aç",
|
||||
"USE-DEFAULT": "Mevcut Jetonu Kullan"
|
||||
},
|
||||
"DEPOSIT": {
|
||||
"ACCOUNT-LOGIN": "Which account would you like to use?",
|
||||
"LOGIN": "Login with {{repository}}",
|
||||
"NO-REPOSITORIES": "No publishing repositories",
|
||||
"SELECT-REPOSITORIES": "Select repositories to deposit",
|
||||
"AUTHORIZE": "Proceed to authorization",
|
||||
"CANCEL": "Cancel"
|
||||
},
|
||||
"LOCKED-DIALOG":{
|
||||
"TITLE": "DMP is locked",
|
||||
"MESSAGE":"Somebody else is modifying the DMP at this moment. If you would like to modify or view it, please come back later."
|
||||
|
|
Loading…
Reference in New Issue