use of org.entando.entando.web.common.annotation.ActivityStreamAuditable in project entando-core by entando.
the class PageConfigurationController method updatePageWidget.
@ActivityStreamAuditable
@RestAccessControl(permission = Permission.MANAGE_PAGES)
@RequestMapping(value = "/pages/{pageCode}/widgets/{frameId}", method = RequestMethod.PUT, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<RestResponse<WidgetConfigurationDto, Map>> updatePageWidget(@PathVariable String pageCode, @PathVariable String frameId, @Valid @RequestBody WidgetConfigurationRequest widget, BindingResult bindingResult) {
logger.debug("updating widget configuration in page {} and frame {}", pageCode, frameId);
this.validateFrameId(frameId, bindingResult);
if (bindingResult.hasErrors()) {
throw new ValidationGenericException(bindingResult);
}
WidgetConfigurationDto widgetConfiguration = this.getPageService().updateWidgetConfiguration(pageCode, Integer.valueOf(frameId), widget);
Map<String, String> metadata = new HashMap<>();
metadata.put("status", IPageService.STATUS_DRAFT);
return new ResponseEntity<>(new RestResponse<>(widgetConfiguration, metadata), HttpStatus.OK);
}
use of org.entando.entando.web.common.annotation.ActivityStreamAuditable in project entando-core by entando.
the class PageConfigurationController method deletePageWidget.
@ActivityStreamAuditable
@RestAccessControl(permission = Permission.MANAGE_PAGES)
@RequestMapping(value = "/pages/{pageCode}/widgets/{frameId}", method = RequestMethod.DELETE, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<RestResponse<Map, Map>> deletePageWidget(@PathVariable String pageCode, @PathVariable String frameId) {
logger.debug("removing widget configuration in page {} and frame {}", pageCode, frameId);
BeanPropertyBindingResult bindingResult = new BeanPropertyBindingResult(frameId, "frameId");
this.validateFrameId(frameId, bindingResult);
if (bindingResult.hasErrors()) {
throw new ValidationGenericException(bindingResult);
}
this.getPageService().deleteWidgetConfiguration(pageCode, Integer.valueOf(frameId));
Map<String, String> result = new HashMap<>();
result.put("code", frameId);
Map<String, String> metadata = new HashMap<>();
metadata.put("status", IPageService.STATUS_DRAFT);
return new ResponseEntity<>(new RestResponse<>(result, metadata), HttpStatus.OK);
}
use of org.entando.entando.web.common.annotation.ActivityStreamAuditable in project entando-core by entando.
the class PageConfigurationController method updatePageConfiguration.
@ActivityStreamAuditable
@RestAccessControl(permission = Permission.MANAGE_PAGES)
@RequestMapping(value = "/pages/{pageCode}/configuration/restore", method = RequestMethod.PUT, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<RestResponse<PageConfigurationDto, Map>> updatePageConfiguration(@PathVariable String pageCode) {
logger.debug("restore configuration on page {}", pageCode);
PageConfigurationDto pageConfiguration = this.getPageService().restorePageConfiguration(pageCode);
Map<String, String> metadata = new HashMap<>();
return new ResponseEntity<>(new RestResponse<>(pageConfiguration, metadata), HttpStatus.OK);
}
use of org.entando.entando.web.common.annotation.ActivityStreamAuditable in project entando-core by entando.
the class PageConfigurationController method applyDefaultWidgetsPageConfiguration.
@ActivityStreamAuditable
@RestAccessControl(permission = Permission.MANAGE_PAGES)
@RequestMapping(value = "/pages/{pageCode}/configuration/defaultWidgets", method = RequestMethod.PUT, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<SimpleRestResponse<PageConfigurationDto>> applyDefaultWidgetsPageConfiguration(@PathVariable String pageCode) {
logger.debug("applying default widgets on page {}", pageCode);
PageConfigurationDto pageConfiguration = this.getPageService().applyDefaultWidgets(pageCode);
return new ResponseEntity<>(new SimpleRestResponse<>(pageConfiguration), HttpStatus.OK);
}
Aggregations