use of org.entando.entando.web.common.annotation.RestAccessControl in project entando-core by entando.
the class LabelController method geLabelGroup.
@RestAccessControl(permission = Permission.SUPERUSER)
@RequestMapping(value = "/{labelCode}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<RestResponse> geLabelGroup(@PathVariable String labelCode) {
logger.debug("loading label {}", labelCode);
LabelDto label = this.getLabelService().getLabelGroup(labelCode);
return new ResponseEntity<>(new RestResponse(label, null, new HashMap<>()), HttpStatus.OK);
}
use of org.entando.entando.web.common.annotation.RestAccessControl in project entando-core by entando.
the class LabelController method addLabelGroup.
@RestAccessControl(permission = Permission.SUPERUSER)
@RequestMapping(method = RequestMethod.POST, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<RestResponse> addLabelGroup(@Valid @RequestBody LabelRequest labelRequest) throws ApsSystemException {
logger.debug("adding label {}", labelRequest.getKey());
LabelDto group = this.getLabelService().addLabelGroup(labelRequest);
return new ResponseEntity<>(new RestResponse(group), HttpStatus.OK);
}
use of org.entando.entando.web.common.annotation.RestAccessControl in project entando-core by entando.
the class LabelController method updateLabelGroup.
@RestAccessControl(permission = Permission.SUPERUSER)
@RequestMapping(value = "/{labelCode}", method = RequestMethod.PUT, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<RestResponse> updateLabelGroup(@PathVariable String labelCode, @Valid @RequestBody LabelRequest labelRequest, BindingResult bindingResult) {
logger.debug("updating label {}", labelRequest.getKey());
this.getLabelValidator().validateBodyName(labelCode, labelRequest, bindingResult);
if (bindingResult.hasErrors()) {
throw new ValidationGenericException(bindingResult);
}
LabelDto group = this.getLabelService().updateLabelGroup(labelRequest);
return new ResponseEntity<>(new RestResponse(group), HttpStatus.OK);
}
use of org.entando.entando.web.common.annotation.RestAccessControl in project entando-core by entando.
the class LanguageController method getLanguage.
@RestAccessControl(permission = Permission.SUPERUSER)
@RequestMapping(value = "/{code}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<RestResponse> getLanguage(@PathVariable String code) {
logger.trace("loading language {}", code);
LanguageDto result = this.getLanguageService().getLanguage(code);
return new ResponseEntity<>(new RestResponse(result), HttpStatus.OK);
}
use of org.entando.entando.web.common.annotation.RestAccessControl in project entando-core by entando.
the class PageConfigurationController method getPageConfiguration.
@RestAccessControl(permission = Permission.SUPERUSER)
@RequestMapping(value = "/pages/{pageCode}/configuration", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> getPageConfiguration(@PathVariable String pageCode, @RequestParam(value = "status", required = false, defaultValue = IPageService.STATUS_DRAFT) String status) {
logger.trace("requested {} configuration", pageCode);
PageConfigurationDto pageConfiguration = this.getPageService().getPageConfiguration(pageCode, status);
Map<String, String> metadata = new HashMap<>();
metadata.put("status", status);
return new ResponseEntity<>(new RestResponse(pageConfiguration, null, metadata), HttpStatus.OK);
}
Aggregations