TSK-224: REST setDistributionTargets

This commit is contained in:
Marcel Lengl 2018-02-21 16:18:27 +01:00 committed by Holger Hagen
parent 1d8f86d130
commit 862f17ed2b
3 changed files with 22 additions and 6 deletions

View File

@ -199,6 +199,22 @@ public class WorkbasketController {
return result;
}
@RequestMapping(value = "/{workbasketId}/distributiontargets", method = RequestMethod.PUT)
public ResponseEntity<?> setDistributionTargets(
@PathVariable(value = "workbasketId") String sourceWorkbasketId,
@RequestBody List<String> targetWorkbasketIds) {
ResponseEntity<?> result;
try {
workbasketService.setDistributionTargets(sourceWorkbasketId, targetWorkbasketIds);
result = ResponseEntity.status(HttpStatus.NO_CONTENT).build();
} catch (WorkbasketNotFoundException e) {
result = ResponseEntity.status(HttpStatus.NOT_FOUND).build();
} catch (NotAuthorizedException e) {
result = ResponseEntity.status(HttpStatus.UNAUTHORIZED).build();
}
return result;
}
private void addAuthorizationFilter(WorkbasketQuery query, String requiredPermission)
throws InvalidArgumentException {
if (requiredPermission == null) {

View File

@ -6,7 +6,7 @@ import org.springframework.hateoas.ResourceSupport;
public class WorkbasketAccessItemResource extends ResourceSupport {
public String id;
public String accessItemId;
@NotNull
public String workbasketId;
@ -32,13 +32,13 @@ public class WorkbasketAccessItemResource extends ResourceSupport {
public boolean permCustom11;
public boolean permCustom12;
public WorkbasketAccessItemResource(String id, String workbasketId, String accessId, boolean permRead,
public WorkbasketAccessItemResource(String accessItemId, String workbasketId, String accessId, boolean permRead,
boolean permOpen, boolean permAppend, boolean permTransfer, boolean permDistribute, boolean permCustom1,
boolean permCustom2, boolean permCustom3, boolean permCustom4, boolean permCustom5, boolean permCustom6,
boolean permCustom7, boolean permCustom8, boolean permCustom9, boolean permCustom10, boolean permCustom11,
boolean permCustom12) {
super();
this.id = id;
this.accessItemId = accessItemId;
this.workbasketId = workbasketId;
this.accessId = accessId;
this.permRead = permRead;

View File

@ -10,7 +10,7 @@ import pro.taskana.impl.WorkbasketType;
public class WorkbasketResource extends ResourceSupport {
public String id;
public String workbasketId;
@NotNull
public String key;
@ -37,11 +37,11 @@ public class WorkbasketResource extends ResourceSupport {
public String orgLevel3;
public String orgLevel4;
public WorkbasketResource(String id, String key, String name, String domain, WorkbasketType type, Instant created,
public WorkbasketResource(String workbasketId, String key, String name, String domain, WorkbasketType type, Instant created,
Instant modified, String description, String owner, String custom1, String custom2, String custom3,
String custom4, String orgLevel1, String orgLevel2, String orgLevel3, String orgLevel4) {
super();
this.id = id;
this.workbasketId = workbasketId;
this.key = key;
this.name = name;
this.domain = domain;