├── contact.xlsx ├── .idea ├── copyright │ └── profiles_settings.xml ├── inspectionProfiles │ ├── profiles_settings.xml │ └── Project_Default.xml ├── modules.xml ├── libraries │ ├── slf4j.xml │ ├── logback_full.xml │ ├── Maven__jstl_jstl_1_2.xml │ ├── Maven__ant_ant_1_6_5.xml │ ├── Maven__antlr_antlr_2_7_7.xml │ ├── Maven__dom4j_dom4j_1_6_1.xml │ ├── Maven__javax_transaction_jta_1_1.xml │ ├── Maven__taglibs_standard_1_1_2.xml │ ├── Maven__xml_apis_xml_apis_1_0_b2.xml │ ├── Maven__commons_io_commons_io_2_4.xml │ ├── Maven__org_slf4j_slf4j_api_1_6_1.xml │ ├── Maven__aopalliance_aopalliance_1_0.xml │ ├── Maven__freemarker_freemarker_2_3_8.xml │ ├── Maven__javax_servlet_servlet_api_2_5.xml │ ├── Maven__org_hibernate_jtidy_r8_20060801.xml │ ├── Maven__org_javassist_javassist_3_15_0_GA.xml │ ├── Maven__commons_logging_commons_logging_1_2.xml │ ├── Maven__mysql_mysql_connector_java_5_1_38.xml │ ├── Maven__org_eclipse_text_3_2_0_v20060605_1400.xml │ ├── Maven__javax_validation_validation_api_1_0_0_GA.xml │ ├── Maven__org_eclipse_osgi_3_10_0_v20140606_1445.xml │ ├── Maven__org_jboss_logging_jboss_logging_3_1_0_CR2.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_core_2_5_1.xml │ ├── Maven__org_hibernate_hibernate_core_4_0_1_Final.xml │ ├── Maven__org_eclipse_core_jobs_3_6_0_v20140424_0053.xml │ ├── Maven__org_hibernate_hibernate_tools_4_0_1_Final.xml │ ├── Maven__org_springframework_spring_tx_4_1_4_RELEASE.xml │ ├── Maven__commons_fileupload_commons_fileupload_1_2_2.xml │ ├── Maven__org_springframework_spring_aop_4_1_4_RELEASE.xml │ ├── Maven__org_springframework_spring_orm_4_1_4_RELEASE.xml │ ├── Maven__org_springframework_spring_web_4_1_4_RELEASE.xml │ ├── Maven__commons_collections_commons_collections_3_2_1.xml │ ├── Maven__org_springframework_spring_core_4_1_4_RELEASE.xml │ ├── Maven__org_springframework_spring_jdbc_4_1_4_RELEASE.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_databind_2_5_1.xml │ ├── Maven__org_eclipse_equinox_app_1_3_200_v20130910_1609.xml │ ├── Maven__org_springframework_spring_beans_4_1_4_RELEASE.xml │ ├── Maven__org_springframework_spring_webmvc_4_1_4_RELEASE.xml │ ├── Maven__org_eclipse_core_commands_3_3_0_I20070605_0010.xml │ ├── Maven__org_eclipse_core_runtime_3_10_0_v20140318_2214.xml │ ├── Maven__org_hibernate_hibernate_validator_4_2_0_Final.xml │ ├── Maven__org_springframework_spring_context_4_1_4_RELEASE.xml │ ├── Maven__com_fasterxml_jackson_core_jackson_annotations_2_5_1.xml │ ├── Maven__org_eclipse_equinox_common_3_6_200_v20130402_1505.xml │ ├── Maven__org_eclipse_equinox_registry_3_5_400_v20140428_1507.xml │ ├── Maven__org_hibernate_hibernate_entitymanager_4_0_1_Final.xml │ ├── Maven__org_springframework_spring_expression_4_1_4_RELEASE.xml │ ├── Maven__org_eclipse_core_contenttype_3_4_200_v20140207_1251.xml │ ├── Maven__org_eclipse_equinox_preferences_3_5_200_v20140224_1527.xml │ ├── Maven__org_hibernate_hibernate_commons_annotations_3_2_0_Final.xml │ ├── Maven__org_springframework_security_spring_security_web_3_1_4_RELEASE.xml │ ├── Maven__org_eclipse_tycho_org_eclipse_jdt_core_3_9_1_v20130905_0837.xml │ ├── Maven__org_springframework_security_spring_security_core_3_1_4_RELEASE.xml │ ├── Maven__org_hibernate_javax_persistence_hibernate_jpa_2_0_api_1_0_1_Final.xml │ ├── Maven__org_hibernate_common_hibernate_commons_annotations_4_0_1_Final.xml │ ├── Maven__org_springframework_security_spring_security_config_3_1_4_RELEASE.xml │ └── Maven__org_jboss_spec_javax_transaction_jboss_transaction_api_1_1_spec_1_0_0_Final.xml ├── compiler.xml ├── misc.xml ├── artifacts │ └── emusicstore_Web_exploded.xml └── uiDesigner.xml ├── lib ├── aopalliance-1.0.jar ├── commons-logging-1.1.3.jar ├── spring-aop-4.2.5.RELEASE.jar ├── spring-core-4.2.5.RELEASE.jar ├── spring-jdbc-4.2.5.RELEASE.jar ├── spring-jms-4.2.5.RELEASE.jar ├── spring-orm-4.2.5.RELEASE.jar ├── spring-oxm-4.2.5.RELEASE.jar ├── spring-test-4.2.5.RELEASE.jar ├── spring-tx-4.2.5.RELEASE.jar ├── spring-web-4.2.5.RELEASE.jar ├── spring-beans-4.2.5.RELEASE.jar ├── spring-webmvc-4.2.5.RELEASE.jar ├── spring-aspects-4.2.5.RELEASE.jar ├── spring-context-4.2.5.RELEASE.jar ├── spring-messaging-4.2.5.RELEASE.jar ├── spring-websocket-4.2.5.RELEASE.jar ├── spring-expression-4.2.5.RELEASE.jar ├── spring-instrument-4.2.5.RELEASE.jar ├── spring-webmvc-portlet-4.2.5.RELEASE.jar ├── spring-context-support-4.2.5.RELEASE.jar └── spring-instrument-tomcat-4.2.5.RELEASE.jar ├── src └── main │ ├── webapp │ ├── META-INF │ │ └── MANIFEST.MF │ └── WEB-INF │ │ ├── lib │ │ ├── slf4j.jar │ │ ├── jstl-1.2.jar │ │ ├── jta-1.1.jar │ │ ├── logback.jar │ │ ├── ant-1.6.5.jar │ │ ├── antlr-2.7.7.jar │ │ ├── dom4j-1.6.1.jar │ │ ├── aopalliance-1.0.jar │ │ ├── commons-io-2.4.jar │ │ ├── freemarker-2.3.8.jar │ │ ├── standard-1.1.2.jar │ │ ├── xml-apis-1.0.b2.jar │ │ ├── javax.servlet-3.0.jar │ │ ├── jtidy-r8-20060801.jar │ │ ├── commons-logging-1.2.jar │ │ ├── javassist-3.15.0-GA.jar │ │ ├── jboss-logging-3.1.0.CR2.jar │ │ ├── spring-tx-4.1.4.RELEASE.jar │ │ ├── validation-api-1.0.0.GA.jar │ │ ├── app-1.3.200-v20130910-1609.jar │ │ ├── commons-collections-3.2.1.jar │ │ ├── commons-fileupload-1.2.2.jar │ │ ├── hibernate-core-4.0.1.Final.jar │ │ ├── jobs-3.6.0-v20140424-0053.jar │ │ ├── osgi-3.10.0-v20140606-1445.jar │ │ ├── spring-aop-4.1.4.RELEASE.jar │ │ ├── spring-beans-4.1.4.RELEASE.jar │ │ ├── spring-core-4.1.4.RELEASE.jar │ │ ├── spring-jdbc-4.1.4.RELEASE.jar │ │ ├── spring-orm-4.1.4.RELEASE.jar │ │ ├── spring-web-4.1.4.RELEASE.jar │ │ ├── text-3.2.0-v20060605-1400.jar │ │ ├── hibernate-tools-4.0.1.Final.jar │ │ ├── mysql-connector-java-5.1.38.jar │ │ ├── spring-context-4.1.4.RELEASE.jar │ │ ├── spring-webmvc-4.1.4.RELEASE.jar │ │ ├── commands-3.3.0-I20070605-0010.jar │ │ ├── common-3.6.200-v20130402-1505.jar │ │ ├── hibernate-validator-4.2.0.Final.jar │ │ ├── registry-3.5.400-v20140428-1507.jar │ │ ├── runtime-3.10.0-v20140318-2214.jar │ │ ├── spring-expression-4.1.4.RELEASE.jar │ │ ├── hibernate-jpa-2.0-api-1.0.1.Final.jar │ │ ├── spring-security-web-3.1.4.RELEASE.jar │ │ ├── contenttype-3.4.200-v20140207-1251.jar │ │ ├── hibernate-entitymanager-4.0.1.Final.jar │ │ ├── preferences-3.5.200-v20140224-1527.jar │ │ ├── spring-security-config-3.1.4.RELEASE.jar │ │ ├── spring-security-core-3.1.4.RELEASE.jar │ │ ├── hibernate-commons-annotations-3.2.0.Final.jar │ │ ├── hibernate-commons-annotations-4.0.1.Final.jar │ │ ├── org.eclipse.jdt.core-3.9.1.v20130905-0837.jar │ │ └── jboss-transaction-api_1.1_spec-1.0.0.Final.jar │ │ ├── resources │ │ ├── images │ │ │ ├── back1.jpg │ │ │ ├── back2.jpg │ │ │ ├── back8.jpg │ │ │ ├── back9.jpg │ │ │ ├── 297e4892546a98b001546aa94f4b0001.png │ │ │ ├── 297e4892546e130101546e1e83ed0001.png │ │ │ ├── 297e4892546e45e701546e53799c0000.png │ │ │ ├── 297e489254746e2301547479f56f0006.png │ │ │ ├── 297e489254746e230154748c84fd0008.png │ │ │ ├── 297e489254746e23015474946d6c000a.png │ │ │ └── 297e489254746e230154749c9915000c.png │ │ ├── fonts │ │ │ ├── glyphicons-halflings-regular.eot │ │ │ ├── glyphicons-halflings-regular.ttf │ │ │ ├── glyphicons-halflings-regular.woff │ │ │ └── glyphicons-halflings-regular.woff2 │ │ ├── css │ │ │ ├── main.css │ │ │ └── carousel.css │ │ └── js │ │ │ └── controller.js │ │ ├── classes │ │ └── com │ │ │ └── emusicstore │ │ │ ├── dao │ │ │ ├── CartDao.class │ │ │ ├── ProductDao.class │ │ │ ├── CartDaoImpl.class │ │ │ ├── ProductDaoImpl.class │ │ │ └── ProductDaoOld.class │ │ │ ├── model │ │ │ ├── Cart.class │ │ │ ├── CartItem.class │ │ │ └── Product.class │ │ │ └── controller │ │ │ ├── MyController.class │ │ │ ├── AdminController.class │ │ │ ├── CartController.class │ │ │ ├── LoginController.class │ │ │ └── CartItemController.class │ │ ├── views │ │ ├── firstPage.html │ │ ├── templates │ │ │ ├── footer.jsp │ │ │ └── header.jsp │ │ ├── admin.jsp │ │ ├── login.jsp │ │ ├── viewProductInventory.jsp │ │ ├── viewProduct.jsp │ │ ├── cart.jsp │ │ ├── productInventory.jsp │ │ ├── productList.jsp │ │ ├── addProduct.jsp │ │ ├── editProduct.jsp │ │ └── home.jsp │ │ ├── dispatcher-servlet.xml │ │ ├── web.xml │ │ └── applicationContext.xml │ ├── java │ └── com │ │ └── emusicstore │ │ ├── dao │ │ ├── CartDao.java │ │ ├── ProductDao.java │ │ ├── CartDaoImpl.java │ │ ├── ProductDaoImpl.java │ │ └── ProductDaoOld.java │ │ ├── controller │ │ ├── LoginController.java │ │ ├── CartItemController.java │ │ ├── MyController.java │ │ ├── CartController.java │ │ └── AdminController.java │ │ └── model │ │ ├── CartItem.java │ │ ├── Cart.java │ │ └── Product.java │ └── main.iml ├── README.md ├── pom.xml └── emusicstore.iml /contact.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/contact.xlsx -------------------------------------------------------------------------------- /.idea/copyright/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /lib/aopalliance-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/lib/aopalliance-1.0.jar -------------------------------------------------------------------------------- /lib/commons-logging-1.1.3.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/lib/commons-logging-1.1.3.jar -------------------------------------------------------------------------------- /lib/spring-aop-4.2.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/lib/spring-aop-4.2.5.RELEASE.jar -------------------------------------------------------------------------------- /lib/spring-core-4.2.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/lib/spring-core-4.2.5.RELEASE.jar -------------------------------------------------------------------------------- /lib/spring-jdbc-4.2.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/lib/spring-jdbc-4.2.5.RELEASE.jar -------------------------------------------------------------------------------- /lib/spring-jms-4.2.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/lib/spring-jms-4.2.5.RELEASE.jar -------------------------------------------------------------------------------- /lib/spring-orm-4.2.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/lib/spring-orm-4.2.5.RELEASE.jar -------------------------------------------------------------------------------- /lib/spring-oxm-4.2.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/lib/spring-oxm-4.2.5.RELEASE.jar -------------------------------------------------------------------------------- /lib/spring-test-4.2.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/lib/spring-test-4.2.5.RELEASE.jar -------------------------------------------------------------------------------- /lib/spring-tx-4.2.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/lib/spring-tx-4.2.5.RELEASE.jar -------------------------------------------------------------------------------- /lib/spring-web-4.2.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/lib/spring-web-4.2.5.RELEASE.jar -------------------------------------------------------------------------------- /lib/spring-beans-4.2.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/lib/spring-beans-4.2.5.RELEASE.jar -------------------------------------------------------------------------------- /lib/spring-webmvc-4.2.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/lib/spring-webmvc-4.2.5.RELEASE.jar -------------------------------------------------------------------------------- /src/main/webapp/META-INF/MANIFEST.MF: -------------------------------------------------------------------------------- 1 | Manifest-Version: 1.0 2 | Built-By: ajeasyvaio 3 | Created-By: IntelliJ IDEA 4 | Build-Jdk: 1.8.0_73 5 | 6 | -------------------------------------------------------------------------------- /lib/spring-aspects-4.2.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/lib/spring-aspects-4.2.5.RELEASE.jar -------------------------------------------------------------------------------- /lib/spring-context-4.2.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/lib/spring-context-4.2.5.RELEASE.jar -------------------------------------------------------------------------------- /lib/spring-messaging-4.2.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/lib/spring-messaging-4.2.5.RELEASE.jar -------------------------------------------------------------------------------- /lib/spring-websocket-4.2.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/lib/spring-websocket-4.2.5.RELEASE.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/slf4j.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/slf4j.jar -------------------------------------------------------------------------------- /lib/spring-expression-4.2.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/lib/spring-expression-4.2.5.RELEASE.jar -------------------------------------------------------------------------------- /lib/spring-instrument-4.2.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/lib/spring-instrument-4.2.5.RELEASE.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/jstl-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/jstl-1.2.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/jta-1.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/jta-1.1.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/logback.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/logback.jar -------------------------------------------------------------------------------- /lib/spring-webmvc-portlet-4.2.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/lib/spring-webmvc-portlet-4.2.5.RELEASE.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/ant-1.6.5.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/ant-1.6.5.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/antlr-2.7.7.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/antlr-2.7.7.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/dom4j-1.6.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/dom4j-1.6.1.jar -------------------------------------------------------------------------------- /lib/spring-context-support-4.2.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/lib/spring-context-support-4.2.5.RELEASE.jar -------------------------------------------------------------------------------- /lib/spring-instrument-tomcat-4.2.5.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/lib/spring-instrument-tomcat-4.2.5.RELEASE.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/aopalliance-1.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/aopalliance-1.0.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/commons-io-2.4.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/commons-io-2.4.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/freemarker-2.3.8.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/freemarker-2.3.8.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/standard-1.1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/standard-1.1.2.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/xml-apis-1.0.b2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/xml-apis-1.0.b2.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/javax.servlet-3.0.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/javax.servlet-3.0.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/jtidy-r8-20060801.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/jtidy-r8-20060801.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resources/images/back1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/resources/images/back1.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resources/images/back2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/resources/images/back2.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resources/images/back8.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/resources/images/back8.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resources/images/back9.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/resources/images/back9.jpg -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/commons-logging-1.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/commons-logging-1.2.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/javassist-3.15.0-GA.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/javassist-3.15.0-GA.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/jboss-logging-3.1.0.CR2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/jboss-logging-3.1.0.CR2.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/spring-tx-4.1.4.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/spring-tx-4.1.4.RELEASE.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/validation-api-1.0.0.GA.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/validation-api-1.0.0.GA.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/app-1.3.200-v20130910-1609.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/app-1.3.200-v20130910-1609.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/commons-collections-3.2.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/commons-collections-3.2.1.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/commons-fileupload-1.2.2.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/commons-fileupload-1.2.2.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/hibernate-core-4.0.1.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/hibernate-core-4.0.1.Final.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/jobs-3.6.0-v20140424-0053.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/jobs-3.6.0-v20140424-0053.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/osgi-3.10.0-v20140606-1445.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/osgi-3.10.0-v20140606-1445.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/spring-aop-4.1.4.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/spring-aop-4.1.4.RELEASE.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/spring-beans-4.1.4.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/spring-beans-4.1.4.RELEASE.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/spring-core-4.1.4.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/spring-core-4.1.4.RELEASE.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/spring-jdbc-4.1.4.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/spring-jdbc-4.1.4.RELEASE.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/spring-orm-4.1.4.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/spring-orm-4.1.4.RELEASE.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/spring-web-4.1.4.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/spring-web-4.1.4.RELEASE.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/text-3.2.0-v20060605-1400.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/text-3.2.0-v20060605-1400.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/hibernate-tools-4.0.1.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/hibernate-tools-4.0.1.Final.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/mysql-connector-java-5.1.38.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/mysql-connector-java-5.1.38.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/spring-context-4.1.4.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/spring-context-4.1.4.RELEASE.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/spring-webmvc-4.1.4.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/spring-webmvc-4.1.4.RELEASE.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/commands-3.3.0-I20070605-0010.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/commands-3.3.0-I20070605-0010.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/common-3.6.200-v20130402-1505.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/common-3.6.200-v20130402-1505.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/hibernate-validator-4.2.0.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/hibernate-validator-4.2.0.Final.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/registry-3.5.400-v20140428-1507.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/registry-3.5.400-v20140428-1507.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/runtime-3.10.0-v20140318-2214.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/runtime-3.10.0-v20140318-2214.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/spring-expression-4.1.4.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/spring-expression-4.1.4.RELEASE.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/classes/com/emusicstore/dao/CartDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/classes/com/emusicstore/dao/CartDao.class -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/classes/com/emusicstore/model/Cart.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/classes/com/emusicstore/model/Cart.class -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/hibernate-jpa-2.0-api-1.0.1.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/hibernate-jpa-2.0-api-1.0.1.Final.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/spring-security-web-3.1.4.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/spring-security-web-3.1.4.RELEASE.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/classes/com/emusicstore/dao/ProductDao.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/classes/com/emusicstore/dao/ProductDao.class -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/classes/com/emusicstore/model/CartItem.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/classes/com/emusicstore/model/CartItem.class -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/classes/com/emusicstore/model/Product.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/classes/com/emusicstore/model/Product.class -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/contenttype-3.4.200-v20140207-1251.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/contenttype-3.4.200-v20140207-1251.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/hibernate-entitymanager-4.0.1.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/hibernate-entitymanager-4.0.1.Final.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/preferences-3.5.200-v20140224-1527.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/preferences-3.5.200-v20140224-1527.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/spring-security-config-3.1.4.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/spring-security-config-3.1.4.RELEASE.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/spring-security-core-3.1.4.RELEASE.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/spring-security-core-3.1.4.RELEASE.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/classes/com/emusicstore/dao/CartDaoImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/classes/com/emusicstore/dao/CartDaoImpl.class -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/classes/com/emusicstore/dao/ProductDaoImpl.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/classes/com/emusicstore/dao/ProductDaoImpl.class -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/classes/com/emusicstore/dao/ProductDaoOld.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/classes/com/emusicstore/dao/ProductDaoOld.class -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/hibernate-commons-annotations-3.2.0.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/hibernate-commons-annotations-3.2.0.Final.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/hibernate-commons-annotations-4.0.1.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/hibernate-commons-annotations-4.0.1.Final.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/org.eclipse.jdt.core-3.9.1.v20130905-0837.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/org.eclipse.jdt.core-3.9.1.v20130905-0837.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resources/fonts/glyphicons-halflings-regular.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/resources/fonts/glyphicons-halflings-regular.eot -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resources/fonts/glyphicons-halflings-regular.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/resources/fonts/glyphicons-halflings-regular.ttf -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resources/fonts/glyphicons-halflings-regular.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/resources/fonts/glyphicons-halflings-regular.woff -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/lib/jboss-transaction-api_1.1_spec-1.0.0.Final.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/lib/jboss-transaction-api_1.1_spec-1.0.0.Final.jar -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resources/fonts/glyphicons-halflings-regular.woff2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/resources/fonts/glyphicons-halflings-regular.woff2 -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/classes/com/emusicstore/controller/MyController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/classes/com/emusicstore/controller/MyController.class -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resources/images/297e4892546a98b001546aa94f4b0001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/resources/images/297e4892546a98b001546aa94f4b0001.png -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resources/images/297e4892546e130101546e1e83ed0001.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/resources/images/297e4892546e130101546e1e83ed0001.png -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resources/images/297e4892546e45e701546e53799c0000.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/resources/images/297e4892546e45e701546e53799c0000.png -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resources/images/297e489254746e2301547479f56f0006.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/resources/images/297e489254746e2301547479f56f0006.png -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resources/images/297e489254746e230154748c84fd0008.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/resources/images/297e489254746e230154748c84fd0008.png -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resources/images/297e489254746e23015474946d6c000a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/resources/images/297e489254746e23015474946d6c000a.png -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resources/images/297e489254746e230154749c9915000c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/resources/images/297e489254746e230154749c9915000c.png -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/classes/com/emusicstore/controller/AdminController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/classes/com/emusicstore/controller/AdminController.class -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/classes/com/emusicstore/controller/CartController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/classes/com/emusicstore/controller/CartController.class -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/classes/com/emusicstore/controller/LoginController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/classes/com/emusicstore/controller/LoginController.class -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/classes/com/emusicstore/controller/CartItemController.class: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/codeadapter/eMusicStore_eCommerce_Website/HEAD/src/main/webapp/WEB-INF/classes/com/emusicstore/controller/CartItemController.class -------------------------------------------------------------------------------- /.idea/inspectionProfiles/profiles_settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 7 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/libraries/slf4j.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /.idea/libraries/logback_full.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # eMusicStore_eCommerce_Website 2 | Author : Ajinkya Sawant @2016 3 | 4 | This is an eCommerce Website project developed using IntelliJ IDEA IDE with technologies like Java/J2EE Spring MVC,Servlets,JSP, Hibernate,Oracle,HTML,CSS,JavaScript,AngularJs, RESTful services.It has a Product list page,REST Cart function with AngularJS,Admin role to Add,Update and delete products and much more. 5 | 6 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/firstPage.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | Using Angular 9 | 10 | 11 | 12 | NAME: {{ name }} 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/main/java/com/emusicstore/dao/CartDao.java: -------------------------------------------------------------------------------- 1 | package com.emusicstore.dao; 2 | 3 | import com.emusicstore.model.Cart; 4 | 5 | /** 6 | * Created by ajeasyvaio on 05/05/2016. 7 | */ 8 | public interface CartDao { 9 | 10 | Cart create(Cart cart); 11 | Cart read(String cartId); 12 | void update(String cartId,Cart cart); 13 | void delete(String cartId); 14 | //public Cart get(String cartId); 15 | 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/emusicstore/dao/ProductDao.java: -------------------------------------------------------------------------------- 1 | package com.emusicstore.dao; 2 | 3 | import com.emusicstore.model.Product; 4 | 5 | import java.util.List; 6 | 7 | /** 8 | * Created by ajeasyvaio on 04/27/2016. 9 | */ 10 | public interface ProductDao { 11 | 12 | void addProduct(Product product); 13 | void editProduct(Product product); 14 | void deleteProduct(String id); 15 | List getProducts(); 16 | Product getProductById(String id); 17 | 18 | } 19 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__jstl_jstl_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__ant_ant_1_6_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__antlr_antlr_2_7_7.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__dom4j_dom4j_1_6_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_transaction_jta_1_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__taglibs_standard_1_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__xml_apis_xml_apis_1_0_b2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_io_commons_io_2_4.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_slf4j_slf4j_api_1_6_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__aopalliance_aopalliance_1_0.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__freemarker_freemarker_2_3_8.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_servlet_servlet_api_2_5.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hibernate_jtidy_r8_20060801.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_javassist_javassist_3_15_0_GA.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_logging_commons_logging_1_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__mysql_mysql_connector_java_5_1_38.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_eclipse_text_3_2_0_v20060605_1400.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__javax_validation_validation_api_1_0_0_GA.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_eclipse_osgi_3_10_0_v20140606_1445.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_jboss_logging_jboss_logging_3_1_0_CR2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_core_2_5_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hibernate_hibernate_core_4_0_1_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_eclipse_core_jobs_3_6_0_v20140424_0053.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hibernate_hibernate_tools_4_0_1_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_tx_4_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_fileupload_commons_fileupload_1_2_2.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_aop_4_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_orm_4_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_web_4_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__commons_collections_commons_collections_3_2_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_core_4_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_jdbc_4_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_databind_2_5_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_eclipse_equinox_app_1_3_200_v20130910_1609.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_beans_4_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_webmvc_4_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_eclipse_core_commands_3_3_0_I20070605_0010.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_eclipse_core_runtime_3_10_0_v20140318_2214.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hibernate_hibernate_validator_4_2_0_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_context_4_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__com_fasterxml_jackson_core_jackson_annotations_2_5_1.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_eclipse_equinox_common_3_6_200_v20130402_1505.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_eclipse_equinox_registry_3_5_400_v20140428_1507.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hibernate_hibernate_entitymanager_4_0_1_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_spring_expression_4_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_eclipse_core_contenttype_3_4_200_v20140207_1251.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/inspectionProfiles/Project_Default.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 12 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_eclipse_equinox_preferences_3_5_200_v20140224_1527.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hibernate_hibernate_commons_annotations_3_2_0_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_security_spring_security_web_3_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_eclipse_tycho_org_eclipse_jdt_core_3_9_1_v20130905_0837.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_security_spring_security_core_3_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hibernate_javax_persistence_hibernate_jpa_2_0_api_1_0_1_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/templates/footer.jsp: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_hibernate_common_hibernate_commons_annotations_4_0_1_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_springframework_security_spring_security_config_3_1_4_RELEASE.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resources/css/main.css: -------------------------------------------------------------------------------- 1 | .container-wrapper{ 2 | 3 | /*!*height: 80%;*!*/ 4 | /*margin: auto;*/ 5 | /*margin-top: 80px;*/ 6 | /*margin-bottom: 300px;*/ 7 | 8 | } 9 | .home-image{ 10 | 11 | display: block; 12 | width: 100%; !important; 13 | height: auto; !important; 14 | } 15 | 16 | 17 | .table{ 18 | table-layout: fixed; 19 | overflow: auto; 20 | } 21 | 22 | .table th { 23 | text-align: center; 24 | } 25 | 26 | .table tr { 27 | 28 | text-align: center; 29 | background: whitesmoke; 30 | /*display: block;*/ 31 | overflow: hidden; 32 | text-overflow: ellipsis; 33 | /*white-space: nowrap;*/ 34 | } 35 | 36 | .login-box{ 37 | 38 | text-align: center; 39 | } 40 | 41 | .login-container{ 42 | width:40%; 43 | margin:auto; 44 | margin-top: 100px; 45 | } -------------------------------------------------------------------------------- /.idea/libraries/Maven__org_jboss_spec_javax_transaction_jboss_transaction_api_1_1_spec_1_0_0_Final.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | -------------------------------------------------------------------------------- /src/main/java/com/emusicstore/controller/LoginController.java: -------------------------------------------------------------------------------- 1 | package com.emusicstore.controller; 2 | 3 | import org.springframework.stereotype.Controller; 4 | import org.springframework.ui.Model; 5 | import org.springframework.web.bind.annotation.RequestMapping; 6 | import org.springframework.web.bind.annotation.RequestParam; 7 | 8 | /** 9 | * Created by ajeasyvaio on 05/04/2016. 10 | */ 11 | 12 | @Controller 13 | public class LoginController { 14 | 15 | @RequestMapping("/login") 16 | public String login(@RequestParam(value="error" ,required = false) String error, 17 | @RequestParam(value="logout" ,required = false) String logout,Model model) 18 | { 19 | 20 | if(error!=null){ 21 | model.addAttribute("error","Invalid Username and Password!"); 22 | } 23 | 24 | if(logout!=null){ 25 | model.addAttribute("msg","You have been logged out successfully!"); 26 | } 27 | 28 | return "login"; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/com/emusicstore/model/CartItem.java: -------------------------------------------------------------------------------- 1 | package com.emusicstore.model; 2 | 3 | /** 4 | * Created by ajeasyvaio on 05/05/2016. 5 | */ 6 | public class CartItem { 7 | 8 | 9 | private Product product; 10 | private int quantity; 11 | private double totalPrice; 12 | 13 | public CartItem(){} 14 | 15 | public CartItem(Product product) { 16 | this.product = product; 17 | this.quantity = 1; 18 | this.totalPrice = product.getProductPrice(); 19 | } 20 | 21 | public Product getProduct() { 22 | return product; 23 | } 24 | 25 | public void setProduct(Product product) { 26 | this.product = product; 27 | } 28 | 29 | public int getQuantity() { 30 | return quantity; 31 | } 32 | 33 | public void setQuantity(int quantity) { 34 | this.quantity = quantity; 35 | } 36 | 37 | public double getTotalPrice() { 38 | return totalPrice; 39 | } 40 | 41 | public void setTotalPrice(double totalPrice) { 42 | this.totalPrice = totalPrice; 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/admin.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: ajeasyvaio 4 | Date: 04/29/2016 5 | Time: 7:38 PM 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | 9 | <%@include file="/WEB-INF/views/templates/header.jsp"%> 10 | 12 | 13 | 14 |
15 |
16 | 20 | 21 | 22 |

23 | Welcome ${pageContext.request.userPrincipal.name} | ">Logout 24 |

25 |
26 |

27 | ">Product Inventory 28 |

29 | 30 |

Here you can view,check and modify the Products!

31 | 32 | 33 | <%@include file="/WEB-INF/views/templates/footer.jsp"%> 34 | -------------------------------------------------------------------------------- /.idea/compiler.xml: -------------------------------------------------------------------------------- 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 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/dispatcher-servlet.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/main/java/com/emusicstore/controller/CartItemController.java: -------------------------------------------------------------------------------- 1 | package com.emusicstore.controller; 2 | 3 | import com.emusicstore.dao.CartDao; 4 | import org.springframework.beans.factory.annotation.Autowired; 5 | import org.springframework.stereotype.Controller; 6 | import org.springframework.ui.Model; 7 | import org.springframework.web.bind.annotation.PathVariable; 8 | import org.springframework.web.bind.annotation.RequestMapping; 9 | import org.springframework.web.bind.annotation.RequestMethod; 10 | 11 | import javax.servlet.http.HttpServletRequest; 12 | 13 | /** 14 | * Created by ajeasyvaio on 05/06/2016. 15 | */ 16 | 17 | @Controller 18 | @RequestMapping("/cart") 19 | public class CartItemController { 20 | 21 | @Autowired 22 | private CartDao cartDao; 23 | 24 | @RequestMapping // This will represent the "/" path as taken from the base class 25 | public String get(HttpServletRequest request){ 26 | System.out.println("IN CART ............."); 27 | return "redirect:/cart/"+request.getSession(true).getId(); 28 | } 29 | 30 | 31 | @RequestMapping(value="/{cartId}",method = RequestMethod.GET) 32 | public String getCart(@PathVariable(value="cartId")String cartId,Model model){ 33 | 34 | model.addAttribute("cartId",cartId); 35 | //model.addAttribute("cart",cartDao.getCart(cartId)); 36 | return "cart"; 37 | } 38 | 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | org.springframework.web.context.ContextLoaderListener 10 | 11 | 12 | contextConfigLocation 13 | 14 | /WEB-INF/applicationContext.xml, 15 | /WEB-INF/dispatcher-servlet.xml 16 | 17 | 18 | 19 | 20 | 21 | dispatcher 22 | org.springframework.web.servlet.DispatcherServlet 23 | 24 | 25 | 26 | dispatcher 27 | / 28 | 29 | 30 | 31 | 32 | springSecurityFilterChain 33 | org.springframework.web.filter.DelegatingFilterProxy 34 | 35 | 36 | springSecurityFilterChain 37 | /* 38 | 39 | 40 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resources/js/controller.js: -------------------------------------------------------------------------------- 1 | /** 2 | * Created by ajeasyvaio on 05/06/2016. 3 | */ 4 | 5 | 6 | var cartApp = angular.module("cartApp",[]); 7 | 8 | cartApp.controller("cartController",function ($scope,$http) { 9 | 10 | $scope.refreshCart = function (cartId) { 11 | $http.get('/eMusicStore/rest/cart/'+$scope.cartId).success(function (data) { 12 | $scope.cart=data; 13 | alert("Product Added successfully to cart"); 14 | }); 15 | }; 16 | 17 | 18 | $scope.clearCart = function () { 19 | $http.delete('/eMusicStore/rest/cart/' + $scope.cartId).success($scope.refreshCart($scope.cartId)) 20 | 21 | alert("Cart Cleared successfully!!"); 22 | }; 23 | 24 | $scope.initCartId = function (cartId) { 25 | $scope.cartId = cartId; 26 | //$scope.cart = cart; 27 | $scope.refreshCart(cartId); 28 | }; 29 | 30 | $scope.addToCart = function (productId) { 31 | $http.put('/eMusicStore/rest/cart/add/'+productId).success(function (data) { 32 | $scope.refreshCart($http.get('/eMusicStore/rest/cart/cartId')); 33 | alert("Product Added successfully to cart "+ $scope.cart); 34 | }); 35 | }; 36 | 37 | $scope.removeFromCart = function (productId) { 38 | $http.put('/eMusicStore/rest/cart/remove/'+productId).success(function (data) { 39 | $scope.refreshCart($http.get('/eMusicStore/rest/cart/cartId')); 40 | alert("Product Removed successfully from cart "); 41 | }); 42 | }; 43 | }); 44 | 45 | 46 | 47 | 48 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/login.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: ajeasyvaio 4 | Date: 05/04/2016 5 | Time: 7:49 PM 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | <%@include file="/WEB-INF/views/templates/header.jsp"%> 9 | 10 | 11 |
12 |
13 |
14 | 15 |

Login with username and password

16 | 17 | 18 |
${msg}
19 |
20 | 21 | 22 |
" method="post"> 23 |
24 | 25 |
${error}
26 |
27 | 28 | 29 |
30 | 31 |
32 | 33 | 34 |
35 | 36 | 37 | 38 | 39 |
40 |
41 |
42 |
43 | 44 | <%@include file="/WEB-INF/views/templates/footer.jsp"%> 45 | -------------------------------------------------------------------------------- /src/main/java/com/emusicstore/dao/CartDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.emusicstore.dao; 2 | 3 | import com.emusicstore.model.Cart; 4 | import com.emusicstore.model.CartItem; 5 | import org.springframework.stereotype.Repository; 6 | 7 | 8 | import java.util.HashMap; 9 | import java.util.Map; 10 | 11 | /** 12 | * Created by ajeasyvaio on 05/05/2016. 13 | */ 14 | @Repository 15 | public class CartDaoImpl implements CartDao{ 16 | 17 | private Map listOfCarts; 18 | 19 | 20 | public CartDaoImpl(){ 21 | 22 | listOfCarts = new HashMap(); 23 | } 24 | 25 | public Cart create(Cart cart) { 26 | if(listOfCarts.keySet().contains(cart.getCartId())){ 27 | throw new IllegalArgumentException(String.format("Cannot create the cart.The cart already exixts with cart id: ",cart.getCartId())); 28 | } 29 | listOfCarts.put(cart.getCartId(),cart); 30 | return cart; 31 | } 32 | 33 | public Cart read(String cartId) { 34 | System.out.println("The cart from Dao read is :"+ listOfCarts.get(cartId)); 35 | return listOfCarts.get(cartId); 36 | } 37 | 38 | 39 | public void update(String cartId, Cart cart) { 40 | if(!listOfCarts.keySet().contains(cartId)){ 41 | throw new IllegalArgumentException(String.format("Cannot update the cart.The cart dosen't exixts " + 42 | "with cart id: ",cart.getCartId())); 43 | } 44 | listOfCarts.put(cartId,cart); 45 | System.out.println("List of carts " +listOfCarts); 46 | 47 | } 48 | 49 | public void delete(String cartId) { 50 | if(!listOfCarts.keySet().contains(cartId)){ 51 | throw new IllegalArgumentException(String.format("Cannot delete the cart.The cart dosen't exixts " + 52 | "with cart id: ",cartId)); 53 | } 54 | listOfCarts.remove(cartId); 55 | } 56 | 57 | // public Cart get(String cartId){ 58 | // 59 | // return listOfCarts.get(cartId); 60 | // } 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/com/emusicstore/model/Cart.java: -------------------------------------------------------------------------------- 1 | package com.emusicstore.model; 2 | 3 | import java.util.*; 4 | 5 | /** 6 | * Created by ajeasyvaio on 05/05/2016. 7 | */ 8 | public class Cart { 9 | 10 | private String cartId; 11 | private Map cartItems; 12 | private double grandTotal; 13 | 14 | public Cart(){ 15 | cartItems = new HashMap(); 16 | grandTotal=0; 17 | } 18 | 19 | public Cart(String cartId){ 20 | this(); 21 | this.cartId=cartId; 22 | } 23 | 24 | public String getCartId() { 25 | return cartId; 26 | } 27 | 28 | public void setCartId(String cartId) { 29 | this.cartId = cartId; 30 | } 31 | 32 | public Map getCartItem() { 33 | return cartItems; 34 | } 35 | 36 | public void setCartItem(Map cartItem) { 37 | this.cartItems = cartItem; 38 | } 39 | 40 | public double getGrandTotal() { 41 | return grandTotal; 42 | } 43 | 44 | public void setGrandTotal(double grandTotal) { 45 | this.grandTotal = grandTotal; 46 | } 47 | 48 | public void addCartItem(CartItem item){ 49 | String productId= item.getProduct().getProductId(); 50 | 51 | if(cartItems.containsKey(productId)){ 52 | CartItem existingCartItem = cartItems.get(productId); 53 | existingCartItem.setQuantity(existingCartItem.getQuantity()+item.getQuantity()); 54 | cartItems.put(productId,existingCartItem); 55 | }else { 56 | cartItems.put(productId,item); 57 | } 58 | updateGrandTotal(); 59 | } 60 | 61 | public void removeCartItem(CartItem item){ 62 | 63 | String productId= item.getProduct().getProductId(); 64 | cartItems.remove(productId); 65 | updateGrandTotal(); 66 | } 67 | 68 | public void updateGrandTotal(){ 69 | grandTotal=0; 70 | for (CartItem item:cartItems.values()) { 71 | grandTotal= grandTotal+item.getTotalPrice(); 72 | } 73 | 74 | } 75 | 76 | } 77 | -------------------------------------------------------------------------------- /src/main/main.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | file://$MODULE_DIR$/webapp/WEB-INF/applicationContext.xml 18 | file://$MODULE_DIR$/webapp/WEB-INF/dispatcher-servlet.xml 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | file://$MODULE_DIR$/webapp/WEB-INF/applicationContext.xml 36 | file://$MODULE_DIR$/webapp/WEB-INF/dispatcher-servlet.xml 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | -------------------------------------------------------------------------------- /src/main/java/com/emusicstore/controller/MyController.java: -------------------------------------------------------------------------------- 1 | package com.emusicstore.controller; 2 | 3 | import com.emusicstore.dao.ProductDao; 4 | import com.emusicstore.dao.ProductDaoImpl; 5 | import com.emusicstore.dao.ProductDaoOld; 6 | import com.emusicstore.model.Product; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Controller; 9 | import org.springframework.ui.Model; 10 | import org.springframework.validation.BindingResult; 11 | import org.springframework.web.bind.annotation.ModelAttribute; 12 | import org.springframework.web.bind.annotation.PathVariable; 13 | import org.springframework.web.bind.annotation.RequestMapping; 14 | import org.springframework.web.bind.annotation.RequestMethod; 15 | import org.springframework.web.multipart.MultipartFile; 16 | 17 | import javax.servlet.http.HttpServletRequest; 18 | import javax.validation.Valid; 19 | import java.io.File; 20 | import java.io.IOException; 21 | import java.nio.file.Files; 22 | import java.nio.file.Path; 23 | import java.nio.file.Paths; 24 | import java.util.List; 25 | 26 | @Controller 27 | public class MyController { 28 | 29 | 30 | @Autowired 31 | private ProductDao dao;//= new ProductDaoImpl(); 32 | 33 | private Path path; 34 | 35 | @RequestMapping("/") 36 | public String home(){ 37 | System.out.println("Inside the Controller"); 38 | return "home"; 39 | } 40 | 41 | 42 | @RequestMapping("/productList") 43 | public String getProducts(Model model){ 44 | System.out.println("Inside the List...Now"); 45 | List products= dao.getProducts(); 46 | System.out.println("Products received..."); 47 | System.out.println(products); 48 | System.out.println(); 49 | model.addAttribute("products",products); 50 | return "productList"; 51 | } 52 | 53 | 54 | @RequestMapping("/productList/viewProduct/{productId}") 55 | public String viewProduct(@PathVariable String productId, Model model)throws IOException { 56 | 57 | Product product = dao.getProductById(productId); 58 | model.addAttribute("product",product); 59 | return "viewProduct"; 60 | } 61 | 62 | } 63 | 64 | 65 | 66 | 67 | 68 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/viewProductInventory.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> 2 | 3 | <%@include file="/WEB-INF/views/templates/header.jsp"%> 4 | 5 | 6 | 7 |
8 |
9 | 10 |

11 | Welcome ${pageContext.request.userPrincipal.name} | ">Logout 12 |

13 |
14 | " class="btn btn-primary btn-lg" 15 | data-toggle="tooltip" title="Go Back to Product Inventory Page">Back to Product Inventory 16 | 17 | 22 | 23 |
24 |
25 |
26 | <%--product image--%> 27 | " 28 | alt="image" style="width:100%"/> 29 |
30 |
31 |

${product.productName}

32 |

${product.productDescription}

33 |

Price : ${product.productPrice} USD

34 |

Category : ${product.productCategory}

35 |

Manufacturer : ${product.productManufacturer}

36 |

Condition : ${product.productCondition}

37 |

Units in Stock : ${product.unitInStock}

38 | 39 | 40 |
41 |
42 |
43 | 44 | <%@include file="/WEB-INF/views/templates/footer.jsp"%> 45 | 46 | 47 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/viewProduct.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> 2 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 3 | 4 | <%@include file="/WEB-INF/views/templates/header.jsp"%> 5 | 6 | 7 | 8 |
9 |
10 | " class="btn btn-primary btn-lg" 11 | data-toggle="tooltip" title="Go Back to Product List Page">Back to Product List 12 | 13 | 17 | 18 |
19 |
20 |
21 | <%--product image--%> 22 | " 23 | alt="image" style="width:100%"/> 24 |
25 |
26 |

${product.productName}

27 |

${product.productDescription}

28 |

Price : ${product.productPrice} USD

29 |

Category : ${product.productCategory}

30 |

Manufacturer : ${product.productManufacturer}

31 |

Condition : ${product.productCondition}

32 |

Units in Stock : ${product.unitInStock}

33 |
34 | 35 | 36 | 37 |

38 | 40 | <%----%>Order Now 41 | 42 | " 43 | class="btn btn-default"><%----%>View cart 44 |

45 |
46 |
47 |
48 | 49 | 50 | <%@include file="/WEB-INF/views/templates/footer.jsp"%> 51 | 52 | 53 | -------------------------------------------------------------------------------- /src/main/java/com/emusicstore/dao/ProductDaoImpl.java: -------------------------------------------------------------------------------- 1 | package com.emusicstore.dao; 2 | 3 | import com.emusicstore.model.Product; 4 | import org.hibernate.Query; 5 | import org.hibernate.Session; 6 | import org.hibernate.SessionFactory; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.beans.factory.annotation.Qualifier; 9 | import org.springframework.stereotype.Repository; 10 | import org.springframework.transaction.annotation.Transactional; 11 | 12 | import java.util.ArrayList; 13 | import java.util.Iterator; 14 | import java.util.List; 15 | 16 | /** 17 | * Created by ajeasyvaio on 04/27/2016. 18 | */ 19 | @Repository 20 | @Transactional 21 | public class ProductDaoImpl implements ProductDao{ 22 | 23 | @Autowired 24 | //@Qualifier("sessionfactory") 25 | private SessionFactory sessionfactory; 26 | 27 | public SessionFactory getSf() { 28 | return sessionfactory; 29 | } 30 | 31 | public void setSf(SessionFactory sf) { 32 | this.sessionfactory = sf; 33 | } 34 | 35 | public void addProduct(Product product) { 36 | 37 | Session session = sessionfactory.getCurrentSession(); 38 | session.saveOrUpdate(product); 39 | session.flush(); 40 | 41 | } 42 | 43 | public void editProduct(Product product) { 44 | 45 | Session session = sessionfactory.getCurrentSession(); 46 | session.saveOrUpdate(product); 47 | session.flush(); 48 | 49 | } 50 | 51 | public void deleteProduct(String id) { 52 | Session session = sessionfactory.getCurrentSession(); 53 | session.delete(getProductById(id)); 54 | session.flush(); 55 | } 56 | 57 | public List getProducts() { 58 | List products = new ArrayList(); 59 | System.out.println("Session Factory obj..."+sessionfactory); 60 | Session session = sessionfactory.getCurrentSession(); 61 | System.out.println("Inside getting .."); 62 | //Query query =session.createSQLQuery("select * from product"); 63 | Query query = session.createQuery("from com.emusicstore.model.Product"); 64 | // Iterator i = query.iterate(); 65 | // while (i.hasNext()){ 66 | // Product p = (Product)i.next(); 67 | // products.add(p); 68 | // System.out.println("Iterated Products...."+p.getProductCategory()+p.getProductPrice()+p.getProductName()); 69 | // } 70 | 71 | products = query.list(); 72 | session.flush(); 73 | System.out.println(); 74 | System.out.println(products); 75 | System.out.println(); 76 | return products; 77 | } 78 | 79 | public Product getProductById(String id) { 80 | 81 | Session session = sessionfactory.getCurrentSession(); 82 | Product product= (Product) session.get(Product.class,id); 83 | session.flush(); 84 | return product; 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /.idea/misc.xml: -------------------------------------------------------------------------------- 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 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/cart.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 2 | <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> 3 | <%-- 4 | Created by IntelliJ IDEA. 5 | User: ajeasyvaio 6 | Date: 05/05/2016 7 | Time: 11:38 PM 8 | To change this template use File | Settings | File Templates. 9 | --%> 10 | <%@include file="/WEB-INF/views/templates/header.jsp"%> 11 | 12 |
13 |
14 |
15 |
16 |
17 |

CART

18 |

Products you have selected

19 |

Cart Id id: ${cartId}

20 | <%--

Cart is ${cart}

--%> 21 |
22 |
23 |
24 | 25 |
26 |
27 |
28 | Clear Cart 30 |
31 |

Cart from Angular {{cart}}

32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | <%----%> 46 | <%----%> 47 | <%----%> 48 | <%----%> 49 | <%----%> 50 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 |
ProductUnit PriceQuantityPriceAction
{{item.product.productName}}{{item.product.productPrice}}{{item.product.quantity}}{{item.product.totalPrice}}
${cart.getCartItem .cartItem.get(product).product.productName}${cart.cartItem.get(product).product.productPrice}${cart.cartItem.get(product).product.quantity}${cart.cartItem.get(product).product.totalPrice} 52 | <%----%>Remove
Grand Total{{cart.grandTotal}}
61 | 62 | " class="btn btn-default">Continue Shopping 63 |
<%--controller--%> 64 |
65 |
66 |
67 | 68 | 69 | <%@include file="/WEB-INF/views/templates/footer.jsp"%> -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/applicationContext.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | org.hibernate.dialect.MySQL5Dialect 26 | update 27 | true 28 | true 29 | 30 | 31 | 32 | 33 | com.emusicstore 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 63 | 64 | 65 | 66 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/resources/css/carousel.css: -------------------------------------------------------------------------------- 1 | /* GLOBAL STYLES 2 | -------------------------------------------------- */ 3 | /* Padding below the footer and lighter body text */ 4 | 5 | body { 6 | padding-bottom: 40px; 7 | color: lightgrey; 8 | } 9 | 10 | 11 | /* CUSTOMIZE THE NAVBAR 12 | -------------------------------------------------- */ 13 | 14 | /* Special class on .container surrounding .navbar, used for positioning it into place. */ 15 | .navbar-wrapper { 16 | position: absolute; 17 | top: 0; 18 | right: 0; 19 | left: 0; 20 | z-index: 20; 21 | } 22 | 23 | /* Flip around the padding for proper display in narrow viewports */ 24 | .navbar-wrapper > .container { 25 | padding-right: 0; 26 | padding-left: 0; 27 | } 28 | .navbar-wrapper .navbar { 29 | padding-right: 15px; 30 | padding-left: 15px; 31 | } 32 | .navbar-wrapper .navbar .container { 33 | width: auto; 34 | } 35 | 36 | 37 | /* CUSTOMIZE THE CAROUSEL 38 | -------------------------------------------------- */ 39 | 40 | /* Carousel base class */ 41 | .carousel { 42 | height: 800px; 43 | margin-bottom: 60px; 44 | } 45 | /* Since positioning the image, we need to help out the caption */ 46 | .carousel-caption { 47 | z-index: 10; 48 | top: 325px; 49 | bottom:auto; 50 | } 51 | 52 | /* Declare heights because of positioning of img element */ 53 | .carousel .item { 54 | height: 800px; 55 | background-color: #777; 56 | } 57 | .carousel-inner > .item > img { 58 | position: absolute; 59 | top: 0; 60 | left: 0; 61 | min-width: 100%; 62 | height: 800px; 63 | } 64 | 65 | 66 | /* MARKETING CONTENT 67 | -------------------------------------------------- */ 68 | 69 | /* Center align the text within the three columns below the carousel */ 70 | .marketing .col-lg-4 { 71 | margin-bottom: 20px; 72 | text-align: center; 73 | } 74 | .marketing h2 { 75 | font-weight: normal; 76 | } 77 | .marketing .col-lg-4 p { 78 | margin-right: 10px; 79 | margin-left: 10px; 80 | } 81 | 82 | 83 | /* Featurettes 84 | ------------------------- */ 85 | 86 | .featurette-divider { 87 | margin: 80px 0; /* Space out the Bootstrap
more */ 88 | } 89 | 90 | /* Thin out the marketing headings */ 91 | .featurette-heading { 92 | font-weight: 300; 93 | line-height: 1; 94 | letter-spacing: -1px; 95 | } 96 | 97 | 98 | /* RESPONSIVE CSS 99 | -------------------------------------------------- */ 100 | 101 | @media (min-width: 768px) { 102 | /* Navbar positioning foo */ 103 | /*.navbar-wrapper {*/ 104 | /*margin-top: 20px;*/ 105 | /*}*/ 106 | .navbar-wrapper .container { 107 | padding-right: 15px; 108 | padding-left: 15px; 109 | } 110 | .navbar-wrapper .navbar { 111 | padding-right: 0; 112 | padding-left: 0; 113 | } 114 | 115 | /* The navbar becomes detached from the top, so we round the corners */ 116 | .navbar-wrapper .navbar { 117 | border-radius: 4px; 118 | } 119 | 120 | /* Bump up size of carousel content */ 121 | .carousel-caption p { 122 | margin-bottom: 20px; 123 | font-size: 21px; 124 | line-height: 1.4; 125 | } 126 | 127 | .featurette-heading { 128 | font-size: 50px; 129 | } 130 | } 131 | 132 | @media (min-width: 992px) { 133 | .featurette-heading { 134 | margin-top: 120px; 135 | } 136 | } 137 | -------------------------------------------------------------------------------- /src/main/java/com/emusicstore/controller/CartController.java: -------------------------------------------------------------------------------- 1 | package com.emusicstore.controller; 2 | 3 | import com.emusicstore.dao.CartDao; 4 | import com.emusicstore.dao.ProductDao; 5 | import com.emusicstore.model.Cart; 6 | import com.emusicstore.model.CartItem; 7 | import com.emusicstore.model.Product; 8 | import org.springframework.beans.factory.annotation.Autowired; 9 | import org.springframework.http.HttpStatus; 10 | import org.springframework.stereotype.Controller; 11 | import org.springframework.web.bind.annotation.*; 12 | 13 | import javax.servlet.http.HttpServletRequest; 14 | 15 | /** 16 | * Created by ajeasyvaio on 05/06/2016. 17 | */ 18 | @Controller 19 | @RequestMapping("/rest/cart") //REST Services Path 20 | public class CartController { 21 | 22 | @Autowired 23 | private CartDao cartDao; 24 | 25 | @Autowired 26 | private ProductDao productDao; 27 | 28 | @RequestMapping(value="/{cartId}",method = RequestMethod.GET) 29 | //ResponseBody is to return a model object in format of JSON 30 | //ResponseEntity option will gve us more options to control the header Http Response status 31 | public @ResponseBody Cart read(@PathVariable(value="cartId")String cartId ){ 32 | System.out.println("The cart to Angular in ResponseBody is :"+ cartDao.read(cartId)); 33 | return cartDao.read(cartId); 34 | } 35 | 36 | @RequestMapping(value="/{cartId}",method = RequestMethod.PUT) 37 | @ResponseStatus(value= HttpStatus.NO_CONTENT) 38 | public void update(@PathVariable(value="cartId")String cartId,@RequestBody Cart cart ){ 39 | 40 | cartDao.update(cartId, cart); 41 | } 42 | 43 | @RequestMapping(value="/{cartId}",method = RequestMethod.DELETE) 44 | @ResponseStatus(value= HttpStatus.NO_CONTENT) 45 | public void delete(@PathVariable(value="cartId")String cartId){ 46 | 47 | cartDao.delete(cartId); 48 | } 49 | 50 | @RequestMapping(value="/add/{productId}",method = RequestMethod.PUT) 51 | @ResponseStatus(value= HttpStatus.NO_CONTENT) 52 | public void addItem(@PathVariable(value="productId")String productId, HttpServletRequest request){ 53 | 54 | String sessionId = request.getSession(true).getId(); 55 | Cart cart = cartDao.read(sessionId); // We are using sessionId as cartId here to retrieve the cart details 56 | 57 | if(cart==null) { 58 | cart = cartDao.create(new Cart(sessionId)); 59 | } 60 | Product product = productDao.getProductById(productId); 61 | if(product==null) 62 | throw new IllegalArgumentException(new Exception()); 63 | cart.addCartItem(new CartItem(product)); 64 | System.out.println("Original cart is "+cart); 65 | cartDao.update(sessionId,cart); 66 | } 67 | 68 | @RequestMapping(value="/remove/{productId}",method = RequestMethod.PUT) 69 | @ResponseStatus(value= HttpStatus.NO_CONTENT) 70 | public void removeItem(@PathVariable(value="productId")String productId, HttpServletRequest request){ 71 | 72 | String sessionId = request.getSession(true).getId(); 73 | Cart cart = cartDao.read(sessionId); // We are using sessionId as cartId here to retrieve the cart details 74 | 75 | if(cart==null) { 76 | cart = cartDao.create(new Cart(sessionId)); 77 | } 78 | 79 | Product product = productDao.getProductById(productId); 80 | if(product==null) 81 | throw new IllegalArgumentException(new Exception()); 82 | cart.removeCartItem(new CartItem(product)); 83 | cartDao.update(sessionId,cart); 84 | } 85 | 86 | @ExceptionHandler(IllegalArgumentException.class) 87 | @ResponseStatus(value = HttpStatus.BAD_REQUEST,reason = "Illegal request.Please verify your Payload") 88 | public void handleClientError(Exception e){ 89 | } 90 | 91 | @ExceptionHandler(Exception.class) 92 | @ResponseStatus(value = HttpStatus.INTERNAL_SERVER_ERROR,reason = "Internal Server Error") 93 | public void handleServerError(Exception e){ 94 | } 95 | } 96 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/templates/header.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 2 | <%-- 3 | Created by IntelliJ IDEA. 4 | User: ajeasyvaio 5 | Date: 04/24/2016 6 | Time: 1:40 AM 7 | To change this template use File | Settings | File Templates. 8 | --%> 9 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 10 | 11 | <%-- 12 | Home Page 13 | 14 | 15 |

Welcome to our Music Shop

16 | --%> 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | Free$oul Muzik Store 29 | 30 | 31 | " rel="stylesheet"> 32 | 33 | 34 | " rel="stylesheet"> 35 | 36 | 37 | 38 | 39 | 40 | 41 | 43 | 44 | 86 | 87 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/productInventory.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: ajeasyvaio 4 | Date: 04/29/2016 5 | Time: 7:56 PM 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> 9 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 10 | 11 | <%@include file="/WEB-INF/views/templates/header.jsp"%> 12 | 14 | 15 | 16 |
17 |
18 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | <%----%> 43 | 44 | <%----%> 45 | 46 | <%----%> 47 | <%----%> 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 57 | 58 | 59 | <%----%> 60 | 61 | <%----%> 62 | 63 | <%----%> 64 | <%----%> 65 | 70 | 75 | 80 | 81 | 82 |
Photo Thumb Product Name Category Description Price Condition Status Unit in Stock Manufacturer Info.EditDelete
" 56 | alt="image" style="width:100%"/>${product.productName}${product.productCategory}${product.productDescription}${product.productPrice} USD${product.productCondition}${product.productStatus}${product.unitInStock}${product.productManufacturer} 66 | " 67 | data-toggle="tooltip" title="Click to get Product Details"> 68 | 69 | 71 | " 72 | data-toggle="tooltip" title="Click to Edit Product from Inventory"> 73 | 74 | 76 | " 77 | data-toggle="tooltip" title="Click to Remove Product from Inventory"> 78 | 79 |
83 | 84 | 85 | " class="btn btn-primary" 86 | data-toggle="tooltip" title="Click to Add Product to Inventory">Add Product 87 | 88 | <%@include file="/WEB-INF/views/templates/footer.jsp"%> 89 | 90 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/productList.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> 2 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 3 | 4 | <%@include file="/WEB-INF/views/templates/header.jsp"%> 5 | 7 | 8 | 9 |
10 |
11 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | <%----%> 24 | 25 | <%----%> 26 | 27 | <%----%> 28 | <%----%> 29 | 30 | 31 | 32 | 33 | 34 | 36 | 37 | 38 | <%----%> 39 | 40 | <%----%> 41 | 42 | <%----%> 43 | <%----%> 44 | 47 | 48 | 49 |
Photo Thumb Product Name Category Description Price Condition Status Unit in Stock Manufacturer More Info.
" 35 | alt="image" style="width:100%"/>${product.productName}${product.productCategory}${product.productDescription}${product.productPrice} USD${product.productCondition}${product.productStatus}${product.unitInStock}${product.productManufacturer}" 45 | data-toggle="tooltip" title="Click to get Product Details"> 46 |
50 | 51 | 52 | 53 | <%@include file="/WEB-INF/views/templates/footer.jsp"%> 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | <%-- 91 | <%@ page contentType="text/html;charset=UTF-8" language="java" %> 92 | 93 | 94 | Products list 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 |
productName productCategory productDescription productPrice productCondition productStatus unitInStock productManufacturer
${product.productName}${product.productCategory}${product.productDescription}${product.productPrice}${product.productCondition}${product.productStatus}${product.unitInStock}${product.productManufacturer}
126 | 127 | 128 | 129 | 130 | 131 | --%> 132 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/addProduct.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: ajeasyvaio 4 | Date: 04/29/2016 5 | Time: 8:07 PM 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | 9 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> 10 | 11 | <%@include file="/WEB-INF/views/templates/header.jsp"%> 12 | 13 | 14 | 15 |
16 |
17 | 26 | 27 | 29 |
30 | 31 | 32 |
33 | 34 |
35 | 36 | 38 | 40 | 42 |
43 | 44 |
45 | 46 | 47 |
48 | 49 |
50 | 51 | 52 |
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 | 78 | 79 |
80 | 81 | 82 |

83 | 84 | 85 | 86 | " class="btn btn-default" >Cancel 87 | 88 | 89 |
90 | 91 |
92 |
93 | 94 | <%@include file="/WEB-INF/views/templates/footer.jsp"%> 95 | 96 | 97 | -------------------------------------------------------------------------------- /src/main/java/com/emusicstore/model/Product.java: -------------------------------------------------------------------------------- 1 | package com.emusicstore.model; 2 | 3 | import org.hibernate.annotations.GenericGenerator; 4 | import org.hibernate.validator.constraints.NotEmpty; 5 | import org.springframework.web.multipart.MultipartFile; 6 | 7 | import javax.persistence.*; 8 | import javax.validation.constraints.Min; 9 | 10 | /** 11 | * Created by ajeasyvaio on 04/24/2016. 12 | */ 13 | 14 | @Entity 15 | public class Product { 16 | @Id 17 | //@GeneratedValue(strategy = GenerationType.AUTO) 18 | @GeneratedValue(generator="system-uuid") 19 | @GenericGenerator(name="system-uuid", strategy = "uuid") 20 | private String productId; 21 | 22 | @NotEmpty(message = "Product must not be Blank.") 23 | private String productName; 24 | private String productCategory; 25 | private String productDescription; 26 | 27 | @Min(value=0 ,message = "Product Price must not be less than zero.") 28 | private double productPrice; 29 | private String productCondition; 30 | private String productStatus; 31 | 32 | @Min(value=0 ,message = "Units in Stock must not be less than zero.") 33 | private int unitInStock; 34 | private String productManufacturer; 35 | @Transient /// This will tell Hibernate that the field is not to be stored in the data base 36 | private MultipartFile productImage; 37 | 38 | 39 | public String toString(){ 40 | 41 | return "Product Details are : "+getProductId()+" "+getProductName()+" " 42 | + getProductCategory()+" "+ getProductDescription()+" " 43 | + getProductPrice()+" "+ getProductCondition()+" " 44 | + getProductStatus()+" "+ getUnitInStock()+" " 45 | + getProductManufacturer(); 46 | } 47 | public Product(){} 48 | public Product(String productId,String productName, String productCategory, String productDescription, double productPrice, String productCondition, String productStatus, int unitInStock, String productManufacturer) { 49 | this.productId = productId; 50 | this.productName = productName; 51 | this.productCategory = productCategory; 52 | this.productDescription = productDescription; 53 | this.productPrice = productPrice; 54 | this.productCondition = productCondition; 55 | this.productStatus = productStatus; 56 | this.unitInStock = unitInStock; 57 | this.productManufacturer = productManufacturer; 58 | } 59 | 60 | public String getProductId() { 61 | return productId; 62 | } 63 | 64 | public void setProductId(String productId) { 65 | this.productId = productId; 66 | } 67 | 68 | public String getProductName() { 69 | return productName; 70 | } 71 | 72 | public void setProductName(String productName) { 73 | this.productName = productName; 74 | } 75 | 76 | public String getProductCategory() { 77 | return productCategory; 78 | } 79 | 80 | public void setProductCategory(String productCategory) { 81 | this.productCategory = productCategory; 82 | } 83 | 84 | public String getProductDescription() { 85 | return productDescription; 86 | } 87 | 88 | public void setProductDescription(String productDescription) { 89 | this.productDescription = productDescription; 90 | } 91 | 92 | public double getProductPrice() { 93 | return productPrice; 94 | } 95 | 96 | public void setProductPrice(double productPrice) { 97 | this.productPrice = productPrice; 98 | } 99 | 100 | public String getProductCondition() { 101 | return productCondition; 102 | } 103 | 104 | public void setProductCondition(String productCondition) { 105 | this.productCondition = productCondition; 106 | } 107 | 108 | public String getProductStatus() { 109 | return productStatus; 110 | } 111 | 112 | public void setProductStatus(String productStatus) { 113 | this.productStatus = productStatus; 114 | } 115 | 116 | public int getUnitInStock() { 117 | return unitInStock; 118 | } 119 | 120 | public void setUnitInStock(int unitInStock) { 121 | this.unitInStock = unitInStock; 122 | } 123 | 124 | public String getProductManufacturer() { 125 | return productManufacturer; 126 | } 127 | 128 | public void setProductManufacturer(String productManufacturer) { 129 | this.productManufacturer = productManufacturer; 130 | } 131 | 132 | public MultipartFile getProductImage() {return productImage;} 133 | 134 | public void setProductImage(MultipartFile productImage) { this.productImage = productImage;} 135 | 136 | 137 | 138 | } -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/editProduct.jsp: -------------------------------------------------------------------------------- 1 | <%-- 2 | Created by IntelliJ IDEA. 3 | User: ajeasyvaio 4 | Date: 05/01/2016 5 | Time: 10:06 PM 6 | To change this template use File | Settings | File Templates. 7 | --%> 8 | 9 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> 10 | 11 | <%@include file="/WEB-INF/views/templates/header.jsp"%> 12 | 13 | 14 | 15 |
16 |
17 | 26 | 27 | 29 | 30 | 31 | 32 | 33 |
34 | 35 | 36 |
37 | 38 |
39 | 40 | 42 | 44 | 46 |
47 | 48 |
49 | 50 | 51 |
52 | 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 | 78 |
79 | 80 |
81 | 82 | 83 |
84 | 85 | 86 |

87 | 88 | 89 | 90 | " class="btn btn-default" >Cancel 91 | 92 | 93 |
94 | 95 |
96 |
97 | 98 | <%@include file="/WEB-INF/views/templates/footer.jsp"%> 99 | 100 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/home.jsp: -------------------------------------------------------------------------------- 1 | 2 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form"%> 3 | 4 | <%@include file="/WEB-INF/views/templates/header.jsp"%> 5 | 6 | 7 | " rel="stylesheet"> 8 | 10 | 59 | 60 | 61 | 63 | 64 | 65 |
66 | 67 | 68 |
69 |
70 | Generic placeholder image 71 |

Heading

72 |

Donec sed odio dui. Etiam porta sem malesuada magna mollis euismod. Nullam id dolor id nibh ultricies vehicula ut id elit. Morbi leo risus, porta ac consectetur ac, vestibulum at eros. Praesent commodo cursus magna.

73 |

View details »

74 |
75 |
76 | Generic placeholder image 77 |

Heading

78 |

Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cras mattis consectetur purus sit amet fermentum. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh.

79 |

View details »

80 |
81 |
82 | Generic placeholder image 83 |

Heading

84 |

Donec sed odio dui. Cras justo odio, dapibus ac facilisis in, egestas eget quam. Vestibulum id ligula porta felis euismod semper. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus.

85 |

View details »

86 |
87 |
88 | 89 | <%@include file="/WEB-INF/views/templates/footer.jsp"%> 90 | -------------------------------------------------------------------------------- /.idea/artifacts/emusicstore_Web_exploded.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | $PROJECT_DIR$/src/main/webapp 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 | 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 | 65 | 66 | 67 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | com.ajwebsite 8 | emusicstore 9 | 1.0-SNAPSHOT 10 | 11 | 12 | 13 | 14 | 15 | org.springframework 16 | spring-webmvc 17 | 4.1.4.RELEASE 18 | 19 | 20 | 21 | org.springframework 22 | spring-core 23 | 4.1.4.RELEASE 24 | 25 | 26 | 27 | org.springframework 28 | spring-orm 29 | 4.1.4.RELEASE 30 | 31 | 32 | 33 | org.springframework 34 | spring-context 35 | 4.1.4.RELEASE 36 | 37 | 38 | 39 | org.springframework.security 40 | spring-security-core 41 | 3.1.4.RELEASE 42 | 43 | 44 | 45 | 46 | org.springframework.security 47 | spring-security-web 48 | 3.1.4.RELEASE 49 | 50 | 51 | 52 | org.springframework.security 53 | spring-security-config 54 | 3.1.4.RELEASE 55 | 56 | 57 | 58 | 59 | 60 | 61 | org.hibernate 62 | hibernate-core 63 | 4.0.1.Final 64 | 65 | 66 | 67 | org.hibernate 68 | hibernate-tools 69 | 4.0.1.Final 70 | 71 | 72 | 73 | org.hibernate.javax.persistence 74 | hibernate-jpa-2.0-api 75 | 1.0.1.Final 76 | 77 | 78 | 79 | org.hibernate 80 | hibernate-validator 81 | 4.2.0.Final 82 | 83 | 84 | 85 | 86 | javax.validation 87 | validation-api 88 | 1.0.0.GA 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | mysql 105 | mysql-connector-java 106 | 5.1.38 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | jstl 118 | jstl 119 | 1.2 120 | 121 | 122 | 123 | 124 | taglibs 125 | standard 126 | 1.1.2 127 | 128 | 129 | 130 | commons-fileupload 131 | commons-fileupload 132 | 1.2.2 133 | 134 | 135 | 136 | commons-io 137 | commons-io 138 | 2.4 139 | 140 | 141 | 142 | javax.servlet 143 | servlet-api 144 | 2.5 145 | provided 146 | 147 | 148 | 149 | 150 | com.fasterxml.jackson.core 151 | jackson-core 152 | 2.5.1 153 | 154 | 155 | 156 | com.fasterxml.jackson.core 157 | jackson-annotations 158 | 2.5.1 159 | 160 | 161 | 162 | com.fasterxml.jackson.core 163 | jackson-databind 164 | 2.5.1 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | -------------------------------------------------------------------------------- /emusicstore.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | file://$MODULE_DIR$/src/main/webapp/WEB-INF/applicationContext.xml 8 | file://$MODULE_DIR$/src/main/webapp/WEB-INF/dispatcher-servlet.xml 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 | 52 | 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 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /src/main/java/com/emusicstore/controller/AdminController.java: -------------------------------------------------------------------------------- 1 | package com.emusicstore.controller; 2 | 3 | import com.emusicstore.dao.ProductDao; 4 | import com.emusicstore.model.Product; 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.PathVariable; 11 | import org.springframework.web.bind.annotation.RequestMapping; 12 | import org.springframework.web.bind.annotation.RequestMethod; 13 | import org.springframework.web.multipart.MultipartFile; 14 | 15 | import javax.servlet.RequestDispatcher; 16 | import javax.servlet.ServletException; 17 | import javax.servlet.http.HttpServletRequest; 18 | import javax.servlet.http.*; 19 | import javax.validation.Valid; 20 | import java.io.File; 21 | import java.io.IOException; 22 | import java.nio.file.Files; 23 | import java.nio.file.Path; 24 | import java.nio.file.Paths; 25 | import java.util.List; 26 | 27 | /** 28 | * Created by ajeasyvaio on 05/04/2016. 29 | */ 30 | 31 | 32 | @Controller 33 | public class AdminController { 34 | 35 | 36 | @Autowired 37 | private ProductDao dao; 38 | 39 | private Path path; 40 | 41 | 42 | @RequestMapping("/admin") 43 | public String adminPage(){ 44 | return "admin"; 45 | } 46 | 47 | 48 | /* View Product Inventory*/ 49 | @RequestMapping("/admin/productInventory/viewProductInventory/{productId}") 50 | public String viewProductInventory(@PathVariable String productId, Model model)throws IOException { 51 | 52 | Product product = dao.getProductById(productId); 53 | model.addAttribute("product",product); 54 | return "viewProductInventory"; 55 | } 56 | /* View Product Inventory*/ 57 | 58 | 59 | /* Product Inventory*/ 60 | @RequestMapping("/admin/productInventory") 61 | public String getProductInventory(Model model){ 62 | List products= dao.getProducts(); 63 | model.addAttribute("products",products); 64 | return "productInventory"; 65 | } 66 | 67 | /* Product Inventory*/ 68 | 69 | /* Add Product */ 70 | 71 | @RequestMapping("/admin/productInventory/addProduct") 72 | public String addProduct(Model model){ 73 | Product product = new Product();; 74 | //We are setting these attributes by default in case user dosen't enter ay details in these input fields 75 | product.setProductStatus("Active"); 76 | product.setProductCondition("New"); 77 | product.setProductCategory("Instrument"); 78 | 79 | model.addAttribute("product",product); 80 | 81 | return "addProduct"; 82 | } 83 | 84 | @RequestMapping(value = "/admin/productInventory/addProduct",method = RequestMethod.POST) 85 | public String addProductPost(@Valid @ModelAttribute("product") Product product, BindingResult result, 86 | HttpServletRequest request, HttpServletResponse response, Model model){ 87 | 88 | if(result.hasErrors()){ 89 | System.out.println("Validation errors"); 90 | return "addProduct";} 91 | 92 | dao.addProduct(product); 93 | System.out.println(product); 94 | 95 | MultipartFile productImage = product.getProductImage(); 96 | String rootDirectory = request.getSession().getServletContext().getRealPath("/"); 97 | path = Paths.get(rootDirectory+"\\WEB-INF\\resources\\images\\"+product.getProductId()+".png"); 98 | 99 | if(productImage!=null && !productImage.isEmpty()){ 100 | try{ 101 | productImage.transferTo(new File(path.toString())); 102 | } 103 | catch (Exception e){ 104 | e.printStackTrace(); 105 | throw new RuntimeException("Product Image Saving Failed"); 106 | } 107 | } 108 | 109 | // String msg = "Product added successfully!"; 110 | //// model.addAttribute("msg",msg); 111 | //// List products= dao.getProducts(); 112 | //// model.addAttribute("products",products); 113 | //// return "productInventory"; 114 | // //return "redirect:/admin/productInventory?msg=Product added successfully!"; 115 | // 116 | // request.setAttribute("msg",msg); 117 | // RequestDispatcher dispatcher = request.getRequestDispatcher("/admin/productInventory"); 118 | // try { 119 | // dispatcher.forward(request, response); 120 | // } catch (ServletException e) { 121 | // e.printStackTrace(); 122 | // } catch (IOException e) { 123 | // e.printStackTrace(); 124 | // } 125 | // System.out.println("End of add product"); 126 | return "redirect:/admin/productInventory"; 127 | } 128 | 129 | /* Add Product ends*/ 130 | 131 | 132 | /* Delete Product*/ 133 | 134 | @RequestMapping("/admin/productInventory/deleteProduct/{productId}") 135 | public String deleteProduct(@PathVariable String productId, Model model, HttpServletRequest request, HttpServletResponse response){ 136 | 137 | String rootDirectory = request.getSession().getServletContext().getRealPath("/"); 138 | path = Paths.get(rootDirectory+"\\WEB-INF\\resources\\images\\"+productId+".png"); 139 | 140 | if (Files.exists(path)){ 141 | try { 142 | Files.delete(path); 143 | } catch (IOException e) { 144 | e.printStackTrace(); 145 | } 146 | } 147 | 148 | dao.deleteProduct(productId); 149 | 150 | 151 | // String msg = "Product deleted successfully!"; 152 | //// model.addAttribute("msg",msg); 153 | //// List products= dao.getProducts(); 154 | //// model.addAttribute("products",products); 155 | //// return "productInventory"; 156 | // //return "redirect:/admin/productInventory?msg=Product delete successfully!"; 157 | // request.setAttribute("msg",msg); 158 | // RequestDispatcher dispatcher = request.getRequestDispatcher("/admin/productInventory"); 159 | // try { 160 | // dispatcher.forward(request, response); 161 | // } catch (ServletException e) { 162 | // e.printStackTrace(); 163 | // } catch (IOException e) { 164 | // e.printStackTrace(); 165 | // } 166 | // System.out.println("End of delete product"); 167 | 168 | return "redirect:/admin/productInventory"; 169 | 170 | 171 | 172 | } 173 | /* Delete Product ends*/ 174 | 175 | 176 | /* Edit Product*/ 177 | 178 | @RequestMapping("/admin/productInventory/editProduct/{productId}") 179 | public String editProduct(@PathVariable String productId,Model model){ 180 | 181 | Product product = dao.getProductById(productId); 182 | model.addAttribute("product",product); 183 | return "editProduct"; 184 | } 185 | 186 | @RequestMapping(value = "/admin/productInventory/editProduct",method = RequestMethod.POST) 187 | public String editProductPost(@Valid @ModelAttribute("product") Product product, BindingResult result, 188 | HttpServletRequest request,Model model){ 189 | 190 | if(result.hasErrors()){ 191 | System.out.println("Validation errors"); 192 | return "editProduct";} 193 | 194 | MultipartFile productImage = product.getProductImage(); 195 | String rootDirectory = request.getSession().getServletContext().getRealPath("/"); 196 | path = Paths.get(rootDirectory+"\\WEB-INF\\resources\\images\\"+product.getProductId()+".png"); 197 | 198 | if(productImage!=null && !productImage.isEmpty()){ 199 | try{ 200 | productImage.transferTo(new File(path.toString())); 201 | } 202 | catch (Exception e){ 203 | e.printStackTrace(); 204 | throw new RuntimeException("Product Image Saving Failed"); 205 | } 206 | } 207 | 208 | dao.editProduct(product); 209 | // String msg = "Product updated successfully!"; 210 | // model.addAttribute("msg",msg); 211 | // List products= dao.getProducts(); 212 | // model.addAttribute("products",products); 213 | // return "productInventory"; 214 | //return "redirect:/admin/productInventory?msg=Product updated successfully!"; 215 | return "redirect:/admin/productInventory"; 216 | } 217 | 218 | 219 | /* Edit Product ends*/ 220 | 221 | 222 | 223 | 224 | } 225 | -------------------------------------------------------------------------------- /src/main/java/com/emusicstore/dao/ProductDaoOld.java: -------------------------------------------------------------------------------- 1 | package com.emusicstore.dao; 2 | 3 | import com.emusicstore.model.Product; 4 | import org.hibernate.Query; 5 | import org.hibernate.Session; 6 | import org.hibernate.SessionFactory; 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import java.sql.*; 9 | import java.io.IOException; 10 | import java.util.ArrayList; 11 | import java.util.List; 12 | import java.util.Set; 13 | 14 | /** 15 | * Created by ajeasyvaio on 04/24/2016. 16 | */ 17 | public class ProductDaoOld { 18 | 19 | private List productList; 20 | 21 | @Autowired 22 | private SessionFactory sf; 23 | public List getProducts(){ 24 | System.out.println("Starting the DAO...."); 25 | Product product1 = new Product(); 26 | product1.setProductId("INS001"); 27 | product1.setProductName("Guitar"); 28 | product1.setProductCategory("String Instrument"); 29 | product1.setProductCondition("New"); 30 | product1.setProductManufacturer("Fender"); 31 | product1.setProductDescription("This is a Fender Strat Guitar"); 32 | product1.setProductPrice(1200); 33 | product1.setUnitInStock(11); 34 | product1.setProductStatus("Active"); 35 | 36 | Product product2 = new Product(); 37 | product2.setProductId("INS002"); 38 | product2.setProductName("Tabla"); 39 | product2.setProductCategory("Percussion Instrument"); 40 | product2.setProductCondition("New"); 41 | product2.setProductManufacturer("Sawant Brothers"); 42 | product2.setProductDescription("This is a KaliChar Tabla"); 43 | product2.setProductPrice(2000); 44 | product2.setUnitInStock(18); 45 | product2.setProductStatus("Active"); 46 | 47 | Product product3 = new Product(); 48 | product3.setProductId("CD001"); 49 | product3.setProductName("Pitbull M.I.A.M.I."); 50 | product3.setProductCategory("BlueRay Disc"); 51 | product3.setProductCondition("New"); 52 | product3.setProductManufacturer("Sony Music"); 53 | product3.setProductDescription("M.I.A.M.I. (backronym of Money Is a Major Issue) is the debut studio album by rapper Pitbull. The album was released on August 3, 2004,[4] and peaked at number fourteen on the U.S. Billboard 200 chart"); 54 | product3.setProductPrice(55); 55 | product3.setUnitInStock(152); 56 | product3.setProductStatus("Active"); 57 | 58 | productList = new ArrayList(); 59 | // productList.add(product1); 60 | // productList.add(product2); 61 | // productList.add(product3); 62 | 63 | 64 | 65 | Connection conn = null; 66 | Statement stmt = null; 67 | try { 68 | 69 | 70 | //STEP 3: Open a connection 71 | System.out.println("Connecting to database..."); 72 | conn = DriverManager.getConnection("jdbc:mysql://localhost:3306/ajinkya","student","student"); 73 | 74 | //STEP 4: Execute a query 75 | System.out.println("Creating statement..."); 76 | stmt = conn.createStatement(); 77 | ResultSet rs = stmt.executeQuery("SELECT * FROM product"); 78 | 79 | while(rs.next()) { 80 | // int productId= rs.getInt("id"); 81 | // String productName= rs.getString("name"); 82 | // String productCategory= rs.getString("email"); 83 | // String productDescription= rs.getString("address"); 84 | // System.out.printf( "The Data is...",productId,productName, productCategory, productDescription); 85 | // String productId= rs.getString("productId"); 86 | // String productName= rs.getString("productName"); 87 | // String productCategory= rs.getString("productCategory"); 88 | // String productDescription= rs.getString("productDescription"); 89 | // double productPrice= rs.getDouble("productPrice"); 90 | // String productCondition= rs.getString("productCondition"); 91 | // String productStatus= rs.getString("productStatus"); 92 | // int unitInStock= rs.getInt("unitInStock"); 93 | // String productManufacturer= rs.getString("productManufacturer"); 94 | // System.out.printf( "The Data is...",productName, productCategory, productDescription, productPrice, productCondition, productStatus, unitInStock, productManufacturer); 95 | // System.out.println("Ending the query...."); 96 | //Product product = new Product( productId,productName, productCategory, productDescription, productPrice, productCondition, productStatus, unitInStock, productManufacturer); 97 | //Product product = new Product(rs.getString("productId"),rs.getString("productName"),rs.getString("productCategory"), 98 | // rs.getString("productDescription"),rs.getDouble("productPrice"),rs.getString("productCondition"),rs.getString("productStatus"),rs.getInt("unitInStock"),rs.getString("productManufacturer")); 99 | // System.out.printf(rs.getString("productId"),rs.getString("productName"),rs.getString("productCategory"), 100 | // rs.getString("productDescription"),rs.getDouble("productPrice"),rs.getString("productCondition"),rs.getString("productStatus"),rs.getInt("unitInStock"),rs.getString("productManufacturer")); 101 | System.out.println("Strings..."+rs.getString(1)+" "+rs.getString(2)+" "+rs.getString(3)+" "+rs.getString(4)+" "+ 102 | rs.getDouble(7)+" "+rs.getString(5)+" "+ 103 | rs.getString(6)+" "+rs.getInt(9)+" "+rs.getString(8)); 104 | 105 | String productId= rs.getString(1); 106 | String productName= rs.getString(6); 107 | String productCategory= rs.getString(2); 108 | String productDescription= rs.getString(4); 109 | double productPrice= rs.getDouble(7); 110 | String productCondition= rs.getString(3); 111 | String productStatus= rs.getString(8); 112 | int unitInStock= rs.getInt(9); 113 | String productManufacturer= rs.getString(5); 114 | System.out.printf("Variables..."+ productId+" "+productName+" "+ productCategory+" "+ productDescription+" "+ productPrice, 115 | productCondition+" "+ productStatus+" "+ unitInStock+" "+ productManufacturer); 116 | 117 | Product product = new Product( productId,productName, productCategory, productDescription, productPrice, productCondition, productStatus, unitInStock, productManufacturer); 118 | System.out.printf( "Product properties ..."+product.getProductId()+" "+product.getProductName()+" "+ product.getProductCategory()+" "+ product.getProductDescription()+" " 119 | + product.getProductPrice()+" "+ product.getProductCondition()+" "+ product.getProductStatus()+" "+ product.getUnitInStock()+" " 120 | + product.getProductManufacturer()); 121 | 122 | //Product product = new Product(); 123 | product.setProductId(rs.getString(1)); 124 | product.setProductName(rs.getString(6)); 125 | product.setProductCategory(rs.getString(2)); 126 | product.setProductCondition(rs.getString(3)); 127 | product.setProductManufacturer(rs.getString(5)); 128 | product.setProductDescription(rs.getString(4)); 129 | product.setProductPrice(rs.getDouble(7)); 130 | product.setProductStatus(rs.getString(8)); 131 | product.setUnitInStock(rs.getInt(9)); 132 | 133 | 134 | productList.add(product); 135 | } 136 | 137 | }catch(Exception e){ 138 | e.printStackTrace(); 139 | } 140 | 141 | 142 | 143 | // Session session = sf.getCurrentSession(); 144 | // System.out.println("Inside getting .."); 145 | // Query query = session.createQuery("from com.emusicstore.model.Product"); 146 | // List productList = query.list(); 147 | // session.flush(); 148 | // System.out.println(); 149 | // System.out.println(productList); 150 | // System.out.println(); 151 | 152 | 153 | System.out.println("Ending the DAO...."); 154 | return productList; 155 | 156 | } 157 | 158 | 159 | public Product getProductById(String productId) throws IOException{ 160 | for(Product product :getProducts()){ 161 | if(product.getProductId().equals(productId)) 162 | return product; 163 | } 164 | throw new IOException("No Matching Products Found in Store.."); 165 | } 166 | 167 | 168 | 169 | } 170 | -------------------------------------------------------------------------------- /.idea/uiDesigner.xml: -------------------------------------------------------------------------------- 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 | 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 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | --------------------------------------------------------------------------------