Search in sources :

Example 1 with ServiceException

use of com.salesmanager.core.business.exception.ServiceException in project shopizer by shopizer-ecommerce.

the class ReadableProductDefinitionMapper method merge.

@Override
public ReadableProductDefinition merge(Product source, ReadableProductDefinition destination, MerchantStore store, Language language) {
    Validate.notNull(source, "Product cannot be null");
    Validate.notNull(destination, "Product destination cannot be null");
    ReadableProductDefinition returnDestination = destination;
    if (language == null) {
        returnDestination = new ReadableProductDefinitionFull();
    }
    List<com.salesmanager.shop.model.catalog.product.ProductDescription> fulldescriptions = new ArrayList<com.salesmanager.shop.model.catalog.product.ProductDescription>();
    returnDestination.setIdentifier(source.getSku());
    returnDestination.setId(source.getId());
    returnDestination.setVisible(source.isAvailable());
    returnDestination.setDateAvailable(DateUtil.formatDate(source.getDateAvailable()));
    ProductDescription description = null;
    if (source.getDescriptions() != null && source.getDescriptions().size() > 0) {
        for (ProductDescription desc : source.getDescriptions()) {
            if (language != null && desc.getLanguage() != null && desc.getLanguage().getId().intValue() == language.getId().intValue()) {
                description = desc;
                break;
            } else {
                fulldescriptions.add(populateDescription(desc));
            }
        }
    }
    if (description != null) {
        com.salesmanager.shop.model.catalog.product.ProductDescription tragetDescription = populateDescription(description);
        returnDestination.setDescription(tragetDescription);
    }
    if (source.getManufacturer() != null) {
        ReadableManufacturer manufacturer = readableManufacturerMapper.convert(source.getManufacturer(), store, language);
        returnDestination.setManufacturer(manufacturer);
    }
    if (!CollectionUtils.isEmpty(source.getCategories())) {
        List<ReadableCategory> categoryList = new ArrayList<ReadableCategory>();
        for (Category category : source.getCategories()) {
            ReadableCategory readableCategory = readableCategoryMapper.convert(category, store, language);
            categoryList.add(readableCategory);
        }
        returnDestination.setCategories(categoryList);
    }
    ProductSpecification specifications = new ProductSpecification();
    specifications.setHeight(source.getProductHeight());
    specifications.setLength(source.getProductLength());
    specifications.setWeight(source.getProductWeight());
    specifications.setWidth(source.getProductWidth());
    if (!StringUtils.isBlank(store.getSeizeunitcode())) {
        specifications.setDimensionUnitOfMeasure(DimensionUnitOfMeasure.valueOf(store.getSeizeunitcode().toLowerCase()));
    }
    if (!StringUtils.isBlank(store.getWeightunitcode())) {
        specifications.setWeightUnitOfMeasure(WeightUnitOfMeasure.valueOf(store.getWeightunitcode().toLowerCase()));
    }
    returnDestination.setProductSpecifications(specifications);
    if (source.getType() != null) {
        ReadableProductType readableType = readableProductTypeMapper.convert(source.getType(), store, language);
        returnDestination.setType(readableType);
    }
    returnDestination.setSortOrder(source.getSortOrder());
    // images
    Set<ProductImage> images = source.getImages();
    if (CollectionUtils.isNotEmpty(images)) {
        List<ReadableImage> imageList = images.stream().map(i -> this.convertImage(source, i, store)).collect(Collectors.toList());
        returnDestination.setImages(imageList);
    }
    // quantity
    ProductAvailability availability = null;
    for (ProductAvailability a : source.getAvailabilities()) {
        availability = a;
        returnDestination.setCanBePurchased(availability.getProductStatus());
        returnDestination.setQuantity(availability.getProductQuantity() == null ? 1 : availability.getProductQuantity());
    }
    FinalPrice price = null;
    try {
        price = pricingService.calculateProductPrice(source);
    } catch (ServiceException e) {
        throw new ConversionRuntimeException("Unable to get product price", e);
    }
    if (price != null) {
        returnDestination.setPrice(price.getStringPrice());
    }
    if (returnDestination instanceof ReadableProductDefinitionFull) {
        ((ReadableProductDefinitionFull) returnDestination).setDescriptions(fulldescriptions);
    }
    return returnDestination;
}
Also used : DateUtil(com.salesmanager.shop.utils.DateUtil) Autowired(org.springframework.beans.factory.annotation.Autowired) StringUtils(org.apache.commons.lang3.StringUtils) CollectionUtils(org.apache.commons.collections4.CollectionUtils) ArrayList(java.util.ArrayList) ServiceException(com.salesmanager.core.business.exception.ServiceException) Language(com.salesmanager.core.model.reference.language.Language) MerchantStore(com.salesmanager.core.model.merchant.MerchantStore) ConversionRuntimeException(com.salesmanager.shop.store.api.exception.ConversionRuntimeException) FinalPrice(com.salesmanager.core.model.catalog.product.price.FinalPrice) ReadableImage(com.salesmanager.shop.model.catalog.product.ReadableImage) ReadableProductDefinition(com.salesmanager.shop.model.catalog.product.product.definition.ReadableProductDefinition) DimensionUnitOfMeasure(com.salesmanager.shop.model.references.DimensionUnitOfMeasure) Qualifier(org.springframework.beans.factory.annotation.Qualifier) PricingService(com.salesmanager.core.business.services.catalog.product.PricingService) ReadableProductDefinitionFull(com.salesmanager.shop.model.catalog.product.product.definition.ReadableProductDefinitionFull) Mapper(com.salesmanager.shop.mapper.Mapper) Product(com.salesmanager.core.model.catalog.product.Product) ReadableProductType(com.salesmanager.shop.model.catalog.product.type.ReadableProductType) Set(java.util.Set) ImageFilePath(com.salesmanager.shop.utils.ImageFilePath) Collectors(java.util.stream.Collectors) Category(com.salesmanager.core.model.catalog.category.Category) ReadableManufacturer(com.salesmanager.shop.model.catalog.manufacturer.ReadableManufacturer) List(java.util.List) Component(org.springframework.stereotype.Component) Validate(org.apache.commons.lang3.Validate) ProductImage(com.salesmanager.core.model.catalog.product.image.ProductImage) ReadableCategory(com.salesmanager.shop.model.catalog.category.ReadableCategory) ProductSpecification(com.salesmanager.shop.model.catalog.product.ProductSpecification) ProductAvailability(com.salesmanager.core.model.catalog.product.availability.ProductAvailability) ProductDescription(com.salesmanager.core.model.catalog.product.description.ProductDescription) WeightUnitOfMeasure(com.salesmanager.shop.model.references.WeightUnitOfMeasure) Category(com.salesmanager.core.model.catalog.category.Category) ReadableCategory(com.salesmanager.shop.model.catalog.category.ReadableCategory) ProductImage(com.salesmanager.core.model.catalog.product.image.ProductImage) ArrayList(java.util.ArrayList) ReadableImage(com.salesmanager.shop.model.catalog.product.ReadableImage) ProductAvailability(com.salesmanager.core.model.catalog.product.availability.ProductAvailability) ReadableCategory(com.salesmanager.shop.model.catalog.category.ReadableCategory) FinalPrice(com.salesmanager.core.model.catalog.product.price.FinalPrice) ConversionRuntimeException(com.salesmanager.shop.store.api.exception.ConversionRuntimeException) ReadableManufacturer(com.salesmanager.shop.model.catalog.manufacturer.ReadableManufacturer) ReadableProductDefinition(com.salesmanager.shop.model.catalog.product.product.definition.ReadableProductDefinition) ProductSpecification(com.salesmanager.shop.model.catalog.product.ProductSpecification) ReadableProductDefinitionFull(com.salesmanager.shop.model.catalog.product.product.definition.ReadableProductDefinitionFull) ServiceException(com.salesmanager.core.business.exception.ServiceException) ProductDescription(com.salesmanager.core.model.catalog.product.description.ProductDescription) ReadableProductType(com.salesmanager.shop.model.catalog.product.type.ReadableProductType)

Example 2 with ServiceException

use of com.salesmanager.core.business.exception.ServiceException in project shopizer by shopizer-ecommerce.

the class ProductFacadeImpl method deleteProduct.

@Override
public void deleteProduct(Long id, MerchantStore store) {
    Validate.notNull(id, "Product id cannot be null");
    Validate.notNull(store, "store cannot be null");
    Product p = productService.getById(id);
    if (p == null) {
        throw new ResourceNotFoundException("Product with id [" + id + " not found");
    }
    if (p.getMerchantStore().getId().intValue() != store.getId().intValue()) {
        throw new ResourceNotFoundException("Product with id [" + id + " not found for store [" + store.getCode() + "]");
    }
    try {
        productService.delete(p);
    } catch (ServiceException e) {
        throw new ServiceRuntimeException("Error while deleting ptoduct with id [" + id + "]", e);
    }
}
Also used : ServiceException(com.salesmanager.core.business.exception.ServiceException) PersistableProduct(com.salesmanager.shop.model.catalog.product.PersistableProduct) ReadableProduct(com.salesmanager.shop.model.catalog.product.ReadableProduct) Product(com.salesmanager.core.model.catalog.product.Product) LightPersistableProduct(com.salesmanager.shop.model.catalog.product.LightPersistableProduct) ResourceNotFoundException(com.salesmanager.shop.store.api.exception.ResourceNotFoundException) ServiceRuntimeException(com.salesmanager.shop.store.api.exception.ServiceRuntimeException)

Example 3 with ServiceException

use of com.salesmanager.core.business.exception.ServiceException in project shopizer by shopizer-ecommerce.

the class ShoppingOrderController method commitOrder.

private Order commitOrder(ShopOrder order, HttpServletRequest request, Locale locale) throws Exception, ServiceException {
    LOGGER.info("Entering comitOrder");
    MerchantStore store = (MerchantStore) request.getAttribute(Constants.MERCHANT_STORE);
    Language language = (Language) request.getAttribute("LANGUAGE");
    String userName = null;
    String password = null;
    PersistableCustomer customer = order.getCustomer();
    /**
     * set username and password to persistable object *
     */
    LOGGER.info("Set username and password to customer");
    Authentication auth = SecurityContextHolder.getContext().getAuthentication();
    Customer authCustomer = null;
    if (auth != null && request.isUserInRole("AUTH_CUSTOMER")) {
        LOGGER.info("Customer authenticated");
        authCustomer = customerFacade.getCustomerByUserName(auth.getName(), store);
        // set id and authentication information
        customer.setUserName(authCustomer.getNick());
        // customer.setEncodedPassword(authCustomer.getPassword());
        customer.setId(authCustomer.getId());
    } else {
        // set customer id to null
        customer.setId(null);
    }
    // if the customer is new, generate a password
    LOGGER.info("New customer generate password");
    if (customer.getId() == null || customer.getId() == 0) {
    // new customer
    // password = UserReset.generateRandomString();
    // String encodedPassword = passwordEncoder.encode(password);
    // customer.setEncodedPassword(encodedPassword);
    }
    if (order.isShipToBillingAdress()) {
        customer.setDelivery(customer.getBilling());
    }
    LOGGER.info("Before creating new volatile");
    Customer modelCustomer = null;
    try {
        // set groups
        if (authCustomer == null) {
            // not authenticated, create a new volatile user
            modelCustomer = customerFacade.getCustomerModel(customer, store, language);
            customerFacade.setCustomerModelDefaultProperties(modelCustomer, store);
            userName = modelCustomer.getNick();
            LOGGER.debug("About to persist volatile customer to database.");
            if (modelCustomer.getDefaultLanguage() == null) {
                modelCustomer.setDefaultLanguage(languageService.toLanguage(locale));
            }
            customerService.saveOrUpdate(modelCustomer);
        } else {
            // use existing customer
            LOGGER.info("Populate customer model");
            modelCustomer = customerFacade.populateCustomerModel(authCustomer, customer, store, language);
        }
    } catch (Exception e) {
        throw new ServiceException(e);
    }
    LOGGER.debug("About to save transaction");
    Order modelOrder = null;
    Transaction initialTransaction = (Transaction) super.getSessionAttribute(Constants.INIT_TRANSACTION_KEY, request);
    if (initialTransaction != null) {
        modelOrder = orderFacade.processOrder(order, modelCustomer, initialTransaction, store, language);
    } else {
        modelOrder = orderFacade.processOrder(order, modelCustomer, store, language);
    }
    // save order id in session
    super.setSessionAttribute(Constants.ORDER_ID, modelOrder.getId(), request);
    // set a unique token for confirmation
    super.setSessionAttribute(Constants.ORDER_ID_TOKEN, modelOrder.getId(), request);
    LOGGER.debug("Transaction ended and order saved");
    LOGGER.debug("Remove cart");
    // get cart
    String cartCode = super.getSessionAttribute(Constants.SHOPPING_CART, request);
    if (StringUtils.isNotBlank(cartCode)) {
        try {
            shoppingCartFacade.setOrderId(cartCode, modelOrder.getId(), store);
        } catch (Exception e) {
            LOGGER.error("Cannot update cart " + cartCode, e);
            throw new ServiceException(e);
        }
    }
    // cleanup the order objects
    super.removeAttribute(Constants.ORDER, request);
    super.removeAttribute(Constants.ORDER_SUMMARY, request);
    super.removeAttribute(Constants.INIT_TRANSACTION_KEY, request);
    super.removeAttribute(Constants.SHIPPING_OPTIONS, request);
    super.removeAttribute(Constants.SHIPPING_SUMMARY, request);
    super.removeAttribute(Constants.SHOPPING_CART, request);
    LOGGER.debug("Refresh customer");
    try {
        // refresh customer --
        modelCustomer = customerFacade.getCustomerByUserName(modelCustomer.getNick(), store);
        // if has downloads, authenticate
        // check if any downloads exist for this order6
        List<OrderProductDownload> orderProductDownloads = orderProdctDownloadService.getByOrderId(modelOrder.getId());
        if (CollectionUtils.isNotEmpty(orderProductDownloads)) {
            LOGGER.debug("Is user authenticated ? ", auth.isAuthenticated());
            if (auth != null && request.isUserInRole("AUTH_CUSTOMER")) {
            // already authenticated
            } else {
                // authenticate
                customerFacade.authenticate(modelCustomer, userName, password);
                super.setSessionAttribute(Constants.CUSTOMER, modelCustomer, request);
            }
            // send new user registration template
            if (order.getCustomer().getId() == null || order.getCustomer().getId().longValue() == 0) {
                // send email for new customer
                // set clear password for email
                customer.setPassword(password);
                customer.setUserName(userName);
                emailTemplatesUtils.sendRegistrationEmail(customer, store, locale, request.getContextPath());
            }
        }
        // send order confirmation email to customer
        emailTemplatesUtils.sendOrderEmail(modelCustomer.getEmailAddress(), modelCustomer, modelOrder, locale, language, store, request.getContextPath());
        if (orderService.hasDownloadFiles(modelOrder)) {
            emailTemplatesUtils.sendOrderDownloadEmail(modelCustomer, modelOrder, store, locale, request.getContextPath());
        }
        // send order confirmation email to merchant
        emailTemplatesUtils.sendOrderEmail(store.getStoreEmailAddress(), modelCustomer, modelOrder, locale, language, store, request.getContextPath());
    } catch (Exception e) {
        LOGGER.error("Error while post processing order", e);
    }
    return modelOrder;
}
Also used : ShopOrder(com.salesmanager.shop.model.order.ShopOrder) Order(com.salesmanager.core.model.order.Order) ReadableShopOrder(com.salesmanager.shop.model.order.ReadableShopOrder) Language(com.salesmanager.core.model.reference.language.Language) ServiceException(com.salesmanager.core.business.exception.ServiceException) Transaction(com.salesmanager.core.model.payments.Transaction) AnonymousCustomer(com.salesmanager.shop.model.customer.AnonymousCustomer) Customer(com.salesmanager.core.model.customer.Customer) PersistableCustomer(com.salesmanager.shop.model.customer.PersistableCustomer) PersistableCustomer(com.salesmanager.shop.model.customer.PersistableCustomer) Authentication(org.springframework.security.core.Authentication) OrderProductDownload(com.salesmanager.core.model.order.orderproduct.OrderProductDownload) MerchantStore(com.salesmanager.core.model.merchant.MerchantStore) ServiceException(com.salesmanager.core.business.exception.ServiceException)

Example 4 with ServiceException

use of com.salesmanager.core.business.exception.ServiceException in project shopizer by shopizer-ecommerce.

the class PackingBox method getBoxPackagesDetails.

@Override
public List<PackageDetails> getBoxPackagesDetails(List<ShippingProduct> products, MerchantStore store) throws ServiceException {
    if (products == null) {
        throw new ServiceException("Product list cannot be null !!");
    }
    double width = 0;
    double length = 0;
    double height = 0;
    double weight = 0;
    double maxweight = 0;
    // int treshold = 0;
    ShippingConfiguration shippingConfiguration = shippingService.getShippingConfiguration(store);
    if (shippingConfiguration == null) {
        throw new ServiceException("ShippingConfiguration not found for merchant " + store.getCode());
    }
    width = (double) shippingConfiguration.getBoxWidth();
    length = (double) shippingConfiguration.getBoxLength();
    height = (double) shippingConfiguration.getBoxHeight();
    weight = shippingConfiguration.getBoxWeight();
    maxweight = shippingConfiguration.getMaxWeight();
    List<PackageDetails> boxes = new ArrayList<PackageDetails>();
    // maximum number of boxes
    int maxBox = 100;
    int iterCount = 0;
    List<Product> individualProducts = new ArrayList<Product>();
    // need to put items individually
    for (ShippingProduct shippingProduct : products) {
        Product product = shippingProduct.getProduct();
        if (product.isProductVirtual()) {
            continue;
        }
        int qty = shippingProduct.getQuantity();
        Set<ProductAttribute> attrs = shippingProduct.getProduct().getAttributes();
        // set attributes values
        BigDecimal w = product.getProductWeight();
        BigDecimal h = product.getProductHeight();
        BigDecimal l = product.getProductLength();
        BigDecimal wd = product.getProductWidth();
        if (w == null) {
            w = new BigDecimal(defaultWeight);
        }
        if (h == null) {
            h = new BigDecimal(defaultHeight);
        }
        if (l == null) {
            l = new BigDecimal(defaultLength);
        }
        if (wd == null) {
            wd = new BigDecimal(defaultWidth);
        }
        if (attrs != null && attrs.size() > 0) {
            for (ProductAttribute attribute : attrs) {
                if (attribute.getProductAttributeWeight() != null) {
                    w = w.add(attribute.getProductAttributeWeight());
                }
            }
        }
        if (qty > 1) {
            for (int i = 1; i <= qty; i++) {
                Product temp = new Product();
                temp.setProductHeight(h);
                temp.setProductLength(l);
                temp.setProductWidth(wd);
                temp.setProductWeight(w);
                temp.setAttributes(product.getAttributes());
                temp.setDescriptions(product.getDescriptions());
                individualProducts.add(temp);
            }
        } else {
            Product temp = new Product();
            temp.setProductHeight(h);
            temp.setProductLength(l);
            temp.setProductWidth(wd);
            temp.setProductWeight(w);
            temp.setAttributes(product.getAttributes());
            temp.setDescriptions(product.getDescriptions());
            individualProducts.add(temp);
        }
        iterCount++;
    }
    if (iterCount == 0) {
        return null;
    }
    int productCount = individualProducts.size();
    List<PackingBox> boxesList = new ArrayList<PackingBox>();
    // start the creation of boxes
    PackingBox box = new PackingBox();
    // set box max volume
    double maxVolume = width * length * height;
    if (maxVolume == 0 || maxweight == 0) {
        merchantLogService.save(new MerchantLog(store, "shipping", "Check shipping box configuration, it has a volume of " + maxVolume + " and a maximum weight of " + maxweight + ". Those values must be greater than 0."));
        throw new ServiceException("Product configuration exceeds box configuraton");
    }
    box.setVolumeLeft(maxVolume);
    box.setWeightLeft(maxweight);
    // assign first box
    boxesList.add(box);
    // int boxCount = 1;
    List<Product> assignedProducts = new ArrayList<Product>();
    // calculate the volume for the next object
    if (assignedProducts.size() > 0) {
        individualProducts.removeAll(assignedProducts);
        assignedProducts = new ArrayList<Product>();
    }
    boolean productAssigned = false;
    for (Product p : individualProducts) {
        // Set<ProductAttribute> attributes = p.getAttributes();
        productAssigned = false;
        double productWeight = p.getProductWeight().doubleValue();
        // validate if product fits in the box
        if (p.getProductWidth().doubleValue() > width || p.getProductHeight().doubleValue() > height || p.getProductLength().doubleValue() > length) {
            // log message to customer
            merchantLogService.save(new MerchantLog(store, "shipping", "Product " + p.getSku() + " has a demension larger than the box size specified. Will use per item calculation."));
            throw new ServiceException("Product configuration exceeds box configuraton");
        }
        if (productWeight > maxweight) {
            merchantLogService.save(new MerchantLog(store, "shipping", "Product " + p.getSku() + " has a weight larger than the box maximum weight specified. Will use per item calculation."));
            throw new ServiceException("Product configuration exceeds box configuraton");
        }
        double productVolume = (p.getProductWidth().doubleValue() * p.getProductHeight().doubleValue() * p.getProductLength().doubleValue());
        if (productVolume == 0) {
            merchantLogService.save(new MerchantLog(store, "shipping", "Product " + p.getSku() + " has one of the dimension set to 0 and therefore cannot calculate the volume"));
            throw new ServiceException("Product configuration exceeds box configuraton");
        }
        if (productVolume > maxVolume) {
            throw new ServiceException("Product configuration exceeds box configuraton");
        }
        // Iterator boxIter = boxesList.iterator();
        for (PackingBox pbox : boxesList) {
            double volumeLeft = pbox.getVolumeLeft();
            double weightLeft = pbox.getWeightLeft();
            if ((volumeLeft * .75) >= productVolume && pbox.getWeightLeft() >= productWeight) {
                // fit the item
                // in this
                // box
                // fit in the current box
                volumeLeft = volumeLeft - productVolume;
                pbox.setVolumeLeft(volumeLeft);
                weightLeft = weightLeft - productWeight;
                pbox.setWeightLeft(weightLeft);
                assignedProducts.add(p);
                productCount--;
                double w = pbox.getWeight();
                w = w + productWeight;
                pbox.setWeight(w);
                productAssigned = true;
                maxBox--;
                break;
            }
        }
        if (!productAssigned) {
            // create a new box
            box = new PackingBox();
            // set box max volume
            box.setVolumeLeft(maxVolume);
            box.setWeightLeft(maxweight);
            boxesList.add(box);
            double volumeLeft = box.getVolumeLeft() - productVolume;
            box.setVolumeLeft(volumeLeft);
            double weightLeft = box.getWeightLeft() - productWeight;
            box.setWeightLeft(weightLeft);
            assignedProducts.add(p);
            productCount--;
            double w = box.getWeight();
            w = w + productWeight;
            box.setWeight(w);
            maxBox--;
        }
    }
    // now prepare the shipping info
    // number of boxes
    // Iterator ubIt = usedBoxesList.iterator();
    System.out.println("###################################");
    System.out.println("Number of boxes " + boxesList.size());
    System.out.println("###################################");
    for (PackingBox pb : boxesList) {
        PackageDetails details = new PackageDetails();
        details.setShippingHeight(height);
        details.setShippingLength(length);
        details.setShippingWeight(weight + box.getWeight());
        details.setShippingWidth(width);
        details.setItemName(store.getCode());
        boxes.add(details);
    }
    return boxes;
}
Also used : ArrayList(java.util.ArrayList) Product(com.salesmanager.core.model.catalog.product.Product) ShippingProduct(com.salesmanager.core.model.shipping.ShippingProduct) ShippingProduct(com.salesmanager.core.model.shipping.ShippingProduct) ProductAttribute(com.salesmanager.core.model.catalog.product.attribute.ProductAttribute) BigDecimal(java.math.BigDecimal) ShippingConfiguration(com.salesmanager.core.model.shipping.ShippingConfiguration) ServiceException(com.salesmanager.core.business.exception.ServiceException) PackageDetails(com.salesmanager.core.model.shipping.PackageDetails) MerchantLog(com.salesmanager.core.model.system.MerchantLog)

Example 5 with ServiceException

use of com.salesmanager.core.business.exception.ServiceException in project shopizer by shopizer-ecommerce.

the class S3ProductContentFileManager method removeProductImage.

@Override
public void removeProductImage(ProductImage productImage) throws ServiceException {
    try {
        // get buckets
        String bucketName = bucketName();
        final AmazonS3 s3 = s3Client();
        s3.deleteObject(bucketName, nodePath(productImage.getProduct().getMerchantStore().getCode(), productImage.getProduct().getSku()) + productImage.getProductImage());
        LOGGER.info("Remove file");
    } catch (final Exception e) {
        LOGGER.error("Error while removing file", e);
        throw new ServiceException(e);
    }
}
Also used : AmazonS3(com.amazonaws.services.s3.AmazonS3) ServiceException(com.salesmanager.core.business.exception.ServiceException) ServiceException(com.salesmanager.core.business.exception.ServiceException) AmazonS3Exception(com.amazonaws.services.s3.model.AmazonS3Exception)

Aggregations

ServiceException (com.salesmanager.core.business.exception.ServiceException)230 ServiceRuntimeException (com.salesmanager.shop.store.api.exception.ServiceRuntimeException)88 ResourceNotFoundException (com.salesmanager.shop.store.api.exception.ResourceNotFoundException)54 ArrayList (java.util.ArrayList)45 MerchantStore (com.salesmanager.core.model.merchant.MerchantStore)44 Language (com.salesmanager.core.model.reference.language.Language)38 List (java.util.List)36 Collectors (java.util.stream.Collectors)30 IOException (java.io.IOException)28 InputStream (java.io.InputStream)27 IntegrationConfiguration (com.salesmanager.core.model.system.IntegrationConfiguration)22 Autowired (org.springframework.beans.factory.annotation.Autowired)21 OutputContentFile (com.salesmanager.core.model.content.OutputContentFile)20 Product (com.salesmanager.core.model.catalog.product.Product)19 HashMap (java.util.HashMap)19 Map (java.util.Map)18 ObjectMapper (com.fasterxml.jackson.databind.ObjectMapper)17 InputContentFile (com.salesmanager.core.model.content.InputContentFile)17 Optional (java.util.Optional)17 IntegrationModule (com.salesmanager.core.model.system.IntegrationModule)16