use of com.salesmanager.shop.model.content.page.ReadableContentPageFull in project shopizer by shopizer-ecommerce.
the class ContentFacadeImpl method convertContentToReadableContentPage.
private ReadableContentPage convertContentToReadableContentPage(MerchantStore store, Language language, Content content) {
if (language != null) {
ReadableContentPage page = new ReadableContentPage();
Optional<ContentDescription> contentDescription = findAppropriateContentDescription(content.getDescriptions(), language);
if (contentDescription.isPresent()) {
com.salesmanager.shop.model.content.common.ContentDescription desc = this.contentDescription(contentDescription.get());
page.setDescription(desc);
}
page.setCode(content.getCode());
page.setId(content.getId());
page.setVisible(content.isVisible());
return page;
} else {
ReadableContentPageFull page = new ReadableContentPageFull();
List<com.salesmanager.shop.model.content.common.ContentDescription> descriptions = content.getDescriptions().stream().map(d -> this.contentDescription(d)).collect(Collectors.toList());
page.setDescriptions(descriptions);
page.setCode(content.getCode());
page.setId(content.getId());
page.setVisible(content.isVisible());
return page;
}
}
Aggregations