Search in sources :

Example 96 with Language

use of com.salesmanager.core.model.reference.language.Language in project shopizer by shopizer-ecommerce.

the class ProductFacadeImpl method getProductPrice.

@Override
public ReadableProductPrice getProductPrice(Long id, ProductPriceRequest priceRequest, MerchantStore store, Language language) {
    Validate.notNull(id, "Product id cannot be null");
    Validate.notNull(priceRequest, "Product price request cannot be null");
    Validate.notNull(store, "MerchantStore cannot be null");
    Validate.notNull(language, "Language cannot be null");
    try {
        Product model = productService.findOne(id, store);
        // TODO check if null
        List<Long> attrinutesIds = priceRequest.getOptions().stream().map(p -> p.getId()).collect(Collectors.toList());
        List<ProductAttribute> attributes = productAttributeService.getByAttributeIds(store, model, attrinutesIds);
        for (ProductAttribute attribute : attributes) {
            if (attribute.getProduct().getId().longValue() != id.longValue()) {
                // throw unauthorized
                throw new OperationNotAllowedException("Attribute with id [" + attribute.getId() + "] is not attached to product id [" + id + "]");
            }
        }
        FinalPrice price;
        price = pricingService.calculateProductPrice(model, attributes);
        ReadableProductPrice readablePrice = new ReadableProductPrice();
        ReadableFinalPricePopulator populator = new ReadableFinalPricePopulator();
        populator.setPricingService(pricingService);
        return populator.populate(price, readablePrice, store, language);
    } catch (Exception e) {
        throw new ServiceRuntimeException("An error occured while getting product price", e);
    }
}
Also used : ProductService(com.salesmanager.core.business.services.catalog.product.ProductService) ProductFacade(com.salesmanager.shop.store.controller.product.facade.ProductFacade) CollectionUtils(org.apache.commons.collections4.CollectionUtils) ArrayList(java.util.ArrayList) Inject(javax.inject.Inject) Language(com.salesmanager.core.model.reference.language.Language) PersistableProduct(com.salesmanager.shop.model.catalog.product.PersistableProduct) ReadableFinalPricePopulator(com.salesmanager.shop.populator.catalog.ReadableFinalPricePopulator) MerchantStore(com.salesmanager.core.model.merchant.MerchantStore) ConversionRuntimeException(com.salesmanager.shop.store.api.exception.ConversionRuntimeException) FinalPrice(com.salesmanager.core.model.catalog.product.price.FinalPrice) Service(org.springframework.stereotype.Service) Qualifier(org.springframework.beans.factory.annotation.Qualifier) PricingService(com.salesmanager.core.business.services.catalog.product.PricingService) CategoryService(com.salesmanager.core.business.services.catalog.category.CategoryService) ReadableProductPrice(com.salesmanager.shop.model.catalog.product.ReadableProductPrice) ProductAttributeService(com.salesmanager.core.business.services.catalog.product.attribute.ProductAttributeService) ReadableProduct(com.salesmanager.shop.model.catalog.product.ReadableProduct) OperationNotAllowedException(com.salesmanager.shop.store.api.exception.OperationNotAllowedException) ProductAttribute(com.salesmanager.core.model.catalog.product.attribute.ProductAttribute) Product(com.salesmanager.core.model.catalog.product.Product) ProductCriteria(com.salesmanager.core.model.catalog.product.ProductCriteria) ProductPriceRequest(com.salesmanager.shop.model.catalog.product.ProductPriceRequest) ProductRelationshipService(com.salesmanager.core.business.services.catalog.product.relationship.ProductRelationshipService) ImageFilePath(com.salesmanager.shop.utils.ImageFilePath) Page(org.springframework.data.domain.Page) Collectors(java.util.stream.Collectors) Profile(org.springframework.context.annotation.Profile) List(java.util.List) LocaleUtils(com.salesmanager.shop.utils.LocaleUtils) Validate(org.apache.commons.lang3.Validate) ProductRelationship(com.salesmanager.core.model.catalog.product.relationship.ProductRelationship) ReadableProductPopulator(com.salesmanager.shop.populator.catalog.ReadableProductPopulator) ServiceRuntimeException(com.salesmanager.shop.store.api.exception.ServiceRuntimeException) ProductRelationshipType(com.salesmanager.core.model.catalog.product.relationship.ProductRelationshipType) ConversionException(com.salesmanager.core.business.exception.ConversionException) Comparator(java.util.Comparator) ReadableProductList(com.salesmanager.shop.model.catalog.product.ReadableProductList) PersistableProduct(com.salesmanager.shop.model.catalog.product.PersistableProduct) ReadableProduct(com.salesmanager.shop.model.catalog.product.ReadableProduct) Product(com.salesmanager.core.model.catalog.product.Product) ProductAttribute(com.salesmanager.core.model.catalog.product.attribute.ProductAttribute) ReadableFinalPricePopulator(com.salesmanager.shop.populator.catalog.ReadableFinalPricePopulator) OperationNotAllowedException(com.salesmanager.shop.store.api.exception.OperationNotAllowedException) ReadableProductPrice(com.salesmanager.shop.model.catalog.product.ReadableProductPrice) ConversionRuntimeException(com.salesmanager.shop.store.api.exception.ConversionRuntimeException) OperationNotAllowedException(com.salesmanager.shop.store.api.exception.OperationNotAllowedException) ServiceRuntimeException(com.salesmanager.shop.store.api.exception.ServiceRuntimeException) ConversionException(com.salesmanager.core.business.exception.ConversionException) FinalPrice(com.salesmanager.core.model.catalog.product.price.FinalPrice) ServiceRuntimeException(com.salesmanager.shop.store.api.exception.ServiceRuntimeException)

Example 97 with Language

use of com.salesmanager.core.model.reference.language.Language in project shopizer by shopizer-ecommerce.

the class CategoryFacadeImpl method getCategoryHierarchy.

@Override
public ReadableCategoryList getCategoryHierarchy(MerchantStore store, ListCriteria criteria, int depth, Language language, List<String> filter, int page, int count) {
    Validate.notNull(store, "MerchantStore can not be null");
    // get parent store
    try {
        MerchantStore parent = merchantStoreService.getParent(store.getCode());
        List<Category> categories = null;
        ReadableCategoryList returnList = new ReadableCategoryList();
        if (!CollectionUtils.isEmpty(filter) && filter.contains(FEATURED_CATEGORY)) {
            categories = categoryService.getListByDepthFilterByFeatured(parent, depth, language);
            returnList.setRecordsTotal(categories.size());
            returnList.setNumber(categories.size());
            returnList.setTotalPages(1);
        } else {
            org.springframework.data.domain.Page<Category> pageable = categoryService.getListByDepth(parent, language, criteria != null ? criteria.getName() : null, depth, page, count);
            categories = pageable.getContent();
            returnList.setRecordsTotal(pageable.getTotalElements());
            returnList.setTotalPages(pageable.getTotalPages());
            returnList.setNumber(categories.size());
        }
        List<ReadableCategory> readableCategories = null;
        if (filter != null && filter.contains(VISIBLE_CATEGORY)) {
            readableCategories = categories.stream().filter(Category::isVisible).map(cat -> categoryReadableCategoryConverter.convert(cat, store, language)).collect(Collectors.toList());
        } else {
            readableCategories = categories.stream().map(cat -> categoryReadableCategoryConverter.convert(cat, store, language)).collect(Collectors.toList());
        }
        Map<Long, ReadableCategory> readableCategoryMap = readableCategories.stream().collect(Collectors.toMap(ReadableCategory::getId, Function.identity()));
        readableCategories.stream().filter(cat -> Objects.nonNull(cat.getParent())).filter(cat -> readableCategoryMap.containsKey(cat.getParent().getId())).forEach(readableCategory -> {
            ReadableCategory parentCategory = readableCategoryMap.get(readableCategory.getParent().getId());
            if (parentCategory != null) {
                parentCategory.getChildren().add(readableCategory);
            }
        });
        List<ReadableCategory> filteredList = readableCategoryMap.values().stream().collect(Collectors.toList());
        // execute only if not admin filtered
        if (filter == null || (filter != null && !filter.contains(ADMIN_CATEGORY))) {
            filteredList = readableCategoryMap.values().stream().filter(cat -> cat.getDepth() == 0).sorted(Comparator.comparing(ReadableCategory::getSortOrder)).collect(Collectors.toList());
            returnList.setNumber(filteredList.size());
        }
        returnList.setCategories(filteredList);
        return returnList;
    } catch (ServiceException e) {
        throw new ServiceRuntimeException(e);
    }
}
Also used : CategoryFacade(com.salesmanager.shop.store.controller.category.facade.CategoryFacade) PersistableCategoryPopulator(com.salesmanager.shop.populator.catalog.PersistableCategoryPopulator) HashMap(java.util.HashMap) ReadableProductVariantValue(com.salesmanager.shop.model.catalog.product.attribute.ReadableProductVariantValue) Function(java.util.function.Function) ArrayList(java.util.ArrayList) ServiceException(com.salesmanager.core.business.exception.ServiceException) Inject(javax.inject.Inject) ProductOptionValueDescription(com.salesmanager.core.model.catalog.product.attribute.ProductOptionValueDescription) Language(com.salesmanager.core.model.reference.language.Language) ListCriteria(com.salesmanager.shop.model.entity.ListCriteria) MerchantStore(com.salesmanager.core.model.merchant.MerchantStore) ResourceNotFoundException(com.salesmanager.shop.store.api.exception.ResourceNotFoundException) Service(org.springframework.stereotype.Service) Map(java.util.Map) ProductOption(com.salesmanager.core.model.catalog.product.attribute.ProductOption) ReadableProductVariant(com.salesmanager.shop.model.catalog.product.attribute.ReadableProductVariant) ReadableCategoryPopulator(com.salesmanager.shop.populator.catalog.ReadableCategoryPopulator) CategoryService(com.salesmanager.core.business.services.catalog.category.CategoryService) MerchantStoreService(com.salesmanager.core.business.services.merchant.MerchantStoreService) ProductAttributeService(com.salesmanager.core.business.services.catalog.product.attribute.ProductAttributeService) OperationNotAllowedException(com.salesmanager.shop.store.api.exception.OperationNotAllowedException) ProductAttribute(com.salesmanager.core.model.catalog.product.attribute.ProductAttribute) Mapper(com.salesmanager.shop.mapper.Mapper) Iterator(java.util.Iterator) ProductOptionDescription(com.salesmanager.core.model.catalog.product.attribute.ProductOptionDescription) Collectors(java.util.stream.Collectors) ReadableCategoryList(com.salesmanager.shop.model.catalog.category.ReadableCategoryList) UnauthorizedException(com.salesmanager.shop.store.api.exception.UnauthorizedException) Objects(java.util.Objects) Category(com.salesmanager.core.model.catalog.category.Category) List(java.util.List) Validate(org.apache.commons.lang3.Validate) CollectionUtils(org.springframework.util.CollectionUtils) ServiceRuntimeException(com.salesmanager.shop.store.api.exception.ServiceRuntimeException) ReadableCategory(com.salesmanager.shop.model.catalog.category.ReadableCategory) Entry(java.util.Map.Entry) Optional(java.util.Optional) ConversionException(com.salesmanager.core.business.exception.ConversionException) Comparator(java.util.Comparator) PersistableCategory(com.salesmanager.shop.model.catalog.category.PersistableCategory) Category(com.salesmanager.core.model.catalog.category.Category) ReadableCategory(com.salesmanager.shop.model.catalog.category.ReadableCategory) PersistableCategory(com.salesmanager.shop.model.catalog.category.PersistableCategory) ReadableCategoryList(com.salesmanager.shop.model.catalog.category.ReadableCategoryList) ServiceRuntimeException(com.salesmanager.shop.store.api.exception.ServiceRuntimeException) ServiceException(com.salesmanager.core.business.exception.ServiceException) ReadableCategory(com.salesmanager.shop.model.catalog.category.ReadableCategory) MerchantStore(com.salesmanager.core.model.merchant.MerchantStore)

Example 98 with Language

use of com.salesmanager.core.model.reference.language.Language in project shopizer by shopizer-ecommerce.

the class ContentFacadeImpl method convertContentToReadableContentBox.

private ReadableContentBox convertContentToReadableContentBox(MerchantStore store, Language language, Content content) {
    if (language != null) {
        ReadableContentBox box = new ReadableContentBox();
        this.setDescription(content, box, language);
        box.setCode(content.getCode());
        box.setId(content.getId());
        box.setVisible(content.isVisible());
        return box;
    } else {
        ReadableContentBoxFull box = new ReadableContentBoxFull();
        List<com.salesmanager.shop.model.content.common.ContentDescription> descriptions = content.getDescriptions().stream().map(d -> this.contentDescription(d)).collect(Collectors.toList());
        this.setDescription(content, box, store.getDefaultLanguage());
        box.setDescriptions(descriptions);
        box.setCode(content.getCode());
        box.setId(content.getId());
        box.setVisible(content.isVisible());
        return box;
    }
// TODO revise this
// String staticImageFilePath = imageUtils.buildStaticImageUtils(store,
// content.getCode() + ".jpg");
// box.setImage(staticImageFilePath);
}
Also used : ContentDescription(com.salesmanager.core.model.content.ContentDescription) ContentFacade(com.salesmanager.shop.store.controller.content.facade.ContentFacade) LoggerFactory(org.slf4j.LoggerFactory) StringUtils(org.apache.commons.lang3.StringUtils) LanguageService(com.salesmanager.core.business.services.reference.language.LanguageService) ContentDescriptionEntity(com.salesmanager.shop.model.content.ContentDescriptionEntity) ArrayList(java.util.ArrayList) ServiceException(com.salesmanager.core.business.exception.ServiceException) PersistableContentBox(com.salesmanager.shop.model.content.box.PersistableContentBox) PersistableContentPage(com.salesmanager.shop.model.content.page.PersistableContentPage) Inject(javax.inject.Inject) Language(com.salesmanager.core.model.reference.language.Language) MerchantStore(com.salesmanager.core.model.merchant.MerchantStore) ContentFile(com.salesmanager.shop.model.content.ContentFile) ReadableContentPageFull(com.salesmanager.shop.model.content.page.ReadableContentPageFull) ReadableContentPage(com.salesmanager.shop.model.content.page.ReadableContentPage) ByteArrayInputStream(java.io.ByteArrayInputStream) ResourceNotFoundException(com.salesmanager.shop.store.api.exception.ResourceNotFoundException) Content(com.salesmanager.core.model.content.Content) ReadableContentFull(com.salesmanager.shop.model.content.ReadableContentFull) Qualifier(org.springframework.beans.factory.annotation.Qualifier) ContentType(com.salesmanager.core.model.content.ContentType) FileContentType(com.salesmanager.core.model.content.FileContentType) ReadableContentBox(com.salesmanager.shop.model.content.box.ReadableContentBox) Validate(org.jsoup.helper.Validate) OutputContentFile(com.salesmanager.core.model.content.OutputContentFile) Logger(org.slf4j.Logger) ConstraintException(com.salesmanager.shop.store.api.exception.ConstraintException) IOException(java.io.IOException) ImageFilePath(com.salesmanager.shop.utils.ImageFilePath) Page(org.springframework.data.domain.Page) InputContentFile(com.salesmanager.core.model.content.InputContentFile) Collectors(java.util.stream.Collectors) ContentService(com.salesmanager.core.business.services.content.ContentService) ContentFolder(com.salesmanager.shop.model.content.ContentFolder) ReadableContentBoxFull(com.salesmanager.shop.model.content.box.ReadableContentBoxFull) URLEncoder(java.net.URLEncoder) List(java.util.List) Component(org.springframework.stereotype.Component) ContentImage(com.salesmanager.shop.model.content.ContentImage) CollectionUtils(org.springframework.util.CollectionUtils) ServiceRuntimeException(com.salesmanager.shop.store.api.exception.ServiceRuntimeException) Optional(java.util.Optional) ReadableContentEntity(com.salesmanager.shop.model.content.ReadableContentEntity) FilePathUtils(com.salesmanager.shop.utils.FilePathUtils) InputStream(java.io.InputStream) ReadableEntityList(com.salesmanager.shop.model.entity.ReadableEntityList) ReadableContentBoxFull(com.salesmanager.shop.model.content.box.ReadableContentBoxFull) ContentDescription(com.salesmanager.core.model.content.ContentDescription) ReadableContentBox(com.salesmanager.shop.model.content.box.ReadableContentBox)

Example 99 with Language

use of com.salesmanager.core.model.reference.language.Language 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;
    }
}
Also used : ContentDescription(com.salesmanager.core.model.content.ContentDescription) ContentFacade(com.salesmanager.shop.store.controller.content.facade.ContentFacade) LoggerFactory(org.slf4j.LoggerFactory) StringUtils(org.apache.commons.lang3.StringUtils) LanguageService(com.salesmanager.core.business.services.reference.language.LanguageService) ContentDescriptionEntity(com.salesmanager.shop.model.content.ContentDescriptionEntity) ArrayList(java.util.ArrayList) ServiceException(com.salesmanager.core.business.exception.ServiceException) PersistableContentBox(com.salesmanager.shop.model.content.box.PersistableContentBox) PersistableContentPage(com.salesmanager.shop.model.content.page.PersistableContentPage) Inject(javax.inject.Inject) Language(com.salesmanager.core.model.reference.language.Language) MerchantStore(com.salesmanager.core.model.merchant.MerchantStore) ContentFile(com.salesmanager.shop.model.content.ContentFile) ReadableContentPageFull(com.salesmanager.shop.model.content.page.ReadableContentPageFull) ReadableContentPage(com.salesmanager.shop.model.content.page.ReadableContentPage) ByteArrayInputStream(java.io.ByteArrayInputStream) ResourceNotFoundException(com.salesmanager.shop.store.api.exception.ResourceNotFoundException) Content(com.salesmanager.core.model.content.Content) ReadableContentFull(com.salesmanager.shop.model.content.ReadableContentFull) Qualifier(org.springframework.beans.factory.annotation.Qualifier) ContentType(com.salesmanager.core.model.content.ContentType) FileContentType(com.salesmanager.core.model.content.FileContentType) ReadableContentBox(com.salesmanager.shop.model.content.box.ReadableContentBox) Validate(org.jsoup.helper.Validate) OutputContentFile(com.salesmanager.core.model.content.OutputContentFile) Logger(org.slf4j.Logger) ConstraintException(com.salesmanager.shop.store.api.exception.ConstraintException) IOException(java.io.IOException) ImageFilePath(com.salesmanager.shop.utils.ImageFilePath) Page(org.springframework.data.domain.Page) InputContentFile(com.salesmanager.core.model.content.InputContentFile) Collectors(java.util.stream.Collectors) ContentService(com.salesmanager.core.business.services.content.ContentService) ContentFolder(com.salesmanager.shop.model.content.ContentFolder) ReadableContentBoxFull(com.salesmanager.shop.model.content.box.ReadableContentBoxFull) URLEncoder(java.net.URLEncoder) List(java.util.List) Component(org.springframework.stereotype.Component) ContentImage(com.salesmanager.shop.model.content.ContentImage) CollectionUtils(org.springframework.util.CollectionUtils) ServiceRuntimeException(com.salesmanager.shop.store.api.exception.ServiceRuntimeException) Optional(java.util.Optional) ReadableContentEntity(com.salesmanager.shop.model.content.ReadableContentEntity) FilePathUtils(com.salesmanager.shop.utils.FilePathUtils) InputStream(java.io.InputStream) ReadableEntityList(com.salesmanager.shop.model.entity.ReadableEntityList) ReadableContentPageFull(com.salesmanager.shop.model.content.page.ReadableContentPageFull) ReadableContentPage(com.salesmanager.shop.model.content.page.ReadableContentPage) ContentDescription(com.salesmanager.core.model.content.ContentDescription)

Example 100 with Language

use of com.salesmanager.core.model.reference.language.Language in project shopizer by shopizer-ecommerce.

the class ContentFacadeImpl method buildDescriptions.

/*
	 * private List<ContentDescription> createContentDescription(
	 * PersistableContentPage content) throws ServiceException {
	 * Validate.notNull(contentModel, "Content cannot be null");
	 * 
	 * List<ContentDescription> descriptions = new
	 * ArrayList<ContentDescription>(); for (NamedEntity objectContent :
	 * content.getDescriptions()) { Language lang =
	 * languageService.getByCode(objectContent.getLanguage());
	 * ContentDescription contentDescription = new ContentDescription(); if
	 * (contentModel != null) {
	 * setContentDescriptionToContentModel(contentModel, contentDescription,
	 * lang); } contentDescription.setLanguage(lang);
	 * contentDescription.setMetatagDescription(objectContent.getMetaDescription
	 * ()); contentDescription.setTitle(objectContent.getTitle());
	 * contentDescription.setName(objectContent.getName());
	 * contentDescription.setSeUrl(objectContent.getFriendlyUrl());
	 * contentDescription.setDescription(objectContent.getDescription());
	 * contentDescription.setMetatagTitle(objectContent.getTitle());
	 * descriptions.add(contentDescription); } return descriptions; }
	 */
private List<ContentDescription> buildDescriptions(Content contentModel, List<com.salesmanager.shop.model.content.common.ContentDescription> persistableDescriptions) throws Exception {
    List<ContentDescription> descriptions = new ArrayList<ContentDescription>();
    for (com.salesmanager.shop.model.content.common.ContentDescription objectContent : persistableDescriptions) {
        Language lang = languageService.getByCode(objectContent.getLanguage());
        Validate.notNull(lang, "language cannot be null");
        ContentDescription contentDescription = null;
        if (!CollectionUtils.isEmpty(contentModel.getDescriptions())) {
            for (ContentDescription descriptionModel : contentModel.getDescriptions()) {
                if (descriptionModel.getLanguage().getCode().equals(lang.getCode())) {
                    contentDescription = descriptionModel;
                    break;
                }
            }
        }
        if (contentDescription == null) {
            contentDescription = new ContentDescription();
        }
        // if (contentModel != null) {
        // setContentDescriptionToContentModel(contentModel, contentDescription, lang);
        // }
        contentDescription.setMetatagDescription(objectContent.getMetaDescription());
        contentDescription.setTitle(objectContent.getTitle());
        contentDescription.setName(objectContent.getName());
        contentDescription.setSeUrl(objectContent.getFriendlyUrl());
        contentDescription.setDescription(objectContent.getDescription());
        contentDescription.setMetatagTitle(objectContent.getTitle());
        contentDescription.setContent(contentModel);
        contentDescription.setLanguage(lang);
        descriptions.add(contentDescription);
    // contentDescription.setId(objectContent.getId());
    /**
     *			contentDescription.setMetatagDescription(objectContent.getMetaDescription());
     *			contentDescription.setTitle(objectContent.getTitle());
     *			contentDescription.setName(objectContent.getName());
     *			contentDescription.setSeUrl(objectContent.getFriendlyUrl());
     *			contentDescription.setDescription(objectContent.getDescription());
     *			contentDescription.setMetatagTitle(objectContent.getTitle());
     *			descriptions.add(contentDescription);
     */
    }
    return descriptions;
}
Also used : Language(com.salesmanager.core.model.reference.language.Language) ArrayList(java.util.ArrayList) ContentDescription(com.salesmanager.core.model.content.ContentDescription)

Aggregations

Language (com.salesmanager.core.model.reference.language.Language)148 MerchantStore (com.salesmanager.core.model.merchant.MerchantStore)115 ArrayList (java.util.ArrayList)58 List (java.util.List)56 ServiceException (com.salesmanager.core.business.exception.ServiceException)55 Collectors (java.util.stream.Collectors)50 Product (com.salesmanager.core.model.catalog.product.Product)45 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)44 ServiceRuntimeException (com.salesmanager.shop.store.api.exception.ServiceRuntimeException)42 ResourceNotFoundException (com.salesmanager.shop.store.api.exception.ResourceNotFoundException)38 Autowired (org.springframework.beans.factory.annotation.Autowired)35 ConversionException (com.salesmanager.core.business.exception.ConversionException)30 Category (com.salesmanager.core.model.catalog.category.Category)30 Validate (org.apache.commons.lang3.Validate)29 Customer (com.salesmanager.core.model.customer.Customer)28 Optional (java.util.Optional)28 Inject (javax.inject.Inject)28 Service (org.springframework.stereotype.Service)28 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)27 ImageFilePath (com.salesmanager.shop.utils.ImageFilePath)25