├── .classpath ├── .gitattributes ├── .gitignore ├── .project ├── .travis.yml ├── Documentry.docx ├── LICENSE.md ├── README.md ├── _config.yml ├── pom.xml ├── src └── main │ ├── java │ └── com │ │ ├── controller │ │ ├── CartController.java │ │ ├── CartItemController.java │ │ ├── HomeController.java │ │ ├── OrderController.java │ │ ├── ProductController.java │ │ └── UserController.java │ │ ├── dao │ │ ├── CartDao.java │ │ ├── CartDaoImpl.java │ │ ├── CartItemDao.java │ │ ├── CartItemDaoImpl.java │ │ ├── CustomerDao.java │ │ ├── CustomerDaoImpl.java │ │ ├── CustomerOrderDao.java │ │ ├── CustomerOrderDaoImpl.java │ │ ├── ProductDao.java │ │ ├── ProductDaoImpl.java │ │ ├── QueriesDao.java │ │ ├── QueriesDaoImpl.java │ │ ├── UserDao.java │ │ └── UserDaoImpl.java │ │ ├── model │ │ ├── Authorities.java │ │ ├── BillingAddress.java │ │ ├── Cart.java │ │ ├── CartItem.java │ │ ├── Customer.java │ │ ├── CustomerOrder.java │ │ ├── Product.java │ │ ├── Queries.java │ │ ├── ShippingAddress.java │ │ └── User.java │ │ └── service │ │ ├── CartItemService.java │ │ ├── CartItemServiceImpl.java │ │ ├── CartService.java │ │ ├── CartServiceImpl.java │ │ ├── CustomerOrderService.java │ │ ├── CustomerOrderServiceImpl.java │ │ ├── CustomerService.java │ │ ├── CustomerServiceImpl.java │ │ ├── ProductService.java │ │ ├── ProductServiceImpl.java │ │ ├── QueriesService.java │ │ ├── QueriesServiceImpl.java │ │ ├── UserService.java │ │ └── UserServiceImpl.java │ └── webapp │ ├── WEB-INF │ ├── applicationContext.xml │ ├── dispatcher-servlet.xml │ ├── flow │ │ └── checkout │ │ │ ├── checkOutCancelled.jsp │ │ │ ├── checkout-flow.xml │ │ │ ├── collectCustomerInfo.jsp │ │ │ ├── collectShippingDetail.jsp │ │ │ ├── invalidCartWarning.jsp │ │ │ ├── orderConfirmation.jsp │ │ │ └── thankCustomer.jsp │ ├── page │ │ ├── UserList.jsp │ │ ├── aboutUs.jsp │ │ ├── addProduct.jsp │ │ ├── cart.jsp │ │ ├── contactUs.jsp │ │ ├── countdown.jsp │ │ ├── editProduct.jsp │ │ ├── footer.jsp │ │ ├── hello.jsp │ │ ├── index1.jsp │ │ ├── login.jsp │ │ ├── navbar.jsp │ │ ├── productGrid.jsp │ │ ├── productList.jsp │ │ ├── productListAngular.jsp │ │ ├── productPage.jsp │ │ ├── register.jsp │ │ ├── slider.jsp │ │ ├── thankCustomer.jsp │ │ └── userInfoView.jsp │ ├── resource │ │ ├── bootstrap │ │ │ ├── css │ │ │ │ ├── bootstrap-theme.css │ │ │ │ ├── bootstrap-theme.css.map │ │ │ │ ├── bootstrap-theme.min.css │ │ │ │ ├── bootstrap.css │ │ │ │ ├── bootstrap.css.map │ │ │ │ └── bootstrap.min.css │ │ │ ├── fonts │ │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ │ ├── glyphicons-halflings-regular.svg │ │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ │ └── glyphicons-halflings-regular.woff2 │ │ │ └── js │ │ │ │ ├── bootstrap.js │ │ │ │ ├── bootstrap.min.js │ │ │ │ └── npm.js │ │ ├── countdown │ │ │ ├── countdown.jquery.json │ │ │ ├── demo.css │ │ │ ├── jquery.countdown.css │ │ │ ├── jquery.countdown.js │ │ │ └── jquery.countdown.min.js │ │ ├── css │ │ │ ├── ProductList.css │ │ │ ├── aboutus.css │ │ │ ├── form-elements.css │ │ │ ├── header.css │ │ │ ├── overall.css │ │ │ ├── register.css │ │ │ └── style.css │ │ ├── images │ │ │ ├── 1.jpg │ │ │ ├── aboutImage.png │ │ │ ├── favicon1.png │ │ │ ├── oppo.jpg │ │ │ ├── oppo1.jpg │ │ │ ├── oppo2.jpg │ │ │ ├── oppo3.jpg │ │ │ ├── oppo4.png │ │ │ ├── products │ │ │ │ ├── 1.jpg │ │ │ │ ├── 2.jpg │ │ │ │ ├── 3.jpg │ │ │ │ ├── 4.jpg │ │ │ │ ├── 5.jpg │ │ │ │ ├── 6.jpg │ │ │ │ ├── five.jpg │ │ │ │ ├── seven.jpg │ │ │ │ └── two.jpg │ │ │ ├── screenshots │ │ │ │ ├── AdminLogin.jpg │ │ │ │ ├── AdminLoginAddProduct.jpg │ │ │ │ ├── AdminLoginProductList.jpg │ │ │ │ ├── AdminLoginUserManagement.jpg │ │ │ │ ├── ConfirmCustomerDetails.png │ │ │ │ ├── ConfirmShippingAddress.png │ │ │ │ ├── ContactUs.png │ │ │ │ ├── Home.jpg │ │ │ │ ├── LoginForm.jpg │ │ │ │ ├── Receipt.png │ │ │ │ ├── SpringSecurity.jpg │ │ │ │ ├── ThankYou.png │ │ │ │ ├── UserLoginProductList.jpg │ │ │ │ ├── cartList.jpg │ │ │ │ └── registrationForm.jpg │ │ │ └── shopieasy-logo.png │ │ └── js │ │ │ ├── jquery-1.11.1.js │ │ │ ├── jquery.backstretch.js │ │ │ ├── jquery.backstretch.min.js │ │ │ ├── jquery.js │ │ │ ├── placeholder.js │ │ │ ├── productController.js │ │ │ ├── retina-1.1.0.js │ │ │ ├── retina-1.1.0.min.js │ │ │ └── scripts.js │ └── web.xml │ └── index.jsp └── target └── m2e-wtp └── web-resources └── META-INF └── MANIFEST.MF /.classpath: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | 7 | # Standard to msysgit 8 | *.doc diff=astextplain 9 | *.DOC diff=astextplain 10 | *.docx diff=astextplain 11 | *.DOCX diff=astextplain 12 | *.dot diff=astextplain 13 | *.DOT diff=astextplain 14 | *.pdf diff=astextplain 15 | *.PDF diff=astextplain 16 | *.rtf diff=astextplain 17 | *.RTF diff=astextplain 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Windows image file caches 2 | Thumbs.db 3 | ehthumbs.db 4 | 5 | # Folder config file 6 | Desktop.ini 7 | 8 | # Recycle Bin used on file shares 9 | $RECYCLE.BIN/ 10 | 11 | # Windows Installer files 12 | *.cab 13 | *.msi 14 | *.msm 15 | *.msp 16 | 17 | # Windows shortcuts 18 | *.lnk 19 | 20 | # ========================= 21 | # Operating System Files 22 | # ========================= 23 | target/ 24 | 25 | # IDE configurations 26 | *.iml 27 | .settings/ 28 | .idea/ 29 | 30 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | pages 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.jdt.core.javabuilder 10 | 11 | 12 | 13 | 14 | org.eclipse.wst.common.project.facet.core.builder 15 | 16 | 17 | 18 | 19 | org.eclipse.wst.validation.validationbuilder 20 | 21 | 22 | 23 | 24 | org.hibernate.eclipse.console.hibernateBuilder 25 | 26 | 27 | 28 | 29 | org.eclipse.m2e.core.maven2Builder 30 | 31 | 32 | 33 | 34 | 35 | org.eclipse.jem.workbench.JavaEMFNature 36 | org.eclipse.wst.common.modulecore.ModuleCoreNature 37 | org.eclipse.jdt.core.javanature 38 | org.eclipse.m2e.core.maven2Nature 39 | org.eclipse.wst.common.project.facet.core.nature 40 | org.eclipse.wst.jsdt.core.jsNature 41 | org.hibernate.eclipse.console.hibernateNature 42 | 43 | 44 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | jdk: oraclejdk8 3 | 4 | 5 | install: true 6 | script: 7 | - ./mvnw clean install 8 | 9 | cache: 10 | directories: 11 | - $HOME/.m2 -------------------------------------------------------------------------------- /Documentry.docx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/Documentry.docx -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2022 Karl Hegner 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # ShoppingCart - An amazing website 2 | 3 | 4 | We developed an end to end **Ecommerce web Application using Spring MVC** with multiple 5 | modules 6 | 7 | ### Functionalities: 8 | 9 | 1. User Registeration Cell. 10 | 11 | 2. **CRUD Operations** like 12 | 13 | * User can add product to their cart and purchase summary. 14 | * Admin can add product to the product list. 15 | * Admin can edit the product details. 16 | * Admin can delete the product from the list. 17 | 18 | 3. **Spring Security** 19 | 20 | * User can login into the site. 21 | * The entire site will change according to the role, depending on whether the client is User or Admin. 22 | * User can logout after completing. 23 | 24 | 4. **Spring WebFlow** 25 | 26 | * After adding products the cart the User can checkout using spring WebFlow. 27 | * Confirming User Details. 28 | * Confirming Shipping and Billing Address. 29 | * Receipt. 30 | * If the user cancels the webflow, it will go to cancel Page. 31 | * If the user submits the checkout, it will go to thank you page with the timing of delivery Report. 32 | 33 | ### Tools and Technologies: 34 | 35 | * **Technology** : Bootstrap, Java, Spring MVC, Hibernate, JSP, Maven. 36 | * **Application Servicer**: Apache Tomcat Server. 37 | * **Database** : H2 Database (In memory database) 38 | 39 | ### Installation: 40 | 41 | 1. Development Platform - Eclipse / IntelliJ Idea 42 | * [Download Eclipse](https://www.eclipse.org/downloads/packages/eclipse-ide-java-ee-developers/mars2). 43 | * [Download IntelliJ Idea](https://www.jetbrains.com/idea/download/#section=windows). 44 | 2. Server - Apache Tomcat Server 45 | 46 | * [Download Apache Server](https://tomcat.apache.org/download-70.cgi). 47 | 48 | 3. Build Tool - Maven 49 | 50 | * [Download Maven](https://maven.apache.org/download.cgi). 51 | 52 | 4. Database - H2 Database 53 | 54 | * [Download H2 Database](http://www.h2database.com/html/download.html). 55 | 56 | 5. Configuring tomcat with Eclipse (windows) - [Click Here](https://javatutorial.net/run-tomcat-from-eclipse). 57 | 58 | 6. Installation of maven in eclipse - [Click Here](https://stackoverflow.com/questions/8620127/maven-in-eclipse-step-by-step-installation). 59 | 60 | 7. Clone the repository and import it to eclipse. 61 | 62 | 8. Run your H2 Database. 63 | 64 | 9. Configure your databse configuration in **application-context.xml**. 65 | 66 | * Database properties: 67 | 68 | 69 | 70 | 71 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | * Database Dialect: 80 | 81 | YOUR DB DIALECT 82 | 83 | 10. Run the server. 84 | 85 | #### Somethings wrong!! 86 | 87 | If you find that something's wrong with this package, you can let me know by raising an issue on the GitHub issue tracker, 88 | or take it as a task and 🧑‍💻 resolve it 💪 --> create a PullRequest 🛠. 89 | 90 | #### Contribution 91 | 92 | Contributors are most welcome. 93 | 94 | ### ScreenShots: 95 | 96 | * Home Page: 97 | 98 | ![Alt text](https://github.com/shardwiz/java-spring-boot-ecommerce/blob/master/src/main/webapp/WEB-INF/resource/images/screenshots/Home.jpg "Home Page") 99 | 100 | * Contact Us: 101 | 102 | ![Alt text](https://github.com/shardwiz/java-spring-boot-ecommerce/blob/master/src/main/webapp/WEB-INF/resource/images/screenshots/ContactUs.png) 103 | 104 | * Product Management: 105 | 106 | ![Alt text](https://github.com/shardwiz/java-spring-boot-ecommerce/blob/master/src/main/webapp/WEB-INF/resource/images/screenshots/AdminLoginProductList.jpg) -------------------------------------------------------------------------------- /_config.yml: -------------------------------------------------------------------------------- 1 | theme: jekyll-theme-time-machine -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | com.demo 5 | war 6 | 0.0.1-SNAPSHOT 7 | pages Maven Webapp 8 | http://maven.apache.org 9 | 10 | 11 | junit 12 | junit 13 | 3.8.1 14 | test 15 | 16 | 17 | org.springframework 18 | spring-webmvc 19 | 4.3.18.RELEASE 20 | 21 | 22 | org.springframework 23 | spring-core 24 | 4.3.18.RELEASE 25 | 26 | 27 | org.springframework 28 | spring-orm 29 | 4.3.18.RELEASE 30 | 31 | 32 | jstl 33 | jstl 34 | 1.2 35 | 36 | 37 | taglibs 38 | standard 39 | 1.1.2 40 | 41 | 42 | org.hibernate 43 | hibernate-core 44 | 4.0.1.Final 45 | 46 | 47 | org.hibernate.javax.persistence 48 | hibernate-jpa-2.0-api 49 | 1.0.1.Final 50 | 51 | 52 | com.h2database 53 | h2 54 | 1.4.191 55 | 56 | 57 | 58 | javax.servlet 59 | servlet-api 60 | 2.5 61 | provided 62 | 63 | 64 | 65 | org.hibernate 66 | hibernate-validator 67 | 5.2.4.Final 68 | 69 | 70 | 71 | 72 | javax.validation 73 | validation-api 74 | 1.1.0.Final 75 | 76 | 77 | 78 | org.springframework 79 | spring-context 80 | 4.3.18.RELEASE 81 | 82 | 83 | 84 | org.hibernate.common 85 | hibernate-commons-annotations 86 | 4.0.1.Final 87 | 88 | 89 | commons-fileupload 90 | commons-fileupload 91 | 1.2.2 92 | 93 | 94 | commons-io 95 | commons-io 96 | 2.4 97 | 98 | 99 | 100 | org.springframework.security 101 | spring-security-config 102 | 4.1.5.RELEASE 103 | 104 | 105 | org.springframework.security 106 | spring-security-core 107 | 4.1.5.RELEASE 108 | 109 | 110 | org.springframework.security 111 | spring-security-taglibs 112 | 4.1.5.RELEASE 113 | 114 | 115 | org.springframework.security 116 | spring-security-web 117 | 4.1.5.RELEASE 118 | 119 | 120 | com.fasterxml.jackson.core 121 | jackson-core 122 | 2.9.8 123 | 124 | 125 | com.fasterxml.jackson.core 126 | jackson-annotations 127 | 2.9.8 128 | 129 | 130 | com.fasterxml.jackson.core 131 | jackson-databind 132 | 2.9.8 133 | 134 | 135 | org.springframework.webflow 136 | spring-webflow 137 | 2.3.3.RELEASE 138 | 139 | 140 | 141 | 142 | shopieasy 143 | 144 | shopieasy 145 | 146 | -------------------------------------------------------------------------------- /src/main/java/com/controller/CartController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.security.core.context.SecurityContextHolder; 5 | import org.springframework.security.core.userdetails.User; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.ui.Model; 8 | import org.springframework.web.bind.annotation.PathVariable; 9 | import org.springframework.web.bind.annotation.RequestMapping; 10 | import org.springframework.web.bind.annotation.ResponseBody; 11 | 12 | import com.model.Cart; 13 | import com.model.Customer; 14 | import com.service.CartService; 15 | import com.service.CustomerService; 16 | 17 | @Controller 18 | public class CartController { 19 | 20 | @Autowired 21 | private CustomerService customerService; 22 | 23 | @Autowired 24 | private CartService cartService; 25 | 26 | public CustomerService getCustomerService() { 27 | return customerService; 28 | } 29 | 30 | public void setCustomerService(CustomerService customerService) { 31 | this.customerService = customerService; 32 | } 33 | 34 | public CartService getCartService() { 35 | return cartService; 36 | } 37 | 38 | public void setCartService(CartService cartService) { 39 | this.cartService = cartService; 40 | } 41 | 42 | @GetMapping("cart/getCartById") 43 | public String getCartId(Model model){ 44 | User user = (User)SecurityContextHolder.getContext().getAuthentication().getPrincipal(); 45 | String emailId = user.getUsername(); 46 | Customer customer = customerService.getCustomerByemailId(emailId); 47 | model.addAttribute("cartId", customer.getCart().getCartId()); 48 | return "cart"; 49 | } 50 | 51 | @GetMapping("/cart/getCart/{cartId}") 52 | public @ResponseBody Cart getCartItems(@PathVariable("cartId") String cartId){ 53 | return cartService.getCartByCartId(cartId); 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/controller/CartItemController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.http.HttpStatus; 7 | import org.springframework.security.core.context.SecurityContextHolder; 8 | import org.springframework.security.core.userdetails.User; 9 | import org.springframework.stereotype.Controller; 10 | import org.springframework.web.bind.annotation.PathVariable; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.ResponseStatus; 13 | 14 | import com.model.Cart; 15 | import com.model.CartItem; 16 | import com.model.Customer; 17 | import com.model.Product; 18 | import com.service.CartItemService; 19 | import com.service.CartService; 20 | import com.service.CustomerService; 21 | import com.service.ProductService; 22 | 23 | @Controller 24 | public class CartItemController { 25 | 26 | @Autowired 27 | private CartService cartService; 28 | 29 | @Autowired 30 | private CartItemService cartItemService; 31 | 32 | @Autowired 33 | private CustomerService customerService; 34 | 35 | @Autowired 36 | private ProductService productService; 37 | 38 | 39 | public CustomerService getCustomerService() { 40 | return customerService; 41 | } 42 | 43 | public void setCustomerService(CustomerService customerService) { 44 | this.customerService = customerService; 45 | } 46 | 47 | public ProductService getProductService() { 48 | return productService; 49 | } 50 | 51 | public void setProductService(ProductService productService) { 52 | this.productService = productService; 53 | } 54 | 55 | public CartService getCartService() { 56 | return cartService; 57 | } 58 | 59 | public void setCartService(CartService cartService) { 60 | this.cartService = cartService; 61 | } 62 | 63 | public CartItemService getCartItemService() { 64 | return cartItemService; 65 | } 66 | 67 | public void setCartItemService(CartItemService cartItemService) { 68 | this.cartItemService = cartItemService; 69 | } 70 | 71 | @RequestMapping("/cart/add/{productId}") 72 | @ResponseStatus(value = HttpStatus.NO_CONTENT) 73 | public void addCartItem(@PathVariable(value = "productId") String productId) { 74 | User user = (User) SecurityContextHolder.getContext().getAuthentication().getPrincipal(); 75 | String emailId = user.getUsername(); 76 | Customer customer = customerService.getCustomerByemailId(emailId); 77 | System.out.println("Customer : " + customer.getUsers().getEmailId()); 78 | Cart cart = customer.getCart(); 79 | System.out.println(cart); 80 | List cartItems = cart.getCartItem(); 81 | Product product = productService.getProductById(productId); 82 | for (int i = 0; i < cartItems.size(); i++) { 83 | CartItem cartItem = cartItems.get(i); 84 | if (product.getProductId().equals(cartItem.getProduct().getProductId())) { 85 | cartItem.setQuality(cartItem.getQuality() + 1); 86 | cartItem.setPrice(cartItem.getQuality() * cartItem.getProduct().getProductPrice()); 87 | cartItemService.addCartItem(cartItem); 88 | return; 89 | } 90 | } 91 | CartItem cartItem = new CartItem(); 92 | cartItem.setQuality(1); 93 | cartItem.setProduct(product); 94 | cartItem.setPrice(product.getProductPrice() * 1); 95 | cartItem.setCart(cart); 96 | cartItemService.addCartItem(cartItem); 97 | } 98 | 99 | @RequestMapping("/cart/removeCartItem/{cartItemId}") 100 | @ResponseStatus(value = HttpStatus.NO_CONTENT) 101 | public void removeCartItem(@PathVariable(value = "cartItemId") String cartItemId) { 102 | cartItemService.removeCartItem(cartItemId); 103 | } 104 | 105 | @RequestMapping("/cart/removeAllItems/{cartId}") 106 | @ResponseStatus(value = HttpStatus.NO_CONTENT) 107 | public void removeAllCartItems(@PathVariable(value = "cartId") String cartId) { 108 | Cart cart = cartService.getCartByCartId(cartId); 109 | cartItemService.removeAllCartItems(cart); 110 | } 111 | 112 | } 113 | -------------------------------------------------------------------------------- /src/main/java/com/controller/HomeController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | 3 | import javax.validation.Valid; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.ui.Model; 8 | import org.springframework.validation.BindingResult; 9 | import org.springframework.web.bind.annotation.ModelAttribute; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RequestMethod; 12 | import org.springframework.web.bind.annotation.RequestParam; 13 | import org.springframework.web.servlet.ModelAndView; 14 | 15 | import com.model.Queries; 16 | import com.service.QueriesService; 17 | 18 | @Controller 19 | public class HomeController { 20 | 21 | @RequestMapping({ "/index", "/index1" }) 22 | public String sayIndex() { 23 | return "index1"; 24 | } 25 | 26 | @RequestMapping("/hello") 27 | public ModelAndView sayHello() { 28 | return new ModelAndView("hello", "hello", "Hello Mr.Ismail"); 29 | } 30 | 31 | @RequestMapping("/login") 32 | public String login(@RequestParam(value = "error", required = false) String error, 33 | @RequestParam(value = "logout", required = false) String logout, Model model) { 34 | if (error != null) 35 | model.addAttribute("error", "Invalid username and Password"); 36 | if (logout != null) 37 | model.addAttribute("logout", "You have logged out successfully"); 38 | return "login"; 39 | } 40 | 41 | @RequestMapping("/aboutus") 42 | public String sayAbout() { 43 | return "aboutUs"; 44 | } 45 | 46 | @Autowired 47 | private QueriesService queryService; 48 | 49 | @RequestMapping(value = "/contactus") 50 | public ModelAndView getQuery() { 51 | Queries query = new Queries(); 52 | return new ModelAndView("contactUs", "contact", query); 53 | } 54 | 55 | @RequestMapping(value = "/contactus", method = RequestMethod.POST) 56 | public String addQuery(@Valid @ModelAttribute(value = "contact") Queries query, Model model, BindingResult result) { 57 | 58 | if (result.hasErrors()) 59 | return "contactUs"; 60 | 61 | queryService.addQuery(query); 62 | model.addAttribute("querySuccess", 63 | "Thank you, Your Message stored in our Server we will contact through corresponding Mail"); 64 | return "login"; 65 | 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/controller/OrderController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Controller; 5 | import org.springframework.web.bind.annotation.PathVariable; 6 | import org.springframework.web.bind.annotation.RequestMapping; 7 | 8 | import com.model.Cart; 9 | import com.model.Customer; 10 | import com.model.CustomerOrder; 11 | import com.service.CartService; 12 | import com.service.CustomerOrderService; 13 | 14 | @Controller 15 | public class OrderController { 16 | 17 | @Autowired 18 | private CartService cartService; 19 | 20 | @Autowired 21 | private CustomerOrderService customerOrderService; 22 | 23 | @RequestMapping("/order/{cartId}") 24 | public String createOrder(@PathVariable("cartId") String cartId) { 25 | 26 | CustomerOrder customerOrder = new CustomerOrder(); 27 | 28 | Cart cart = cartService.getCartByCartId(cartId); 29 | // Update CartId for customerOrder - set CartId 30 | customerOrder.setCart(cart); 31 | 32 | Customer customer = cart.getCustomer(); 33 | 34 | customerOrder.setCustomer(customer); 35 | // Set customerid 36 | // Set ShippingAddressId 37 | customerOrder.setShippingAddress(customer.getShippingAddress()); 38 | 39 | customerOrder.setBillingAddress(customer.getBillingAddress()); 40 | 41 | customerOrderService.addCustomerOrder(customerOrder); 42 | 43 | return "redirect:/checkout?cartId=" + cartId; 44 | } 45 | } 46 | -------------------------------------------------------------------------------- /src/main/java/com/controller/ProductController.java: -------------------------------------------------------------------------------- 1 | 2 | package com.controller; 3 | 4 | import java.io.File; 5 | import java.io.IOException; 6 | import java.nio.file.Files; 7 | import java.nio.file.Path; 8 | import java.nio.file.Paths; 9 | import java.util.List; 10 | 11 | import javax.validation.Valid; 12 | 13 | import org.springframework.beans.factory.annotation.Autowired; 14 | import org.springframework.context.annotation.Bean; 15 | import org.springframework.stereotype.Controller; 16 | import org.springframework.ui.Model; 17 | import org.springframework.validation.BindingResult; 18 | import org.springframework.web.bind.annotation.ModelAttribute; 19 | import org.springframework.web.bind.annotation.PathVariable; 20 | import org.springframework.web.bind.annotation.RequestMapping; 21 | import org.springframework.web.bind.annotation.RequestMethod; 22 | import org.springframework.web.bind.annotation.ResponseBody; 23 | import org.springframework.web.multipart.MultipartFile; 24 | import org.springframework.web.multipart.MultipartResolver; 25 | import org.springframework.web.multipart.commons.CommonsMultipartResolver; 26 | import org.springframework.web.servlet.ModelAndView; 27 | 28 | import com.model.Product; 29 | import com.service.ProductService; 30 | 31 | @Controller 32 | public class ProductController { 33 | 34 | @Autowired 35 | private ProductService productService; 36 | 37 | // Getters and Setters 38 | 39 | public ProductService getProductService() { 40 | return productService; 41 | } 42 | 43 | public void setProductService(ProductService productService) { 44 | this.productService = productService; 45 | } 46 | 47 | // Configuration for MultiPartResolver 48 | // Multipart resolver is for uploading images and other media 49 | // maxupload size is for image size should not be maximum than 10240000 50 | 51 | @Bean 52 | public MultipartResolver multipartResolver() { 53 | CommonsMultipartResolver multipartResolver = new CommonsMultipartResolver(); 54 | multipartResolver.setMaxUploadSize(10240000); 55 | return multipartResolver; 56 | } 57 | 58 | // Request Mapping 59 | 60 | // which displays the list of products to the productList page 61 | 62 | /* Product List using Angular 63 | * @RequestMapping("/getAllProducts") 64 | * public ModelAndView getAllProducts() { 65 | * List products = productService.getAllProducts(); 66 | * return new ModelAndView("productListAngular", "products", products); 67 | *} 68 | */ 69 | // Normal ProductList view 70 | @RequestMapping("/getAllProducts") public ModelAndView getAllProducts() { 71 | List products = productService.getAllProducts(); return new 72 | ModelAndView("productList", "products", products); } 73 | 74 | 75 | // this is used for getting the product by productId 76 | 77 | @RequestMapping("getProductById/{productId}") 78 | public ModelAndView getProductById(@PathVariable(value = "productId") String productId) { 79 | Product product = productService.getProductById(productId); 80 | return new ModelAndView("productPage", "productObj", product); 81 | } 82 | 83 | @RequestMapping("/admin/delete/{productId}") 84 | public String deleteProduct(@PathVariable(value = "productId") String productId) { 85 | 86 | // Here the Path class is used to refer the path of the file 87 | 88 | Path path = Paths.get("C:/Users/Ismail/workspace/ShoppingCart/src/main/webapp/WEB-INF/resource/images/products/" 89 | + productId + ".jpg"); 90 | 91 | if (Files.exists(path)) { 92 | try { 93 | Files.delete(path); 94 | } catch (IOException e) { 95 | e.printStackTrace(); 96 | } 97 | } 98 | 99 | productService.deleteProduct(productId); 100 | // http://localhost:8080/shoppingCart/getAllProducts 101 | return "redirect:/getAllProducts"; 102 | } 103 | 104 | @RequestMapping(value = "/admin/product/addProduct", method = RequestMethod.GET) 105 | public String getProductForm(Model model) { 106 | Product product = new Product(); 107 | // New Arrivals 108 | // set the category as 1 for the Book book 109 | product.setProductCategory("Android"); 110 | model.addAttribute("productFormObj", product); 111 | return "addProduct"; 112 | 113 | } 114 | 115 | @RequestMapping(value = "/admin/product/addProduct", method = RequestMethod.POST) 116 | public String addProduct(@Valid @ModelAttribute(value = "productFormObj") Product product, BindingResult result) { 117 | // Binding Result is used if the form that has any error then it will 118 | // redirect to the same page without performing any functions 119 | if (result.hasErrors()) 120 | return "addProduct"; 121 | productService.addProduct(product); 122 | MultipartFile image = product.getProductImage(); 123 | if (image != null && !image.isEmpty()) { 124 | Path path = Paths 125 | .get("C:/Users/Ismail/workspace/ShoppingCart/src/main/webapp/WEB-INF/resource/images/products/" 126 | + product.getProductId() + ".jpg"); 127 | 128 | try { 129 | image.transferTo(new File(path.toString())); 130 | } catch (IllegalStateException e) { 131 | e.printStackTrace(); 132 | } catch (IOException e) { 133 | // TODO Auto-generated catch block 134 | e.printStackTrace(); 135 | } 136 | 137 | } 138 | return "redirect:/getAllProducts"; 139 | } 140 | 141 | @RequestMapping(value = "/admin/product/editProduct/{productId}") 142 | public ModelAndView getEditForm(@PathVariable(value = "productId") String productId) { 143 | Product product = productService.getProductById(productId); 144 | return new ModelAndView("editProduct", "editProductObj", product); 145 | } 146 | 147 | @RequestMapping(value = "/admin/product/editProduct", method = RequestMethod.POST) 148 | public String editProduct(@ModelAttribute(value = "editProductObj") Product product) { 149 | productService.editProduct(product); 150 | return "redirect:/getAllProducts"; 151 | } 152 | 153 | @RequestMapping("/getProductsList") 154 | public @ResponseBody List getProductsListInJson() { 155 | return productService.getAllProducts(); 156 | } 157 | 158 | @RequestMapping("/productsListAngular") 159 | public String getProducts() { 160 | return "productListAngular"; 161 | } 162 | 163 | } 164 | -------------------------------------------------------------------------------- /src/main/java/com/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.controller; 2 | 3 | import javax.validation.Valid; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Controller; 7 | import org.springframework.ui.Model; 8 | import org.springframework.validation.BindingResult; 9 | import org.springframework.web.bind.annotation.ModelAttribute; 10 | import org.springframework.web.bind.annotation.RequestMapping; 11 | import org.springframework.web.bind.annotation.RequestMethod; 12 | import org.springframework.web.servlet.ModelAndView; 13 | 14 | import com.model.BillingAddress; 15 | import com.model.Customer; 16 | import com.model.ShippingAddress; 17 | import com.model.User; 18 | import com.service.CustomerService; 19 | 20 | @Controller 21 | public class UserController { 22 | 23 | @Autowired 24 | private CustomerService customerService; 25 | 26 | public CustomerService getCustomerService() { 27 | return customerService; 28 | } 29 | 30 | public void setCustomerService(CustomerService customerService) { 31 | this.customerService = customerService; 32 | } 33 | 34 | @RequestMapping(value = "/customer/registration") 35 | public ModelAndView getRegistrationForm() { 36 | Customer customer = new Customer(); 37 | User user = new User(); 38 | BillingAddress ba = new BillingAddress(); 39 | ShippingAddress sa = new ShippingAddress(); 40 | customer.setShippingAddress(sa); 41 | customer.setBillingAddress(ba); 42 | customer.setUsers(user); 43 | 44 | return new ModelAndView("register", "customer", customer); 45 | } 46 | 47 | // to insert the data 48 | @RequestMapping(value = "/customer/registration", method = RequestMethod.POST) 49 | public String registerCustomer(@Valid @ModelAttribute(value = "customer") Customer customer, Model model, 50 | BindingResult result) { 51 | if (result.hasErrors()) 52 | return "register"; 53 | customerService.addCustomer(customer); 54 | model.addAttribute("registrationSuccess", "Registered Successfully. Login using username and password"); 55 | return "login"; 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /src/main/java/com/dao/CartDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import java.io.IOException; 4 | 5 | import com.model.Cart; 6 | 7 | public interface CartDao { 8 | 9 | Cart getCartByCartId(String CartId); 10 | 11 | Cart validate(String cartId) throws IOException; 12 | 13 | void update(Cart cart); 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/dao/CartDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import java.io.IOException; 4 | 5 | import org.hibernate.Session; 6 | import org.hibernate.SessionFactory; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Repository; 9 | import org.springframework.transaction.annotation.Transactional; 10 | 11 | import com.model.Cart; 12 | import com.service.CustomerOrderService; 13 | 14 | @Repository 15 | @Transactional 16 | public class CartDaoImpl implements CartDao { 17 | 18 | @Autowired 19 | private SessionFactory sessionFactory; 20 | 21 | @Autowired 22 | private CustomerOrderService customerOrderService; 23 | 24 | public SessionFactory getSessionFactory() { 25 | return sessionFactory; 26 | } 27 | 28 | public void setSessionFactory(SessionFactory sessionFactory) { 29 | this.sessionFactory = sessionFactory; 30 | } 31 | 32 | public Cart getCartByCartId(String CartId) { 33 | Session session = sessionFactory.openSession(); 34 | Cart cart = (Cart) session.get(Cart.class, CartId); 35 | // System.out.println(cart.getCartId() + " " + cart.getCartItem()); 36 | System.out.println(cart); 37 | session.close(); 38 | return cart; 39 | 40 | } 41 | 42 | public Cart validate(String cartId) throws IOException { 43 | Cart cart = getCartByCartId(cartId); 44 | if (cart == null || cart.getCartItem().size() == 0) { 45 | throw new IOException(cartId + ""); 46 | } 47 | update(cart); 48 | return cart; 49 | } 50 | 51 | public void update(Cart cart) { 52 | 53 | String cartId = cart.getCartId(); 54 | double grandTotal = customerOrderService.getCustomerOrderGrandTotal(cartId); 55 | cart.setTotalPrice(grandTotal); 56 | 57 | Session session = sessionFactory.openSession(); 58 | session.saveOrUpdate(cart); 59 | session.flush(); 60 | session.close(); 61 | } 62 | 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/com/dao/CartItemDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.model.Cart; 4 | import com.model.CartItem; 5 | 6 | public interface CartItemDao { 7 | 8 | void addCartItem(CartItem cartItem); 9 | void removeCartItem(String CartItemId); 10 | void removeAllCartItems(Cart cart); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/com/dao/CartItemDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.hibernate.Session; 6 | import org.hibernate.SessionFactory; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Repository; 9 | import org.springframework.transaction.annotation.Transactional; 10 | 11 | import com.model.Cart; 12 | import com.model.CartItem; 13 | 14 | @Repository 15 | @Transactional 16 | public class CartItemDaoImpl implements CartItemDao { 17 | 18 | @Autowired 19 | private SessionFactory sessionFactory; 20 | 21 | public SessionFactory getSessionFactory() { 22 | return sessionFactory; 23 | } 24 | 25 | public void setSessionFactory(SessionFactory sessionFactory) { 26 | this.sessionFactory = sessionFactory; 27 | } 28 | 29 | public void addCartItem(CartItem cartItem) { 30 | Session session = sessionFactory.openSession(); 31 | session.saveOrUpdate(cartItem); 32 | session.flush(); 33 | session.close(); 34 | } 35 | 36 | public void removeCartItem(String CartItemId) { 37 | Session session = sessionFactory.openSession(); 38 | CartItem cartItem = (CartItem) session.get(CartItem.class, CartItemId); 39 | session.delete(cartItem); 40 | Cart cart = cartItem.getCart(); 41 | List cartItems = cart.getCartItem(); 42 | cartItems.remove(cartItem); 43 | session.flush(); 44 | session.close(); 45 | } 46 | 47 | public void removeAllCartItems(Cart cart) { 48 | List cartItems = cart.getCartItem(); 49 | for (CartItem cartItem : cartItems) { 50 | removeCartItem(cartItem.getCartItemId()); 51 | } 52 | } 53 | 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/dao/CustomerDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.model.Customer; 6 | 7 | public interface CustomerDao { 8 | 9 | void addCustomer(Customer customer); 10 | 11 | List getAllCustomers(); 12 | 13 | Customer getCustomerByemailId(String emailId); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/dao/CustomerDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.hibernate.Query; 6 | import org.hibernate.Session; 7 | import org.hibernate.SessionFactory; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.stereotype.Repository; 10 | 11 | import com.model.Authorities; 12 | import com.model.Cart; 13 | import com.model.Customer; 14 | import com.model.User; 15 | 16 | @Repository 17 | public class CustomerDaoImpl implements CustomerDao { 18 | 19 | @Autowired 20 | private SessionFactory sessionFactory; 21 | 22 | public SessionFactory getSessionFactory() { 23 | return sessionFactory; 24 | } 25 | 26 | public void setSessionFactory(SessionFactory sessionFactory) { 27 | this.sessionFactory = sessionFactory; 28 | } 29 | 30 | public void addCustomer(Customer customer) { 31 | System.out.println("Adding customer in dao"); 32 | Session session = sessionFactory.openSession(); 33 | //customer - has users,shippingaddress 34 | //insert the users,billingaddress 35 | customer.getUsers().setEnabled(true); 36 | 37 | Authorities authorities = new Authorities(); 38 | authorities.setAuthorities("ROLE_USER"); 39 | authorities.setEmailId(customer.getUsers().getEmailId()); 40 | 41 | Cart cart = new Cart(); 42 | //it is to set CartId for customer table 43 | customer.setCart(cart);//set the cart to the customer 44 | //if we omit this statement, hen it will insert null for customerid in cart 45 | //to set the customerid in cart table 46 | cart.setCustomer(customer); 47 | session.save(customer); 48 | session.save(authorities); 49 | session.flush(); 50 | session.close(); 51 | } 52 | 53 | public List getAllCustomers() { 54 | Session session = sessionFactory.openSession(); 55 | List customerList = session.createQuery("from Customer").list(); 56 | 57 | return customerList; 58 | } 59 | 60 | public Customer getCustomerByemailId(String emailId) { 61 | Session session = sessionFactory.openSession(); 62 | Query query = session.createQuery("from User where emailId=?"); 63 | query.setString(0, emailId); 64 | User users = (User)query.uniqueResult(); 65 | Customer customer = users.getCustomer(); 66 | return customer; 67 | } 68 | 69 | 70 | } 71 | -------------------------------------------------------------------------------- /src/main/java/com/dao/CustomerOrderDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.model.CustomerOrder; 4 | 5 | public interface CustomerOrderDao { 6 | 7 | void addCustomerOrder(CustomerOrder customerOrder); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/dao/CustomerOrderDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import org.hibernate.Session; 4 | import org.hibernate.SessionFactory; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Repository; 7 | import org.springframework.transaction.annotation.Transactional; 8 | 9 | import com.model.CustomerOrder; 10 | 11 | @Repository 12 | @Transactional 13 | public class CustomerOrderDaoImpl implements CustomerOrderDao { 14 | 15 | @Autowired 16 | private SessionFactory sessionFactory; 17 | 18 | public void addCustomerOrder(CustomerOrder customerOrder) { 19 | Session session = sessionFactory.openSession(); 20 | session.saveOrUpdate(customerOrder); 21 | session.flush(); 22 | session.close(); 23 | } 24 | 25 | } 26 | -------------------------------------------------------------------------------- /src/main/java/com/dao/ProductDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.model.Product; 6 | 7 | public interface ProductDao { 8 | 9 | List getAllProducts(); 10 | 11 | Product getProductById(String productId); 12 | 13 | void deleteProduct(String productId); 14 | 15 | void addProduct(Product product); 16 | 17 | void editProduct(Product product); 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/com/dao/ProductDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.hibernate.Session; 6 | import org.hibernate.SessionFactory; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Repository; 9 | 10 | import com.model.Product; 11 | 12 | @Repository(value = "productDao") 13 | public class ProductDaoImpl implements ProductDao { 14 | 15 | // this class is wired with the sessionFactory to do some operation in the 16 | // database 17 | 18 | @Autowired 19 | private SessionFactory sessionFactory; 20 | 21 | // this will create one sessionFactory for this class 22 | // there is only one sessionFactory should be created for the applications 23 | // we can create multiple sessions for a sessionFactory 24 | // each session can do some functions 25 | 26 | public SessionFactory getSessionFactory() { 27 | return sessionFactory; 28 | } 29 | 30 | public void setSessionFactory(SessionFactory sessionFactory) { 31 | this.sessionFactory = sessionFactory; 32 | } 33 | 34 | public List getAllProducts() { 35 | // Reading the records from the table 36 | Session session = sessionFactory.openSession(); 37 | // List products = session.createQuery("from Product").list(); 38 | List products = session.createCriteria(Product.class).list(); 39 | System.out.println("----- List of Products-----"); 40 | System.out.println(products); 41 | // session.flush is used for clear cache in the session 42 | session.flush(); 43 | // it will close the particular session after completing the process 44 | session.close(); 45 | return products; 46 | } 47 | 48 | public Product getProductById(String productId) { 49 | 50 | // Reading the records from the table 51 | Session session = sessionFactory.openSession(); 52 | // select * from Product where isbn=i 53 | Product product = (Product) session.get(Product.class, productId); 54 | session.close(); 55 | return product; 56 | } 57 | 58 | public void deleteProduct(String productId) { 59 | Session session = sessionFactory.openSession(); 60 | Product product = (Product) session.get(Product.class, productId); 61 | session.delete(product); 62 | session.flush(); 63 | session.close();// close the session 64 | } 65 | 66 | public void addProduct(Product product) { 67 | Session session = sessionFactory.openSession(); 68 | session.save(product); 69 | session.close(); 70 | } 71 | 72 | public void editProduct(Product product) { 73 | Session session = sessionFactory.openSession(); 74 | session.update(product); 75 | session.flush(); 76 | session.close(); 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/com/dao/QueriesDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import com.model.Queries; 4 | 5 | public interface QueriesDao { 6 | 7 | void addQuery(Queries queries); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/dao/QueriesDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import org.hibernate.Session; 4 | import org.hibernate.SessionFactory; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Repository; 7 | 8 | import com.model.Queries; 9 | 10 | @Repository 11 | public class QueriesDaoImpl implements QueriesDao { 12 | 13 | @Autowired 14 | private SessionFactory sessionFactory; 15 | 16 | public void addQuery(Queries queries) { 17 | Session session = sessionFactory.openSession(); 18 | session.save(queries); 19 | session.close(); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/com/dao/UserDao.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import java.util.List; 4 | 5 | import com.model.User; 6 | 7 | public interface UserDao { 8 | 9 | List getAllUsers(); 10 | 11 | void deleteUser(String userId); 12 | 13 | void addUser(User user); 14 | 15 | User getUserById(String userId); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/dao/UserDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.dao; 2 | 3 | import java.util.List; 4 | 5 | import org.hibernate.Session; 6 | import org.hibernate.SessionFactory; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Repository; 9 | 10 | import com.model.User; 11 | 12 | @Repository 13 | public class UserDaoImpl implements UserDao { 14 | 15 | @Autowired 16 | private SessionFactory sessionFactory; 17 | 18 | public List getAllUsers() { 19 | Session session = sessionFactory.openSession(); 20 | //List products = session.createQuery("from Product").list(); 21 | List users= session.createCriteria(User.class).list(); 22 | System.out.println(users); 23 | session.close(); 24 | return users; 25 | } 26 | 27 | public void deleteUser(String userId) { 28 | Session session = sessionFactory.openSession(); 29 | User user = (User) session.get(User.class, userId); 30 | session.saveOrUpdate(user); 31 | session.flush(); 32 | session.close();// close the session 33 | } 34 | 35 | public void addUser(User user) { 36 | Session session = sessionFactory.openSession(); 37 | session.save(user); 38 | session.close(); 39 | } 40 | 41 | public User getUserById(String userId) { 42 | // Reading the records from the table 43 | Session session = sessionFactory.openSession(); 44 | // select * from Product where isbn=i 45 | // if we call get method,Record doesnot exist it will return null 46 | // if we call load, if the record doesnt exist it will throw exception 47 | User user = (User) session.get(User.class, userId); 48 | session.close(); 49 | return user; 50 | } 51 | 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/model/Authorities.java: -------------------------------------------------------------------------------- 1 | package com.model; 2 | 3 | import java.io.Serializable; 4 | 5 | import javax.persistence.Entity; 6 | import javax.persistence.GeneratedValue; 7 | import javax.persistence.GenerationType; 8 | import javax.persistence.Id; 9 | import javax.persistence.Table; 10 | 11 | @Entity 12 | @Table(name = "authorities") 13 | public class Authorities implements Serializable { 14 | 15 | private static final long serialVersionUID = 8734140534986494039L; 16 | 17 | @Id 18 | @GeneratedValue(strategy = GenerationType.AUTO) 19 | private String authorityId; 20 | private String emailId; 21 | private String authorities; 22 | 23 | public String getAuthorityId() { 24 | return authorityId; 25 | } 26 | 27 | public void setAuthorityId(String authorityId) { 28 | this.authorityId = authorityId; 29 | } 30 | 31 | public String getAuthorities() { 32 | return authorities; 33 | } 34 | 35 | public void setAuthorities(String authorities) { 36 | this.authorities = authorities; 37 | } 38 | 39 | public String getEmailId() { 40 | return emailId; 41 | } 42 | 43 | public void setEmailId(String emailId) { 44 | this.emailId = emailId; 45 | } 46 | 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/model/BillingAddress.java: -------------------------------------------------------------------------------- 1 | package com.model; 2 | 3 | import java.io.Serializable; 4 | 5 | import javax.persistence.Entity; 6 | import javax.persistence.GeneratedValue; 7 | import javax.persistence.GenerationType; 8 | import javax.persistence.Id; 9 | import javax.persistence.OneToOne; 10 | import javax.persistence.Table; 11 | 12 | @Entity 13 | @Table(name = "billingAddress") 14 | public class BillingAddress implements Serializable { 15 | 16 | private static final long serialVersionUID = 1028098616457762743L; 17 | 18 | @Id 19 | @GeneratedValue(strategy = GenerationType.AUTO) 20 | private String billindAddressId; 21 | private String address; 22 | private String city; 23 | private String state; 24 | private String zipcode; 25 | private String country; 26 | 27 | @OneToOne(mappedBy = "billingAddress") 28 | private Customer customer; 29 | 30 | public Customer getCustomer() { 31 | return customer; 32 | } 33 | 34 | public void setCustomer(Customer customer) { 35 | this.customer = customer; 36 | } 37 | 38 | public String getBillindAddressId() { 39 | return billindAddressId; 40 | } 41 | 42 | public void setBillindAddressId(String billindAddressId) { 43 | this.billindAddressId = billindAddressId; 44 | } 45 | 46 | public String getAddress() { 47 | return address; 48 | } 49 | 50 | public void setAddress(String address) { 51 | this.address = address; 52 | } 53 | 54 | public String getCity() { 55 | return city; 56 | } 57 | 58 | public void setCity(String city) { 59 | this.city = city; 60 | } 61 | 62 | public String getState() { 63 | return state; 64 | } 65 | 66 | public void setState(String state) { 67 | this.state = state; 68 | } 69 | 70 | public String getZipcode() { 71 | return zipcode; 72 | } 73 | 74 | public void setZipcode(String zipcode) { 75 | this.zipcode = zipcode; 76 | } 77 | 78 | public String getCountry() { 79 | return country; 80 | } 81 | 82 | public void setCountry(String country) { 83 | this.country = country; 84 | } 85 | 86 | } 87 | -------------------------------------------------------------------------------- /src/main/java/com/model/Cart.java: -------------------------------------------------------------------------------- 1 | package com.model; 2 | 3 | import java.io.Serializable; 4 | import java.util.List; 5 | 6 | import javax.persistence.CascadeType; 7 | import javax.persistence.Entity; 8 | import javax.persistence.FetchType; 9 | import javax.persistence.GeneratedValue; 10 | import javax.persistence.GenerationType; 11 | import javax.persistence.Id; 12 | import javax.persistence.JoinColumn; 13 | import javax.persistence.OneToMany; 14 | import javax.persistence.OneToOne; 15 | import javax.persistence.Table; 16 | 17 | import com.fasterxml.jackson.annotation.JsonIgnore; 18 | 19 | @Entity 20 | @Table(name = "cart") 21 | public class Cart implements Serializable { 22 | 23 | private static final long serialVersionUID = 8436097833452420298L; 24 | 25 | @Id 26 | @GeneratedValue(strategy = GenerationType.AUTO) 27 | private String cartId; 28 | 29 | @OneToOne 30 | @JoinColumn(name = "customerId") 31 | @JsonIgnore 32 | private Customer customer; 33 | 34 | @OneToMany(mappedBy = "cart", cascade = CascadeType.ALL,fetch=FetchType.EAGER) 35 | private List cartItem; 36 | 37 | private double totalPrice; 38 | 39 | public String getCartId() { 40 | return cartId; 41 | } 42 | 43 | public void setCartId(String cartId) { 44 | this.cartId = cartId; 45 | } 46 | 47 | public Customer getCustomer() { 48 | return customer; 49 | } 50 | 51 | public void setCustomer(Customer customer) { 52 | this.customer = customer; 53 | } 54 | 55 | public List getCartItem() { 56 | return cartItem; 57 | } 58 | 59 | public void setCartItem(List cartItem) { 60 | this.cartItem = cartItem; 61 | } 62 | 63 | public double getTotalPrice() { 64 | return totalPrice; 65 | } 66 | 67 | public void setTotalPrice(double totalPrice) { 68 | this.totalPrice = totalPrice; 69 | } 70 | 71 | } 72 | -------------------------------------------------------------------------------- /src/main/java/com/model/CartItem.java: -------------------------------------------------------------------------------- 1 | package com.model; 2 | 3 | import java.io.Serializable; 4 | 5 | import javax.persistence.Entity; 6 | import javax.persistence.GeneratedValue; 7 | import javax.persistence.GenerationType; 8 | import javax.persistence.Id; 9 | import javax.persistence.JoinColumn; 10 | import javax.persistence.ManyToOne; 11 | import javax.persistence.Table; 12 | 13 | import com.fasterxml.jackson.annotation.JsonIgnore; 14 | 15 | @Entity 16 | @Table(name = "cartitem") 17 | public class CartItem implements Serializable { 18 | 19 | private static final long serialVersionUID = -2455760938054036364L; 20 | 21 | @Id 22 | @GeneratedValue(strategy = GenerationType.AUTO) 23 | private String cartItemId; 24 | 25 | private int quality; 26 | 27 | private double price; 28 | 29 | @ManyToOne 30 | @JoinColumn(name = "productId") 31 | private Product product; 32 | 33 | @ManyToOne 34 | @JoinColumn(name = "cartId") 35 | @JsonIgnore 36 | private Cart cart; 37 | 38 | public String getCartItemId() { 39 | return cartItemId; 40 | } 41 | 42 | public void setCartItemId(String cartItemId) { 43 | this.cartItemId = cartItemId; 44 | } 45 | 46 | public int getQuality() { 47 | return quality; 48 | } 49 | 50 | public void setQuality(int quality) { 51 | this.quality = quality; 52 | } 53 | 54 | public double getPrice() { 55 | return price; 56 | } 57 | 58 | public void setPrice(double price) { 59 | this.price = price; 60 | } 61 | 62 | public Product getProduct() { 63 | return product; 64 | } 65 | 66 | public void setProduct(Product product) { 67 | this.product = product; 68 | } 69 | 70 | public Cart getCart() { 71 | return cart; 72 | } 73 | 74 | public void setCart(Cart cart) { 75 | this.cart = cart; 76 | } 77 | 78 | } 79 | -------------------------------------------------------------------------------- /src/main/java/com/model/Customer.java: -------------------------------------------------------------------------------- 1 | package com.model; 2 | 3 | import java.io.Serializable; 4 | 5 | import javax.persistence.CascadeType; 6 | import javax.persistence.Entity; 7 | import javax.persistence.FetchType; 8 | import javax.persistence.GeneratedValue; 9 | import javax.persistence.GenerationType; 10 | import javax.persistence.Id; 11 | import javax.persistence.JoinColumn; 12 | import javax.persistence.OneToOne; 13 | import javax.persistence.Table; 14 | 15 | import com.fasterxml.jackson.annotation.JsonIgnore; 16 | 17 | @Entity 18 | @Table(name = "customer") 19 | public class Customer implements Serializable { 20 | 21 | private static final long serialVersionUID = 2652327633296064143L; 22 | 23 | @Id 24 | @GeneratedValue(strategy = GenerationType.AUTO) 25 | private String customerId; 26 | private String firstName; 27 | private String lastName; 28 | private String customerPhone; 29 | 30 | @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER) 31 | @JoinColumn(name = "shippingAddressId") 32 | private ShippingAddress shippingAddress; 33 | 34 | @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER) 35 | @JoinColumn(name = "billingAddressId") 36 | private BillingAddress billingAddress; 37 | 38 | @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER) 39 | @JoinColumn(name = "userId") 40 | private User users; 41 | 42 | @OneToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER) 43 | @JoinColumn(name = "cartId") 44 | @JsonIgnore 45 | private Cart cart; 46 | 47 | public BillingAddress getBillingAddress() { 48 | return billingAddress; 49 | } 50 | 51 | public void setBillingAddress(BillingAddress billingAddress) { 52 | this.billingAddress = billingAddress; 53 | } 54 | 55 | public Cart getCart() { 56 | return cart; 57 | } 58 | 59 | public void setCart(Cart cart) { 60 | this.cart = cart; 61 | } 62 | 63 | public String getCustomerId() { 64 | return customerId; 65 | } 66 | 67 | public void setCustomerId(String custmerId) { 68 | this.customerId = custmerId; 69 | } 70 | 71 | public String getCustomerPhone() { 72 | return customerPhone; 73 | } 74 | 75 | public void setCustomerPhone(String customerPhone) { 76 | this.customerPhone = customerPhone; 77 | } 78 | 79 | public ShippingAddress getShippingAddress() { 80 | return shippingAddress; 81 | } 82 | 83 | public void setShippingAddress(ShippingAddress shippingAddress) { 84 | this.shippingAddress = shippingAddress; 85 | } 86 | 87 | public String getFirstName() { 88 | return firstName; 89 | } 90 | 91 | public void setFirstName(String firstName) { 92 | this.firstName = firstName; 93 | } 94 | 95 | public String getLastName() { 96 | return lastName; 97 | } 98 | 99 | public void setLastName(String lastName) { 100 | this.lastName = lastName; 101 | } 102 | 103 | public User getUsers() { 104 | return users; 105 | } 106 | 107 | public void setUsers(User users) { 108 | this.users = users; 109 | } 110 | 111 | } 112 | -------------------------------------------------------------------------------- /src/main/java/com/model/CustomerOrder.java: -------------------------------------------------------------------------------- 1 | package com.model; 2 | 3 | import java.io.Serializable; 4 | 5 | import javax.persistence.Entity; 6 | import javax.persistence.GeneratedValue; 7 | import javax.persistence.GenerationType; 8 | import javax.persistence.Id; 9 | import javax.persistence.JoinColumn; 10 | import javax.persistence.OneToOne; 11 | import javax.persistence.Table; 12 | 13 | @Entity 14 | @Table(name = "customerorder") 15 | public class CustomerOrder implements Serializable { 16 | 17 | private static final long serialVersionUID = -6571020025726257848L; 18 | 19 | @Id 20 | @GeneratedValue(strategy = GenerationType.AUTO) 21 | private String customerOrderId; 22 | 23 | @OneToOne 24 | @JoinColumn(name = "cartId") 25 | private Cart cart; 26 | 27 | @OneToOne 28 | @JoinColumn(name = "customerId") 29 | private Customer customer; 30 | 31 | @OneToOne 32 | @JoinColumn(name = "shippingAddressId") 33 | private ShippingAddress shippingAddress; 34 | 35 | @OneToOne 36 | @JoinColumn(name = "billingAddressId") 37 | private BillingAddress billingAddress; 38 | 39 | public BillingAddress getBillingAddress() { 40 | return billingAddress; 41 | } 42 | 43 | public void setBillingAddress(BillingAddress billingAddress) { 44 | this.billingAddress = billingAddress; 45 | } 46 | 47 | public String getCustomerOrderId() { 48 | return customerOrderId; 49 | } 50 | 51 | public void setCustomerOrderId(String customerOrderId) { 52 | this.customerOrderId = customerOrderId; 53 | } 54 | 55 | public Cart getCart() { 56 | return cart; 57 | } 58 | 59 | public void setCart(Cart cart) { 60 | this.cart = cart; 61 | } 62 | 63 | public Customer getCustomer() { 64 | return customer; 65 | } 66 | 67 | public void setCustomer(Customer customer) { 68 | this.customer = customer; 69 | } 70 | 71 | public ShippingAddress getShippingAddress() { 72 | return shippingAddress; 73 | } 74 | 75 | public void setShippingAddress(ShippingAddress shippingAddress) { 76 | this.shippingAddress = shippingAddress; 77 | } 78 | 79 | } 80 | -------------------------------------------------------------------------------- /src/main/java/com/model/Product.java: -------------------------------------------------------------------------------- 1 | package com.model; 2 | 3 | import java.io.Serializable; 4 | 5 | import javax.persistence.Column; 6 | import javax.persistence.Entity; 7 | import javax.persistence.GeneratedValue; 8 | import javax.persistence.GenerationType; 9 | import javax.persistence.Id; 10 | import javax.persistence.Table; 11 | import javax.persistence.Transient; 12 | import javax.validation.constraints.Min; 13 | import javax.validation.constraints.NotNull; 14 | 15 | import org.hibernate.validator.constraints.NotEmpty; 16 | import org.springframework.web.multipart.MultipartFile; 17 | 18 | @Entity 19 | @Table(name = "item") 20 | public class Product implements Serializable { 21 | 22 | private static final long serialVersionUID = 5186013952828648626L; 23 | 24 | @Id 25 | @Column(name = "Id") 26 | @GeneratedValue(strategy = GenerationType.AUTO) 27 | private String productId; 28 | 29 | @Column(name="category") 30 | private String productCategory; 31 | 32 | @Column(name = "description") 33 | private String productDescription; 34 | 35 | @Column(name = "manufacturer") 36 | private String productManufacturer; 37 | 38 | @NotEmpty(message = "Product Name is mandatory") 39 | @Column(name = "name") 40 | private String productName; 41 | 42 | @NotNull(message="Please provide some price") 43 | @Min(value = 100, message = "Minimum value should be greater than 100") 44 | @Column(name = "price") 45 | private double productPrice; 46 | 47 | @Column(name = "unit") 48 | private String unitStock; 49 | 50 | @Transient 51 | private MultipartFile productImage; 52 | 53 | // Getters and Setter 54 | 55 | public String getProductId() { 56 | return productId; 57 | } 58 | 59 | public String getProductCategory() { 60 | return productCategory; 61 | } 62 | 63 | public String getProductDescription() { 64 | return productDescription; 65 | } 66 | 67 | public String getProductManufacturer() { 68 | return productManufacturer; 69 | } 70 | 71 | public String getProductName() { 72 | return productName; 73 | } 74 | 75 | public double getProductPrice() { 76 | return productPrice; 77 | } 78 | 79 | public String getUnitStock() { 80 | return unitStock; 81 | } 82 | 83 | public void setProductId(String productId) { 84 | this.productId = productId; 85 | } 86 | 87 | public void setProductCategory(String productCategory) { 88 | this.productCategory = productCategory; 89 | } 90 | 91 | public void setProductDescription(String productDescription) { 92 | this.productDescription = productDescription; 93 | } 94 | 95 | public void setProductManufacturer(String productManufacturer) { 96 | this.productManufacturer = productManufacturer; 97 | } 98 | 99 | public void setProductName(String productName) { 100 | this.productName = productName; 101 | } 102 | 103 | public void setProductPrice(double productPrice) { 104 | this.productPrice = productPrice; 105 | } 106 | 107 | public void setUnitStock(String unitStock) { 108 | this.unitStock = unitStock; 109 | } 110 | 111 | public MultipartFile getProductImage() { 112 | return productImage; 113 | } 114 | 115 | public void setProductImage(MultipartFile productImage) { 116 | this.productImage = productImage; 117 | } 118 | 119 | // Constructors 120 | public Product(String productId, String productCategory, String productDescription, String productManufacturer, 121 | String productName, double productPrice, String unitStock) { 122 | super(); 123 | this.productId = productId; 124 | this.productCategory = productCategory; 125 | this.productDescription = productDescription; 126 | this.productManufacturer = productManufacturer; 127 | this.productName = productName; 128 | this.productPrice = productPrice; 129 | this.unitStock = unitStock; 130 | } 131 | 132 | public Product() { 133 | 134 | } 135 | 136 | } 137 | -------------------------------------------------------------------------------- /src/main/java/com/model/Queries.java: -------------------------------------------------------------------------------- 1 | package com.model; 2 | 3 | import javax.persistence.Entity; 4 | import javax.persistence.GeneratedValue; 5 | import javax.persistence.GenerationType; 6 | import javax.persistence.Id; 7 | import javax.persistence.Table; 8 | 9 | @Entity 10 | @Table(name = "query") 11 | public class Queries { 12 | 13 | @Id 14 | @GeneratedValue(strategy = GenerationType.AUTO) 15 | private int id; 16 | 17 | private String email; 18 | private String subject; 19 | private String message; 20 | 21 | public int getId() { 22 | return id; 23 | } 24 | 25 | public void setId(int id) { 26 | this.id = id; 27 | } 28 | 29 | public String getEmail() { 30 | return email; 31 | } 32 | 33 | public void setEmail(String email) { 34 | this.email = email; 35 | } 36 | 37 | public String getSubject() { 38 | return subject; 39 | } 40 | 41 | public void setSubject(String subject) { 42 | this.subject = subject; 43 | } 44 | 45 | public String getMessage() { 46 | return message; 47 | } 48 | 49 | public void setMessage(String message) { 50 | this.message = message; 51 | } 52 | 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/model/ShippingAddress.java: -------------------------------------------------------------------------------- 1 | package com.model; 2 | 3 | import java.io.Serializable; 4 | 5 | import javax.persistence.Entity; 6 | import javax.persistence.GeneratedValue; 7 | import javax.persistence.GenerationType; 8 | import javax.persistence.Id; 9 | import javax.persistence.OneToOne; 10 | import javax.persistence.Table; 11 | 12 | @Entity 13 | @Table(name = "shippingAddress") 14 | public class ShippingAddress implements Serializable { 15 | 16 | private static final long serialVersionUID = 7551999649936522523L; 17 | 18 | @Id 19 | @GeneratedValue(strategy = GenerationType.AUTO) 20 | private String shippingAddressId; 21 | 22 | private String address; 23 | private String city; 24 | private String state; 25 | private String zipcode; 26 | private String country; 27 | 28 | @OneToOne(mappedBy = "shippingAddress") 29 | private Customer customer; 30 | 31 | public String getBillingAddressId() { 32 | return shippingAddressId; 33 | } 34 | 35 | public void setBillingAddressId(String billingAddressId) { 36 | this.shippingAddressId = billingAddressId; 37 | } 38 | 39 | public String getAddress() { 40 | return address; 41 | } 42 | 43 | public void setAddress(String address) { 44 | this.address = address; 45 | } 46 | 47 | public String getCity() { 48 | return city; 49 | } 50 | 51 | public void setCity(String city) { 52 | this.city = city; 53 | } 54 | 55 | public String getState() { 56 | return state; 57 | } 58 | 59 | public void setState(String state) { 60 | this.state = state; 61 | } 62 | 63 | public String getZipcode() { 64 | return zipcode; 65 | } 66 | 67 | public void setZipcode(String zipcode) { 68 | this.zipcode = zipcode; 69 | } 70 | 71 | public String getCountry() { 72 | return country; 73 | } 74 | 75 | public void setCountry(String country) { 76 | this.country = country; 77 | } 78 | 79 | public Customer getCustomer() { 80 | return customer; 81 | } 82 | 83 | public void setCustomer(Customer customer) { 84 | this.customer = customer; 85 | } 86 | 87 | } 88 | -------------------------------------------------------------------------------- /src/main/java/com/model/User.java: -------------------------------------------------------------------------------- 1 | package com.model; 2 | 3 | import java.io.Serializable; 4 | 5 | import javax.persistence.Entity; 6 | import javax.persistence.GeneratedValue; 7 | import javax.persistence.GenerationType; 8 | import javax.persistence.Id; 9 | import javax.persistence.OneToOne; 10 | import javax.persistence.Table; 11 | 12 | @Entity 13 | @Table(name = "users") 14 | public class User implements Serializable { 15 | 16 | private static final long serialVersionUID = 2681531852204068105L; 17 | @Id 18 | @GeneratedValue(strategy = GenerationType.AUTO) 19 | private String userId; 20 | private String emailId; 21 | private String password; 22 | private boolean enabled; 23 | 24 | @OneToOne(mappedBy = "users") 25 | private Customer customer; 26 | 27 | public Customer getCustomer() { 28 | return customer; 29 | } 30 | 31 | public void setCustomer(Customer customer) { 32 | this.customer = customer; 33 | } 34 | 35 | public String getUserId() { 36 | return userId; 37 | } 38 | 39 | public void setUserId(String userId) { 40 | this.userId = userId; 41 | } 42 | 43 | public String getPassword() { 44 | return password; 45 | } 46 | 47 | public void setPassword(String password) { 48 | this.password = password; 49 | } 50 | 51 | public boolean isEnabled() { 52 | return enabled; 53 | } 54 | 55 | public void setEnabled(boolean enabled) { 56 | this.enabled = enabled; 57 | } 58 | 59 | public String getEmailId() { 60 | return emailId; 61 | } 62 | 63 | public void setEmailId(String emailId) { 64 | this.emailId = emailId; 65 | } 66 | 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/com/service/CartItemService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.model.Cart; 4 | import com.model.CartItem; 5 | 6 | public interface CartItemService { 7 | 8 | void addCartItem(CartItem cartItem); 9 | void removeCartItem(String CartItemId); 10 | void removeAllCartItems(Cart cart); 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/com/service/CartItemServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import com.dao.CartItemDao; 7 | import com.model.Cart; 8 | import com.model.CartItem; 9 | 10 | @Service 11 | public class CartItemServiceImpl implements CartItemService { 12 | 13 | @Autowired 14 | private CartItemDao cartItemDao; 15 | 16 | public CartItemDao getCartItemDao() { 17 | return cartItemDao; 18 | } 19 | 20 | public void setCartItemDao(CartItemDao cartItemDao) { 21 | this.cartItemDao = cartItemDao; 22 | } 23 | 24 | public void addCartItem(CartItem cartItem) { 25 | cartItemDao.addCartItem(cartItem); 26 | 27 | } 28 | 29 | public void removeCartItem(String CartItemId) { 30 | cartItemDao.removeCartItem(CartItemId); 31 | } 32 | 33 | public void removeAllCartItems(Cart cart) { 34 | cartItemDao.removeAllCartItems(cart); 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/service/CartService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.model.Cart; 4 | 5 | public interface CartService { 6 | 7 | Cart getCartByCartId(String CartId); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/service/CartServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import com.dao.CartDao; 7 | import com.model.Cart; 8 | 9 | @Service 10 | public class CartServiceImpl implements CartService { 11 | 12 | @Autowired 13 | private CartDao cartDao; 14 | 15 | public CartDao getCartDao() { 16 | return cartDao; 17 | } 18 | 19 | public void setCartDao(CartDao cartDao) { 20 | this.cartDao = cartDao; 21 | } 22 | 23 | public Cart getCartByCartId(String CartId) { 24 | 25 | return cartDao.getCartByCartId(CartId); 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/com/service/CustomerOrderService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.model.CustomerOrder; 4 | 5 | public interface CustomerOrderService { 6 | 7 | void addCustomerOrder(CustomerOrder customerOrder); 8 | double getCustomerOrderGrandTotal(String cartId); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/service/CustomerOrderServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | 8 | import com.dao.CustomerOrderDao; 9 | import com.model.Cart; 10 | import com.model.CartItem; 11 | import com.model.CustomerOrder; 12 | 13 | @Service 14 | public class CustomerOrderServiceImpl implements CustomerOrderService { 15 | 16 | @Autowired 17 | private CustomerOrderDao customerOrderDao; 18 | 19 | @Autowired 20 | private CartService cartService; 21 | 22 | public void addCustomerOrder(CustomerOrder customerOrder) { 23 | customerOrderDao.addCustomerOrder(customerOrder); 24 | } 25 | 26 | public double getCustomerOrderGrandTotal(String cartId) { 27 | double grandTotal=0; 28 | Cart cart = cartService.getCartByCartId(cartId); 29 | List cartItems = cart.getCartItem(); 30 | 31 | for(CartItem item: cartItems){ 32 | grandTotal += item.getPrice(); 33 | } 34 | return grandTotal; 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/service/CustomerService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import java.util.List; 4 | 5 | import com.model.Customer; 6 | 7 | public interface CustomerService { 8 | 9 | void addCustomer(Customer customer); 10 | 11 | List getAllCustomers(); 12 | 13 | Customer getCustomerByemailId(String emailId); 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/com/service/CustomerServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | import org.springframework.transaction.annotation.Transactional; 8 | 9 | import com.dao.CustomerDao; 10 | import com.model.Customer; 11 | 12 | @Service 13 | public class CustomerServiceImpl implements CustomerService { 14 | @Autowired 15 | private CustomerDao customerDao; 16 | 17 | // The database transaction happens inside the scope of a persistence 18 | // context. The persistence context is in JPA the EntityManager , 19 | // implemented internally using an Hibernate Session (when using Hibernate 20 | // as the persistence provider). 21 | 22 | @Transactional 23 | public void addCustomer(Customer customer) { 24 | customerDao.addCustomer(customer); 25 | } 26 | 27 | public List getAllCustomers() { 28 | 29 | return customerDao.getAllCustomers(); 30 | } 31 | 32 | public Customer getCustomerByemailId(String emailId) { 33 | return customerDao.getCustomerByemailId(emailId); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/com/service/ProductService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import java.util.List; 4 | 5 | import com.model.Product; 6 | 7 | public interface ProductService { 8 | 9 | public List getAllProducts(); 10 | 11 | Product getProductById(String productId); 12 | 13 | void deleteProduct(String productId); 14 | 15 | void addProduct(Product product); 16 | 17 | void editProduct(Product product); 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/com/service/ProductServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | import org.springframework.transaction.annotation.Transactional; 8 | 9 | import com.dao.ProductDao; 10 | import com.model.Product; 11 | 12 | @Service(value="productService") 13 | public class ProductServiceImpl implements ProductService { 14 | 15 | @Autowired 16 | private ProductDao productDao; 17 | 18 | public ProductDao getProductDao() { 19 | return productDao; 20 | } 21 | 22 | public void setProductDao(ProductDao productDao) { 23 | this.productDao = productDao; 24 | } 25 | 26 | @Transactional 27 | public List getAllProducts() { 28 | return productDao.getAllProducts(); 29 | } 30 | 31 | 32 | public Product getProductById(String productId) { 33 | return productDao.getProductById(productId); 34 | } 35 | 36 | 37 | public void deleteProduct(String productId) { 38 | productDao.deleteProduct(productId); 39 | } 40 | 41 | public void addProduct(Product product){ 42 | productDao.addProduct(product); 43 | } 44 | 45 | public void editProduct(Product product){ 46 | productDao.editProduct(product); 47 | } 48 | 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/service/QueriesService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import com.model.Queries; 4 | 5 | public interface QueriesService { 6 | 7 | void addQuery(Queries queries); 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/service/QueriesServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import com.dao.QueriesDao; 7 | import com.model.Queries; 8 | 9 | @Service 10 | public class QueriesServiceImpl implements QueriesService { 11 | 12 | @Autowired 13 | private QueriesDao queryDao; 14 | 15 | public void addQuery(Queries queries) { 16 | 17 | queryDao.addQuery(queries); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/com/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import java.util.List; 4 | 5 | import com.model.User; 6 | 7 | public interface UserService { 8 | 9 | List getAllUsers(); 10 | 11 | void deleteUser(String userId); 12 | 13 | void addUser(User user); 14 | 15 | User getUserById(String userId); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/service/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.service; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.stereotype.Service; 7 | import org.springframework.transaction.annotation.Transactional; 8 | 9 | import com.dao.UserDao; 10 | import com.model.User; 11 | 12 | @Service 13 | public class UserServiceImpl implements UserService { 14 | 15 | @Autowired 16 | private UserDao userDao; 17 | 18 | @Transactional 19 | public List getAllUsers() { 20 | return userDao.getAllUsers(); 21 | } 22 | 23 | @Transactional 24 | public void deleteUser(String userId) { 25 | userDao.deleteUser(userId); 26 | } 27 | @Transactional 28 | public void addUser(User user){ 29 | userDao.addUser(user); 30 | } 31 | 32 | public User getUserById(String userId) { 33 | return userDao.getUserById(userId); 34 | } 35 | 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 13 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 23 | 24 | 25 | 26 | 27 | 28 | org.hibernate.dialect.H2Dialect 29 | 30 | 31 | 33 | update 34 | 35 | 36 | true 37 | true 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | com.model.Product 46 | com.model.Authorities 47 | com.model.BillingAddress 48 | com.model.Cart 49 | com.model.CartItem 50 | com.model.Customer 51 | com.model.CustomerOrder 52 | com.model.ShippingAddress 53 | com.model.User 54 | com.model.Queries 55 | 56 | 57 | 58 | 59 | 60 | 64 | 66 | 67 | 68 | 69 | 70 | 71 | 73 | 75 | 77 | 79 | 81 | 83 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 101 | 102 | 108 | 109 | 110 | 111 | 112 | 113 | 115 | 116 | 117 | 119 | 121 | 122 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/dispatcher-servlet.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | 13 | 14 | 15 | 16 | 17 | 19 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 30 | 31 | 32 | 33 | 34 | 36 | 37 | 38 | 39 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/flow/checkout/checkOutCancelled.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%> 2 | <%@ include file="/WEB-INF/page/navbar.jsp"%> 3 | <%@ page isELIgnored="false"%> 4 |
5 |
6 |
7 |
8 |
9 |

Checkout cancelled!

10 | 11 |

Your checkout process is cancelled! You may continue 12 | shopping.

13 |
14 |
15 |
16 | 17 |
18 |

19 |

" class="btn btn-default">Go to Products page
20 |

21 |
22 |
23 |
24 | <%@ include file="/WEB-INF/page/footer.jsp"%> -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/flow/checkout/checkout-flow.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/flow/checkout/collectCustomerInfo.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> 2 | <%@ page isELIgnored="false"%> 3 | <%@ include file="/WEB-INF/page/navbar.jsp"%> 4 | 5 | 6 | 7 | 8 | Insert title here 9 | "> 11 | 12 | 13 | "> 14 | 15 | 16 | 17 | 18 |
19 |

Customer Details!

20 |
21 |
22 | 23 | 24 |
25 |
26 |
27 | 28 | 30 |
31 |
32 | 33 | 35 |
36 |
37 |
38 |
39 | 40 | 42 |
43 |
44 | 45 | 47 |
48 |
49 | 50 |
Billing Address:
51 |
52 | 53 | 55 |
56 |
57 |
58 | 59 | 61 |
62 |
63 | 64 | 66 |
67 |
68 |
69 |
70 | 71 | 73 |
74 |
75 | 76 | 78 |
79 |
80 | 81 | 82 |
83 | 85 | 86 |
87 | 88 |
89 |
90 |
91 |
92 |
93 | 94 | 95 | <%@ include file="/WEB-INF/page/footer.jsp"%> -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/flow/checkout/collectShippingDetail.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> 2 | <%@ page isELIgnored="false"%> 3 | <%@ include file="/WEB-INF/page/navbar.jsp"%> 4 | 5 | 6 | 7 | 8 | Insert title here 9 | "> 11 | 12 | 13 | "> 15 | 16 | 17 | 18 | 19 |
20 |

Confirm Shipping Address!

21 |
22 |
23 | 24 | 25 |
26 |
27 | 28 |
Shipping Address
29 |
30 | 31 | 33 |
34 |
35 |
36 | 37 | 39 |
40 |
41 | 42 | 44 |
45 |
46 |
47 |
48 | 49 | 51 |
52 |
53 | 54 | 56 |
57 |
58 | 59 | 60 |
61 | 62 | 63 | 64 |
65 |
66 |
67 |
68 |
69 |
70 |
71 | 72 | 73 | <%@ include file="/WEB-INF/page/footer.jsp"%> 74 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/flow/checkout/invalidCartWarning.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%> 2 | <%@ include file="/WEB-INF/page/navbar.jsp"%> 3 | <%@ page isELIgnored="false"%> 4 |
5 |
6 |
7 |
8 |
9 |

Invalid Cart!

10 |
11 |
12 |
13 | 14 |
15 |

16 |

" 17 | class="btn btn-default">Browse Products
18 |

19 |
20 |
21 |
22 | <%@ include file="/WEB-INF/page/footer.jsp"%> -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/flow/checkout/orderConfirmation.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> 4 | <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%> 5 | <%@ page isELIgnored="false"%> 6 | 7 | 8 | <%@ include file="/WEB-INF/page/navbar.jsp"%> 9 | 10 | 11 | 12 | 13 | Insert title here 14 | "> 16 | 17 | 18 | "> 20 | 21 | 22 | 23 |
24 |
25 |
26 | 27 |
28 |

Receipt

29 |
30 |
31 |
32 | Shipping Address
33 | ${order.cart.customer.shippingAddress.address}
34 | ${order.cart.customer.shippingAddress.city}, 35 | ${order.cart.customer.shippingAddress.state}
36 | ${order.cart.customer.shippingAddress.country}, 37 | ${order.cart.customer.shippingAddress.zipcode} 38 |
39 |
40 |
41 |

Shipping Date:

42 |
43 |
44 |
45 |
46 |
47 | Billing Address
48 | ${order.cart.customer.billingAddress.address}
49 | ${order.cart.customer.billingAddress.city}, 50 | ${order.cart.customer.billingAddress.state}
51 | ${order.cart.customer.billingAddress.country}, 52 | ${order.cart.customer.billingAddress.zipcode} 53 |
54 |
55 |
56 |
57 |
58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 |
ProductQuantityPriceTotal
${cartItem.product.productName}${cartItem.quality}${cartItem.product.productPrice}${cartItem.price}
78 |
79 |
80 |

Grand Total: $ ${order.cart.totalPrice}

81 |
82 | 83 |
84 | 85 | 86 |

87 | 88 | 90 | 91 | 93 | 94 | 95 |
96 |
97 |
98 |
99 |
100 | 101 | 102 | 103 | 104 | 105 | <%@ include file="/WEB-INF/page/footer.jsp"%> -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/flow/checkout/thankCustomer.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%> 2 | <%@ include file="/WEB-INF/page/navbar.jsp"%> 3 | <%@ page isELIgnored="false"%> 4 | 5 | 6 | 7 | 8 | Insert title here 9 | "> 11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 |
19 |
20 |
21 |
22 |

Thank you for your business!

23 | 24 |

Your order will be deliverd within

25 |
26 |
27 | <%@ include file="/WEB-INF/page/countdown.jsp"%> 28 |
29 |
30 |

31 | " class="btn btn-default">OK 32 |

33 |
34 |
35 |
36 | 37 | 38 | 39 | <%@ include file="/WEB-INF/page/footer.jsp"%> -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/page/UserList.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | <%@ page isELIgnored="false"%> 5 | 6 | 7 | <%@ include file="navbar.jsp"%> 8 | 9 | 10 | 11 | 12 | 13 | Product Management 14 | "> 16 | 17 | 18 | "> 20 | 21 | 22 |
23 |

User Management

24 |

The List of Users in our Database

25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 59 | 60 | 61 | 62 |
User IdFirst NameLast NameAddressGenderStateCityPhone NumberemailIdpasswordRoleType
${user.userId}${user.firstName}${user.lastName}${user.address}${user.gender}${user.state}${user.city}${user.phNumber}${user.emailId}${user.password}${user.roleType} 57 |
63 |
64 | 65 | 66 | <%@ include file="footer.jsp"%> -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/page/aboutUs.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 4 | 5 | 6 | 7 | 8 | AboutUs 9 | "> 11 | 12 | 13 | "> 15 | " /> 16 | 17 | 18 | 19 | 20 | 21 | <%@ include file="navbar.jsp"%> 22 | 23 | 24 |
25 |
26 |
27 |

Who Am I?

28 | " class="img-circle" alt="AboutUs" width="350" 29 | height="350"> 30 |

ShopIeasy a WorldWide E-Commerce Site

31 |
32 | 33 |
34 | 35 |
36 |

What Am I?

37 |

ShopIeasy's vision is to create India's most reliable and 38 | frictionless commerce ecosystem that creates life-changing 39 | experiences for buyers and sellers.

40 |
41 |

We have always taken pride in our culture. There are some core 42 | values that have been inherent and are an integral part of our 43 | success story. These values are a pure reflection of what is 44 | important to us as a Team and Business..

45 |
46 |
47 | 48 | 49 | <%@ include file="footer.jsp"%> 50 | 51 | 52 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/page/addProduct.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | 4 | <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form" %> 5 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 6 | <%@ page isELIgnored="false" %> 7 | 8 | 9 | 10 | 11 | 12 | Add Product 13 | "> 15 | 16 | 17 | "> 19 | " /> 20 | 21 | 22 | <%@ include file="navbar.jsp"%> 23 |
24 |

Add Product !

25 |
26 |
27 | 28 | 29 | 30 | 31 |
32 |
33 |
34 | Product Id 35 | 38 |
39 |
40 | Product Name 41 | 44 | 45 |
46 |
47 |
48 | Product Description 49 | 52 |
53 |
54 | Product Category 55 | Android 56 | Windows 57 | Linux 58 | Mac 59 |
60 |
61 |
62 | Product Manufacturer 63 | 66 |
67 |
68 | Product Price 69 | 72 | 73 |
74 |
75 | Number of Products 76 | 79 |
80 |
81 |
82 | Product Image 83 | 84 |
85 |
86 | 87 |
88 |
89 |
90 |
91 |
92 |
93 | <%@ include file="footer.jsp"%> 94 | 95 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/page/cart.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 4 | <%@ taglib prefix="security" 5 | uri="http://www.springframework.org/security/tags"%> 6 | <%@ page isELIgnored="false"%> 7 | 8 | 9 | 10 | 11 | Cart 12 | " /> 13 | 15 | 17 | 19 | 21 | 22 | 23 | 24 | <%@ include file="navbar.jsp"%> 25 | 26 |
28 |
30 |
31 |
List of Products Purchased 32 |
33 | 34 | Clear Cart 37 | 38 |
39 |
40 | 41 | Check Out 44 | 45 |
46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 65 | 66 |
Product NameQuantityPriceTotal Price
{{cart.product.productName}}{{cart.quality}}{{cart.product.productPrice}}{{cart.price}}remove
67 | Grand Total Price: {{calculateGrandTotal()}} 68 |
69 | 70 | Continue 71 | Shopping 72 |
73 |
74 | 75 | <%@ include file="footer.jsp"%> 76 | 77 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/page/contactUs.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 4 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> 5 | <%@ page isELIgnored="false"%> 6 | 7 | 8 | 9 | 10 | 11 | Contact Us 12 | " /> 13 | 14 | 16 | 18 | 20 | 21 | "> 23 | "> 24 | 25 | 26 | 28 | 30 | 31 | 32 | 37 | 38 | 39 | 40 | 41 | 42 |
43 | 44 |
45 |
46 |
47 |

48 | ShopIeasy Contact Form 49 |

50 |
51 |

If you need any help from Us please contact us. Write your 52 | Queries.

53 |
54 |
55 |
56 |
57 |
58 |
59 |
60 |

Contact us

61 | 62 |
63 |
64 | 65 |
66 |
67 |
68 | 69 | 71 |
72 | 73 | 74 |
75 |
76 | 77 | 78 |
79 |
80 | 81 | 82 |
83 | 84 | 87 |
88 |
89 |
90 |
91 |
92 |
93 | 94 | 95 | 96 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/page/countdown.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 4 | <%@ taglib prefix="security" 5 | uri="http://www.springframework.org/security/tags"%> 6 | <%@ page isELIgnored="false"%> 7 | 8 | 9 | 10 | 11 | Thank You 12 | rel="stylesheet"> 13 | 15 | 16 | rel="stylesheet"> 17 | 18 | 20 | 21 | 22 | 23 |
    24 |
  • 00 25 |

    Days

  • 26 |
  • :
  • 27 |
  • 00 28 |

    Hours

  • 29 |
  • :
  • 30 |
  • 00 31 |

    Minutes

  • 32 |
  • :
  • 33 |
  • 00 34 |

    Seconds

  • 35 |
36 | 37 | 48 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/page/editProduct.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | 4 | <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%> 5 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 6 | <%@ page isELIgnored="false"%> 7 | 8 | 9 | 10 | 11 | 12 | Edit Product 13 | " /> 15 | "> 17 | 18 | 19 | "> 21 | 22 | 23 | 24 | <%@ include file="navbar.jsp"%> 25 |
26 |

Update Product !

27 |
28 |
29 | 30 | 31 | 32 | 34 |
35 |
36 |
37 | Product Id 38 | 40 |
41 |
42 | Product Name 43 | 45 |
46 |
47 |
48 | Product Description 49 | 51 |
52 |
53 | Product Category 54 | 55 | Android 56 | 57 | Windows 58 | 59 | Linux 60 | 61 | Mac 62 |
63 |
64 |
65 | Product Manufacturer 66 | 69 |
70 |
71 | Product Price 72 | 74 |
75 |
76 | Number of Products 77 | 79 |
80 |
81 |
82 | 83 |
84 |
85 |
86 |
87 |
88 |
89 | <%@ include file="footer.jsp"%> 90 | 91 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/page/footer.jsp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/page/footer.jsp -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/page/hello.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@ page isELIgnored="false"%> 4 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 5 | 6 | 7 | 8 | 9 | Insert title here 10 | 11 | 12 | ${hello} 13 | 14 | 15 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/page/index1.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 4 | 5 | 6 | 7 | 8 | ShopIeasy 9 | " /> 10 | 11 | 12 | <%@ include file="navbar.jsp"%> 13 | <%@ include file="slider.jsp"%> 14 | <%@ include file="productGrid.jsp"%> 15 | <%@ include file="footer.jsp"%> 16 | 17 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/page/login.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 4 | 5 | 6 | 7 | 8 | Login 9 | " /> 10 | 11 | 12 | 13 | 14 | 34 | 35 | 36 | <%@ include file="navbar.jsp"%> 37 |
38 |
39 | 86 |
87 | 88 |
89 | <%@ include file="footer.jsp"%> 90 | 91 | 92 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/page/navbar.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 4 | <%@ taglib prefix="security" 5 | uri="http://www.springframework.org/security/tags"%> 6 | <%@ page isELIgnored="false"%> 7 | 8 | 9 | 10 | 11 | " /> 12 | "> 14 | 15 | 16 | "> 18 | 19 | 20 | 21 | 22 | 88 | 89 | 90 | 91 | 92 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/page/productGrid.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 4 | <%@ taglib prefix="security" 5 | uri="http://www.springframework.org/security/tags"%> 6 | <%@ page isELIgnored="false"%> 7 | 8 | 9 | 10 | 11 | "> 13 | 14 | 15 | 16 | 17 | 18 | 27 | 28 | 29 |
30 |
31 |
32 | " alt="Norway" style="width: 100%" 33 | class="w3-hover-opacity"> 34 |
35 |

36 | Oppo A37 37 |

38 |

39 |

    40 |
  • Technology - GSM/HSPA/LTE
  • 41 |
  • Resolution - 720x1280 pixels
  • 42 |
  • OS - Android OS, v5.1(Lollipop)
  • 43 |
  • Price - 10,000.00
  • 44 |
45 |

46 |
47 |
48 | 49 |
50 | " alt="Norway" style="width: 100%" 51 | class="w3-hover-opacity"> 52 |
53 |

54 | Oppo A53 55 |

56 |

57 |

    58 |
  • Technology - GSM/HSPA/LTE
  • 59 |
  • Resolution - 720x1280 pixels
  • 60 |
  • OS - Android OS, v5.1(Lollipop)
  • 61 |
  • Price - 8,000.00
  • 62 |
63 |

64 |
65 |
66 |
67 | " alt="Norway" style="width: 100%" 68 | class="w3-hover-opacity"> 69 |
70 |

71 | Oppo F1s 72 |

73 |

74 |

    75 |
  • Technology - GSM/HSPA/LTE
  • 76 |
  • Resolution - 720x1280 pixels
  • 77 |
  • OS - Android OS, v5.1(Lollipop)
  • 78 |
  • Price - 18,000.00
  • 79 |
80 |

81 |
82 |
83 |
84 | 85 |
86 |
87 |
88 | " alt="Norway" style="width: 100%" 89 | class="w3-hover-opacity"> 90 |
91 |

92 | Oppo F1s 93 |

94 |

95 |

    96 |
  • Technology - GSM/HSPA/LTE
  • 97 |
  • Resolution - 720x1280 pixels
  • 98 |
  • OS - Android OS, v5.1(Lollipop)
  • 99 |
  • Price - 18,000.00
  • 100 |
101 |

102 |
103 |
104 | 105 |
106 | " alt="Norway" style="width: 100%" 107 | class="w3-hover-opacity"> 108 |
109 |

110 | Oppo A53 111 |

112 |

113 |

    114 |
  • Technology - GSM/HSPA/LTE
  • 115 |
  • Resolution - 720x1280 pixels
  • 116 |
  • OS - Android OS, v5.1(Lollipop)
  • 117 |
  • Price - 8,000.00
  • 118 |
119 |

120 |
121 |
122 |
123 | " alt="Norway" style="width: 100%" 124 | class="w3-hover-opacity"> 125 |
126 |

127 | Oppo A37 128 |

129 |

130 |

    131 |
  • Technology - GSM/HSPA/LTE
  • 132 |
  • Resolution - 720x1280 pixels
  • 133 |
  • OS - Android OS, v5.1(Lollipop)
  • 134 |
  • Price - 10,000.00
  • 135 |
136 |

137 | 138 |
139 |
140 |
141 | 142 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/page/productList.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | <%@ page isELIgnored="false"%> 5 | 6 | 7 | <%@ include file="navbar.jsp"%> 8 | 9 | 10 | 11 | 12 | 13 | Product Management 14 | " /> 16 | "> 18 | 19 | 20 | "> 22 | 24 | 25 | 26 | 27 |
29 |

Product Management

30 |

The List of Products in our Database

31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 49 | 50 | 51 | 52 | 53 | 54 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 82 | 83 | 84 | 85 |
Screen-ShotProduct IdCategoryProduct NameProducts PriceStock UnitDescriptionManufacturerView 43 | / Add to Cart 44 | 46 | /Edit/Delete 47 | 48 |
" 56 | style="width: 100px; height: 90px;" ${prod.productName}" />${prod.productId}${prod.productCategory}${prod.productName}${prod.productPrice}${prod.unitStock}${prod.productDescription}${prod.productManufacturer} 67 | 68 | 70 | 73 | 75 | 78 | 81 |
86 |
87 | 88 | 89 | <%@ include file="footer.jsp"%> -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/page/productListAngular.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 4 | <%@ page isELIgnored="false"%> 5 | 6 | 7 | <%@ include file="navbar.jsp"%> 8 | 9 | 10 | 11 | 12 | Search Products 13 | " /> 15 | "> 17 | 18 | 19 | "> 21 | 23 | 24 | 25 | 26 |
27 |
28 |
30 |

Product Management

31 |

The List of Products in our Database

32 | Search: 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 52 | 53 | 54 | 55 | 56 | 57 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 83 | 84 | 85 |
Screen-ShotProduct IdCategoryProduct NameProducts PriceStock UnitDescriptionManufacturerView 46 | / Add to Cart 47 | 49 | /Edit/Delete 50 | 51 |
" 59 | style="width: 100px; height: 90px;" {{b.productName}}" />{{b.productId}}{{b.productCategory}}{{b.productName}}{{b.productPrice}}{{b.unitStock}}{{b.productDescription}}{{b.productManufacturer}} 75 | 76 | 79 | 82 |
86 |
87 |
88 |
89 | 90 | 91 | 92 | 93 | <%@ include file="footer.jsp"%> -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/page/productPage.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 4 | <%@ taglib prefix="security" 5 | uri="http://www.springframework.org/security/tags"%> 6 | <%@ page isELIgnored="false"%> 7 | 8 | <%@ include file="navbar.jsp"%> 9 | 10 | 11 | 12 | 13 | Products 14 | " /> 16 | 18 | 19 | 20 | 21 |
22 |
23 |

Product Details

24 |

Details of the Product

25 | 26 | 27 | 28 | 29 | 30 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 79 | 80 | 81 |
Prodcut Image" 32 | width="40%" alt="${productObj.productName}" />
Prodcut ID${productObj.productId }
Product Name${productObj.productName }
Product Category${productObj.productCategory}
Product Description${productObj.productDescription}
Product Manufacturer${productObj.productManufacturer}
Product Price${productObj.productPrice}
Stock Available${productObj.unitStock}
Add to Cart: 66 |
82 |
83 |
84 | 85 | 86 | <%@ include file="footer.jsp"%> 87 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/page/register.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | 4 | <%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%> 5 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%> 6 | <%@ page isELIgnored="false"%> 7 | 8 | 9 | 10 | 11 | 12 | Register Here 13 | " /> 15 | "> 17 | 18 | 19 | "> 21 | 22 | 23 | 24 | <%@ include file="navbar.jsp"%> 25 |
26 |

Register Here !

27 |
28 |
29 | 30 | 31 | 32 | 34 |
35 |
36 |
37 |
User Details
38 |
39 |
40 | First Name 41 | 43 | 44 |
45 |
46 | Last Name 47 | 49 |
50 |
51 |
52 |
53 | Email Id 54 | 56 | 57 |
58 |
59 | Phone Number 60 | 62 | 63 |
64 |
65 |
66 |
67 |
Shipping Address
68 |
69 |
70 | Address 71 | 73 |
74 |
75 |
76 | City 77 | 79 |
80 |
81 | State 82 | 84 | 85 |
86 |
87 |
88 |
89 | Country 90 | 92 |
93 |
94 | Zipcode 95 | 97 | 98 |
99 |
100 |
101 |
102 |
Billing Address
103 |
104 |
105 | Address 106 | 108 |
109 |
110 |
111 | City 112 | 114 |
115 |
116 | State 117 | 119 | 120 |
121 |
122 |
123 |
124 | Country 125 | 127 |
128 |
129 | Zipcode 130 | 132 | 133 |
134 |
135 |
136 |
137 | Password 138 | 140 |
141 |
142 | 144 |
145 |
146 | 147 |
148 | 150 |
151 |
152 |
153 |
154 |
155 |
156 | <%@ include file="footer.jsp"%> 157 | 158 | 159 | 170 | 171 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/page/slider.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 4 | 5 | 6 | 7 | 8 | "> 10 | 11 | 12 | "> 14 | 15 | 16 | 17 |
18 |
19 |
20 | 69 |
70 |
71 | 72 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/page/thankCustomer.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%> 2 | <%@ include file="/WEB-INF/page/navbar.jsp"%> 3 | <%@ page isELIgnored="false"%> 4 |
5 |
6 |
7 |
8 |
9 |

Thank you for your business!

10 | 11 |

Your order will be shipped in two business days!

12 |
13 |
14 |
15 | 16 |
17 |

18 | " class="btn btn-default">OK 19 |

20 |
21 |
22 |
23 | <%@ include file="productGrid.jsp"%> 24 | <%@ include file="/WEB-INF/page/footer.jsp"%> -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/page/userInfoView.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | 4 | 5 | 6 | 7 | User Info 8 | 9 | 10 | 11 | 12 |

Hello: ${user.EmailId}

13 | 14 | User Name: ${user.EmailId}
15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/bootstrap/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/bootstrap/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/bootstrap/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/bootstrap/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/bootstrap/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/bootstrap/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/bootstrap/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/bootstrap/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/bootstrap/js/npm.js: -------------------------------------------------------------------------------- 1 | // This file is autogenerated via the `commonjs` Grunt task. You can require() this file in a CommonJS environment. 2 | require('../../js/transition.js') 3 | require('../../js/alert.js') 4 | require('../../js/button.js') 5 | require('../../js/carousel.js') 6 | require('../../js/collapse.js') 7 | require('../../js/dropdown.js') 8 | require('../../js/modal.js') 9 | require('../../js/tooltip.js') 10 | require('../../js/popover.js') 11 | require('../../js/scrollspy.js') 12 | require('../../js/tab.js') 13 | require('../../js/affix.js') -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/countdown/countdown.jquery.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "countdown", 3 | "version": "1.0.0.0", 4 | "title": "jQuery CountDown Clock", 5 | "description": "Simple countdown plugin for product special offers", 6 | "keywords": [ 7 | "countdown", 8 | "timezone", 9 | "offset" 10 | ], 11 | "author": { 12 | "name": "Ekrem KAYA", 13 | "url": "https://e-piksel.com" 14 | }, 15 | "licenses": [ 16 | { 17 | "type": "GNU GPL v2", 18 | "url": "https://github.com/e-piksel/countdown/blob/master/LICENSE" 19 | } 20 | ], 21 | "homepage": "https://github.com/e-piksel/countdown", 22 | "docs": "https://github.com/e-piksel/countdown", 23 | "demo": "http://e-piksel.github.io/countdown/demo", 24 | "dependencies": { 25 | "jquery": ">=1.7" 26 | } 27 | } -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/countdown/demo.css: -------------------------------------------------------------------------------- 1 | @import url(http://fonts.googleapis.com/css?family=Open+Sans:300,400); 2 | body { 3 | background: #363f48; 4 | color: white; 5 | font: normal 12px 'Open Sans', sans-serif; 6 | margin-top: 20px; 7 | } -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/countdown/jquery.countdown.css: -------------------------------------------------------------------------------- 1 | 2 | ul#example { 3 | list-style: none; 4 | margin: 50px 0; 5 | padding: 0; 6 | display: block; 7 | text-align: center; 8 | } 9 | 10 | ul#example li { display: inline-block; } 11 | 12 | ul#example li span { 13 | font-size: 80px; 14 | font-weight: 300; 15 | line-height: 80px; 16 | } 17 | 18 | ul#example li.seperator { 19 | font-size: 80px; 20 | line-height: 70px; 21 | vertical-align: top; 22 | } 23 | 24 | ul#example li p { 25 | color: #a7abb1; 26 | font-size: 25px; 27 | } 28 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/countdown/jquery.countdown.js: -------------------------------------------------------------------------------- 1 | // CountDown Clock 2 | // Version : 1.0.1 3 | // Developer : Ekrem KAYA 4 | // Website : http://e-piksel.com 5 | // GitHub : https://github.com/epiksel/countdown 6 | 7 | (function ($) { 8 | $.fn.countdown = function (options, callback) { 9 | var settings = $.extend({ 10 | date: null, 11 | offset: null, 12 | day: 'Day', 13 | days: 'Days', 14 | hour: 'Hour', 15 | hours: 'Hours', 16 | minute: 'Minute', 17 | minutes: 'Minutes', 18 | second: 'Second', 19 | seconds: 'Seconds' 20 | }, options); 21 | 22 | // Throw error if date is not set 23 | if (!settings.date) { 24 | $.error('Date is not defined.'); 25 | } 26 | 27 | // Throw error if date is set incorectly 28 | if (!Date.parse(settings.date)) { 29 | $.error('Incorrect date format, it should look like this, 12/24/2012 12:00:00.'); 30 | } 31 | 32 | // Save container 33 | var container = this; 34 | 35 | /** 36 | * Change client's local date to match offset timezone 37 | * @return {Object} Fixed Date object. 38 | */ 39 | var currentDate = function () { 40 | // get client's current date 41 | var date = new Date(); 42 | 43 | // turn date to utc 44 | var utc = date.getTime() + (date.getTimezoneOffset() * 60000); 45 | 46 | // set new Date object 47 | var new_date = new Date(utc + (3600000*settings.offset)); 48 | 49 | return new_date; 50 | }; 51 | 52 | /** 53 | * Main countdown function that calculates everything 54 | */ 55 | function countdown () { 56 | var target_date = new Date(settings.date), // set target date 57 | current_date = currentDate(); // get fixed current date 58 | 59 | // difference of dates 60 | var difference = target_date - current_date; 61 | 62 | // if difference is negative than it's pass the target date 63 | if (difference < 0) { 64 | // stop timer 65 | clearInterval(interval); 66 | 67 | if (callback && typeof callback === 'function') callback(); 68 | 69 | return; 70 | } 71 | 72 | // basic math variables 73 | var _second = 1000, 74 | _minute = _second * 60, 75 | _hour = _minute * 60, 76 | _day = _hour * 24; 77 | 78 | // calculate dates 79 | var days = Math.floor(difference / _day), 80 | hours = Math.floor((difference % _day) / _hour), 81 | minutes = Math.floor((difference % _hour) / _minute), 82 | seconds = Math.floor((difference % _minute) / _second); 83 | 84 | // based on the date change the refrence wording 85 | var text_days = (days === 1) ? settings.day : settings.days, 86 | text_hours = (hours === 1) ? settings.hour : settings.hours, 87 | text_minutes = (minutes === 1) ? settings.minute : settings.minutes, 88 | text_seconds = (seconds === 1) ? settings.second : settings.seconds; 89 | 90 | // fix dates so that it will show two digets 91 | days = (String(days).length >= 2) ? days : '0' + days; 92 | hours = (String(hours).length >= 2) ? hours : '0' + hours; 93 | minutes = (String(minutes).length >= 2) ? minutes : '0' + minutes; 94 | seconds = (String(seconds).length >= 2) ? seconds : '0' + seconds; 95 | 96 | // set to DOM 97 | container.find('.days').text(days); 98 | container.find('.hours').text(hours); 99 | container.find('.minutes').text(minutes); 100 | container.find('.seconds').text(seconds); 101 | 102 | container.find('.days_text').text(text_days); 103 | container.find('.hours_text').text(text_hours); 104 | container.find('.minutes_text').text(text_minutes); 105 | container.find('.seconds_text').text(text_seconds); 106 | } 107 | 108 | // start 109 | var interval = setInterval(countdown, 1000); 110 | }; 111 | 112 | })(jQuery); 113 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/countdown/jquery.countdown.min.js: -------------------------------------------------------------------------------- 1 | // CountDown Clock 2 | // Version : 1.0.1 3 | // Developer : Ekrem KAYA 4 | // Website : http://e-piksel.com 5 | // GitHub : https://github.com/epiksel/countdown 6 | 7 | !function(t) { 8 | t.fn.countdown = function(e, n) { 9 | function o() { 10 | var t = new Date(r.date), e = s(), o = t - e; 11 | if (0 > o) 12 | return clearInterval(d), 13 | void (n && "function" == typeof n && n()); 14 | var a = 1e3, f = 60 * a, u = 60 * f, l = 24 * u, c = Math.floor(o 15 | / l), h = Math.floor(o % l / u), x = Math.floor(o % u / f), g = Math 16 | .floor(o % f / a), y = 1 === c ? r.day : r.days, m = 1 === h ? r.hour 17 | : r.hours, v = 1 === x ? r.minute : r.minutes, D = 1 === g ? r.second 18 | : r.seconds; 19 | c = String(c).length >= 2 ? c : "0" + c, 20 | h = String(h).length >= 2 ? h : "0" + h, 21 | x = String(x).length >= 2 ? x : "0" + x, 22 | g = String(g).length >= 2 ? g : "0" + g, i.find(".days") 23 | .text(c), i.find(".hours").text(h), i.find( 24 | ".minutes").text(x), i.find(".seconds").text(g), i 25 | .find(".days_text").text(y), i.find(".hours_text") 26 | .text(m), i.find(".minutes_text").text(v), i.find( 27 | ".seconds_text").text(D) 28 | } 29 | var r = t.extend({ 30 | date : null, 31 | offset : null, 32 | day : "Day", 33 | days : "Days", 34 | hour : "Hour", 35 | hours : "Hours", 36 | minute : "Minute", 37 | minutes : "Minutes", 38 | second : "Second", 39 | seconds : "Seconds" 40 | }, e); 41 | r.date || t.error("Date is not defined."), 42 | Date.parse(r.date) 43 | || t 44 | .error("Incorrect date format, it should look like this, 12/24/2012 12:00:00."); 45 | var i = this, s = function() { 46 | var t = new Date, e = t.getTime() + 6e4 * t.getTimezoneOffset(), n = new Date( 47 | e + 36e5 * r.offset); 48 | return n 49 | }, d = setInterval(o, 1e3) 50 | } 51 | }(jQuery); -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/css/ProductList.css: -------------------------------------------------------------------------------- 1 | @CHARSET "ISO-8859-1"; 2 | #productList{ 3 | background-color: rgba(241,241,241); 4 | } 5 | #productable{ 6 | 7 | } -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/css/aboutus.css: -------------------------------------------------------------------------------- 1 | /* For AboutUs Section */ 2 | .bg-1 { 3 | background-color: #5bc0de; /* Green */ 4 | color: #211935; 5 | } 6 | .bg-2 { 7 | background-color: rgb(123,113,148); /* Dark Blue */ 8 | color: #ffffff; 9 | } 10 | .bg-3 { 11 | background-color: #fff; /* White */ 12 | color: #555555; 13 | } 14 | @media (min-width:768px){.col-sm-1,.col-sm-10,.col-sm-11,.col-sm-12,.col-sm-2,.col-sm-3,.col-sm-4,.col-sm-5,.col-sm-6,.col-sm-7,.col-sm-8,.col-sm-9{ 15 | float:left; 16 | margin-top:20px; 17 | } 18 | 19 | @media(min-width:768px) 20 | .col-sm-4{ 21 | margin-top:0px; 22 | width:33.33333%; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/css/form-elements.css: -------------------------------------------------------------------------------- 1 | 2 | input[type="text"], 3 | input[type="password"], 4 | textarea, 5 | textarea.form-control { 6 | height: 50px; 7 | margin: 0; 8 | padding: 0 20px; 9 | vertical-align: middle; 10 | background: #fff; 11 | border: 3px solid #fff; 12 | font-family: 'Roboto', sans-serif; 13 | font-size: 16px; 14 | font-weight: 300; 15 | line-height: 50px; 16 | color: #888; 17 | -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; 18 | -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; 19 | -o-transition: all .3s; -moz-transition: all .3s; -webkit-transition: all .3s; -ms-transition: all .3s; transition: all .3s; 20 | } 21 | 22 | textarea, 23 | textarea.form-control { 24 | padding-top: 10px; 25 | padding-bottom: 10px; 26 | line-height: 30px; 27 | } 28 | 29 | input[type="text"]:focus, 30 | input[type="password"]:focus, 31 | textarea:focus, 32 | textarea.form-control:focus { 33 | outline: 0; 34 | background: #fff; 35 | border: 3px solid #fff; 36 | -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; 37 | } 38 | 39 | input[type="text"]:-moz-placeholder, input[type="password"]:-moz-placeholder, 40 | textarea:-moz-placeholder, textarea.form-control:-moz-placeholder { color: #888; } 41 | 42 | input[type="text"]:-ms-input-placeholder, input[type="password"]:-ms-input-placeholder, 43 | textarea:-ms-input-placeholder, textarea.form-control:-ms-input-placeholder { color: #888; } 44 | 45 | input[type="text"]::-webkit-input-placeholder, input[type="password"]::-webkit-input-placeholder, 46 | textarea::-webkit-input-placeholder, textarea.form-control::-webkit-input-placeholder { color: #888; } 47 | 48 | 49 | 50 | button.btn { 51 | height: 50px; 52 | margin: 0; 53 | padding: 0 20px; 54 | vertical-align: middle; 55 | background: #19b9e7; 56 | border: 0; 57 | font-family: 'Roboto', sans-serif; 58 | font-size: 16px; 59 | font-weight: 300; 60 | line-height: 50px; 61 | color: #fff; 62 | -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; 63 | text-shadow: none; 64 | -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; 65 | -o-transition: all .3s; -moz-transition: all .3s; -webkit-transition: all .3s; -ms-transition: all .3s; transition: all .3s; 66 | } 67 | 68 | button.btn:hover { opacity: 0.6; color: #fff; } 69 | 70 | button.btn:active { outline: 0; opacity: 0.6; color: #fff; -moz-box-shadow: none; -webkit-box-shadow: none; box-shadow: none; } 71 | 72 | button.btn:focus { outline: 0; opacity: 0.6; background: #19b9e7; color: #fff; } 73 | 74 | button.btn:active:focus, button.btn.active:focus { outline: 0; opacity: 0.6; background: #19b9e7; color: #fff; } 75 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/css/header.css: -------------------------------------------------------------------------------- 1 | .navbar-brand{ 2 | padding:0px 15px; 3 | font-size: 40px; 4 | } 5 | body{ 6 | font-size: 19px; 7 | line-height: 0.75; 8 | } 9 | .btn{ 10 | padding:8px 13px; 11 | margin-bottom: 0; 12 | margin-top: 13px; 13 | } 14 | .container-fluid{ 15 | padding-right: 23px; 16 | } 17 | .navbar{ 18 | min-height: 49px; 19 | margin-bottom: 7px; 20 | } 21 | .col-xs-6{ 22 | margin-top:8px; 23 | } 24 | 25 | /* Slider */ 26 | .carousel-inner>.item>a>img, .carousel-inner>.item>img{ 27 | line-height: 1; 28 | height: 292px; 29 | width: 1353px; 30 | } -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/css/overall.css: -------------------------------------------------------------------------------- 1 | 2 | /* Slider */ 3 | .carousel-inner>.item>a>img, .carousel-inner>.item>img{ 4 | line-height: 1; 5 | height: 292px; 6 | width: 1353px; 7 | } 8 | .container{ 9 | margin-top: -20px; 10 | } 11 | .container{ 12 | width:1335px; 13 | } 14 | .jumbotron{ 15 | background-color: rgb(210, 206, 219); 16 | margin-bottom:19px; 17 | padding-top:23px; 18 | padding-bottom:23px; 19 | } 20 | 21 | 22 | /* Navigation bar */ 23 | @CHARSET "ISO-8859-1"; 24 | .col-xs-6{ 25 | margin-top:11px; 26 | } 27 | .navbar-brand{ 28 | padding:0px 15px; 29 | font-size: 40px; 30 | } 31 | 32 | .btn{ 33 | padding:7px 13px; 34 | margin-bottom: 0; 35 | margin-top: 15px; 36 | margin-left: -10px; 37 | } 38 | .container-fluid{ 39 | padding-right: 23px; 40 | } 41 | .navbar{ 42 | min-height: 49px; 43 | margin-bottom: -4px; 44 | } 45 | .navbar-inverse{ 46 | background-color:#211935; 47 | border-color:#211935; 48 | } 49 | 50 | /* Footer */ 51 | .footer-distributed{ 52 | background-color: #292c2f; 53 | box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.12); 54 | box-sizing: border-box; 55 | width: 100%; 56 | text-align: left; 57 | font: normal 16px sans-serif; 58 | 59 | padding: 2px 15px; 60 | margin-top: -19px; 61 | } 62 | 63 | .footer-distributed .footer-left p{ 64 | color: #8f9296; 65 | font-size: 14px; 66 | margin: 0; 67 | } 68 | 69 | /* Footer links */ 70 | 71 | .footer-distributed p.footer-links{ 72 | font-size:18px; 73 | font-weight: bold; 74 | color: #ffffff; 75 | } 76 | 77 | .footer-distributed p.footer-links a{ 78 | display:inline-block; 79 | line-height: 1.8; 80 | text-decoration: none; 81 | color: inherit; 82 | } 83 | 84 | .footer-distributed .footer-right{ 85 | float: right; 86 | margin-top: 6px; 87 | max-width: 180px; 88 | } 89 | 90 | .footer-distributed .footer-right a{ 91 | display: inline-block; 92 | width: 35px; 93 | height: 35px; 94 | background-color: #33383b; 95 | border-radius: 2px; 96 | 97 | font-size: 20px; 98 | color: #ffffff; 99 | text-align: center; 100 | line-height: 35px; 101 | 102 | margin-left: 3px; 103 | } 104 | /* If you don't want the footer to be responsive, remove these media queries */ 105 | 106 | @media (max-width: 600px) { 107 | 108 | .footer-distributed .footer-left, 109 | .footer-distributed .footer-right{ 110 | text-align: center; 111 | } 112 | 113 | .footer-distributed .footer-right{ 114 | float: none; 115 | margin: 0 auto 20px; 116 | } 117 | 118 | .footer-distributed .footer-left p.footer-links{ 119 | line-height: 1.8; 120 | } 121 | } 122 | 123 | /* ProductList */ 124 | 125 | 126 | 127 | /*AboutUs Page*/ 128 | 129 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/css/register.css: -------------------------------------------------------------------------------- 1 | @import "font-awesome.min.css"; 2 | @import "font-awesome-ie7.min.css"; 3 | /* Space out content a bit */ 4 | /* Everything but the jumbotron gets side spacing for mobile first views */ 5 | .header, 6 | .marketing, 7 | .footer { 8 | padding-right: 15px; 9 | padding-left: 15px; 10 | } 11 | 12 | /* Custom page header */ 13 | .header { 14 | border-bottom: 1px solid #e5e5e5; 15 | } 16 | /* Make the masthead heading the same height as the navigation */ 17 | .header h3 { 18 | padding-bottom: 19px; 19 | margin-top: 0; 20 | margin-bottom: 0; 21 | line-height: 40px; 22 | } 23 | 24 | /* Custom page footer */ 25 | .footer { 26 | padding-top: 19px; 27 | color: #777; 28 | border-top: 1px solid #e5e5e5; 29 | } 30 | 31 | /* Customize container */ 32 | @media (min-width: 768px) { 33 | .container { 34 | max-width: 730px; 35 | } 36 | } 37 | .container-narrow > hr { 38 | margin: 30px 0; 39 | } 40 | 41 | /* Main marketing message and sign up button */ 42 | .jumbotron { 43 | text-align: center; 44 | border-bottom: 1px solid #e5e5e5; 45 | } 46 | .jumbotron .btn { 47 | padding: 14px 24px; 48 | font-size: 21px; 49 | } 50 | 51 | /* Supporting marketing content */ 52 | .marketing { 53 | margin: 40px 0; 54 | } 55 | .marketing p + h4 { 56 | margin-top: 28px; 57 | } 58 | 59 | /* Responsive: Portrait tablets and up */ 60 | @media screen and (min-width: 768px) { 61 | /* Remove the padding we set earlier */ 62 | .header, 63 | .marketing, 64 | .footer { 65 | padding-right: 0; 66 | padding-left: 0; 67 | } 68 | /* Space out the masthead */ 69 | .header { 70 | margin-bottom: 30px; 71 | } 72 | /* Remove the bottom border on the jumbotron for visual effect */ 73 | .jumbotron { 74 | border-bottom: 0; 75 | } 76 | } 77 | .form-actions{ 78 | margin:0; 79 | background-color: transparent;; 80 | text-align: center; 81 | } -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/css/style.css: -------------------------------------------------------------------------------- 1 | 2 | body { 3 | font-family: 'Roboto', sans-serif; 4 | font-size: 16px; 5 | font-weight: 300; 6 | color: #888; 7 | line-height: 30px; 8 | text-align: center; 9 | } 10 | 11 | strong { font-weight: 500; } 12 | 13 | a, a:hover, a:focus { 14 | color: #19b9e7; 15 | text-decoration: none; 16 | -o-transition: all .3s; -moz-transition: all .3s; -webkit-transition: all .3s; -ms-transition: all .3s; transition: all .3s; 17 | } 18 | 19 | h1, h2 { 20 | margin-top: 10px; 21 | font-size: 38px; 22 | font-weight: 100; 23 | color: #555; 24 | line-height: 50px; 25 | } 26 | 27 | h3 { 28 | font-size: 22px; 29 | font-weight: 300; 30 | color: #555; 31 | line-height: 30px; 32 | } 33 | 34 | img { max-width: 100%; } 35 | 36 | ::-moz-selection { background: #19b9e7; color: #fff; text-shadow: none; } 37 | ::selection { background: #19b9e7; color: #fff; text-shadow: none; } 38 | 39 | 40 | .btn-link-1 { 41 | display: inline-block; 42 | height: 50px; 43 | margin: 0 5px; 44 | padding: 16px 20px 0 20px; 45 | background: #19b9e7; 46 | font-size: 16px; 47 | font-weight: 300; 48 | line-height: 16px; 49 | color: #fff; 50 | -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; 51 | } 52 | .btn-link-1:hover, .btn-link-1:focus, .btn-link-1:active { outline: 0; opacity: 0.6; color: #fff; } 53 | 54 | .btn-link-2 { 55 | display: inline-block; 56 | height: 50px; 57 | margin: 0 5px; 58 | padding: 15px 20px 0 20px; 59 | background: rgba(0, 0, 0, 0.3); 60 | border: 1px solid #fff; 61 | font-size: 16px; 62 | font-weight: 300; 63 | line-height: 16px; 64 | color: #fff; 65 | -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; 66 | } 67 | .btn-link-2:hover, .btn-link-2:focus, 68 | .btn-link-2:active, .btn-link-2:active:focus { outline: 0; opacity: 0.6; background: rgba(0, 0, 0, 0.3); color: #fff; } 69 | 70 | 71 | /***** Top menu *****/ 72 | 73 | .navbar { 74 | padding-top: 10px; 75 | background: #333; 76 | background: rgba(51, 51, 51, 0.3); 77 | border: 0; 78 | -o-transition: all .3s; -moz-transition: all .3s; -webkit-transition: all .3s; -ms-transition: all .3s; transition: all .3s; 79 | } 80 | .navbar.navbar-no-bg { background: none; } 81 | 82 | ul.navbar-nav { 83 | font-size: 16px; 84 | color: #fff; 85 | } 86 | 87 | .navbar-inverse ul.navbar-nav li { padding-top: 8px; padding-bottom: 8px; } 88 | 89 | .navbar-inverse ul.navbar-nav li .li-text { opacity: 0.8; } 90 | 91 | .navbar-inverse ul.navbar-nav li a { display: inline; padding: 0; color: #fff; } 92 | .navbar-inverse ul.navbar-nav li a:hover { color: #fff; opacity: 1; border-bottom: 1px dotted #fff; } 93 | .navbar-inverse ul.navbar-nav li a:focus { color: #fff; outline: 0; opacity: 1; border-bottom: 1px dotted #fff; } 94 | 95 | .navbar-inverse ul.navbar-nav li .li-social a { 96 | margin: 0 5px; 97 | font-size: 28px; 98 | vertical-align: middle; 99 | } 100 | .navbar-inverse ul.navbar-nav li .li-social a:hover, 101 | .navbar-inverse ul.navbar-nav li .li-social a:focus { border: 0; color: #19b9e7; } 102 | 103 | .navbar-brand { 104 | width: 113px; 105 | background: url(../img/logo.png) left center no-repeat; 106 | text-indent: -99999px; 107 | } 108 | 109 | 110 | /***** Top content *****/ 111 | 112 | .inner-bg { 113 | padding: 40px 0 170px 0; 114 | } 115 | 116 | .top-content .text { 117 | color: #fff; 118 | } 119 | 120 | .top-content .text h1 { color: #fff; } 121 | 122 | .top-content .description { 123 | margin: 20px 0 10px 0; 124 | } 125 | 126 | .top-content .description p { opacity: 0.8; } 127 | 128 | .top-content .description a { 129 | color: #fff; 130 | } 131 | .top-content .description a:hover, 132 | .top-content .description a:focus { border-bottom: 1px dotted #fff; } 133 | 134 | .top-content .top-big-link { 135 | margin-top: 35px; 136 | } 137 | 138 | .form-box { 139 | padding-top: 40px; 140 | } 141 | 142 | .form-top { 143 | overflow: hidden; 144 | padding: 0 25px 15px 25px; 145 | background: #444; 146 | background: rgba(0, 0, 0, 0.35); 147 | -moz-border-radius: 4px 4px 0 0; -webkit-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; 148 | text-align: left; 149 | } 150 | 151 | .form-top-left { 152 | float: left; 153 | width: 75%; 154 | padding-top: 25px; 155 | } 156 | 157 | .form-top-left h3 { margin-top: 0; color: #fff; } 158 | .form-top-left p { opacity: 0.8; color: #fff; } 159 | 160 | .form-top-right { 161 | float: left; 162 | width: 25%; 163 | padding-top: 5px; 164 | font-size: 66px; 165 | color: #fff; 166 | line-height: 100px; 167 | text-align: right; 168 | opacity: 0.3; 169 | } 170 | 171 | .form-bottom { 172 | padding: 25px 25px 30px 25px; 173 | background: #444; 174 | background: rgba(0, 0, 0, 0.3); 175 | -moz-border-radius: 0 0 4px 4px; -webkit-border-radius: 0 0 4px 4px; border-radius: 0 0 4px 4px; 176 | text-align: left; 177 | } 178 | 179 | .form-bottom form textarea { 180 | height: 100px; 181 | } 182 | 183 | .form-bottom form .input-error { 184 | border-color: #19b9e7; 185 | } 186 | 187 | .form-bottom p { opacity: 0.8; color: #fff; } 188 | 189 | 190 | /***** Media queries *****/ 191 | 192 | @media (min-width: 992px) and (max-width: 1199px) {} 193 | 194 | @media (min-width: 768px) and (max-width: 991px) {} 195 | 196 | @media (max-width: 767px) { 197 | 198 | .navbar { padding-top: 0; } 199 | .navbar.navbar-no-bg { background: #333; background: rgba(51, 51, 51, 0.9); } 200 | .navbar-brand { height: 60px; margin-left: 15px; } 201 | .navbar-collapse { border: 0; } 202 | .navbar-toggle { margin-top: 12px; } 203 | 204 | .inner-bg { padding: 40px 0 110px 0; } 205 | .top-content .top-big-link { margin-top: 25px; } 206 | .top-content .top-big-link a.btn { margin-top: 10px; } 207 | 208 | } 209 | 210 | @media (max-width: 415px) { 211 | 212 | h1, h2 { font-size: 32px; } 213 | 214 | } 215 | 216 | 217 | /* Retina-ize images/icons */ 218 | 219 | @media 220 | only screen and (-webkit-min-device-pixel-ratio: 2), 221 | only screen and ( min--moz-device-pixel-ratio: 2), 222 | only screen and ( -o-min-device-pixel-ratio: 2/1), 223 | only screen and ( min-device-pixel-ratio: 2), 224 | only screen and ( min-resolution: 192dpi), 225 | only screen and ( min-resolution: 2dppx) { 226 | 227 | /* logo */ 228 | .navbar-brand { 229 | background-image: url(../img/logo@2x.png) !important; background-repeat: no-repeat !important; background-size: 113px 32px !important; 230 | } 231 | 232 | } 233 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/1.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/aboutImage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/aboutImage.png -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/favicon1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/favicon1.png -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/oppo.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/oppo.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/oppo1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/oppo1.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/oppo2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/oppo2.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/oppo3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/oppo3.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/oppo4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/oppo4.png -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/products/1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/products/1.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/products/2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/products/2.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/products/3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/products/3.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/products/4.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/products/4.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/products/5.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/products/5.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/products/6.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/products/6.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/products/five.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/products/five.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/products/seven.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/products/seven.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/products/two.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/products/two.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/screenshots/AdminLogin.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/screenshots/AdminLogin.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/screenshots/AdminLoginAddProduct.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/screenshots/AdminLoginAddProduct.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/screenshots/AdminLoginProductList.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/screenshots/AdminLoginProductList.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/screenshots/AdminLoginUserManagement.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/screenshots/AdminLoginUserManagement.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/screenshots/ConfirmCustomerDetails.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/screenshots/ConfirmCustomerDetails.png -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/screenshots/ConfirmShippingAddress.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/screenshots/ConfirmShippingAddress.png -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/screenshots/ContactUs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/screenshots/ContactUs.png -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/screenshots/Home.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/screenshots/Home.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/screenshots/LoginForm.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/screenshots/LoginForm.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/screenshots/Receipt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/screenshots/Receipt.png -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/screenshots/SpringSecurity.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/screenshots/SpringSecurity.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/screenshots/ThankYou.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/screenshots/ThankYou.png -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/screenshots/UserLoginProductList.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/screenshots/UserLoginProductList.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/screenshots/cartList.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/screenshots/cartList.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/screenshots/registrationForm.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/screenshots/registrationForm.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/images/shopieasy-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/shardwiz/java-spring-boot-ecommerce/9e092f4dac70be93474b18eddd744243ee1c8668/src/main/webapp/WEB-INF/resource/images/shopieasy-logo.png -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/js/jquery.backstretch.min.js: -------------------------------------------------------------------------------- 1 | /*! Backstretch - v2.0.4 - 2013-06-19 2 | * http://srobbin.com/jquery-plugins/backstretch/ 3 | * Copyright (c) 2013 Scott Robbin; Licensed MIT */ 4 | (function(a,d,p){a.fn.backstretch=function(c,b){(c===p||0===c.length)&&a.error("No images were supplied for Backstretch");0===a(d).scrollTop()&&d.scrollTo(0,0);return this.each(function(){var d=a(this),g=d.data("backstretch");if(g){if("string"==typeof c&&"function"==typeof g[c]){g[c](b);return}b=a.extend(g.options,b);g.destroy(!0)}g=new q(this,c,b);d.data("backstretch",g)})};a.backstretch=function(c,b){return a("body").backstretch(c,b).data("backstretch")};a.expr[":"].backstretch=function(c){return a(c).data("backstretch")!==p};a.fn.backstretch.defaults={centeredX:!0,centeredY:!0,duration:5E3,fade:0};var r={left:0,top:0,overflow:"hidden",margin:0,padding:0,height:"100%",width:"100%",zIndex:-999999},s={position:"absolute",display:"none",margin:0,padding:0,border:"none",width:"auto",height:"auto",maxHeight:"none",maxWidth:"none",zIndex:-999999},q=function(c,b,e){this.options=a.extend({},a.fn.backstretch.defaults,e||{});this.images=a.isArray(b)?b:[b];a.each(this.images,function(){a("")[0].src=this});this.isBody=c===document.body;this.$container=a(c);this.$root=this.isBody?l?a(d):a(document):this.$container;c=this.$container.children(".backstretch").first();this.$wrap=c.length?c:a('
').css(r).appendTo(this.$container);this.isBody||(c=this.$container.css("position"),b=this.$container.css("zIndex"),this.$container.css({position:"static"===c?"relative":c,zIndex:"auto"===b?0:b,background:"none"}),this.$wrap.css({zIndex:-999998}));this.$wrap.css({position:this.isBody&&l?"fixed":"absolute"});this.index=0;this.show(this.index);a(d).on("resize.backstretch",a.proxy(this.resize,this)).on("orientationchange.backstretch",a.proxy(function(){this.isBody&&0===d.pageYOffset&&(d.scrollTo(0,1),this.resize())},this))};q.prototype={resize:function(){try{var a={left:0,top:0},b=this.isBody?this.$root.width():this.$root.innerWidth(),e=b,g=this.isBody?d.innerHeight?d.innerHeight:this.$root.height():this.$root.innerHeight(),j=e/this.$img.data("ratio"),f;j>=g?(f=(j-g)/2,this.options.centeredY&&(a.top="-"+f+"px")):(j=g,e=j*this.$img.data("ratio"),f=(e-b)/2,this.options.centeredX&&(a.left="-"+f+"px"));this.$wrap.css({width:b,height:g}).find("img:not(.deleteable)").css({width:e,height:j}).css(a)}catch(h){}return this},show:function(c){if(!(Math.abs(c)>this.images.length-1)){var b=this,e=b.$wrap.find("img").addClass("deleteable"),d={relatedTarget:b.$container[0]};b.$container.trigger(a.Event("backstretch.before",d),[b,c]);this.index=c;clearInterval(b.interval);b.$img=a("").css(s).bind("load",function(f){var h=this.width||a(f.target).width();f=this.height||a(f.target).height();a(this).data("ratio",h/f);a(this).fadeIn(b.options.speed||b.options.fade,function(){e.remove();b.paused||b.cycle();a(["after","show"]).each(function(){b.$container.trigger(a.Event("backstretch."+this,d),[b,c])})});b.resize()}).appendTo(b.$wrap);b.$img.attr("src",b.images[c]);return b}},next:function(){return this.show(this.indexe||d.operamini&&"[object OperaMini]"==={}.toString.call(d.operamini)||n&&7458>t||-1e||h&&6>h||"palmGetResource"in d&&e&&534>e||-1=k)})(jQuery,window); -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/js/placeholder.js: -------------------------------------------------------------------------------- 1 | 2 | $(document).ready(function(){ 3 | 4 | $('input[type="text"], input[type="password"], textarea').each(function() { 5 | $(this).val( $(this).attr('placeholder') ); 6 | }); 7 | 8 | }); -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/js/productController.js: -------------------------------------------------------------------------------- 1 | var app = angular.module("myapp", []).controller( 2 | "myController", 3 | function($scope, $http) { 4 | 5 | var BASE_PATH = "http://localhost:8080"; 6 | 7 | $scope.getProductList = function() { 8 | $http.get(BASE_PATH + "/getProductsList") 9 | .success(function(data) { 10 | $scope.products = data; 11 | }); 12 | } 13 | 14 | $scope.addToCart = function(productId) { 15 | $http.put(BASE_PATH + "/cart/add/" + productId) 16 | .success(function() { 17 | alert("Added Successfully"); 18 | }) 19 | } 20 | 21 | $scope.refreshCart = function() { 22 | $http.get(BASE_PATH + "/cart/getCart/" 23 | + $scope.cartId).success(function(data) { 24 | 25 | $scope.carts = data; 26 | }) 27 | } 28 | 29 | $scope.getCart = function(cartId) { 30 | $scope.cartId = cartId; 31 | $scope.refreshCart(cartId); 32 | } 33 | $scope.removeFromCart = function(cartItemId) { 34 | $http.put(BASE_PATH +"/cart/removeCartItem/" 35 | + cartItemId).success(function() { 36 | $scope.refreshCart(); 37 | }); 38 | } 39 | 40 | $scope.clearCart = function() { 41 | $http.put(BASE_PATH + "/cart/removeAllItems/" 42 | + $scope.cartId).success(function() { 43 | $scope.refreshCart(); 44 | }); 45 | } 46 | 47 | $scope.calculateGrandTotal = function() { 48 | var grandTotal = 0.0; 49 | for (var i = 0; i < $scope.carts.cartItem.length; i++) 50 | grandTotal = grandTotal + $scope.carts.cartItem[i].price; 51 | return grandTotal; 52 | 53 | } 54 | }); 55 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/js/retina-1.1.0.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Retina.js v1.1.0 3 | * 4 | * Copyright 2013 Imulus, LLC 5 | * Released under the MIT license 6 | * 7 | * Retina.js is an open source script that makes it easy to serve 8 | * high-resolution images to devices with retina displays. 9 | */ 10 | (function() { 11 | 12 | var root = (typeof exports == 'undefined' ? window : exports); 13 | 14 | var config = { 15 | // Ensure Content-Type is an image before trying to load @2x image 16 | // https://github.com/imulus/retinajs/pull/45) 17 | check_mime_type: true 18 | }; 19 | 20 | 21 | 22 | root.Retina = Retina; 23 | 24 | function Retina() {} 25 | 26 | Retina.configure = function(options) { 27 | if (options == null) options = {}; 28 | for (var prop in options) config[prop] = options[prop]; 29 | }; 30 | 31 | Retina.init = function(context) { 32 | if (context == null) context = root; 33 | 34 | var existing_onload = context.onload || new Function; 35 | 36 | context.onload = function() { 37 | var images = document.getElementsByTagName("img"), retinaImages = [], i, image; 38 | for (i = 0; i < images.length; i++) { 39 | image = images[i]; 40 | retinaImages.push(new RetinaImage(image)); 41 | } 42 | existing_onload(); 43 | } 44 | }; 45 | 46 | Retina.isRetina = function(){ 47 | var mediaQuery = "(-webkit-min-device-pixel-ratio: 1.5),\ 48 | (min--moz-device-pixel-ratio: 1.5),\ 49 | (-o-min-device-pixel-ratio: 3/2),\ 50 | (min-resolution: 1.5dppx)"; 51 | 52 | if (root.devicePixelRatio > 1) 53 | return true; 54 | 55 | if (root.matchMedia && root.matchMedia(mediaQuery).matches) 56 | return true; 57 | 58 | return false; 59 | }; 60 | 61 | 62 | root.RetinaImagePath = RetinaImagePath; 63 | 64 | function RetinaImagePath(path, at_2x_path) { 65 | this.path = path; 66 | if (typeof at_2x_path !== "undefined" && at_2x_path !== null) { 67 | this.at_2x_path = at_2x_path; 68 | this.perform_check = false; 69 | } else { 70 | this.at_2x_path = path.replace(/\.\w+$/, function(match) { return "@2x" + match; }); 71 | this.perform_check = true; 72 | } 73 | } 74 | 75 | RetinaImagePath.confirmed_paths = []; 76 | 77 | RetinaImagePath.prototype.is_external = function() { 78 | return !!(this.path.match(/^https?\:/i) && !this.path.match('//' + document.domain) ) 79 | } 80 | 81 | RetinaImagePath.prototype.check_2x_variant = function(callback) { 82 | var http, that = this; 83 | if (this.is_external()) { 84 | return callback(false); 85 | } else if (!this.perform_check && typeof this.at_2x_path !== "undefined" && this.at_2x_path !== null) { 86 | return callback(true); 87 | } else if (this.at_2x_path in RetinaImagePath.confirmed_paths) { 88 | return callback(true); 89 | } else { 90 | http = new XMLHttpRequest; 91 | http.open('HEAD', this.at_2x_path); 92 | http.onreadystatechange = function() { 93 | if (http.readyState != 4) { 94 | return callback(false); 95 | } 96 | 97 | if (http.status >= 200 && http.status <= 399) { 98 | if (config.check_mime_type) { 99 | var type = http.getResponseHeader('Content-Type'); 100 | if (type == null || !type.match(/^image/i)) { 101 | return callback(false); 102 | } 103 | } 104 | 105 | RetinaImagePath.confirmed_paths.push(that.at_2x_path); 106 | return callback(true); 107 | } else { 108 | return callback(false); 109 | } 110 | } 111 | http.send(); 112 | } 113 | } 114 | 115 | 116 | 117 | function RetinaImage(el) { 118 | this.el = el; 119 | this.path = new RetinaImagePath(this.el.getAttribute('src'), this.el.getAttribute('data-at2x')); 120 | var that = this; 121 | this.path.check_2x_variant(function(hasVariant) { 122 | if (hasVariant) that.swap(); 123 | }); 124 | } 125 | 126 | root.RetinaImage = RetinaImage; 127 | 128 | RetinaImage.prototype.swap = function(path) { 129 | if (typeof path == 'undefined') path = this.path.at_2x_path; 130 | 131 | var that = this; 132 | function load() { 133 | if (! that.el.complete) { 134 | setTimeout(load, 5); 135 | } else { 136 | that.el.setAttribute('width', that.el.offsetWidth); 137 | that.el.setAttribute('height', that.el.offsetHeight); 138 | that.el.setAttribute('src', path); 139 | } 140 | } 141 | load(); 142 | } 143 | 144 | 145 | 146 | 147 | if (Retina.isRetina()) { 148 | Retina.init(root); 149 | } 150 | 151 | })(); 152 | 153 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/js/retina-1.1.0.min.js: -------------------------------------------------------------------------------- 1 | /*! 2 | * Retina.js v1.1.0 3 | * 4 | * Copyright 2013 Imulus, LLC 5 | * Released under the MIT license 6 | * 7 | * Retina.js is an open source script that makes it easy to serve 8 | * high-resolution images to devices with retina displays. 9 | */ 10 | (function(){var root=typeof exports=="undefined"?window:exports;var config={check_mime_type:true};root.Retina=Retina;function Retina(){}Retina.configure=function(options){if(options==null)options={};for(var prop in options)config[prop]=options[prop]};Retina.init=function(context){if(context==null)context=root;var existing_onload=context.onload||new Function;context.onload=function(){var images=document.getElementsByTagName("img"),retinaImages=[],i,image;for(i=0;i1)return true;if(root.matchMedia&&root.matchMedia(mediaQuery).matches)return true;return false};root.RetinaImagePath=RetinaImagePath;function RetinaImagePath(path,at_2x_path){this.path=path;if(typeof at_2x_path!=="undefined"&&at_2x_path!==null){this.at_2x_path=at_2x_path;this.perform_check=false}else{this.at_2x_path=path.replace(/\.\w+$/,function(match){return"@2x"+match});this.perform_check=true}}RetinaImagePath.confirmed_paths=[];RetinaImagePath.prototype.is_external=function(){return!!(this.path.match(/^https?\:/i)&&!this.path.match("//"+document.domain))};RetinaImagePath.prototype.check_2x_variant=function(callback){var http,that=this;if(this.is_external()){return callback(false)}else if(!this.perform_check&&typeof this.at_2x_path!=="undefined"&&this.at_2x_path!==null){return callback(true)}else if(this.at_2x_path in RetinaImagePath.confirmed_paths){return callback(true)}else{http=new XMLHttpRequest;http.open("HEAD",this.at_2x_path);http.onreadystatechange=function(){if(http.readyState!=4){return callback(false)}if(http.status>=200&&http.status<=399){if(config.check_mime_type){var type=http.getResponseHeader("Content-Type");if(type==null||!type.match(/^image/i)){return callback(false)}}RetinaImagePath.confirmed_paths.push(that.at_2x_path);return callback(true)}else{return callback(false)}};http.send()}};function RetinaImage(el){this.el=el;this.path=new RetinaImagePath(this.el.getAttribute("src"),this.el.getAttribute("data-at2x"));var that=this;this.path.check_2x_variant(function(hasVariant){if(hasVariant)that.swap()})}root.RetinaImage=RetinaImage;RetinaImage.prototype.swap=function(path){if(typeof path=="undefined")path=this.path.at_2x_path;var that=this;function load(){if(!that.el.complete){setTimeout(load,5)}else{that.el.setAttribute("width",that.el.offsetWidth);that.el.setAttribute("height",that.el.offsetHeight);that.el.setAttribute("src",path)}}load()};if(Retina.isRetina()){Retina.init(root)}})(); -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resource/js/scripts.js: -------------------------------------------------------------------------------- 1 | 2 | jQuery(document).ready(function() { 3 | 4 | /* 5 | Fullscreen background 6 | */ 7 | $.backstretch("WEB-INF/resource/images/1.jpg"); 8 | 9 | /* 10 | Login form validation 11 | */ 12 | $('.login-form input[type="text"], .login-form input[type="password"], .login-form textarea').on('focus', function() { 13 | $(this).removeClass('input-error'); 14 | }); 15 | 16 | $('.login-form').on('submit', function(e) { 17 | 18 | $(this).find('input[type="text"], input[type="password"], textarea').each(function(){ 19 | if( $(this).val() == "" ) { 20 | e.preventDefault(); 21 | $(this).addClass('input-error'); 22 | } 23 | else { 24 | $(this).removeClass('input-error'); 25 | } 26 | }); 27 | 28 | }); 29 | 30 | /* 31 | Registration form validation 32 | */ 33 | $('.registration-form input[type="text"], .registration-form textarea').on('focus', function() { 34 | $(this).removeClass('input-error'); 35 | }); 36 | 37 | $('.registration-form').on('submit', function(e) { 38 | 39 | $(this).find('input[type="text"], textarea').each(function(){ 40 | if( $(this).val() == "" ) { 41 | e.preventDefault(); 42 | $(this).addClass('input-error'); 43 | } 44 | else { 45 | $(this).removeClass('input-error'); 46 | } 47 | }); 48 | 49 | }); 50 | 51 | 52 | }); 53 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | ShopIeasy 7 | 8 | 9 | 10 | contextConfigLocation 11 | 12 | /WEB-INF/dispatcher-servlet.xml, 13 | /WEB-INF/applicationContext.xml 14 | 15 | 16 | 17 | 18 | 19 | 20 | springSecurityFilterChain 21 | 22 | 23 | org.springframework.web.filter.DelegatingFilterProxy 24 | 25 | 26 | 27 | 28 | springSecurityFilterChain 29 | /* 30 | 31 | 32 | 33 | 34 | 35 | org.springframework.web.context.ContextLoaderListener 36 | 37 | 38 | 39 | 40 | dispatcher 41 | org.springframework.web.servlet.DispatcherServlet 42 | 43 | 44 | 45 | dispatcher 46 | / 47 | 48 | 49 | -------------------------------------------------------------------------------- /src/main/webapp/index.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=ISO-8859-1" 2 | pageEncoding="ISO-8859-1"%> 3 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%> 4 | 5 | 6 | 7 | 8 | ShopIeasy 9 | " /> 10 | 11 | 12 | <%@ include file="WEB-INF/page/navbar.jsp"%> 13 | <%@ include file="WEB-INF/page/slider.jsp"%> 14 | <%@ include file="WEB-INF/page/productGrid.jsp"%> 15 | <%@ include file="WEB-INF/page/footer.jsp"%> 16 | 17 | -------------------------------------------------------------------------------- /target/m2e-wtp/web-resources/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Built-By: ikismail 3 | Build-Jdk: 1.8.0_181 4 | Created-By: Maven Integration for Eclipse 5 | 6 | --------------------------------------------------------------------------------