use of com.salesmanager.shop.model.content.ReadableContentEntity in project shopizer by shopizer-ecommerce.
the class ContentFacadeImpl method convertContentToReadableContentEntity.
@Deprecated
private ReadableContentEntity convertContentToReadableContentEntity(MerchantStore store, Language language, Content content) {
ReadableContentEntity contentEntity = new ReadableContentEntity();
ContentDescriptionEntity description = this.create(content.getDescription());
contentEntity.setDescription(description);
contentEntity.setId(content.getId());
contentEntity.setDisplayedInMenu(content.isLinkToMenu());
contentEntity.setContentType(content.getContentType().name());
contentEntity.setCode(content.getCode());
contentEntity.setId(content.getId());
contentEntity.setVisible(content.isVisible());
return contentEntity;
}
use of com.salesmanager.shop.model.content.ReadableContentEntity in project shopizer by shopizer-ecommerce.
the class ContentFacadeImpl method getContents.
@Override
public List<ReadableContentEntity> getContents(Optional<String> type, MerchantStore store, Language language) {
/**
* get all types
*/
List<ContentType> types = new ArrayList<ContentType>();
types.add(ContentType.BOX);
types.add(ContentType.PAGE);
types.add(ContentType.SECTION);
try {
return contentService.listByType(types, store, language).stream().map(content -> convertContentToReadableContentEntity(store, language, content)).collect(Collectors.toList());
} catch (ServiceException e) {
throw new ServiceRuntimeException("Exception while getting contents", e);
}
}
Aggregations