use of com.salesmanager.shop.store.api.exception.ConversionRuntimeException in project shopizer by shopizer-ecommerce.
the class CustomerFacadeImpl method updateAuthCustomer.
private PersistableCustomer updateAuthCustomer(PersistableCustomer customer, MerchantStore store) {
if (customer.getId() == null || customer.getId() == 0) {
throw new ServiceRuntimeException("Can't update a customer with null id");
}
Customer cust = customerService.getById(customer.getId());
try {
customerPopulator.populate(customer, cust, store, store.getDefaultLanguage());
} catch (ConversionException e) {
throw new ConversionRuntimeException(e);
}
saveCustomer(cust);
customer.setId(cust.getId());
return customer;
}
use of com.salesmanager.shop.store.api.exception.ConversionRuntimeException in project shopizer by shopizer-ecommerce.
the class SearchFacadeImpl method convertCategoryToReadableCategory.
private ReadableCategory convertCategoryToReadableCategory(MerchantStore merchantStore, Language language, Map<String, Long> productCategoryCount, Category category) {
ReadableCategoryPopulator populator = new ReadableCategoryPopulator();
try {
ReadableCategory categoryProxy = populator.populate(category, new ReadableCategory(), merchantStore, language);
Long total = productCategoryCount.get(categoryProxy.getCode());
if (total != null) {
categoryProxy.setProductCount(total.intValue());
}
return categoryProxy;
} catch (ConversionException e) {
throw new ConversionRuntimeException(e);
}
}
use of com.salesmanager.shop.store.api.exception.ConversionRuntimeException in project shopizer by shopizer-ecommerce.
the class StoreFacadeImpl method convertPersistableMerchantStoreToMerchantStore.
private MerchantStore convertPersistableMerchantStoreToMerchantStore(PersistableMerchantStore store, Language language) {
MerchantStore mStore = new MerchantStore();
// set default values
mStore.setWeightunitcode(MeasureUnit.KG.name());
mStore.setSeizeunitcode(MeasureUnit.IN.name());
try {
mStore = persistableMerchantStorePopulator.populate(store, mStore, language);
} catch (ConversionException e) {
throw new ConversionRuntimeException(e);
}
return mStore;
}
use of com.salesmanager.shop.store.api.exception.ConversionRuntimeException in project shopizer by shopizer-ecommerce.
the class StoreFacadeImpl method mergePersistableMerchantStoreToMerchantStore.
private MerchantStore mergePersistableMerchantStoreToMerchantStore(PersistableMerchantStore store, String code, Language language) {
MerchantStore mStore = getMerchantStoreByCode(code);
store.setId(mStore.getId());
try {
mStore = persistableMerchantStorePopulator.populate(store, mStore, language);
} catch (ConversionException e) {
throw new ConversionRuntimeException(e);
}
return mStore;
}
use of com.salesmanager.shop.store.api.exception.ConversionRuntimeException in project shopizer by shopizer-ecommerce.
the class CustomerFacadeImpl method convertPersistableCustomerReviewToCustomerReview.
private CustomerReview convertPersistableCustomerReviewToCustomerReview(PersistableCustomerReview review, MerchantStore store, Language language) {
PersistableCustomerReviewPopulator populator = new PersistableCustomerReviewPopulator();
populator.setCustomerService(customerService);
populator.setLanguageService(languageService);
try {
return populator.populate(review, new CustomerReview(), store, language);
} catch (ConversionException e) {
throw new ConversionRuntimeException(e);
}
}
Aggregations