Loading dmp-backend/web/src/main/java/eu/eudat/controllers/DMPs.java +7 −3 Original line number Diff line number Diff line Loading @@ -118,9 +118,13 @@ public class DMPs extends BaseController { @RequestMapping(method = RequestMethod.GET, value = {"/overview/{id}"}) public @ResponseBody ResponseEntity getOverviewSingle(@PathVariable String id, Principal principal) throws IllegalAccessException, InstantiationException { ResponseEntity getOverviewSingle(@PathVariable String id, Principal principal) { try { DataManagementPlanOverviewModel dataManagementPlan = this.dataManagementPlanManager.getOverviewSingle(id, principal); return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<DataManagementPlanOverviewModel>().status(ApiMessageCode.NO_MESSAGE).payload(dataManagementPlan)); } catch (Exception e) { return ResponseEntity.status(HttpStatus.NOT_FOUND).body(new ResponseItem<DataManagementPlanOverviewModel>().status(ApiMessageCode.ERROR_MESSAGE)); } } @RequestMapping(method = RequestMethod.GET, value = {"/public/{id}"}) Loading dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java +4 −1 Original line number Diff line number Diff line Loading @@ -362,8 +362,11 @@ public class DataManagementPlanManager { return dataManagementPlan; } public DataManagementPlanOverviewModel getOverviewSingle(String id, Principal principal) throws InstantiationException, IllegalAccessException { public DataManagementPlanOverviewModel getOverviewSingle(String id, Principal principal) throws Exception { DMP dataManagementPlanEntity = databaseRepository.getDmpDao().find(UUID.fromString(id)); if (dataManagementPlanEntity.getStatus() == DMP.DMPStatus.DELETED.getValue()) { throw new Exception("DMP is deleted."); } if (dataManagementPlanEntity.getUsers() .stream().filter(userInfo -> userInfo.getUser().getId() == principal.getId()) .collect(Collectors.toList()).size() == 0) Loading dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts +14 −1 Original line number Diff line number Diff line Loading @@ -69,7 +69,11 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { breadCrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.MY-DMPS'), url: "/plans" }); breadCrumbs.push({ parentComponentName: 'DmpListingComponent', label: this.dmp.label, url: '/plans/overview/' + this.dmp.id }); this.breadCrumbs = observableOf(breadCrumbs); }) }, (error: any) => { if (error.status === 404) { return this.onFetchingDeletedCallbackError('/plans/'); } }); } else if (publicId != null) { this.isNew = false; Loading @@ -84,11 +88,20 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { breadCrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.PUBLIC-DMPS'), url: "/explore-plans" }); breadCrumbs.push({ parentComponentName: 'DmpListingComponent', label: this.dmp.label, url: '/plans/publicOverview/' + this.dmp.id }); this.breadCrumbs = observableOf(breadCrumbs); }, (error: any) => { if (error.status === 404) { return this.onFetchingDeletedCallbackError('/plans/'); } }); } }); } onFetchingDeletedCallbackError(redirectRoot: string) { this.uiNotificationService.snackBarNotification(this.language.instant('DMP-OVERVIEW.ERROR.DELETED-DMP'), SnackBarNotificationLevel.Error); this.router.navigate([redirectRoot]); } setIsUserOwner() { if (this.dmp) { const principal: Principal = this.authentication.current(); Loading dmp-frontend/src/assets/i18n/en.json +3 −0 Original line number Diff line number Diff line Loading @@ -503,6 +503,9 @@ "LEVEL-OF-ACCESS": "Level of Access", "INVOLVED-DATASETS": "Involved Dataset Descriptions", "TEMPLATES-INVOLVED": "Dataset Description Templates Involved" }, "ERROR": { "DELETED-DMP": "The requested DMP is deleted" } }, "DATASET-LISTING": { Loading Loading
dmp-backend/web/src/main/java/eu/eudat/controllers/DMPs.java +7 −3 Original line number Diff line number Diff line Loading @@ -118,9 +118,13 @@ public class DMPs extends BaseController { @RequestMapping(method = RequestMethod.GET, value = {"/overview/{id}"}) public @ResponseBody ResponseEntity getOverviewSingle(@PathVariable String id, Principal principal) throws IllegalAccessException, InstantiationException { ResponseEntity getOverviewSingle(@PathVariable String id, Principal principal) { try { DataManagementPlanOverviewModel dataManagementPlan = this.dataManagementPlanManager.getOverviewSingle(id, principal); return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem<DataManagementPlanOverviewModel>().status(ApiMessageCode.NO_MESSAGE).payload(dataManagementPlan)); } catch (Exception e) { return ResponseEntity.status(HttpStatus.NOT_FOUND).body(new ResponseItem<DataManagementPlanOverviewModel>().status(ApiMessageCode.ERROR_MESSAGE)); } } @RequestMapping(method = RequestMethod.GET, value = {"/public/{id}"}) Loading
dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java +4 −1 Original line number Diff line number Diff line Loading @@ -362,8 +362,11 @@ public class DataManagementPlanManager { return dataManagementPlan; } public DataManagementPlanOverviewModel getOverviewSingle(String id, Principal principal) throws InstantiationException, IllegalAccessException { public DataManagementPlanOverviewModel getOverviewSingle(String id, Principal principal) throws Exception { DMP dataManagementPlanEntity = databaseRepository.getDmpDao().find(UUID.fromString(id)); if (dataManagementPlanEntity.getStatus() == DMP.DMPStatus.DELETED.getValue()) { throw new Exception("DMP is deleted."); } if (dataManagementPlanEntity.getUsers() .stream().filter(userInfo -> userInfo.getUser().getId() == principal.getId()) .collect(Collectors.toList()).size() == 0) Loading
dmp-frontend/src/app/ui/dmp/overview/dmp-overview.component.ts +14 −1 Original line number Diff line number Diff line Loading @@ -69,7 +69,11 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { breadCrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.MY-DMPS'), url: "/plans" }); breadCrumbs.push({ parentComponentName: 'DmpListingComponent', label: this.dmp.label, url: '/plans/overview/' + this.dmp.id }); this.breadCrumbs = observableOf(breadCrumbs); }) }, (error: any) => { if (error.status === 404) { return this.onFetchingDeletedCallbackError('/plans/'); } }); } else if (publicId != null) { this.isNew = false; Loading @@ -84,11 +88,20 @@ export class DmpOverviewComponent extends BaseComponent implements OnInit { breadCrumbs.push({ parentComponentName: null, label: this.language.instant('NAV-BAR.PUBLIC-DMPS'), url: "/explore-plans" }); breadCrumbs.push({ parentComponentName: 'DmpListingComponent', label: this.dmp.label, url: '/plans/publicOverview/' + this.dmp.id }); this.breadCrumbs = observableOf(breadCrumbs); }, (error: any) => { if (error.status === 404) { return this.onFetchingDeletedCallbackError('/plans/'); } }); } }); } onFetchingDeletedCallbackError(redirectRoot: string) { this.uiNotificationService.snackBarNotification(this.language.instant('DMP-OVERVIEW.ERROR.DELETED-DMP'), SnackBarNotificationLevel.Error); this.router.navigate([redirectRoot]); } setIsUserOwner() { if (this.dmp) { const principal: Principal = this.authentication.current(); Loading
dmp-frontend/src/assets/i18n/en.json +3 −0 Original line number Diff line number Diff line Loading @@ -503,6 +503,9 @@ "LEVEL-OF-ACCESS": "Level of Access", "INVOLVED-DATASETS": "Involved Dataset Descriptions", "TEMPLATES-INVOLVED": "Dataset Description Templates Involved" }, "ERROR": { "DELETED-DMP": "The requested DMP is deleted" } }, "DATASET-LISTING": { Loading