use of com.salesmanager.shop.model.content.ContentDescriptionEntity in project shopizer by shopizer-ecommerce.
the class ContentFacadeImpl method convertContentToReadableContentFull.
@Deprecated
private ReadableContentFull convertContentToReadableContentFull(MerchantStore store, Language language, Content content) {
ReadableContentFull contentFull = new ReadableContentFull();
try {
List<ContentDescriptionEntity> descriptions = this.createContentDescriptionEntitys(store, content, language);
contentFull.setDescriptions(descriptions);
contentFull.setId(content.getId());
contentFull.setDisplayedInMenu(content.isLinkToMenu());
contentFull.setContentType(content.getContentType().name());
contentFull.setCode(content.getCode());
contentFull.setId(content.getId());
contentFull.setVisible(content.isVisible());
return contentFull;
} catch (ServiceException e) {
throw new ServiceRuntimeException("Error while creating ReadableContentFull", e);
}
}
use of com.salesmanager.shop.model.content.ContentDescriptionEntity 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.ContentDescriptionEntity in project shopizer by shopizer-ecommerce.
the class ContentFacadeImpl method create.
@Deprecated
private ContentDescriptionEntity create(ContentDescription description) {
ContentDescriptionEntity contentDescription = new ContentDescriptionEntity();
contentDescription.setLanguage(description.getLanguage().getCode());
contentDescription.setTitle(description.getTitle());
contentDescription.setName(description.getName());
contentDescription.setFriendlyUrl(description.getSeUrl());
contentDescription.setDescription(description.getDescription());
if (description.getId() != null && description.getId().longValue() > 0) {
contentDescription.setId(description.getId());
}
return contentDescription;
}
use of com.salesmanager.shop.model.content.ContentDescriptionEntity in project shopizer by shopizer-ecommerce.
the class ContentFacadeImpl method createContentDescriptionEntitys.
/*
* private Content convertContentPageToContent(MerchantStore store, Language
* language, Content content, PersistableContentEntity contentPage) throws
* ServiceException {
*
* ContentType contentType =
* ContentType.valueOf(contentPage.getContentType()); if (contentType ==
* null) { throw new
* ServiceRuntimeException("Invalid specified contentType [" +
* contentPage.getContentType() + "]"); }
*
* List<ContentDescription> descriptions = createContentDescription(store,
* content, contentPage); descriptions.stream().forEach(c ->
* c.setContent(content));
*
* content.setDescriptions(descriptions);
*
* // ContentDescription contentDescription = //
* createContentDescription(store, contentPage, language); //
* setContentDescriptionToContentModel(content,contentDescription,language);
*
* // contentDescription.setContent(content);
*
* if (contentPage.getId() != null && contentPage.getId().longValue() > 0) {
* content.setId(contentPage.getId()); }
* content.setVisible(contentPage.isVisible());
* content.setLinkToMenu(contentPage.isDisplayedInMenu());
* content.setContentType(ContentType.valueOf(contentPage.getContentType()))
* ; content.setMerchantStore(store);
*
* return content; }
*/
@Deprecated
private List<ContentDescriptionEntity> createContentDescriptionEntitys(MerchantStore store, Content contentModel, Language language) throws ServiceException {
List<ContentDescriptionEntity> descriptions = new ArrayList<ContentDescriptionEntity>();
if (!CollectionUtils.isEmpty(contentModel.getDescriptions())) {
for (ContentDescription description : contentModel.getDescriptions()) {
if (language != null && !language.getId().equals(description.getLanguage().getId())) {
continue;
}
ContentDescriptionEntity contentDescription = create(description);
descriptions.add(contentDescription);
}
}
return descriptions;
}
Aggregations