use of org.entando.entando.web.common.model.RestResponse 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.model.RestResponse 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.model.RestResponse 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);
}
use of org.entando.entando.web.common.model.RestResponse in project entando-core by entando.
the class PageConfigurationController method getPageWidget.
@RestAccessControl(permission = Permission.SUPERUSER)
@RequestMapping(value = "/pages/{pageCode}/widgets/{frameId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> getPageWidget(@PathVariable String pageCode, @PathVariable int frameId, @RequestParam(value = "status", required = false, defaultValue = IPageService.STATUS_DRAFT) String status) {
logger.trace("requested widget detail for page {} and frame {}", pageCode, frameId);
WidgetConfigurationDto widgetConfiguration = this.getPageService().getWidgetConfiguration(pageCode, frameId, status);
Map<String, String> metadata = new HashMap<>();
metadata.put("status", status);
return new ResponseEntity<>(new RestResponse(widgetConfiguration, null, metadata), HttpStatus.OK);
}
use of org.entando.entando.web.common.model.RestResponse in project entando-core by entando.
the class PageConfigurationController method deletePageWidget.
@RestAccessControl(permission = Permission.SUPERUSER)
@RequestMapping(value = "/pages/{pageCode}/widgets/{frameId}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> deletePageWidget(@PathVariable String pageCode, @PathVariable int frameId) {
logger.trace("removing widget configuration in page {} and frame {}", pageCode, frameId);
this.getPageService().deleteWidgetConfiguration(pageCode, frameId);
Map<String, String> metadata = new HashMap<>();
metadata.put("status", IPageService.STATUS_DRAFT);
return new ResponseEntity<>(new RestResponse(frameId, null, metadata), HttpStatus.OK);
}
Aggregations