use of org.entando.entando.web.component.ComponentUsage in project entando-core by entando.
the class WidgetController method getComponentUsage.
@RestAccessControl(permission = Permission.SUPERUSER)
@RequestMapping(value = "/widgets/{widgetCode}/usage", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<SimpleRestResponse<ComponentUsage>> getComponentUsage(@PathVariable String widgetCode) {
logger.trace("get {} usage by code {}", COMPONENT_ID, widgetCode);
ComponentUsage usage = ComponentUsage.builder().type(COMPONENT_ID).code(widgetCode).usage(widgetService.getComponentUsage(widgetCode)).build();
return new ResponseEntity<>(new SimpleRestResponse<>(usage), HttpStatus.OK);
}
use of org.entando.entando.web.component.ComponentUsage in project entando-core by entando.
the class PageController method getComponentUsage.
@RestAccessControl(permission = Permission.SUPERUSER)
@RequestMapping(value = "/pages/{pageCode}/usage", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<SimpleRestResponse<ComponentUsage>> getComponentUsage(@PathVariable String pageCode) {
logger.trace("get {} usage by code {}", COMPONENT_ID, pageCode);
ComponentUsage usage = ComponentUsage.builder().type(COMPONENT_ID).code(pageCode).usage(getPageService().getComponentUsage(pageCode)).build();
return new ResponseEntity<>(new SimpleRestResponse<>(usage), HttpStatus.OK);
}
use of org.entando.entando.web.component.ComponentUsage in project entando-core by entando.
the class PageModelController method getComponentUsage.
@ApiOperation("Retrieve pageModel usage count")
@ApiResponses({ @ApiResponse(code = 200, message = "OK") })
@RestAccessControl(permission = Permission.MANAGE_PAGES)
@RequestMapping(value = "/{code}/usage", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<SimpleRestResponse<ComponentUsage>> getComponentUsage(@PathVariable String code) {
logger.trace("get {} usage by code {}", COMPONENT_ID, code);
ComponentUsage usage = ComponentUsage.builder().type(COMPONENT_ID).code(code).usage(pageModelService.getComponentUsage(code)).build();
return new ResponseEntity<>(new SimpleRestResponse<>(usage), HttpStatus.OK);
}
use of org.entando.entando.web.component.ComponentUsage in project entando-core by entando.
the class GuiFragmentController method getComponentUsage.
@RestAccessControl(permission = Permission.SUPERUSER)
@RequestMapping(value = "/{fragmentCode}/usage", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<SimpleRestResponse<ComponentUsage>> getComponentUsage(@PathVariable String fragmentCode) {
logger.trace("get {} usage by code {}", COMPONENT_ID, fragmentCode);
ComponentUsage usage = ComponentUsage.builder().type(COMPONENT_ID).code(fragmentCode).usage(guiFragmentService.getComponentUsage(fragmentCode)).build();
return new ResponseEntity<>(new SimpleRestResponse<>(usage), HttpStatus.OK);
}
Aggregations