shopizer-uncached

Fixing image display issues

11/29/2016 6:44:57 PM

Changes

sm-shop/src/main/java/com/salesmanager/shop/tags/Computer - Shortcut.lnk 0(+0 -0)

Details

diff --git a/sm-shop/files/store/StoreRepository.dat b/sm-shop/files/store/StoreRepository.dat
index 24d7eff..6a419b6 100644
Binary files a/sm-shop/files/store/StoreRepository.dat and b/sm-shop/files/store/StoreRepository.dat differ
diff --git a/sm-shop/SALESMANAGER.h2.db b/sm-shop/SALESMANAGER.h2.db
index 02428a2..8bbe5e7 100644
Binary files a/sm-shop/SALESMANAGER.h2.db and b/sm-shop/SALESMANAGER.h2.db differ
diff --git a/sm-shop/SALESMANAGER.lock.db b/sm-shop/SALESMANAGER.lock.db
index f5f7387..62a4d10 100644
--- a/sm-shop/SALESMANAGER.lock.db
+++ b/sm-shop/SALESMANAGER.lock.db
@@ -1,4 +1,4 @@
 #FileLock
-#Mon Nov 28 12:30:37 EST 2016
-id=158abfd02e65b2be4012364a048aa29e21595fda4f8
+#Tue Nov 29 15:37:04 EST 2016
+id=158b1ce139543c5cc9de5085c7e7583e8f054752c02
 method=file
diff --git a/sm-shop/src/main/java/com/salesmanager/shop/admin/controller/content/ContentImageController.java b/sm-shop/src/main/java/com/salesmanager/shop/admin/controller/content/ContentImageController.java
index f1e301f..d48a2fb 100644
--- a/sm-shop/src/main/java/com/salesmanager/shop/admin/controller/content/ContentImageController.java
+++ b/sm-shop/src/main/java/com/salesmanager/shop/admin/controller/content/ContentImageController.java
@@ -107,7 +107,7 @@ public class ContentImageController {
 
 					@SuppressWarnings("rawtypes")
 					Map entry = new HashMap();
-					entry.put("picture", new StringBuilder().append(request.getContextPath()).append(imageUtils.buildStaticimageUtils(store, name)).toString());
+					entry.put("picture", new StringBuilder().append(request.getContextPath()).append(imageUtils.buildStaticImageUtils(store, name)).toString());
 					
 					entry.put("name", name);
 					entry.put("id", name);
diff --git a/sm-shop/src/main/java/com/salesmanager/shop/admin/controller/merchant/StoreBrandingController.java b/sm-shop/src/main/java/com/salesmanager/shop/admin/controller/merchant/StoreBrandingController.java
index 36e274a..22f34e0 100644
--- a/sm-shop/src/main/java/com/salesmanager/shop/admin/controller/merchant/StoreBrandingController.java
+++ b/sm-shop/src/main/java/com/salesmanager/shop/admin/controller/merchant/StoreBrandingController.java
@@ -16,6 +16,10 @@ import com.salesmanager.shop.admin.model.web.Menu;
 import com.salesmanager.shop.constants.Constants;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.MediaType;
+import org.springframework.http.ResponseEntity;
 import org.springframework.security.access.prepost.PreAuthorize;
 import org.springframework.stereotype.Controller;
 import org.springframework.ui.Model;
@@ -23,7 +27,9 @@ import org.springframework.validation.BindingResult;
 import org.springframework.web.bind.annotation.ModelAttribute;
 import org.springframework.web.bind.annotation.RequestMapping;
 import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.multipart.MultipartFile;
 
 import javax.annotation.Resource;
 import javax.inject.Inject;
@@ -94,7 +100,7 @@ public class StoreBrandingController {
 	 */
 	@PreAuthorize("hasRole('STORE')")
 	@RequestMapping(value="/admin/store/saveBranding.html", method=RequestMethod.POST)
-	public String saveStoreBranding(@ModelAttribute(value="contentImages") @Valid final ContentFiles contentImages, BindingResult result, Model model, HttpServletRequest request, HttpServletResponse response) throws Exception {
+	public String saveStoreBranding(@RequestParam("file") MultipartFile file, Model model, HttpServletRequest request, HttpServletResponse response) throws Exception {
 		
 		setMenu(model,request);
 
@@ -104,20 +110,16 @@ public class StoreBrandingController {
 		
 		
 		model.addAttribute("store", store);
-		
-		if(contentImages == null || contentImages.getFile() == null) {
-			model.addAttribute("error","error");
-			return "admin-store-branding";
-		}
-		
-		
-		if(contentImages.getFile()!=null && contentImages.getFile().size()>0) {
 
-			String imageName = contentImages.getFile().get(0).getOriginalFilename();
-            InputStream inputStream = contentImages.getFile().get(0).getInputStream();
+		if(file!=null) {
+
+			String imageName = file.getOriginalFilename();
+			InputStream inputStream = file.getInputStream();
+			String mimeType = file.getContentType();
+			
             InputContentFile cmsContentImage = new InputContentFile();
             cmsContentImage.setFileName(imageName);
-            cmsContentImage.setMimeType( contentImages.getFile().get(0).getContentType());
+            cmsContentImage.setMimeType(mimeType);
             cmsContentImage.setFile( inputStream );
             contentService.addLogo(store.getCode(), cmsContentImage);
 			
@@ -125,10 +127,11 @@ public class StoreBrandingController {
             store.setStoreLogo(imageName);
             merchantStoreService.update(store);
             request.getSession().setAttribute(Constants.ADMIN_STORE, store);
-  
+
+		} else {
+			model.addAttribute("error","error");
+			return "admin-store-branding";
 		}
-		
-		//display templates
 
 		model.addAttribute("success","success");
 		return "admin-store-branding";
@@ -158,14 +161,13 @@ public class StoreBrandingController {
 	}
 	
 	@PreAuthorize("hasRole('STORE')")
-	@RequestMapping(value="/admin/store/removeImage.html", method=RequestMethod.POST, produces="application/json")
-	public @ResponseBody String removeImage(HttpServletRequest request, HttpServletResponse response, Locale locale) {
+	@RequestMapping(value="/admin/store/removeImage.html", method=RequestMethod.POST)
+	public @ResponseBody ResponseEntity<String> removeImage(HttpServletRequest request, HttpServletResponse response, Locale locale) {
 
 		MerchantStore store = (MerchantStore)request.getAttribute(Constants.ADMIN_STORE);
 		
 		AjaxResponse resp = new AjaxResponse();
 
-		
 		try {
 			
 
@@ -183,8 +185,9 @@ public class StoreBrandingController {
 		}
 		
 		String returnString = resp.toJSONString();
-		
-		return returnString;
+		final HttpHeaders httpHeaders= new HttpHeaders();
+	    httpHeaders.setContentType(MediaType.APPLICATION_JSON_UTF8);
+		return new ResponseEntity<String>(returnString,httpHeaders,HttpStatus.OK);
 	}
 	
 	private void setMenu(Model model, HttpServletRequest request) throws Exception {
diff --git a/sm-shop/src/main/java/com/salesmanager/shop/admin/controller/products/OptionsValueController.java b/sm-shop/src/main/java/com/salesmanager/shop/admin/controller/products/OptionsValueController.java
index 3c54ea4..7d68ef0 100644
--- a/sm-shop/src/main/java/com/salesmanager/shop/admin/controller/products/OptionsValueController.java
+++ b/sm-shop/src/main/java/com/salesmanager/shop/admin/controller/products/OptionsValueController.java
@@ -305,7 +305,7 @@ public class OptionsValueController {
 				
 				entry.put("name", description.getName());
 				//entry.put("image", new StringBuilder().append(store.getCode()).append("/").append(FileContentType.PROPERTY.name()).append("/").append(option.getProductOptionValueImage()).toString());
-				entry.put("image", imageUtils.buildProductPropertyimageUtils(store, option.getProductOptionValueImage()));
+				entry.put("image", imageUtils.buildProductPropertyImageUtils(store, option.getProductOptionValueImage()));
 				resp.addDataEntry(entry);
 				
 				
diff --git a/sm-shop/src/main/java/com/salesmanager/shop/admin/controller/products/ProductImagesController.java b/sm-shop/src/main/java/com/salesmanager/shop/admin/controller/products/ProductImagesController.java
index 78dc013..65262f6 100644
--- a/sm-shop/src/main/java/com/salesmanager/shop/admin/controller/products/ProductImagesController.java
+++ b/sm-shop/src/main/java/com/salesmanager/shop/admin/controller/products/ProductImagesController.java
@@ -150,7 +150,7 @@ public class ProductImagesController {
 				
 				for(ProductImage image : images) {
 					
-						String imagePath = imageUtils.buildProductimageUtils(store, product, image.getProductImage());
+						String imagePath = imageUtils.buildProductImageUtils(store, product, image.getProductImage());
 						
 						Map entry = new HashMap();
 						//entry.put("picture", new StringBuilder().append(request.getContextPath()).append(imagePath).toString());
diff --git a/sm-shop/src/main/java/com/salesmanager/shop/admin/model/content/ContentFiles.java b/sm-shop/src/main/java/com/salesmanager/shop/admin/model/content/ContentFiles.java
index e5ca080..c392562 100644
--- a/sm-shop/src/main/java/com/salesmanager/shop/admin/model/content/ContentFiles.java
+++ b/sm-shop/src/main/java/com/salesmanager/shop/admin/model/content/ContentFiles.java
@@ -28,14 +28,15 @@ public class ContentFiles implements Serializable
     
     
     private List<MultipartFile> file;
+    
     public void setFile(List<MultipartFile> file) {
 		this.file = file;
 	}
 
 	private String fileName;
 
-    @NotEmpty(message="{merchant.files.invalid}")
-    @Valid
+    //@NotEmpty(message="{merchant.files.invalid}")
+    //@Valid
     public List<MultipartFile> getFile()
     {
         return file;
diff --git a/sm-shop/src/main/java/com/salesmanager/shop/controller/ImagesController.java b/sm-shop/src/main/java/com/salesmanager/shop/controller/ImagesController.java
index 95c47e7..d835eba 100644
--- a/sm-shop/src/main/java/com/salesmanager/shop/controller/ImagesController.java
+++ b/sm-shop/src/main/java/com/salesmanager/shop/controller/ImagesController.java
@@ -47,10 +47,10 @@ public class ImagesController {
 	 * @throws IOException
 	 * @throws ServiceException 
 	 */
-	@RequestMapping("/static/{storeCode}/{imageType}/{imageName}.{extension}")
+	@RequestMapping("/static/files/{storeCode}/{imageType}/{imageName}.{extension}")
 	public @ResponseBody byte[] printImage(@PathVariable final String storeCode, @PathVariable final String imageType, @PathVariable final String imageName, @PathVariable final String extension) throws IOException, ServiceException {
 
-		// example -> /static/mystore/CONTENT/myImage.png
+		// example -> /static/files/DEFAULT/CONTENT/myImage.png
 		
 		FileContentType imgType = null;
 		
diff --git a/sm-shop/src/main/java/com/salesmanager/shop/populator/catalog/ReadableProductPopulator.java b/sm-shop/src/main/java/com/salesmanager/shop/populator/catalog/ReadableProductPopulator.java
index d2efc35..1053123 100644
--- a/sm-shop/src/main/java/com/salesmanager/shop/populator/catalog/ReadableProductPopulator.java
+++ b/sm-shop/src/main/java/com/salesmanager/shop/populator/catalog/ReadableProductPopulator.java
@@ -125,7 +125,7 @@ public class ReadableProductPopulator extends
 			if(image!=null) {
 				ReadableImage rimg = new ReadableImage();
 				rimg.setImageName(image.getProductImage());
-				String imagePath = imageUtils.buildProductimageUtils(store, source.getSku(), image.getProductImage());
+				String imagePath = imageUtils.buildProductImageUtils(store, source.getSku(), image.getProductImage());
 				rimg.setImageUrl(imagePath);
 				rimg.setId(image.getId());
 				target.setImage(rimg);
@@ -137,7 +137,7 @@ public class ReadableProductPopulator extends
 					for(ProductImage img : images) {
 						ReadableImage prdImage = new ReadableImage();
 						prdImage.setImageName(img.getProductImage());
-						String imgPath = imageUtils.buildProductimageUtils(store, source.getSku(), img.getProductImage());
+						String imgPath = imageUtils.buildProductImageUtils(store, source.getSku(), img.getProductImage());
 						prdImage.setImageUrl(imgPath);
 						prdImage.setId(img.getId());
 						prdImage.setImageType(img.getImageType());
diff --git a/sm-shop/src/main/java/com/salesmanager/shop/populator/shoppingCart/ShoppingCartDataPopulator.java b/sm-shop/src/main/java/com/salesmanager/shop/populator/shoppingCart/ShoppingCartDataPopulator.java
index b2f76f4..256cf1e 100644
--- a/sm-shop/src/main/java/com/salesmanager/shop/populator/shoppingCart/ShoppingCartDataPopulator.java
+++ b/sm-shop/src/main/java/com/salesmanager/shop/populator/shoppingCart/ShoppingCartDataPopulator.java
@@ -114,7 +114,7 @@ public class ShoppingCartDataPopulator extends AbstractDataPopulator<ShoppingCar
                     shoppingCartItem.setSubTotal(pricingService.getDisplayAmount(item.getSubTotal(), store));
                     ProductImage image = item.getProduct().getProductImage();
                     if(image!=null && imageUtils!=null) {
-                        String imagePath = imageUtils.buildProductimageUtils(store, item.getProduct().getSku(), image.getProductImage());
+                        String imagePath = imageUtils.buildProductImageUtils(store, item.getProduct().getSku(), image.getProductImage());
                         shoppingCartItem.setImage(imagePath);
                     }
                     Set<com.salesmanager.core.model.shoppingcart.ShoppingCartAttributeItem> attributes = item.getAttributes();
diff --git a/sm-shop/src/main/java/com/salesmanager/shop/store/controller/product/ShopProductController.java b/sm-shop/src/main/java/com/salesmanager/shop/store/controller/product/ShopProductController.java
index e3f3a85..352a89e 100644
--- a/sm-shop/src/main/java/com/salesmanager/shop/store/controller/product/ShopProductController.java
+++ b/sm-shop/src/main/java/com/salesmanager/shop/store/controller/product/ShopProductController.java
@@ -249,7 +249,7 @@ public class ShopProductController {
 				}
 				
 				if(!StringUtils.isBlank(attribute.getProductOptionValue().getProductOptionValueImage())) {
-					attrValue.setImage(imageUtils.buildProductPropertyimageUtils(store, attribute.getProductOptionValue().getProductOptionValueImage()));
+					attrValue.setImage(imageUtils.buildProductPropertyImageUtils(store, attribute.getProductOptionValue().getProductOptionValueImage()));
 				}
 				
 				List<ProductOptionValueDescription> descriptions = optionValue.getDescriptionsSettoList();
diff --git a/sm-shop/src/main/java/com/salesmanager/shop/tags/ContentImageUrlTag.java b/sm-shop/src/main/java/com/salesmanager/shop/tags/ContentImageUrlTag.java
index db28c46..99f619a 100644
--- a/sm-shop/src/main/java/com/salesmanager/shop/tags/ContentImageUrlTag.java
+++ b/sm-shop/src/main/java/com/salesmanager/shop/tags/ContentImageUrlTag.java
@@ -55,15 +55,8 @@ public class ContentImageUrlTag extends RequestContextAwareTag {
 			if(this.getMerchantStore()!=null) {
 				merchantStore = this.getMerchantStore();
 			}
-			
-			//TODO TO BE REVISED
-			//StringBuilder imagePath = new StringBuilder();
-			//String baseUrl = filePathUtils.buildStoreUri(merchantStore, request);
-			//imagePath.append(baseUrl);	
-			
-			
-			String img = imageUtils.buildStaticimageUtils(merchantStore,this.getImageType(),this.getImageName());
-			//imagePath.append(img);
+
+			String img = imageUtils.buildStaticImageUtils(merchantStore,this.getImageType(),this.getImageName());
 
 			pageContext.getOut().print(img);
 
diff --git a/sm-shop/src/main/java/com/salesmanager/shop/tags/ProductImageUrlTag.java b/sm-shop/src/main/java/com/salesmanager/shop/tags/ProductImageUrlTag.java
index 5417253..a77d04b 100644
--- a/sm-shop/src/main/java/com/salesmanager/shop/tags/ProductImageUrlTag.java
+++ b/sm-shop/src/main/java/com/salesmanager/shop/tags/ProductImageUrlTag.java
@@ -61,7 +61,7 @@ public class ProductImageUrlTag extends RequestContextAwareTag {
 			
 			imagePath
 
-				.append(imageUtils.buildProductimageUtils(merchantStore, product, this.getImageName())).toString();
+				.append(imageUtils.buildProductImageUtils(merchantStore, product, this.getImageName())).toString();
 
 			System.out.println("Printing image " + imagePath.toString());
 
diff --git a/sm-shop/src/main/java/com/salesmanager/shop/tags/ShopProductImageUrlTag.java b/sm-shop/src/main/java/com/salesmanager/shop/tags/ShopProductImageUrlTag.java
index d07dbff..b2a3754 100644
--- a/sm-shop/src/main/java/com/salesmanager/shop/tags/ShopProductImageUrlTag.java
+++ b/sm-shop/src/main/java/com/salesmanager/shop/tags/ShopProductImageUrlTag.java
@@ -63,9 +63,9 @@ public class ShopProductImageUrlTag extends RequestContextAwareTag {
 			imagePath.append(baseUrl);
 			
 			if(StringUtils.isBlank(this.getSize()) || this.getSize().equals(SMALL)) {
-				imagePath.append(imageUtils.buildProductimageUtils(merchantStore, this.getSku(), this.getImageName())).toString();
+				imagePath.append(imageUtils.buildProductImageUtils(merchantStore, this.getSku(), this.getImageName())).toString();
 			} else {
-				imagePath.append(imageUtils.buildLargeProductimageUtils(merchantStore, this.getSku(), this.getImageName())).toString();
+				imagePath.append(imageUtils.buildLargeProductImageUtils(merchantStore, this.getSku(), this.getImageName())).toString();
 			}
 
 			//System.out.println("Printing image -M " + imagePath.toString());
diff --git a/sm-shop/src/main/java/com/salesmanager/shop/utils/AbstractimageFilePath.java b/sm-shop/src/main/java/com/salesmanager/shop/utils/AbstractimageFilePath.java
index 5a05f65..88c3e91 100644
--- a/sm-shop/src/main/java/com/salesmanager/shop/utils/AbstractimageFilePath.java
+++ b/sm-shop/src/main/java/com/salesmanager/shop/utils/AbstractimageFilePath.java
@@ -14,6 +14,7 @@ import com.salesmanager.shop.constants.Constants;
 
 public abstract class AbstractimageFilePath implements ImageFilePath {
 
+
 	public abstract String getBasePath();
 
 	public abstract void setBasePath(String basePath);
@@ -25,7 +26,7 @@ public abstract class AbstractimageFilePath implements ImageFilePath {
 	 * @param imageName
 	 * @return
 	 */
-	public String buildStaticimageUtils(MerchantStore store, String imageName) {
+	public String buildStaticImageUtils(MerchantStore store, String imageName) {
 		StringBuilder imgName = new StringBuilder().append(getBasePath()).append(Constants.SLASH).append(store.getCode()).append(Constants.SLASH).append(FileContentType.IMAGE.name()).append(Constants.SLASH);
 				if(!StringUtils.isBlank(imageName)) {
 					imgName.append(imageName);
@@ -41,8 +42,8 @@ public abstract class AbstractimageFilePath implements ImageFilePath {
 	 * @param imageName
 	 * @return
 	 */
-	public String buildStaticimageUtils(MerchantStore store, String type, String imageName) {
-		StringBuilder imgName = new StringBuilder().append(getBasePath()).append(Constants.SLASH).append(store.getCode()).append(Constants.SLASH).append(type).append(Constants.SLASH);
+	public String buildStaticImageUtils(MerchantStore store, String type, String imageName) {
+		StringBuilder imgName = new StringBuilder().append(getBasePath()).append(Constants.FILES_URI).append(Constants.SLASH).append(store.getCode()).append(Constants.SLASH).append(type).append(Constants.SLASH);
 		if(!StringUtils.isBlank(imageName)) {
 				imgName.append(imageName);
 		}
@@ -58,7 +59,7 @@ public abstract class AbstractimageFilePath implements ImageFilePath {
 	 * @param imageName
 	 * @return
 	 */
-	public String buildManufacturerimageUtils(MerchantStore store, Manufacturer manufacturer, String imageName) {
+	public String buildManufacturerImageUtils(MerchantStore store, Manufacturer manufacturer, String imageName) {
 		return new StringBuilder().append(getBasePath()).append(Constants.SLASH).append(store.getCode()).append(Constants.SLASH).
 				append(FileContentType.MANUFACTURER.name()).append(Constants.SLASH)
 				.append(manufacturer.getId()).append(Constants.SLASH)
@@ -73,7 +74,7 @@ public abstract class AbstractimageFilePath implements ImageFilePath {
 	 * @param imageName
 	 * @return
 	 */
-	public String buildProductimageUtils(MerchantStore store, Product product, String imageName) {
+	public String buildProductImageUtils(MerchantStore store, Product product, String imageName) {
 		return new StringBuilder().append(getBasePath()).append(Constants.SLASH).append(store.getCode()).append(Constants.SLASH).append(FileContentType.PRODUCT.name()).append(Constants.SLASH)
 				.append(product.getSku()).append(Constants.SLASH).append(imageName).toString();
 	}
@@ -86,7 +87,7 @@ public abstract class AbstractimageFilePath implements ImageFilePath {
 	 * @param imageName
 	 * @return
 	 */
-	public String buildProductimageUtils(MerchantStore store, String sku, String imageName) {
+	public String buildProductImageUtils(MerchantStore store, String sku, String imageName) {
 		return new StringBuilder().append(getBasePath()).append(Constants.SLASH).append(store.getCode()).append(Constants.SLASH).append(FileContentType.PRODUCT.name()).append(Constants.SLASH)
 				.append(sku).append(Constants.SLASH).append(imageName).toString();
 	}
@@ -98,7 +99,7 @@ public abstract class AbstractimageFilePath implements ImageFilePath {
 	 * @param imageName
 	 * @return
 	 */
-	public String buildLargeProductimageUtils(MerchantStore store, String sku, String imageName) {
+	public String buildLargeProductImageUtils(MerchantStore store, String sku, String imageName) {
 		return new StringBuilder().append(getBasePath()).append(Constants.SLASH).append(store.getCode()).append(Constants.SLASH).append(FileContentType.PRODUCTLG.name()).append(Constants.SLASH)
 				.append(sku).append(Constants.SLASH).append(imageName).toString();
 	}
@@ -121,12 +122,12 @@ public abstract class AbstractimageFilePath implements ImageFilePath {
 	 * @param imageName
 	 * @return
 	 */
-	public String buildProductPropertyimageFilePath(MerchantStore store, String imageName) {
+	public String buildProductPropertyImageFilePath(MerchantStore store, String imageName) {
 		return new StringBuilder().append(getBasePath()).append(Constants.SLASH).append(store.getCode()).append(Constants.SLASH).append(FileContentType.PROPERTY).append(Constants.SLASH)
 				.append(imageName).toString();
 	}
 	
-	public String buildProductPropertyimageUtils(MerchantStore store, String imageName) {
+	public String buildProductPropertyImageUtils(MerchantStore store, String imageName) {
 		return new StringBuilder().append(getBasePath()).append("/files/").append(store.getCode()).append("/").append(FileContentType.PROPERTY).append("/")
 				.append(imageName).toString();
 	}
diff --git a/sm-shop/src/main/java/com/salesmanager/shop/utils/ImageFilePath.java b/sm-shop/src/main/java/com/salesmanager/shop/utils/ImageFilePath.java
index 20f6ea4..b6fcea7 100644
--- a/sm-shop/src/main/java/com/salesmanager/shop/utils/ImageFilePath.java
+++ b/sm-shop/src/main/java/com/salesmanager/shop/utils/ImageFilePath.java
@@ -16,7 +16,7 @@ public interface ImageFilePath {
 	 * @param imageName
 	 * @return
 	 */
-	public String buildStaticimageUtils(MerchantStore store, String imageName);
+	public String buildStaticImageUtils(MerchantStore store, String imageName);
 	
 	/**
 	 * Builds a static content image file path that can be used by image servlet
@@ -25,7 +25,7 @@ public interface ImageFilePath {
 	 * @param imageName
 	 * @return
 	 */
-	public String buildStaticimageUtils(MerchantStore store, String type, String imageName);
+	public String buildStaticImageUtils(MerchantStore store, String type, String imageName);
 	
 	/**
 	 * Builds a manufacturer image file path that can be used by image servlet
@@ -35,7 +35,7 @@ public interface ImageFilePath {
 	 * @param imageName
 	 * @return
 	 */
-	public String buildManufacturerimageUtils(MerchantStore store, Manufacturer manufacturer, String imageName);
+	public String buildManufacturerImageUtils(MerchantStore store, Manufacturer manufacturer, String imageName);
 	
 	/**
 	 * Builds a product image file path that can be used by image servlet
@@ -45,7 +45,7 @@ public interface ImageFilePath {
 	 * @param imageName
 	 * @return
 	 */
-	public String buildProductimageUtils(MerchantStore store, Product product, String imageName);
+	public String buildProductImageUtils(MerchantStore store, Product product, String imageName);
 	
 	/**
 	 * Builds a default product image file path that can be used by image servlet
@@ -55,7 +55,7 @@ public interface ImageFilePath {
 	 * @param imageName
 	 * @return
 	 */
-	public String buildProductimageUtils(MerchantStore store, String sku, String imageName);
+	public String buildProductImageUtils(MerchantStore store, String sku, String imageName);
 	
 	/**
 	 * Builds a large product image file path that can be used by the image servlet
@@ -64,7 +64,7 @@ public interface ImageFilePath {
 	 * @param imageName
 	 * @return
 	 */
-	public String buildLargeProductimageUtils(MerchantStore store, String sku, String imageName);
+	public String buildLargeProductImageUtils(MerchantStore store, String sku, String imageName);
 
 
 	
@@ -81,7 +81,7 @@ public interface ImageFilePath {
 	 * @param imageName
 	 * @return
 	 */
-	public String buildProductPropertyimageUtils(MerchantStore store, String imageName);
+	public String buildProductPropertyImageUtils(MerchantStore store, String imageName);
 	
 	
 	/**
diff --git a/sm-shop/src/main/java/com/salesmanager/shop/utils/LocalImageFilePathUtils.java b/sm-shop/src/main/java/com/salesmanager/shop/utils/LocalImageFilePathUtils.java
index f5d1c61..5d47dc5 100644
--- a/sm-shop/src/main/java/com/salesmanager/shop/utils/LocalImageFilePathUtils.java
+++ b/sm-shop/src/main/java/com/salesmanager/shop/utils/LocalImageFilePathUtils.java
@@ -17,13 +17,11 @@ public class LocalImageFilePathUtils extends AbstractimageFilePath{
 
 	@Override
 	public String getBasePath() {
-		// TODO Auto-generated method stub
 		return basePath;
 	}
 
 	@Override
 	public void setBasePath(String context) {
-		// TODO Auto-generated method stub
 		this.basePath = context;
 	}
 	
@@ -35,7 +33,7 @@ public class LocalImageFilePathUtils extends AbstractimageFilePath{
 	 * @return
 	 */
 	public String buildStaticimageUtils(MerchantStore store, String imageName) {
-		StringBuilder imgName = new StringBuilder().append(getBasePath()).append("/files/").append(store.getCode()).append("/").append(FileContentType.IMAGE.name()).append("/");
+		StringBuilder imgName = new StringBuilder().append(getBasePath()).append(Constants.FILES_URI).append(Constants.SLASH).append(store.getCode()).append("/").append(FileContentType.IMAGE.name()).append("/");
 				if(!StringUtils.isBlank(imageName)) {
 					imgName.append(imageName);
 				}
@@ -51,7 +49,7 @@ public class LocalImageFilePathUtils extends AbstractimageFilePath{
 	 * @return
 	 */
 	public String buildStaticimageUtils(MerchantStore store, String type, String imageName) {
-		StringBuilder imgName = new StringBuilder().append(getBasePath()).append("/files/").append(store.getCode()).append("/").append(type).append("/");
+		StringBuilder imgName = new StringBuilder().append(getBasePath()).append(Constants.FILES_URI).append(Constants.SLASH).append(store.getCode()).append("/").append(type).append("/");
 		if(!StringUtils.isBlank(imageName)) {
 				imgName.append(imageName);
 		}
@@ -120,7 +118,7 @@ public class LocalImageFilePathUtils extends AbstractimageFilePath{
 	 * @return
 	 */
 	public String buildStoreLogoFilePath(MerchantStore store) {
-		return new StringBuilder().append(getBasePath()).append("/files/").append(store.getCode()).append("/").append(FileContentType.LOGO).append("/")
+		return new StringBuilder().append(getBasePath()).append(Constants.FILES_URI).append(Constants.SLASH).append(store.getCode()).append("/").append(FileContentType.LOGO).append("/")
 				.append(store.getStoreLogo()).toString();
 	}
 	
@@ -131,7 +129,7 @@ public class LocalImageFilePathUtils extends AbstractimageFilePath{
 	 * @return
 	 */
 	public String buildProductPropertyimageUtils(MerchantStore store, String imageName) {
-		return new StringBuilder().append(getBasePath()).append("/files/").append(store.getCode()).append("/").append(FileContentType.PROPERTY).append("/")
+		return new StringBuilder().append(getBasePath()).append(Constants.FILES_URI).append(Constants.SLASH).append(store.getCode()).append("/").append(FileContentType.PROPERTY).append("/")
 				.append(imageName).toString();
 	}
 	
diff --git a/sm-shop/src/main/resources/spring/shopizer-servlet-context.xml b/sm-shop/src/main/resources/spring/shopizer-servlet-context.xml
index 3b9f6f7..2e8c485 100644
--- a/sm-shop/src/main/resources/spring/shopizer-servlet-context.xml
+++ b/sm-shop/src/main/resources/spring/shopizer-servlet-context.xml
@@ -28,10 +28,11 @@
 	</beans:bean> -->
 	
 
-	<!-- Only needed because we require fileupload in the org.springframework.samples.mvc.fileupload package -->
+ 	<!-- Only needed because we require fileupload in the org.springframework.samples.mvc.fileupload package -->
+ 	<!--
 	<beans:bean id="multipartResolver" class="org.springframework.web.multipart.commons.CommonsMultipartResolver">
 		<beans:property name="maxUploadSize" value="10000000"/>
-	</beans:bean>
+	</beans:bean> -->
 	
 	
 	<beans:bean id="localeResolver"
diff --git a/sm-shop/src/main/webapp/pages/admin/merchant/branding.jsp b/sm-shop/src/main/webapp/pages/admin/merchant/branding.jsp
index e0ab649..6f6acd6 100644
--- a/sm-shop/src/main/webapp/pages/admin/merchant/branding.jsp
+++ b/sm-shop/src/main/webapp/pages/admin/merchant/branding.jsp
@@ -55,7 +55,7 @@
 		<div class="tab-pane active" id="catalogue-section">
 		
 				<c:url var="saveBrandingImage" value="/admin/store/saveBranding.html" />
-				<form:form method="POST" enctype="multipart/form-data" commandName="contentImages" action="${saveBrandingImage}">
+				<form:form method="POST" enctype="multipart/form-data" action="${saveBrandingImage}">
 
 					<form:errors path="*" cssClass="alert alert-error" element="div" />
 					<div id="store.success" class="alert alert-success"
@@ -72,8 +72,7 @@
 						
 									   <c:choose>
 				                        		<c:when test="${store.storeLogo==null}">
-				                                    
-				                                    <input class="input-file" id="file" name="file[0]" type="file"><br/>
+				                                    <input class="input-file" name="file" type="file"><br/>
 				                                </c:when>
 				                                <c:otherwise>
 				                                	<img src="<c:url value=""/><sm:contentImage imageName="${store.storeLogo}" imageType="LOGO"/>">
diff --git a/sm-shop/target/m2e-wtp/web-resources/META-INF/maven/com.shopizer/sm-shop/pom.properties b/sm-shop/target/m2e-wtp/web-resources/META-INF/maven/com.shopizer/sm-shop/pom.properties
index a2629b5..2f49009 100644
--- a/sm-shop/target/m2e-wtp/web-resources/META-INF/maven/com.shopizer/sm-shop/pom.properties
+++ b/sm-shop/target/m2e-wtp/web-resources/META-INF/maven/com.shopizer/sm-shop/pom.properties
@@ -1,5 +1,5 @@
 #Generated by Maven Integration for Eclipse
-#Mon Nov 28 12:12:04 EST 2016
+#Tue Nov 29 11:28:55 EST 2016
 version=2.5.0-SNAPSHOT
 groupId=com.shopizer
 m2e.projectName=sm-shop