use of org.entando.entando.aps.system.services.page.model.PageConfigurationDto 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.aps.system.services.page.model.PageConfigurationDto in project entando-core by entando.
the class PageService method getPageConfiguration.
@Override
public PageConfigurationDto getPageConfiguration(String pageCode, String status) {
IPage page = this.loadPage(pageCode, status);
if (null == page) {
throw new RestRourceNotFoundException(ERRCODE_PAGE_NOT_FOUND, "page", pageCode);
}
PageConfigurationDto pageConfigurationDto = new PageConfigurationDto(page, status);
return pageConfigurationDto;
}
use of org.entando.entando.aps.system.services.page.model.PageConfigurationDto in project entando-core by entando.
the class PageServiceWidgetIntegrationTest method testGetPageConfiguration.
public void testGetPageConfiguration() throws JsonProcessingException {
IPage draftRoot = this.pageManager.getDraftRoot();
PageConfigurationDto pageConfigurationDto = (PageConfigurationDto) this.pageService.getPageConfiguration(draftRoot.getCode(), IPageService.STATUS_DRAFT);
ObjectMapper mapper = new ObjectMapper();
String out = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(pageConfigurationDto);
System.out.println(out);
}
use of org.entando.entando.aps.system.services.page.model.PageConfigurationDto in project entando-core by entando.
the class PageConfigurationController method getPageWidgets.
@RestAccessControl(permission = Permission.SUPERUSER)
@RequestMapping(value = "/pages/{pageCode}/widgets", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> getPageWidgets(@PathVariable String pageCode, @RequestParam(value = "status", required = false, defaultValue = IPageService.STATUS_DRAFT) String status) {
logger.trace("requested {} widgets detail", pageCode);
PageConfigurationDto pageConfiguration = this.getPageService().getPageConfiguration(pageCode, status);
Map<String, String> metadata = new HashMap<>();
metadata.put("status", status);
return new ResponseEntity<>(new RestResponse(pageConfiguration.getWidgets(), null, metadata), HttpStatus.OK);
}
Aggregations