use of org.entando.entando.aps.system.services.guifragment.model.GuiFragmentDtoSmall in project entando-core by entando.
the class GuiFragmentController method getGuiFragments.
@RestAccessControl(permission = Permission.SUPERUSER)
@RequestMapping(method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<RestResponse> getGuiFragments(RestListRequest requestList) throws JsonProcessingException {
this.getGuiFragmentValidator().validateRestListRequest(requestList);
PagedMetadata<GuiFragmentDtoSmall> result = this.getGuiFragmentService().getGuiFragments(requestList);
this.getGuiFragmentValidator().validateRestListResult(requestList, result);
logger.debug("Main Response -> {}", result);
return new ResponseEntity<>(new RestResponse(result.getBody(), null, result), HttpStatus.OK);
}
use of org.entando.entando.aps.system.services.guifragment.model.GuiFragmentDtoSmall in project entando-core by entando.
the class GuiFragmentService method getGuiFragments.
@Override
public PagedMetadata<GuiFragmentDtoSmall> getGuiFragments(RestListRequest restListReq) {
PagedMetadata<GuiFragmentDtoSmall> pagedMetadata = null;
try {
SearcherDaoPaginatedResult<GuiFragment> fragments = this.getGuiFragmentManager().getGuiFragments(restListReq.buildFieldSearchFilters());
List<GuiFragmentDtoSmall> dtoList = this.getDtoSmallBuilder().convert(fragments.getList());
pagedMetadata = new PagedMetadata<>(restListReq, fragments);
pagedMetadata.setBody(dtoList);
} catch (Throwable t) {
logger.error("error in search fragments", t);
throw new RestServerError("error in search fragments", t);
}
return pagedMetadata;
}
Aggregations