├── .github └── workflows │ └── vprobuild.yml ├── Jenkinsfile ├── README.md ├── ansible ├── ansible.cfg ├── site.yml ├── templates │ ├── application.j2 │ ├── epel6-svcfile.j2 │ ├── epel7-svcfile.j2 │ ├── ubuntu14_15-svcfile.j2 │ └── ubuntu16-svcfile.j2 ├── tomcat_setup.yml └── vpro-app-setup.yml ├── files ├── context.xml └── tomcat-users.xml ├── logo.png ├── pom.xml └── src ├── main ├── java │ └── com │ │ └── visualpathit │ │ └── account │ │ ├── beans │ │ └── Components.java │ │ ├── controller │ │ ├── ElasticSearchController.java │ │ ├── FileUploadController.java │ │ └── UserController.java │ │ ├── model │ │ ├── Role.java │ │ └── User.java │ │ ├── repository │ │ ├── RoleRepository.java │ │ └── UserRepository.java │ │ ├── service │ │ ├── ConsumerService.java │ │ ├── ConsumerServiceImpl.java │ │ ├── ProducerService.java │ │ ├── ProducerServiceImpl.java │ │ ├── SecurityService.java │ │ ├── SecurityServiceImpl.java │ │ ├── UserDetailsServiceImpl.java │ │ ├── UserService.java │ │ └── UserServiceImpl.java │ │ ├── utils │ │ ├── ElasticsearchUtil.java │ │ ├── MemcachedUtils.java │ │ └── RabbitMqUtil.java │ │ └── validator │ │ └── UserValidator.java ├── resources │ ├── application.properties │ ├── db_backup.sql │ ├── logback.xml │ └── validation.properties └── webapp │ ├── WEB-INF │ ├── appconfig-data.xml │ ├── appconfig-mvc.xml │ ├── appconfig-rabbitmq.xml │ ├── appconfig-root.xml │ ├── appconfig-security.xml │ ├── views │ │ ├── elasticeSearchRes.jsp │ │ ├── index_home.jsp │ │ ├── login.jsp │ │ ├── rabbitmq.jsp │ │ ├── registration.jsp │ │ ├── upload.jsp │ │ ├── user.jsp │ │ ├── userList.jsp │ │ ├── userUpdate.jsp │ │ └── welcome.jsp │ └── web.xml │ └── resources │ ├── Images │ ├── background.png │ ├── header.jpg │ ├── technologies │ │ ├── Ansible_logo.png │ │ ├── Vagrant.png │ │ ├── aws.png │ │ ├── docker.png │ │ ├── git.jpg │ │ ├── jenkins.png │ │ ├── puppet.jpg │ │ └── python-logo.png │ ├── user │ │ ├── giphy.gif │ │ ├── logo.png │ │ ├── user.png │ │ ├── user2.png │ │ └── user3.png │ ├── visualpath.png │ ├── visualpathlogo2.png │ └── visualpathlogo3.png │ ├── css │ ├── bootstrap.min.css │ ├── common.css │ ├── profile.css │ └── w3.css │ └── js │ └── bootstrap.min.js └── test └── java └── com └── visualpathit └── account ├── controllerTest ├── SampleTest.java └── UserControllerTest.java ├── modelTest ├── RoleTest.java └── UserTest.java └── setup └── StandaloneMvcTestViewResolver.java /.github/workflows/vprobuild.yml: -------------------------------------------------------------------------------- 1 | name: Build Workflow 2 | on: workflow_dispatch 3 | jobs: 4 | first-job: 5 | runs-on: ubuntu-latest 6 | steps: 7 | - name: Fetch Source coce 8 | uses: actions/checkout@v4 9 | - name: Build artifacts 10 | run: | 11 | mvn install 12 | mv target/vprofile-v2.war . 13 | rm -rf target 14 | mkdir target 15 | mv vprofile-v2.war target/ 16 | ls -l target/ 17 | 18 | -------------------------------------------------------------------------------- /Jenkinsfile: -------------------------------------------------------------------------------- 1 | pipeline { 2 | 3 | agent any 4 | /* 5 | tools { 6 | maven "maven3" 7 | 8 | } 9 | */ 10 | environment { 11 | NEXUS_VERSION = "nexus3" 12 | NEXUS_PROTOCOL = "http" 13 | NEXUS_URL = "172.31.40.209:8081" 14 | NEXUS_REPOSITORY = "vprofile-release" 15 | NEXUS_REPO_ID = "vprofile-release" 16 | NEXUS_CREDENTIAL_ID = "nexuslogin" 17 | ARTVERSION = "${env.BUILD_ID}" 18 | } 19 | 20 | stages{ 21 | 22 | stage('BUILD'){ 23 | steps { 24 | sh 'mvn clean install -DskipTests' 25 | } 26 | post { 27 | success { 28 | echo 'Now Archiving...' 29 | archiveArtifacts artifacts: '**/target/*.war' 30 | } 31 | } 32 | } 33 | 34 | stage('UNIT TEST'){ 35 | steps { 36 | sh 'mvn test' 37 | } 38 | } 39 | 40 | stage('INTEGRATION TEST'){ 41 | steps { 42 | sh 'mvn verify -DskipUnitTests' 43 | } 44 | } 45 | 46 | stage ('CODE ANALYSIS WITH CHECKSTYLE'){ 47 | steps { 48 | sh 'mvn checkstyle:checkstyle' 49 | } 50 | post { 51 | success { 52 | echo 'Generated Analysis Result' 53 | } 54 | } 55 | } 56 | 57 | stage('CODE ANALYSIS with SONARQUBE') { 58 | 59 | environment { 60 | scannerHome = tool 'sonarscanner4' 61 | } 62 | 63 | steps { 64 | withSonarQubeEnv('sonar-pro') { 65 | sh '''${scannerHome}/bin/sonar-scanner -Dsonar.projectKey=vprofile \ 66 | -Dsonar.projectName=vprofile-repo \ 67 | -Dsonar.projectVersion=1.0 \ 68 | -Dsonar.sources=src/ \ 69 | -Dsonar.java.binaries=target/test-classes/com/visualpathit/account/controllerTest/ \ 70 | -Dsonar.junit.reportsPath=target/surefire-reports/ \ 71 | -Dsonar.jacoco.reportsPath=target/jacoco.exec \ 72 | -Dsonar.java.checkstyle.reportPaths=target/checkstyle-result.xml''' 73 | } 74 | 75 | timeout(time: 10, unit: 'MINUTES') { 76 | waitForQualityGate abortPipeline: true 77 | } 78 | } 79 | } 80 | 81 | stage("Publish to Nexus Repository Manager") { 82 | steps { 83 | script { 84 | pom = readMavenPom file: "pom.xml"; 85 | filesByGlob = findFiles(glob: "target/*.${pom.packaging}"); 86 | echo "${filesByGlob[0].name} ${filesByGlob[0].path} ${filesByGlob[0].directory} ${filesByGlob[0].length} ${filesByGlob[0].lastModified}" 87 | artifactPath = filesByGlob[0].path; 88 | artifactExists = fileExists artifactPath; 89 | if(artifactExists) { 90 | echo "*** File: ${artifactPath}, group: ${pom.groupId}, packaging: ${pom.packaging}, version ${pom.version} ARTVERSION"; 91 | nexusArtifactUploader( 92 | nexusVersion: NEXUS_VERSION, 93 | protocol: NEXUS_PROTOCOL, 94 | nexusUrl: NEXUS_URL, 95 | groupId: pom.groupId, 96 | version: ARTVERSION, 97 | repository: NEXUS_REPOSITORY, 98 | credentialsId: NEXUS_CREDENTIAL_ID, 99 | artifacts: [ 100 | [artifactId: pom.artifactId, 101 | classifier: '', 102 | file: artifactPath, 103 | type: pom.packaging], 104 | [artifactId: pom.artifactId, 105 | classifier: '', 106 | file: "pom.xml", 107 | type: "pom"] 108 | ] 109 | ); 110 | } 111 | else { 112 | error "*** File: ${artifactPath}, could not be found"; 113 | } 114 | } 115 | } 116 | } 117 | 118 | 119 | } 120 | 121 | 122 | } 123 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | ### 3 | - JDK 11 4 | - Maven 3 or later 5 | - MySQL 5.6 or later 6 | 7 | # Technologies 8 | - Spring MVC 9 | - Spring Security 10 | - Spring Data JPA 11 | - Maven 12 | - JSP 13 | - MySQL 14 | # Database 15 | Here,we used Mysql DB 16 | MSQL DB Installation Steps for Linux ubuntu 14.04: 17 | - $ sudo apt-get update 18 | - $ sudo apt-get install mysql-server 19 | 20 | Then look for the file : 21 | - /src/main/resources/accountsdb 22 | - accountsdb.sql file is a mysql dump file.we have to import this dump to mysql db server 23 | - > mysql -u -p accounts < accountsdb.sql 24 | 25 | 26 | -------------------------------------------------------------------------------- /ansible/ansible.cfg: -------------------------------------------------------------------------------- 1 | [defaults] 2 | host_key_checking = False 3 | timeout = 30 4 | -------------------------------------------------------------------------------- /ansible/site.yml: -------------------------------------------------------------------------------- 1 | --- 2 | - import_playbook: tomcat_setup.yml 3 | - import_playbook: vpro-app-setup.yml 4 | 5 | ### 6 | -------------------------------------------------------------------------------- /ansible/templates/application.j2: -------------------------------------------------------------------------------- 1 | #JDBC Configutation for Database Connection 2 | jdbc.driverClassName=com.mysql.jdbc.Driver 3 | jdbc.url=jdbc:mysql://dbhost:3306/accounts?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull 4 | jdbc.username=db_user 5 | jdbc.password=db_password 6 | 7 | #Memcached Configuration For Active and StandBy Host 8 | #For Active Host 9 | memcached.active.host=127.0.0.1 10 | memcached.active.port=11211 11 | #For StandBy Host 12 | memcached.standBy.host=127.0.0.2 13 | memcached.standBy.port=11211 14 | 15 | #RabbitMq Configuration 16 | rabbitmq.address=18.220.62.126 17 | rabbitmq.port=5672 18 | rabbitmq.username=test 19 | rabbitmq.password=test 20 | 21 | #Elasticesearch Configuration 22 | elasticsearch.host =192.168.1.85 23 | elasticsearch.port =9300 24 | elasticsearch.cluster=vprofile 25 | elasticsearch.node=vprofilenode 26 | -------------------------------------------------------------------------------- /ansible/templates/epel6-svcfile.j2: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### BEGIN INIT INFO 4 | # Provides: tomcat7 5 | # Required-Start: $network 6 | # Required-Stop: $network 7 | # Default-Start: 2 3 4 5 8 | # Default-Stop: 0 1 6 9 | # Short-Description: Start/Stop Tomcat server 10 | ### END INIT INFO 11 | 12 | PATH=/sbin:/bin:/usr/sbin:/usr/bin 13 | 14 | start() { 15 | sh /usr/local/tomcat8/bin/startup.sh 16 | } 17 | 18 | stop() { 19 | sh /usr/local/tomcat8/bin/shutdown.sh 20 | } 21 | 22 | status() { 23 | pid=$(ps -fe | grep '/usr/local/tomcat8' | grep -v grep | tr -s " " | cut -d" " -f2) 24 | if [ -n "$pid" ]; then 25 | echo -e "\e[00;32mTomcat is running with pid: $pid\e[00m" 26 | else 27 | echo -e "\e[00;31mTomcat is not running\e[00m" 28 | fi 29 | } 30 | 31 | case $1 in 32 | start|stop|status) $1;; 33 | restart) stop; start;; 34 | *) echo "Run as $0 "; exit 1;; 35 | esac 36 | exit 0 37 | 38 | 39 | -------------------------------------------------------------------------------- /ansible/templates/epel7-svcfile.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Tomcat 3 | After=network.target 4 | 5 | [Service] 6 | User=tomcat 7 | WorkingDirectory=/usr/local/tomcat8 8 | Environment=JRE_HOME=/usr/lib/jvm/jre 9 | Environment=JAVA_HOME=/usr/lib/jvm/jre 10 | Environment=CATALINA_HOME=/usr/local/tomcat8 11 | Environment=CATALINE_BASE=/usr/local/tomcat8 12 | ExecStart=/usr/local/tomcat8/bin/catalina.sh run 13 | ExecStop=/usr/local/tomcat8/bin/shutdown.sh 14 | SyslogIdentifier=tomcat-%i 15 | 16 | [Install] 17 | WantedBy=multi-user.target 18 | 19 | -------------------------------------------------------------------------------- /ansible/templates/ubuntu14_15-svcfile.j2: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ### BEGIN INIT INFO 4 | # Provides: tomcat7 5 | # Required-Start: $network 6 | # Required-Stop: $network 7 | # Default-Start: 2 3 4 5 8 | # Default-Stop: 0 1 6 9 | # Short-Description: Start/Stop Tomcat server 10 | ### END INIT INFO 11 | 12 | PATH=/sbin:/bin:/usr/sbin:/usr/bin 13 | 14 | start() { 15 | sh /usr/local/tomcat8/bin/startup.sh 16 | } 17 | 18 | stop() { 19 | sh /usr/local/tomcat8/bin/shutdown.sh 20 | } 21 | 22 | status() { 23 | pid=$(ps -fe | grep '/usr/local/tomcat8' | grep -v grep | tr -s " " | cut -d" " -f2) 24 | if [ -n "$pid" ]; then 25 | echo -e "\e[00;32mTomcat is running with pid: $pid\e[00m" 26 | else 27 | echo -e "\e[00;31mTomcat is not running\e[00m" 28 | fi 29 | } 30 | 31 | case $1 in 32 | start|stop|status) $1;; 33 | restart) stop; start;; 34 | *) echo "Run as $0 "; exit 1;; 35 | esac 36 | exit 0 37 | 38 | 39 | -------------------------------------------------------------------------------- /ansible/templates/ubuntu16-svcfile.j2: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Tomcat 3 | After=network.target 4 | 5 | [Service] 6 | User=tomcat 7 | WorkingDirectory=/usr/local/tomcat8 8 | Environment=JRE_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre 9 | Environment=JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64/jre 10 | Environment=CATALINA_HOME=/usr/local/tomcat8 11 | Environment=CATALINE_BASE=/usr/local/tomcat8 12 | ExecStart=/usr/local/tomcat8/bin/catalina.sh run 13 | ExecStop=/usr/local/tomcat8/bin/shutdown.sh 14 | SyslogIdentifier=tomcat-%i 15 | 16 | [Install] 17 | WantedBy=multi-user.target 18 | 19 | -------------------------------------------------------------------------------- /ansible/tomcat_setup.yml: -------------------------------------------------------------------------------- 1 | - name: Common tool setup on all the servers 2 | hosts: appsrvgrp 3 | become: yes 4 | vars: 5 | tom_url: https://archive.apache.org/dist/tomcat/tomcat-8/v8.5.37/bin/apache-tomcat-8.5.37.tar.gz 6 | 7 | tasks: 8 | - name: Install JDK on Centos 6/7 9 | yum: 10 | name: java-1.8.0-openjdk.x86_64 11 | state: present 12 | when: ansible_distribution == 'CentOS' 13 | 14 | - name: Install JDK on Ubuntu 14/15/16/18 15 | apt: 16 | name: openjdk-8-jdk 17 | state: present 18 | update_cache: yes 19 | when: ansible_distribution == 'Ubuntu' 20 | 21 | - name: Download Tomcat Tar Ball/Binaries 22 | get_url: 23 | url: "{{tom_url}}" 24 | dest: /tmp/tomcat-8.tar.gz 25 | 26 | - name: Add tomcat group 27 | group: 28 | name: tomcat 29 | state: present 30 | 31 | - name: Add tomcat user 32 | user: 33 | name: tomcat 34 | group: tomcat 35 | shell: /bin/nologin 36 | home: /usr/local/tomcat8 37 | 38 | - file: 39 | path: /tmp/tomcat8 40 | state: directory 41 | 42 | - name: Extract tomcat 43 | unarchive: 44 | src: /tmp/tomcat-8.tar.gz 45 | dest: /tmp/tomcat8/ 46 | remote_src: yes 47 | list_files: yes 48 | register: unarchive_info 49 | 50 | - debug: 51 | msg: "{{unarchive_info.files[0].split('/')[0]}}" 52 | 53 | - name: Synchronize /tmp/tomcat8/tomcat_cont /usr/local/tomcat8. 54 | synchronize: 55 | src: "/tmp/tomcat8/{{unarchive_info.files[0].split('/')[0]}}/" 56 | dest: /usr/local/tomcat8/ 57 | delegate_to: "{{ inventory_hostname }}" 58 | 59 | - name: Change ownership of /usr/local/tomcat8 60 | file: 61 | path: /usr/local/tomcat8 62 | owner: tomcat 63 | group: tomcat 64 | recurse: yes 65 | 66 | - name: Setup tomcat SVC file on Centos 7 67 | template: 68 | src: templates/epel7-svcfile.j2 69 | dest: /etc/systemd/system/tomcat.service 70 | mode: "a+x" 71 | when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '7' 72 | 73 | - name: Setup tomcat SVC file on Centos 6 74 | template: 75 | src: templates/epel6-svcfile.j2 76 | dest: /etc/init.d/tomcat 77 | mode: "a+x" 78 | when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '6' 79 | 80 | - name: Setup tomcat SVC file on ubuntu 14/15 81 | template: 82 | src: templates/ubuntu14_15-svcfile.j2 83 | dest: /etc/init.d/tomcat 84 | mode: "a+x" 85 | when: ansible_distribution == 'Ubuntu' and ansible_distribution_major_version < '16' 86 | 87 | - name: Setup tomcat SVC file on ubuntu 16 and 18 88 | template: 89 | src: templates/ubuntu16-svcfile.j2 90 | dest: /etc/systemd/system/tomcat.service 91 | mode: "a+x" 92 | when: ansible_distribution == 'Ubuntu' and ansible_distribution_major_version >= '16' 93 | 94 | - name: Reload tomcat svc config in ubuntu 14/15 95 | command: update-rc.d tomcat defaults 96 | when: ansible_distribution == 'Ubuntu' and ansible_distribution_major_version < '16' 97 | 98 | - name: Reload tomcat svc config in Centos 6 99 | command: chkconfig --add tomcat 100 | when: ansible_distribution == 'CentOS' and ansible_distribution_major_version == '6' 101 | 102 | - name: just force systemd to reread configs (2.4 and above) 103 | systemd: 104 | daemon_reload: yes 105 | when: ansible_distribution_major_version > '6' or ansible_distribution_major_version > '15' 106 | 107 | - name: Start & Enable TOmcat 8 108 | service: 109 | name: tomcat 110 | state: started 111 | enabled: yes 112 | 113 | 114 | -------------------------------------------------------------------------------- /ansible/vpro-app-setup.yml: -------------------------------------------------------------------------------- 1 | 2 | - name: Setup Tomcat8 & Deploy Artifact 3 | hosts: appsrvgrp 4 | become: yes 5 | vars: 6 | timestamp: "{{ansible_date_time.date}}_{{ansible_date_time.hour}}_{{ansible_date_time.minute}}" 7 | tasks: 8 | - name: Download latest VProfile.war from nexus 9 | get_url: 10 | url: "http://{{USER}}:{{PASS}}@{{nexusip}}:8081/repository/{{reponame}}/{{groupid}}/{{time}}/{{build}}/{{vprofile_version}}" 11 | dest: "/tmp/vproapp-{{vprofile_version}}" 12 | register: wardeploy 13 | tags: 14 | - deploy 15 | 16 | - stat: 17 | path: /usr/local/tomcat8/webapps/ROOT 18 | register: artifact_stat 19 | tags: 20 | - deploy 21 | 22 | - name: Stop tomcat svc 23 | service: 24 | name: tomcat 25 | state: stopped 26 | tags: 27 | - deploy 28 | 29 | - name: Try Backup and Deploy 30 | block: 31 | - name: Archive ROOT dir with timestamp 32 | archive: 33 | path: /usr/local/tomcat8/webapps/ROOT 34 | dest: "/opt/ROOT_{{timestamp}}.tgz" 35 | when: artifact_stat.stat.exists 36 | register: archive_info 37 | tags: 38 | - deploy 39 | 40 | - name: copy ROOT dir with old_ROOT name 41 | shell: cp -r ROOT old_ROOT 42 | args: 43 | chdir: /usr/local/tomcat8/webapps/ 44 | 45 | - name: Delete current artifact 46 | file: 47 | path: "{{item}}" 48 | state: absent 49 | when: archive_info.changed 50 | loop: 51 | - /usr/local/tomcat8/webapps/ROOT 52 | - /usr/local/tomcat8/webapps/ROOT.war 53 | tags: 54 | - deploy 55 | 56 | - name: Try deploy artifact else restore from previos old_ROOT 57 | block: 58 | - name: Deploy vprofile artifact 59 | copy: 60 | src: "/tmp/vproapp-{{vprofile_version}}" 61 | dest: /usr/local/tomcat8/webapps/ROOT.war 62 | remote_src: yes 63 | register: deploy_info 64 | tags: 65 | - deploy 66 | rescue: 67 | - shell: cp -r old_ROOT ROOT 68 | args: 69 | chdir: /usr/local/tomcat8/webapps/ 70 | 71 | rescue: 72 | - name: Start tomcat svc 73 | service: 74 | name: tomcat 75 | state: started 76 | 77 | - name: Start tomcat svc 78 | service: 79 | name: tomcat 80 | state: started 81 | when: deploy_info.changed 82 | tags: 83 | - deploy 84 | 85 | - name: Wait until ROOT.war is extracted to ROOT directory 86 | wait_for: 87 | path: /usr/local/tomcat8/webapps/ROOT 88 | tags: 89 | - deploy 90 | 91 | # - name: Deploy web configuration file 92 | # template: 93 | # src: templates/application.j2 94 | # dest: /usr/local/tomcat8/webapps/ROOT/WEB-INF/classes/application.properties 95 | # force: yes 96 | # notify: 97 | # - Restart Tomcat 98 | # tags: 99 | # - deploy 100 | 101 | handlers: 102 | - name: Restart Tomcat 103 | service: 104 | name: tomcat 105 | state: restarted 106 | -------------------------------------------------------------------------------- /files/context.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 19 | 24 | 25 | -------------------------------------------------------------------------------- /files/tomcat-users.xml: -------------------------------------------------------------------------------- 1 | 2 | 18 | 22 | 30 | 37 | 44 | 45 | -------------------------------------------------------------------------------- /logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopshydclub/vprofile-project/a4cd8e41e653023e1dbb6a900d392fb3fc1ebdee/logo.png -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | com.visualpathit 5 | vprofile 6 | war 7 | v2 8 | Visualpathit VProfile Webapp 9 | http://maven.apache.org 10 | 11 | 4.2.0.RELEASE 12 | 4.0.2.RELEASE 13 | 1.8.2.RELEASE 14 | 4.3.11.Final 15 | 5.2.1.Final 16 | 5.1.36 17 | 1.4 18 | 1.2 19 | 4.10 20 | 1.1.3 21 | 1.8 22 | 1.8 23 | 24 | 25 | 26 | 27 | org.springframework 28 | spring-web 29 | ${spring.version} 30 | 31 | 32 | 33 | org.springframework 34 | spring-webmvc 35 | ${spring.version} 36 | 37 | 38 | 39 | org.springframework.security 40 | spring-security-web 41 | ${spring-security.version} 42 | 43 | 44 | 45 | org.springframework.security 46 | spring-security-config 47 | ${spring-security.version} 48 | 49 | 50 | 51 | org.hibernate 52 | hibernate-validator 53 | ${hibernate-validator.version} 54 | 55 | 56 | 57 | org.springframework.data 58 | spring-data-jpa 59 | ${spring-data-jpa.version} 60 | 61 | 62 | 63 | org.hibernate 64 | hibernate-entitymanager 65 | ${hibernate.version} 66 | 67 | 68 | 69 | mysql 70 | mysql-connector-java 71 | ${mysql-connector.version} 72 | 73 | 74 | 75 | commons-dbcp 76 | commons-dbcp 77 | ${commons-dbcp.version} 78 | 79 | 80 | 81 | javax.servlet 82 | jstl 83 | ${jstl.version} 84 | 85 | 86 | 87 | junit 88 | junit 89 | ${junit.version} 90 | test 91 | 92 | 93 | org.mockito 94 | mockito-core 95 | 1.9.5 96 | test 97 | 98 | 99 | org.springframework 100 | spring-test 101 | 3.2.3.RELEASE 102 | test 103 | 104 | 105 | javax.servlet 106 | javax.servlet-api 107 | 3.1.0 108 | provided 109 | 110 | 111 | ch.qos.logback 112 | logback-classic 113 | ${logback.version} 114 | 115 | 116 | org.hamcrest 117 | hamcrest-all 118 | 1.3 119 | test 120 | 121 | 122 | commons-fileupload 123 | commons-fileupload 124 | 1.3.1 125 | 126 | 127 | 128 | net.spy 129 | spymemcached 130 | 2.12.3 131 | 132 | 133 | commons-io 134 | commons-io 135 | 2.4 136 | 137 | 138 | 139 | org.springframework.amqp 140 | spring-rabbit 141 | 1.7.1.RELEASE 142 | 143 | 144 | 145 | com.rabbitmq 146 | amqp-client 147 | 4.0.2 148 | 149 | 150 | 151 | org.elasticsearch 152 | elasticsearch 153 | 5.6.4 154 | 155 | 156 | 157 | org.elasticsearch.client 158 | transport 159 | 5.6.4 160 | 161 | 162 | 163 | com.google.code.gson 164 | gson 165 | 2.8.2 166 | 167 | 168 | 169 | 170 | 171 | org.eclipse.jetty 172 | jetty-maven-plugin 173 | 9.2.11.v20150529 174 | 175 | 10 176 | 177 | / 178 | 179 | 180 | 181 | 182 | 183 | org.apache.maven.plugins 184 | maven-war-plugin 185 | 3.2.2 186 | 187 | 188 | org.jacoco 189 | jacoco-maven-plugin 190 | 0.8.4 191 | 192 | 193 | jacoco-initialize 194 | process-resources 195 | 196 | prepare-agent 197 | 198 | 199 | 200 | jacoco-site 201 | post-integration-test 202 | 203 | report 204 | 205 | 206 | 207 | 208 | 209 | 210 | 211 | 212 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/beans/Components.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.beans; 2 | 3 | import org.springframework.beans.factory.annotation.Value; 4 | import org.springframework.stereotype.Component; 5 | 6 | @Component 7 | public class Components { 8 | 9 | @Value("${memcached.active.host}") 10 | private String activeHost; 11 | @Value("${memcached.active.port}") 12 | private String activePort; 13 | @Value("${memcached.standBy.host}") 14 | private String standByHost; 15 | @Value("${memcached.standBy.port}") 16 | private String standByPort; 17 | 18 | @Value("${rabbitmq.address}") 19 | private String rabbitMqHost; 20 | @Value("${rabbitmq.port}") 21 | private String rabbitMqPort; 22 | @Value("${rabbitmq.username}") 23 | private String rabbitMqUser; 24 | @Value("${rabbitmq.password}") 25 | private String rabbitMqPassword; 26 | 27 | @Value("${elasticsearch.host}") 28 | private String elasticsearchHost; 29 | @Value("${elasticsearch.port}") 30 | private String elasticsearchPort; 31 | @Value("${elasticsearch.cluster}") 32 | private String elasticsearchCluster; 33 | @Value("${elasticsearch.node}") 34 | private String elasticsearchNode; 35 | 36 | 37 | public String getActiveHost() { 38 | return activeHost; 39 | } 40 | public String getActivePort() { 41 | return activePort; 42 | } 43 | public String getStandByHost() { 44 | return standByHost; 45 | } 46 | public String getStandByPort() { 47 | return standByPort; 48 | } 49 | public void setActiveHost(String activeHost) { 50 | this.activeHost = activeHost; 51 | } 52 | public void setActivePort(String activePort) { 53 | this.activePort = activePort; 54 | } 55 | public void setStandByHost(String standByHost) { 56 | this.standByHost = standByHost; 57 | } 58 | public void setStandByPort(String standByPort) { 59 | this.standByPort = standByPort; 60 | } 61 | public String getRabbitMqHost() { 62 | return rabbitMqHost; 63 | } 64 | public void setRabbitMqHost(String rabbitMqHost) { 65 | this.rabbitMqHost = rabbitMqHost; 66 | } 67 | public String getRabbitMqPort() { 68 | return rabbitMqPort; 69 | } 70 | public void setRabbitMqPort(String rabbitMqPort) { 71 | this.rabbitMqPort = rabbitMqPort; 72 | } 73 | public String getRabbitMqUser() { 74 | return rabbitMqUser; 75 | } 76 | public void setRabbitMqUser(String rabbitMqUser) { 77 | this.rabbitMqUser = rabbitMqUser; 78 | } 79 | public String getRabbitMqPassword() { 80 | return rabbitMqPassword; 81 | } 82 | public void setRabbitMqPassword(String rabbitMqPassword) { 83 | this.rabbitMqPassword = rabbitMqPassword; 84 | } 85 | public String getElasticsearchHost() { 86 | return elasticsearchHost; 87 | } 88 | public void setElasticsearchHost(String elasticsearchHost) { 89 | this.elasticsearchHost = elasticsearchHost; 90 | } 91 | public String getElasticsearchPort() { 92 | return elasticsearchPort; 93 | } 94 | public void setElasticsearchPort(String elasticsearchPort) { 95 | this.elasticsearchPort = elasticsearchPort; 96 | } 97 | public String getElasticsearchCluster() { 98 | return elasticsearchCluster; 99 | } 100 | public void setElasticsearchCluster(String elasticsearchCluster) { 101 | this.elasticsearchCluster = elasticsearchCluster; 102 | } 103 | public String getElasticsearchNode() { 104 | return elasticsearchNode; 105 | } 106 | public void setElasticsearchNode(String elasticsearchNode) { 107 | this.elasticsearchNode = elasticsearchNode; 108 | } 109 | 110 | 111 | } 112 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/controller/ElasticSearchController.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.controller; 2 | 3 | import java.io.IOException; 4 | import java.util.List; 5 | import java.util.Map; 6 | import java.util.concurrent.ExecutionException; 7 | 8 | import org.elasticsearch.action.admin.indices.create.CreateIndexRequestBuilder; 9 | import org.elasticsearch.action.delete.DeleteResponse; 10 | import org.elasticsearch.action.get.GetResponse; 11 | import org.elasticsearch.action.index.IndexRequest; 12 | import org.elasticsearch.action.index.IndexResponse; 13 | import org.elasticsearch.action.update.UpdateRequest; 14 | import org.elasticsearch.action.update.UpdateResponse; 15 | import org.elasticsearch.common.xcontent.XContentBuilder; 16 | import org.springframework.beans.factory.annotation.Autowired; 17 | import org.springframework.stereotype.Controller; 18 | import org.springframework.ui.Model; 19 | import org.springframework.web.bind.annotation.PathVariable; 20 | import org.springframework.web.bind.annotation.RequestMapping; 21 | import org.springframework.web.bind.annotation.RequestMethod; 22 | import org.springframework.web.bind.annotation.RequestParam; 23 | import org.springframework.web.bind.annotation.ResponseBody; 24 | 25 | import com.google.gson.Gson; 26 | import com.visualpathit.account.model.User; 27 | import com.visualpathit.account.service.UserService; 28 | import com.visualpathit.account.utils.ElasticsearchUtil; 29 | 30 | import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder; 31 | 32 | @Controller 33 | public class ElasticSearchController { 34 | @Autowired 35 | private UserService userService; 36 | 37 | @RequestMapping(value="/user/elasticsearch", method=RequestMethod.GET) 38 | public String insert(final Model model) throws IOException { 39 | List users = userService.getList(); 40 | //contextMapping(); 41 | 42 | /* for (User user : users) { 43 | //IndexRequest indexRequest = new IndexRequest("users","user", String.valueOf(user.getId())); 44 | //indexRequest.source(new Gson().toJson(user)); 45 | //IndexResponse response = ElasticsearchUtil.trannsportClient().index(indexRequest).actionGet(); 46 | System.out.println("User" +new Gson().toJson(user)); 47 | }*/ 48 | String result =""; 49 | for (User user : users) { 50 | IndexResponse response = ElasticsearchUtil.trannsportClient().prepareIndex("users","user", String.valueOf(user.getId())) 51 | .setSource(jsonBuilder() 52 | .startObject() 53 | .field("name", user.getUsername()) 54 | .field("DOB",user.getDateOfBirth()) 55 | .field("fatherName",user.getFatherName()) 56 | .field("motherName",user.getMotherName()) 57 | .field("gender",user.getGender()) 58 | .field("nationality",user.getNationality()) 59 | .field("phoneNumber", user.getPhoneNumber()) 60 | .endObject() 61 | ) 62 | .get(); 63 | String res =response.getResult().toString(); 64 | System.out.println(res); 65 | result="Users"; 66 | } 67 | model.addAttribute(result); 68 | return "elasticeSearchRes"; 69 | 70 | } 71 | 72 | @RequestMapping(value="/rest/users/view/{id}", method=RequestMethod.GET) 73 | public String view(@PathVariable final String id,final Model model) { 74 | GetResponse getResponse = ElasticsearchUtil.trannsportClient().prepareGet("users", "user", id).get(); 75 | System.out.println(getResponse.getSource()); 76 | 77 | model.addAttribute("res", getResponse.getSource().get("name")); 78 | 79 | return "elasticeSearchRes"; 80 | } 81 | /*@RequestMapping(value = "/get_user_list", method = RequestMethod.GET) 82 | public @ResponseBody List getTagList(@RequestParam("term") String query) { 83 | List users = userService.getList(); 84 | List tagList = null; 85 | for (User user : users) { 86 | GetResponse getResponse = ElasticsearchUtil.trannsportClient().prepareGet("users", "user" ,String.valueOf(user.getId())).get(); 87 | System.out.println(getResponse.getSource()); 88 | 89 | tagList.add(getResponse.getSource()); 90 | } 91 | return tagList; 92 | }*/ 93 | 94 | @RequestMapping(value="/rest/users/update/{id}", method=RequestMethod.GET) 95 | public String update(@PathVariable final String id,final Model model) throws IOException { 96 | 97 | UpdateRequest updateRequest = new UpdateRequest(); 98 | updateRequest.index("employee") 99 | .type("id") 100 | .id(id) 101 | .doc(jsonBuilder() 102 | .startObject() 103 | .field("gender", "male") 104 | .endObject()); 105 | try { 106 | UpdateResponse updateResponse = ElasticsearchUtil.trannsportClient().update(updateRequest).get(); 107 | System.out.println(updateResponse.status()); 108 | model.addAttribute("res", updateResponse.status()); 109 | return "elasticeSearchRes"; 110 | } catch (InterruptedException | ExecutionException e) { 111 | System.out.println(e); 112 | } 113 | return "elasticeSearchRes"; 114 | } 115 | @RequestMapping(value="/rest/users/delete/{id}", method=RequestMethod.GET) 116 | public String delete(@PathVariable final String id,final Model model) { 117 | 118 | DeleteResponse deleteResponse =ElasticsearchUtil.trannsportClient().prepareDelete("employee", "id", id).get(); 119 | System.out.println(deleteResponse.getResult().toString()); 120 | model.addAttribute("res", deleteResponse.getResult().toString()); 121 | return "elasticeSearchRes"; 122 | } 123 | /*public void contextMapping() throws IOException{ 124 | String json ="{" 125 | + "\"mappings\":{" 126 | + "\"users\":\" {" 127 | + "\"properties\" : {" 128 | + "\"name\" : { \"type\" : \"string\" }," 129 | + " \"city\" : { \"type\" : \"string\" }," 130 | + "\"name_suggest\" : {" 131 | + "\"type\" : \"completion\"" 132 | + "}}" 133 | + "}"; 134 | IndexResponse response = ElasticsearchUtil.trannsportClient().prepareIndex("users", "data") 135 | .setSource(json).execute().actionGet(); 136 | 137 | }*/ 138 | } 139 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/controller/FileUploadController.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.controller; 2 | 3 | import java.io.BufferedOutputStream; 4 | import java.io.File; 5 | import java.io.FileOutputStream; 6 | import java.util.List; 7 | 8 | import org.slf4j.Logger; 9 | import org.slf4j.LoggerFactory; 10 | import org.springframework.beans.factory.annotation.Autowired; 11 | import org.springframework.stereotype.Controller; 12 | import org.springframework.ui.Model; 13 | import org.springframework.web.bind.annotation.RequestMapping; 14 | import org.springframework.web.bind.annotation.RequestMethod; 15 | import org.springframework.web.bind.annotation.RequestParam; 16 | import org.springframework.web.bind.annotation.ResponseBody; 17 | import org.springframework.web.multipart.MultipartFile; 18 | 19 | import com.visualpathit.account.model.User; 20 | import com.visualpathit.account.service.UserService; 21 | 22 | @Controller 23 | public class FileUploadController { 24 | @Autowired 25 | private UserService userService; 26 | private static final Logger logger = LoggerFactory 27 | .getLogger(FileUploadController.class); 28 | 29 | /** 30 | * Upload single file using Spring Controller 31 | */ 32 | @RequestMapping(value = { "/upload"} , method = RequestMethod.GET) 33 | public final String upload(final Model model) { 34 | return "upload"; 35 | } 36 | @RequestMapping(value = "/uploadFile", method = RequestMethod.POST) 37 | public @ResponseBody 38 | String uploadFileHandler(@RequestParam("name") String name,@RequestParam("userName") String userName, 39 | @RequestParam("file") MultipartFile file) { 40 | 41 | System.out.println("Called the upload file :::" ); 42 | if (!file.isEmpty()) { 43 | try { 44 | byte[] bytes = file.getBytes(); 45 | 46 | // Creating the directory to store file 47 | String rootPath = System.getProperty("catalina.home"); 48 | System.out.println("Path ::::" +rootPath); 49 | File dir = new File(rootPath + File.separator + "tmpFiles"); 50 | if (!dir.exists()) 51 | dir.mkdirs(); 52 | 53 | // Create the file on server 54 | File serverFile = new File(dir.getAbsolutePath() 55 | + File.separator + name+".png"); 56 | //image saving 57 | User user = userService.findByUsername(userName); 58 | user.setProfileImg(name +".png"); 59 | user.setProfileImgPath(serverFile.getAbsolutePath()); 60 | userService.save(user); 61 | 62 | BufferedOutputStream stream = new BufferedOutputStream( 63 | new FileOutputStream(serverFile)); 64 | stream.write(bytes); 65 | stream.close(); 66 | 67 | logger.info("Server File Location=" 68 | + serverFile.getAbsolutePath()); 69 | 70 | return "You successfully uploaded file=" + name +".png"; 71 | } catch (Exception e) { 72 | return "You failed to upload " + name +".png" + " => " + e.getMessage(); 73 | } 74 | } else { 75 | return "You failed to upload " + name +".png" 76 | + " because the file was empty."; 77 | } 78 | } 79 | 80 | } 81 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/controller/UserController.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.controller; 2 | 3 | import com.visualpathit.account.model.User; 4 | import com.visualpathit.account.service.ProducerService; 5 | import com.visualpathit.account.service.SecurityService; 6 | import com.visualpathit.account.service.UserService; 7 | import com.visualpathit.account.utils.MemcachedUtils; 8 | import com.visualpathit.account.validator.UserValidator; 9 | 10 | import java.util.List; 11 | import java.util.UUID; 12 | 13 | import org.springframework.beans.factory.annotation.Autowired; 14 | import org.springframework.stereotype.Controller; 15 | import org.springframework.ui.Model; 16 | import org.springframework.validation.BindingResult; 17 | import org.springframework.web.bind.annotation.ModelAttribute; 18 | import org.springframework.web.bind.annotation.PathVariable; 19 | import org.springframework.web.bind.annotation.RequestMapping; 20 | import org.springframework.web.bind.annotation.RequestMethod; 21 | /**{@author waheedk}*/ 22 | @Controller 23 | public class UserController { 24 | @Autowired 25 | private UserService userService; 26 | 27 | @Autowired 28 | private SecurityService securityService; 29 | 30 | @Autowired 31 | private UserValidator userValidator; 32 | 33 | @Autowired 34 | private ProducerService producerService; 35 | 36 | /** {@inheritDoc} */ 37 | @RequestMapping(value = "/registration", method = RequestMethod.GET) 38 | public final String registration(final Model model) { 39 | model.addAttribute("userForm", new User()); 40 | return "registration"; 41 | } 42 | /** {@inheritDoc} */ 43 | @RequestMapping(value = "/registration", method = RequestMethod.POST) 44 | public final String registration(final @ModelAttribute("userForm") User userForm, 45 | final BindingResult bindingResult, final Model model) { 46 | 47 | userValidator.validate(userForm, bindingResult); 48 | if (bindingResult.hasErrors()) { 49 | return "registration"; 50 | } 51 | System.out.println("User PWD:"+userForm.getPassword()); 52 | userService.save(userForm); 53 | 54 | securityService.autologin(userForm.getUsername(), userForm.getPasswordConfirm()); 55 | 56 | return "redirect:/welcome"; 57 | } 58 | /** {@inheritDoc} */ 59 | @RequestMapping(value = "/login", method = RequestMethod.GET) 60 | public final String login(final Model model, final String error, final String logout) { 61 | System.out.println("Model data"+model.toString()); 62 | if (error != null){ 63 | model.addAttribute("error", "Your username and password is invalid."); 64 | } 65 | if (logout != null){ 66 | model.addAttribute("message", "You have been logged out successfully."); 67 | } 68 | return "login"; 69 | } 70 | /** {@inheritDoc} */ 71 | @RequestMapping(value = { "/", "/welcome"}, method = RequestMethod.GET) 72 | public final String welcome(final Model model) { 73 | return "welcome"; 74 | } 75 | /** {@inheritDoc} */ 76 | @RequestMapping(value = { "/index"} , method = RequestMethod.GET) 77 | public final String indexHome(final Model model) { 78 | return "index_home"; 79 | } 80 | @RequestMapping(value = "/users", method = RequestMethod.GET) 81 | public String getAllUsers(Model model) 82 | { 83 | 84 | List users = userService.getList(); 85 | //JSONObject jsonObject 86 | System.out.println("All User Data:::" + users); 87 | model.addAttribute("users", users); 88 | return "userList"; 89 | } 90 | 91 | @RequestMapping(value = "/users/{id}", method = RequestMethod.GET) 92 | public String getOneUser(@PathVariable(value="id") String id,Model model) 93 | { 94 | String Result =""; 95 | try{ 96 | if( id != null && MemcachedUtils.memcachedGetData(id)!= null){ 97 | User userData = MemcachedUtils.memcachedGetData(id); 98 | Result ="Data is From Cache"; 99 | System.out.println("--------------------------------------------"); 100 | System.out.println("Data is From Cache !!"); 101 | System.out.println("--------------------------------------------"); 102 | System.out.println("Father ::: "+userData.getFatherName()); 103 | model.addAttribute("user", userData); 104 | model.addAttribute("Result", Result); 105 | } 106 | else{ 107 | User user = userService.findById(Long.parseLong(id)); 108 | Result = MemcachedUtils.memcachedSetData(user,id); 109 | if(Result == null ){ 110 | Result ="Memcached Connection Failure !!"; 111 | } 112 | System.out.println("--------------------------------------------"); 113 | System.out.println("Data is From Database"); 114 | System.out.println("--------------------------------------------"); 115 | System.out.println("Result ::: "+ Result); 116 | model.addAttribute("user", user); 117 | model.addAttribute("Result", Result); 118 | } 119 | } catch (Exception e) { 120 | System.out.println( e.getMessage() ); 121 | } 122 | return "user"; 123 | } 124 | 125 | /** {@inheritDoc} */ 126 | @RequestMapping(value = { "/user/{username}"} , method = RequestMethod.GET) 127 | public final String userUpdate(@PathVariable(value="username") String username,final Model model) { 128 | User user = userService.findByUsername(username); 129 | System.out.println("User Data:::" + user); 130 | model.addAttribute("user", user); 131 | return "userUpdate"; 132 | } 133 | @RequestMapping(value = { "/user/{username}"} , method = RequestMethod.POST) 134 | public final String userUpdateProfile(@PathVariable(value="username") String username,final @ModelAttribute("user") User userForm,final Model model) { 135 | User user = userService.findByUsername(username); 136 | user.setUsername(userForm.getUsername()); 137 | user.setUserEmail(userForm.getUserEmail()); 138 | user.setDateOfBirth(userForm.getDateOfBirth()); 139 | user.setFatherName(userForm.getFatherName()); 140 | user.setMotherName(userForm.getMotherName()); 141 | user.setGender(userForm.getGender()); 142 | user.setLanguage(userForm.getLanguage()); 143 | user.setMaritalStatus(userForm.getMaritalStatus()); 144 | user.setNationality(userForm.getNationality()); 145 | user.setPermanentAddress(userForm.getPermanentAddress()); 146 | user.setTempAddress(userForm.getTempAddress()); 147 | user.setPhoneNumber(userForm.getPhoneNumber()); 148 | user.setSecondaryPhoneNumber(userForm.getSecondaryPhoneNumber()); 149 | user.setPrimaryOccupation(userForm.getPrimaryOccupation()); 150 | user.setSecondaryOccupation(userForm.getSecondaryOccupation()); 151 | user.setSkills(userForm.getSkills()); 152 | user.setWorkingExperience(userForm.getWorkingExperience()); 153 | userService.save(user); 154 | /*model.addAttribute("user", user);*/ 155 | return "welcome"; 156 | } 157 | 158 | @RequestMapping(value={"/user/rabbit"}, method={RequestMethod.GET}) 159 | public String rabbitmqSetUp() { 160 | System.out.println("Rabbit mq method is callled!!!"); 161 | for (int i = 0; i < 20; i++) { 162 | producerService.produceMessage(generateString()); 163 | } 164 | return "rabbitmq"; 165 | } 166 | 167 | private static String generateString() { 168 | String uuid = UUID.randomUUID().toString(); 169 | return "uuid = " + uuid; 170 | } 171 | 172 | 173 | 174 | } 175 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/model/Role.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.model; 2 | 3 | import javax.persistence.*; 4 | import java.util.Set; 5 | /**{@author waheedk} !*/ 6 | @Entity 7 | @Table(name = "role") 8 | public class Role { 9 | /** the id field !*/ 10 | private Long id; 11 | /** the name field !*/ 12 | private String name; 13 | /** the user field !*/ 14 | private Set users; 15 | /** {@inheritDoc}} !*/ 16 | @Id 17 | @GeneratedValue(strategy = GenerationType.AUTO) 18 | /** 19 | * {@link Role#id} 20 | !*/ 21 | public Long getId() { 22 | return id; 23 | } 24 | /** {@inheritDoc}} !*/ 25 | public void setId(final Long id) { 26 | this.id = id; 27 | } 28 | /** 29 | * {@link Role#name} 30 | !*/ 31 | public String getName() { 32 | return name; 33 | } 34 | /** {@inheritDoc}} !*/ 35 | public void setName(final String name) { 36 | this.name = name; 37 | } 38 | /** 39 | * {@inheritDoc}} 40 | !*/ 41 | @ManyToMany(fetch = FetchType.EAGER, mappedBy = "roles",cascade = CascadeType.ALL) 42 | /** 43 | * {@link Role#id} 44 | !*/ 45 | public Set getUsers() { 46 | return users; 47 | } 48 | /** 49 | * {@inheritDoc}} 50 | !*/ 51 | public final void setUsers(Set users) { 52 | this.users = users; 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/model/User.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.model; 2 | 3 | 4 | import javax.persistence.*; 5 | 6 | import java.io.Serializable; 7 | import java.util.Set; 8 | /**{@author waheedk} !*/ 9 | @Entity 10 | @Table(name = "user") 11 | public class User implements Serializable { 12 | /** the id field !*/ 13 | private Long id; 14 | /** the user name field !*/ 15 | private String username; 16 | /** the password field !*/ 17 | private String password; 18 | /** the userEmail field !*/ 19 | private String userEmail; 20 | /** the passwordConfirm field !*/ 21 | private String passwordConfirm; 22 | /** the profileImg field !*/ 23 | private String profileImg; 24 | /** the profileImgPath field !*/ 25 | private String profileImgPath; 26 | private String dateOfBirth; 27 | private String fatherName; 28 | private String motherName; 29 | private String gender; 30 | private String maritalStatus; 31 | private String permanentAddress; 32 | private String tempAddress; 33 | private String primaryOccupation; 34 | private String secondaryOccupation; 35 | private String skills; 36 | private String phoneNumber; 37 | private String secondaryPhoneNumber; 38 | private String nationality; 39 | private String language; 40 | private String workingExperience; 41 | 42 | 43 | /** the roles field !*/ 44 | private Set roles; 45 | /** {@inheritDoc}} !*/ 46 | @Id 47 | @GeneratedValue(strategy = GenerationType.AUTO) 48 | /** {@link User#id} */ 49 | public Long getId() { 50 | return id; 51 | } 52 | /** {@inheritDoc}} !*/ 53 | public void setId(final Long id) { 54 | this.id = id; 55 | } 56 | /**{@inheritDoc}} !*/ 57 | public String getUsername() { 58 | return username; 59 | } 60 | /** {@inheritDoc}} !*/ 61 | public void setUsername(final String username) { 62 | this.username = username; 63 | } 64 | /** 65 | * {@link User#password} 66 | * @return The {@link String} instance representing password 67 | !*/ 68 | public String getPassword() { 69 | return password; 70 | } 71 | /** 72 | * {@inheritDoc}} 73 | !*/ 74 | public void setPassword(final String password) { 75 | this.password = password; 76 | } 77 | /** 78 | * {@link User#userEmail} 79 | * @return The {@link String} instance representing userEmail. 80 | !*/ 81 | public String getUserEmail() { 82 | return userEmail; 83 | } 84 | /** {@inheritDoc}} !*/ 85 | public void setUserEmail(final String userEmail) { 86 | this.userEmail = userEmail; 87 | } 88 | 89 | /** {@inheritDoc}} !*/ 90 | @Transient 91 | /** 92 | * {@link User#passwordConfirm} 93 | !*/ 94 | public String getPasswordConfirm() { 95 | return passwordConfirm; 96 | } 97 | /** {@inheritDoc}} !*/ 98 | public void setPasswordConfirm(final String passwordConfirm) { 99 | this.passwordConfirm = passwordConfirm; 100 | } 101 | /** {@inheritDoc}} !*/ 102 | @ManyToMany 103 | @JoinTable(name = "user_role", joinColumns = @JoinColumn(name = "user_id"), inverseJoinColumns = @JoinColumn(name = "role_id")) 104 | public Set getRoles() { 105 | return roles; 106 | } 107 | /** {@inheritDoc}} !*/ 108 | public void setRoles(final Set roles) { 109 | this.roles = roles; 110 | } 111 | public String getProfileImg() { 112 | return profileImg; 113 | } 114 | public void setProfileImg(String profileImg) { 115 | this.profileImg = profileImg; 116 | } 117 | public String getProfileImgPath() { 118 | return profileImgPath; 119 | } 120 | public void setProfileImgPath(String profileImgPath) { 121 | this.profileImgPath = profileImgPath; 122 | } 123 | public String getDateOfBirth() { 124 | return dateOfBirth; 125 | } 126 | public void setDateOfBirth(String dateOfBirth) { 127 | this.dateOfBirth = dateOfBirth; 128 | } 129 | public String getFatherName() { 130 | return fatherName; 131 | } 132 | public void setFatherName(String fatherName) { 133 | this.fatherName = fatherName; 134 | } 135 | public String getMotherName() { 136 | return motherName; 137 | } 138 | public void setMotherName(String motherName) { 139 | this.motherName = motherName; 140 | } 141 | public String getGender() { 142 | return gender; 143 | } 144 | public void setGender(String gender) { 145 | this.gender = gender; 146 | } 147 | public String getMaritalStatus() { 148 | return maritalStatus; 149 | } 150 | public void setMaritalStatus(String maritalStatus) { 151 | this.maritalStatus = maritalStatus; 152 | } 153 | public String getPermanentAddress() { 154 | return permanentAddress; 155 | } 156 | public void setPermanentAddress(String permanentAddress) { 157 | this.permanentAddress = permanentAddress; 158 | } 159 | public String getTempAddress() { 160 | return tempAddress; 161 | } 162 | public void setTempAddress(String tempAddress) { 163 | this.tempAddress = tempAddress; 164 | } 165 | public String getPrimaryOccupation() { 166 | return primaryOccupation; 167 | } 168 | public void setPrimaryOccupation(String primaryOccupation) { 169 | this.primaryOccupation = primaryOccupation; 170 | } 171 | public String getSecondaryOccupation() { 172 | return secondaryOccupation; 173 | } 174 | public void setSecondaryOccupation(String secondaryOccupation) { 175 | this.secondaryOccupation = secondaryOccupation; 176 | } 177 | public String getSkills() { 178 | return skills; 179 | } 180 | public void setSkills(String skills) { 181 | this.skills = skills; 182 | } 183 | public String getPhoneNumber() { 184 | return phoneNumber; 185 | } 186 | public void setPhoneNumber(String phoneNumber) { 187 | this.phoneNumber = phoneNumber; 188 | } 189 | public String getSecondaryPhoneNumber() { 190 | return secondaryPhoneNumber; 191 | } 192 | public void setSecondaryPhoneNumber(String secondaryPhoneNumber) { 193 | this.secondaryPhoneNumber = secondaryPhoneNumber; 194 | } 195 | public String getNationality() { 196 | return nationality; 197 | } 198 | public void setNationality(String nationality) { 199 | this.nationality = nationality; 200 | } 201 | public String getLanguage() { 202 | return language; 203 | } 204 | public void setLanguage(String language) { 205 | this.language = language; 206 | } 207 | public String getWorkingExperience() { 208 | return workingExperience; 209 | } 210 | public void setWorkingExperience(String workingExperience) { 211 | this.workingExperience = workingExperience; 212 | } 213 | 214 | 215 | } 216 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/repository/RoleRepository.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.repository; 2 | 3 | import org.springframework.data.jpa.repository.JpaRepository; 4 | 5 | import com.visualpathit.account.model.Role; 6 | 7 | public interface RoleRepository extends JpaRepository{ 8 | } 9 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/repository/UserRepository.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.repository; 2 | 3 | import java.util.List; 4 | 5 | import org.springframework.data.jpa.repository.JpaRepository; 6 | 7 | import com.visualpathit.account.model.User; 8 | 9 | public interface UserRepository extends JpaRepository { 10 | User findByUsername(String username); 11 | User findById(long id); 12 | /*public void updateUser(User user)*/; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/service/ConsumerService.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | public interface ConsumerService { 4 | 5 | void consumerMessage(byte[] data); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/service/ConsumerServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import org.springframework.amqp.core.ExchangeTypes; 4 | import org.springframework.amqp.rabbit.annotation.Exchange; 5 | import org.springframework.amqp.rabbit.annotation.Queue; 6 | import org.springframework.amqp.rabbit.annotation.QueueBinding; 7 | import org.springframework.amqp.rabbit.annotation.RabbitListener; 8 | import org.springframework.stereotype.Service; 9 | 10 | @Service 11 | public class ConsumerServiceImpl implements ConsumerService { 12 | 13 | /** 14 | The name of the exchange. 15 | */ 16 | private static final String EXCHANGE_NAME = "messages"; 17 | 18 | /** 19 | * The function that consumes messages from the broker(RabbitMQ) 20 | * @param data 21 | */ 22 | @Override 23 | @RabbitListener(bindings = @QueueBinding( value = @Queue(), 24 | exchange = @Exchange(value = EXCHANGE_NAME, type = ExchangeTypes.FANOUT))) 25 | public void consumerMessage(byte[] data) { 26 | String consumedMessage = new String(data); 27 | System.out.println(" [x] Consumed '" + consumedMessage + "'"); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/service/ProducerService.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | public interface ProducerService { 4 | 5 | public String produceMessage(String message); 6 | } 7 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/service/ProducerServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import com.rabbitmq.client.Connection; 4 | import com.rabbitmq.client.ConnectionFactory; 5 | import com.visualpathit.account.utils.RabbitMqUtil; 6 | 7 | import org.springframework.stereotype.Service; 8 | import com.rabbitmq.client.Channel; 9 | 10 | import java.io.IOException; 11 | import java.util.concurrent.TimeoutException; 12 | 13 | @Service 14 | public class ProducerServiceImpl implements ProducerService { 15 | 16 | /** 17 | * The name of the Exchange 18 | */ 19 | private static final String EXCHANGE_NAME = "messages"; 20 | 21 | /** 22 | * This method publishes a message 23 | * @param message 24 | */ 25 | @Override 26 | public String produceMessage(String message) { 27 | try { 28 | ConnectionFactory factory = new ConnectionFactory(); 29 | /** 30 | * System.out.println("Rabitmq host: ::" + RabbitMqUtil.getRabbitMqHost()); 31 | * System.out.println("Rabitmq port: ::" + RabbitMqUtil.getRabbitMqPort()); 32 | * System.out.println("Rabitmq user: ::" + RabbitMqUtil.getRabbitMqUser()); 33 | * System.out.println("Rabitmq password: ::" + RabbitMqUtil.getRabbitMqPassword()); 34 | **/ 35 | factory.setHost(RabbitMqUtil.getRabbitMqHost()); 36 | factory.setPort(Integer.parseInt(RabbitMqUtil.getRabbitMqPort())); 37 | factory.setUsername(RabbitMqUtil.getRabbitMqUser()); 38 | factory.setPassword(RabbitMqUtil.getRabbitMqPassword()); 39 | Connection connection = factory.newConnection(); 40 | System.out.println("Connection open status"+connection.isOpen()); 41 | Channel channel = connection.createChannel(); 42 | channel.exchangeDeclare(EXCHANGE_NAME, "fanout"); 43 | channel.basicPublish(EXCHANGE_NAME, "", null, message.getBytes()); 44 | System.out.println(" [x] Sent '" + message + "'"); 45 | channel.close(); 46 | connection.close(); 47 | } catch (IOException io) { 48 | System.out.println("IOException"); 49 | io.printStackTrace(); 50 | } catch (TimeoutException toe) { 51 | System.out.println("TimeoutException : " + toe.getMessage()); 52 | toe.printStackTrace(); 53 | } 54 | return "response"; 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/service/SecurityService.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | /** method for finding already added user !*/ 4 | public interface SecurityService { 5 | /** {@inheritDoc}} !*/ 6 | String findLoggedInUsername(); 7 | 8 | void autologin(String username, String password); 9 | } 10 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/service/SecurityServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import org.slf4j.Logger; 4 | import org.slf4j.LoggerFactory; 5 | import org.springframework.beans.factory.annotation.Autowired; 6 | import org.springframework.security.authentication.AuthenticationManager; 7 | import org.springframework.security.authentication 8 | .UsernamePasswordAuthenticationToken; 9 | import org.springframework.security.core.context.SecurityContextHolder; 10 | import org.springframework.security.core.userdetails.UserDetails; 11 | import org.springframework.security.core.userdetails.UserDetailsService; 12 | import org.springframework.stereotype.Service; 13 | /** {@author waheedk} !*/ 14 | @Service 15 | public class SecurityServiceImpl implements SecurityService { 16 | /** authenticationManager !*/ 17 | @Autowired 18 | private AuthenticationManager authenticationManager; 19 | /** userDetailsService !*/ 20 | @Autowired 21 | private UserDetailsService userDetailsService; 22 | 23 | /** Logger creation !*/ 24 | private static final Logger logger = LoggerFactory 25 | .getLogger(SecurityServiceImpl.class); 26 | 27 | @Override 28 | public String findLoggedInUsername() { 29 | Object userDetails = SecurityContextHolder.getContext() 30 | .getAuthentication().getDetails(); 31 | if (userDetails instanceof UserDetails) { 32 | return ((UserDetails) userDetails).getUsername(); 33 | } 34 | 35 | return null; 36 | } 37 | 38 | @Override 39 | public void autologin(final String username, final String password) { 40 | UserDetails userDetails = userDetailsService.loadUserByUsername(username); 41 | UsernamePasswordAuthenticationToken usernamePasswordAuthenticationToken = 42 | new UsernamePasswordAuthenticationToken(userDetails, password, userDetails.getAuthorities()); 43 | 44 | authenticationManager.authenticate(usernamePasswordAuthenticationToken); 45 | 46 | if (usernamePasswordAuthenticationToken.isAuthenticated()) { 47 | SecurityContextHolder.getContext() 48 | .setAuthentication(usernamePasswordAuthenticationToken); 49 | logger.debug(String.format("Auto login %s successfully!", username)); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/service/UserDetailsServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import com.visualpathit.account.model.Role; 4 | import com.visualpathit.account.model.User; 5 | import com.visualpathit.account.repository.UserRepository; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.security.core.GrantedAuthority; 9 | import org.springframework.security.core.authority.SimpleGrantedAuthority; 10 | import org.springframework.security.core.userdetails.UserDetails; 11 | import org.springframework.security.core.userdetails.UserDetailsService; 12 | import org.springframework.security.core.userdetails.UsernameNotFoundException; 13 | import org.springframework.transaction.annotation.Transactional; 14 | 15 | import java.util.HashSet; 16 | import java.util.Set; 17 | /** {@author waheedk} !*/ 18 | public class UserDetailsServiceImpl implements UserDetailsService { 19 | @Autowired 20 | /** userRepository !*/ 21 | private UserRepository userRepository; 22 | 23 | @Override 24 | @Transactional(readOnly = true) 25 | public UserDetails loadUserByUsername(final String username) 26 | throws UsernameNotFoundException { 27 | User user = userRepository.findByUsername(username); 28 | 29 | Set grantedAuthorities = new HashSet<>(); 30 | for (Role role : user.getRoles()) { 31 | grantedAuthorities.add(new SimpleGrantedAuthority(role.getName())); 32 | } 33 | 34 | return new org.springframework.security.core 35 | .userdetails.User(user.getUsername(), user.getPassword(), grantedAuthorities); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/service/UserService.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import java.util.List; 4 | 5 | import com.visualpathit.account.model.User; 6 | 7 | /** {@author waheedk}!*/ 8 | public interface UserService { 9 | /** {@inheritDoc}} !*/ 10 | void save(User user); 11 | /** {@inheritDoc}} !*/ 12 | User findByUsername(String username); 13 | User findById(long id); 14 | /*public void updateUser(User user);*/ 15 | public List getList(); 16 | } 17 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/service/UserServiceImpl.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.service; 2 | 3 | import com.visualpathit.account.model.User; 4 | import com.visualpathit.account.repository.RoleRepository; 5 | import com.visualpathit.account.repository.UserRepository; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder; 9 | import org.springframework.stereotype.Service; 10 | 11 | import java.util.HashSet; 12 | import java.util.List; 13 | 14 | /** {@author waheedk}!*/ 15 | @Service 16 | public class UserServiceImpl implements UserService { 17 | @Autowired 18 | /** userRepository !*/ 19 | private UserRepository userRepository; 20 | @Autowired 21 | /** roleRepository !*/ 22 | private RoleRepository roleRepository; 23 | @Autowired 24 | /** bCryptPasswordEncoder !*/ 25 | private BCryptPasswordEncoder bCryptPasswordEncoder; 26 | 27 | @Override 28 | public void save(final User user) { 29 | user.setPassword(bCryptPasswordEncoder.encode(user.getPassword())); 30 | user.setRoles(new HashSet<>(roleRepository.findAll())); 31 | userRepository.save(user); 32 | } 33 | 34 | @Override 35 | public User findByUsername(final String username) { 36 | return userRepository.findByUsername(username); 37 | } 38 | 39 | @Override 40 | public List getList() { 41 | return userRepository.findAll(); 42 | } 43 | @Override 44 | public User findById(long id){ 45 | return userRepository.findOne(id); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/utils/ElasticsearchUtil.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.utils; 2 | 3 | import java.net.InetSocketAddress; 4 | 5 | import org.elasticsearch.client.transport.TransportClient; 6 | import org.elasticsearch.common.settings.Settings; 7 | import org.elasticsearch.common.transport.InetSocketTransportAddress; 8 | import org.elasticsearch.transport.client.PreBuiltTransportClient; 9 | import org.springframework.beans.factory.annotation.Autowired; 10 | import org.springframework.stereotype.Service; 11 | 12 | import com.visualpathit.account.beans.Components; 13 | @Service 14 | public class ElasticsearchUtil { 15 | 16 | private static Components object; 17 | @Autowired 18 | public void setComponents(Components object){ 19 | ElasticsearchUtil.object = object; 20 | 21 | } 22 | public static TransportClient trannsportClient() { 23 | System.out.println(" elasticsearch client"); 24 | String elasticsearchHost =object.getElasticsearchHost(); 25 | String elasticsearchPort =object.getElasticsearchPort(); 26 | String elasticsearchCluster =object.getElasticsearchCluster(); 27 | String elasticsearchNode =object.getElasticsearchNode(); 28 | System.out.println(" elasticsearchHost ........"+ elasticsearchHost); 29 | System.out.println(" elasticsearchHost ........"+ elasticsearchPort); 30 | TransportClient client = null; 31 | try { 32 | Settings settings = Settings.builder() 33 | .put("cluster.name",elasticsearchCluster) 34 | .put("node.name",elasticsearchNode) 35 | .build(); 36 | client = new PreBuiltTransportClient(settings) 37 | .addTransportAddress( 38 | new InetSocketTransportAddress( 39 | new InetSocketAddress(elasticsearchHost, Integer.parseInt(elasticsearchPort)))); 40 | 41 | 42 | } 43 | catch (Exception e) { 44 | e.printStackTrace(); 45 | } 46 | return client; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/utils/MemcachedUtils.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.utils; 2 | 3 | import java.net.InetSocketAddress; 4 | import java.net.SocketAddress; 5 | import java.util.concurrent.Future; 6 | 7 | import org.springframework.beans.factory.annotation.Autowired; 8 | import org.springframework.stereotype.Service; 9 | 10 | import com.visualpathit.account.beans.Components; 11 | import com.visualpathit.account.model.User; 12 | 13 | import net.spy.memcached.MemcachedClient; 14 | @Service 15 | public class MemcachedUtils { 16 | 17 | private static Components object; 18 | @Autowired 19 | public void setComponents(Components object){ 20 | MemcachedUtils.object = object; 21 | } 22 | public static String memcachedSetData(User user,String key){ 23 | String Result = ""; 24 | int expireTime = 900; 25 | try{ 26 | MemcachedClient mactiveClient = memcachedConnection(); 27 | System.out.println("--------------------------------------------"); 28 | System.out.println("Client is ::"+ mactiveClient.getStats()); 29 | System.out.println("--------------------------------------------"); 30 | Future future = mactiveClient.set(key,expireTime, user); 31 | System.out.println("set status:" + future.get()); 32 | Result =" Data is From DB and Data Inserted In Cache !!"; 33 | mactiveClient.shutdown(); 34 | 35 | 36 | } catch (Exception e) { 37 | System.out.println( e.getMessage() ); 38 | } 39 | return Result; 40 | } 41 | public static User memcachedGetData(String key){ 42 | String Result = ""; 43 | User userData = null; 44 | try{ 45 | MemcachedClient mclient = memcachedConnection(); 46 | System.out.println("--------------------------------------------"); 47 | System.out.println("Client Status :: "+mclient.getStats()); 48 | System.out.println("--------------------------------------------"); 49 | userData = (User) mclient.get(key); 50 | System.out.println("user value in cache - " + mclient.get(key)); 51 | Result =" Data Retrieval From Cache !!"; 52 | System.out.println(Result); 53 | mclient.shutdown(); 54 | 55 | } catch (Exception e) { 56 | System.out.println( e.getMessage() ); 57 | } 58 | return userData; 59 | } 60 | public static MemcachedClient memcachedConnection(){ 61 | MemcachedClient mcconn = null; 62 | boolean active = true; 63 | String key="pid"; 64 | String port = ""; 65 | String activeHost =object.getActiveHost(); 66 | String activePort =object.getActivePort(); 67 | try{ 68 | if(!activeHost.isEmpty() && !activePort.isEmpty() && active){ 69 | mcconn = new MemcachedClient(new InetSocketAddress(activeHost,Integer.parseInt(activePort))); 70 | for(SocketAddress innerKey:mcconn.getStats().keySet()){ 71 | System.out.println("Connection SocketAddress ::" + innerKey); 72 | //System.out.println("Connection port ::" + mcconn.getStats().get(innerKey).get(key)); 73 | port = mcconn.getStats().get(innerKey).get(key); 74 | } 75 | if(port == null){ 76 | System.out.println("Port::"+ port); 77 | mcconn.shutdown(); 78 | System.out.println("--------------------------------------------"); 79 | System.out.println("Connection Failure By Active Host ::" + activeHost); 80 | System.out.println("--------------------------------------------"); 81 | mcconn = null; 82 | active =false; 83 | return mcconn = standByMemcachedConn(); 84 | } 85 | if(!port.isEmpty()){ 86 | System.out.println("--------------------------------------------"); 87 | System.out.println("Connection to server sucessfull for active Host ::"+activeHost); 88 | System.out.println("--------------------------------------------"); 89 | active =true; 90 | return mcconn; 91 | } 92 | }else if(!activeHost.isEmpty() && !activePort.isEmpty() && !active){ 93 | return mcconn = standByMemcachedConn(); 94 | }else { 95 | System.out.println("--------------------------------------------"); 96 | System.out.println("Connection to Failure Due to Incorrect or Empty Host:: "); 97 | System.out.println("--------------------------------------------"); 98 | } 99 | } 100 | catch (Exception e) { 101 | System.out.println( e.getMessage() ); 102 | } 103 | return mcconn; 104 | } 105 | public static MemcachedClient standByMemcachedConn(){ 106 | MemcachedClient mcconn = null; 107 | String port = ""; 108 | String key="pid"; 109 | String standByHost = object.getStandByHost(); 110 | String standByPort = object.getStandByPort(); 111 | try{ 112 | if(!standByHost.isEmpty() && !standByPort.isEmpty() && mcconn == null && port.isEmpty()){ 113 | mcconn = new MemcachedClient(new InetSocketAddress(standByHost,Integer.parseInt(standByPort))); 114 | for(SocketAddress innerKey:mcconn.getStats().keySet()){ 115 | port = mcconn.getStats().get(innerKey).get(key); 116 | } 117 | if(!port.isEmpty()){ 118 | System.out.println("--------------------------------------------"); 119 | System.out.println("Connection to server sucessful by StandBy Host::" + standByHost); 120 | System.out.println("--------------------------------------------"); 121 | return mcconn; 122 | }else { 123 | mcconn.shutdown(); 124 | System.out.println("--------------------------------------------"); 125 | System.out.println("Connection Failure By StandBy Host ::" +standByHost); 126 | System.out.println("--------------------------------------------"); 127 | } 128 | } 129 | }catch (Exception e) { 130 | System.out.println( e.getMessage() ); 131 | } 132 | return mcconn; 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/utils/RabbitMqUtil.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.utils; 2 | 3 | import org.springframework.beans.factory.annotation.Autowired; 4 | import org.springframework.stereotype.Service; 5 | 6 | import com.visualpathit.account.beans.Components; 7 | 8 | @Service 9 | public class RabbitMqUtil { 10 | private static Components object; 11 | 12 | public RabbitMqUtil() {} 13 | 14 | @Autowired 15 | public void setComponents(Components object) { 16 | RabbitMqUtil.object = object; 17 | } 18 | 19 | public static String getRabbitMqHost() { return object.getRabbitMqHost(); } 20 | 21 | public static String getRabbitMqPort() { 22 | return object.getRabbitMqPort(); 23 | } 24 | 25 | public static String getRabbitMqUser() { return object.getRabbitMqUser(); } 26 | 27 | public static String getRabbitMqPassword() { 28 | return object.getRabbitMqPassword(); 29 | } 30 | } -------------------------------------------------------------------------------- /src/main/java/com/visualpathit/account/validator/UserValidator.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.validator; 2 | 3 | import com.visualpathit.account.model.User; 4 | import com.visualpathit.account.service.UserService; 5 | 6 | import org.springframework.beans.factory.annotation.Autowired; 7 | import org.springframework.stereotype.Component; 8 | import org.springframework.validation.Errors; 9 | import org.springframework.validation.ValidationUtils; 10 | import org.springframework.validation.Validator; 11 | 12 | @Component 13 | public class UserValidator implements Validator { 14 | @Autowired 15 | private UserService userService; 16 | 17 | @Override 18 | public boolean supports(Class aClass) { 19 | return User.class.equals(aClass); 20 | } 21 | 22 | @Override 23 | public void validate(Object o, Errors errors) { 24 | User user = (User) o; 25 | 26 | ValidationUtils.rejectIfEmptyOrWhitespace(errors, "username", "NotEmpty"); 27 | if (user.getUsername().length() < 6 || user.getUsername().length() > 32) { 28 | errors.rejectValue("username", "Size.userForm.username"); 29 | } 30 | if (userService.findByUsername(user.getUsername()) != null) { 31 | errors.rejectValue("username", "Duplicate.userForm.username"); 32 | } 33 | 34 | ValidationUtils.rejectIfEmptyOrWhitespace(errors, "password", "NotEmpty"); 35 | if (user.getPassword().length() < 8 || user.getPassword().length() > 32) { 36 | errors.rejectValue("password", "Size.userForm.password"); 37 | } 38 | 39 | if (!user.getPasswordConfirm().equals(user.getPassword())) { 40 | errors.rejectValue("passwordConfirm", "Diff.userForm.passwordConfirm"); 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/resources/application.properties: -------------------------------------------------------------------------------- 1 | #JDBC Configutation for Database Connection 2 | jdbc.driverClassName=com.mysql.jdbc.Driver 3 | jdbc.url=jdbc:mysql://db01:3306/accounts?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull 4 | jdbc.username=admin 5 | jdbc.password=admin123 6 | 7 | #Memcached Configuration For Active and StandBy Host 8 | ##For Active Host 9 | memcached.active.host=mc01 10 | memcached.active.port=11211 11 | #For StandBy Host 12 | memcached.standBy.host=127.0.0.2 13 | memcached.standBy.port=11211 14 | 15 | #RabbitMq Configuration 16 | rabbitmq.address=rmq01 17 | rabbitmq.port=5672 18 | rabbitmq.username=test 19 | rabbitmq.password=test 20 | 21 | #Elasticesearch Configuration 22 | elasticsearch.host =192.168.1.85 23 | elasticsearch.port =9300 24 | elasticsearch.cluster=vprofile 25 | elasticsearch.node=vprofilenode 26 | -------------------------------------------------------------------------------- /src/main/resources/db_backup.sql: -------------------------------------------------------------------------------- 1 | -- MySQL dump 10.13 Distrib 5.7.18, for Linux (x86_64) 2 | -- 3 | -- Host: localhost Database: accounts 4 | -- ------------------------------------------------------ 5 | -- Server version 5.7.18-0ubuntu0.16.10.1 6 | 7 | /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */; 8 | /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */; 9 | /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */; 10 | /*!40101 SET NAMES utf8 */; 11 | /*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */; 12 | /*!40103 SET TIME_ZONE='+00:00' */; 13 | /*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */; 14 | /*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */; 15 | /*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */; 16 | /*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */; 17 | 18 | -- 19 | -- Table structure for table `role` 20 | -- 21 | 22 | DROP TABLE IF EXISTS `role`; 23 | /*!40101 SET @saved_cs_client = @@character_set_client */; 24 | /*!40101 SET character_set_client = utf8 */; 25 | CREATE TABLE `role` ( 26 | `id` int(11) NOT NULL AUTO_INCREMENT, 27 | `name` varchar(45) DEFAULT NULL, 28 | PRIMARY KEY (`id`) 29 | ) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8; 30 | /*!40101 SET character_set_client = @saved_cs_client */; 31 | 32 | -- 33 | -- Dumping data for table `role` 34 | -- 35 | 36 | LOCK TABLES `role` WRITE; 37 | /*!40000 ALTER TABLE `role` DISABLE KEYS */; 38 | INSERT INTO `role` VALUES (1,'ROLE_USER'); 39 | /*!40000 ALTER TABLE `role` ENABLE KEYS */; 40 | UNLOCK TABLES; 41 | 42 | -- 43 | -- Table structure for table `user` 44 | -- 45 | 46 | DROP TABLE IF EXISTS `user`; 47 | /*!40101 SET @saved_cs_client = @@character_set_client */; 48 | /*!40101 SET character_set_client = utf8 */; 49 | CREATE TABLE `user` ( 50 | `id` int(11) NOT NULL AUTO_INCREMENT, 51 | `username` varchar(255) DEFAULT NULL, 52 | `userEmail` varchar(255) DEFAULT NULL, 53 | `profileImg` varchar(255) DEFAULT NULL, 54 | `profileImgPath` varchar(255) DEFAULT NULL, 55 | `dateOfBirth` varchar(255) DEFAULT NULL, 56 | `fatherName` varchar(255) DEFAULT NULL, 57 | `motherName` varchar(255) DEFAULT NULL, 58 | `gender` varchar(255) DEFAULT NULL, 59 | `maritalStatus` varchar(255) DEFAULT NULL, 60 | `permanentAddress` varchar(255) DEFAULT NULL, 61 | `tempAddress` varchar(255) DEFAULT NULL, 62 | `primaryOccupation` varchar(255) DEFAULT NULL, 63 | `secondaryOccupation` varchar(255) DEFAULT NULL, 64 | `skills` varchar(255) DEFAULT NULL, 65 | `phoneNumber` varchar(255) DEFAULT NULL, 66 | `secondaryPhoneNumber` varchar(255) DEFAULT NULL, 67 | `nationality` varchar(255) DEFAULT NULL, 68 | `language` varchar(255) DEFAULT NULL, 69 | `workingExperience` varchar(255) DEFAULT NULL, 70 | `password` varchar(255) DEFAULT NULL, 71 | PRIMARY KEY (`id`) 72 | ) ENGINE=InnoDB AUTO_INCREMENT=14 DEFAULT CHARSET=utf8; 73 | /*!40101 SET character_set_client = @saved_cs_client */; 74 | 75 | -- 76 | -- Dumping data for table `user` 77 | -- 78 | 79 | LOCK TABLES `user` WRITE; 80 | /*!40000 ALTER TABLE `user` DISABLE KEYS */; 81 | INSERT INTO `user` VALUES (7,'admin_vp','admin@hkhinfo.com',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'$2a$11$0a7VdTr4rfCQqtsvpng6GuJnzUmQ7gZiHXgzGPgm5hkRa3avXgBLK'),(8,'WahidKhan','wahid.khan74@gmail.com',NULL,NULL,'28/03/1994','M Khan','R Khan','male','unMarried','Ameerpet,Hyderabad','Ameerpet,Hyderabad','Software Engineer','Software Engineer','Java HTML CSS ','8888888888','8888888888','Indian','english','2 ','$2a$11$UgG9TkHcgl02LxlqxRHYhOf7Xv4CxFmFEgS0FpUdk42OeslI.6JAW'),(9,'Gayatri','gayatri@gmail.com',NULL,NULL,'20/06/1993','K','L','male','unMarried','Ameerpet,Hyderabad','Ameerpet,Hyderabad','Software Engineer','Software Engineer','Java HTML CSS ','9999999999','9999999999','India','english','5','$2a$11$gwvsvUrFU.YirMM1Yb7NweFudLUM91AzH5BDFnhkNzfzpjG.FplYO'),(10,'WahidKhan2','wahid.khan741@gmail.com',NULL,NULL,'28/03/1994','M Khan','R Khan','male','unMarried','Ameerpet,Hyderabad','Ameerpet,Hyderabad','Software Engineer','Software Engineer','Java HTML CSS ','7777777777','777777777','India','english','7','$2a$11$6oZEgfGGQAH23EaXLVZ2WOSKxcEJFnBSw2N2aghab0s2kcxSQwjhC'),(11,'KiranKumar','kiran@gmail.com',NULL,NULL,'8/12/1993','K K','RK','male','unMarried','California','James Street','Software Engineer','Software Engineer','Java HTML CSS ','1010101010','1010101010','India','english','10','$2a$11$EXwpna1MlFFlKW5ut1iVi.AoeIulkPPmcOHFO8pOoQt1IYU9COU0m'),(12,'Saikumar','sai@gmail.com',NULL,NULL,'20/06/1993','Sai RK','Sai AK','male','unMarried','California','US','Software Engineer','Software Engineer','Java HTML CSS AWS','8888888111','8888888111','India','english','8','$2a$11$pzWNzzR.HUkHzz2zhAgqOeCl0WaTgY33NxxJ7n0l.rnEqjB9JO7vy'),(13,'RamSai','ram@gmail.com',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,'$2a$11$6BSmYPrT8I8b9yHmx.uTRu/QxnQM2vhZYQa8mR33aReWA4WFihyGK'); 82 | /*!40000 ALTER TABLE `user` ENABLE KEYS */; 83 | UNLOCK TABLES; 84 | 85 | -- 86 | -- Table structure for table `user_role` 87 | -- 88 | 89 | DROP TABLE IF EXISTS `user_role`; 90 | /*!40101 SET @saved_cs_client = @@character_set_client */; 91 | /*!40101 SET character_set_client = utf8 */; 92 | CREATE TABLE `user_role` ( 93 | `user_id` int(11) NOT NULL, 94 | `role_id` int(11) NOT NULL, 95 | PRIMARY KEY (`user_id`,`role_id`), 96 | KEY `fk_user_role_roleid_idx` (`role_id`), 97 | CONSTRAINT `fk_user_role_roleid` FOREIGN KEY (`role_id`) REFERENCES `role` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, 98 | CONSTRAINT `fk_user_role_userid` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE 99 | ) ENGINE=InnoDB DEFAULT CHARSET=utf8; 100 | /*!40101 SET character_set_client = @saved_cs_client */; 101 | 102 | -- 103 | -- Dumping data for table `user_role` 104 | -- 105 | 106 | LOCK TABLES `user_role` WRITE; 107 | /*!40000 ALTER TABLE `user_role` DISABLE KEYS */; 108 | INSERT INTO `user_role` VALUES (4,1),(5,1),(6,1),(7,1),(8,1),(9,1),(10,1),(11,1),(12,1),(13,1); 109 | /*!40000 ALTER TABLE `user_role` ENABLE KEYS */; 110 | UNLOCK TABLES; 111 | /*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */; 112 | 113 | /*!40101 SET SQL_MODE=@OLD_SQL_MODE */; 114 | /*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */; 115 | /*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */; 116 | /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */; 117 | /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */; 118 | /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; 119 | /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; 120 | 121 | -- Dump completed on 2017-12-07 16:32:31 122 | -------------------------------------------------------------------------------- /src/main/resources/logback.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | %date{HH:mm:ss.SSS} [%thread] %-5level %logger{15}#%line %msg\n 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /src/main/resources/validation.properties: -------------------------------------------------------------------------------- 1 | NotEmpty=This field is required. 2 | Size.userForm.username=Please use between 6 and 32 characters. 3 | Duplicate.userForm.username= User has already taken this Username. 4 | Size.userForm.password=Try one with at least 8 characters. 5 | Diff.userForm.passwordConfirm=These passwords don't match. -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/appconfig-data.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | org.hibernate.dialect.MySQL5Dialect 33 | true 34 | 35 | 36 | 37 | 38 | 39 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/appconfig-mvc.xml: -------------------------------------------------------------------------------- 1 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | classpath:validation 15 | 16 | 17 | 18 | 19 | 20 | /WEB-INF/views/ 21 | 22 | 23 | .jsp 24 | 25 | 26 | 28 | 29 | 30 | 31 | 32 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/appconfig-rabbitmq.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 24 | 25 | 26 | 27 | 28 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/appconfig-root.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/appconfig-security.xml: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/elasticeSearchRes.jsp: -------------------------------------------------------------------------------- 1 | 2 | <%@ page language="java" contentType="text/html; charset=UTF-8" 3 | pageEncoding="UTF-8"%> 4 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 5 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 6 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 7 | 8 | 9 | 10 | 11 | 12 | vp-elasticsearch 13 | 14 | 15 |

Data is ${result} into Elasticsearch

16 |

Please go to elastic search dash board and verify link ip:9200/users/user/id

17 | 18 | 19 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/index_home.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 3 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 |
15 | 47 |
48 |
49 | 50 |
51 | Architecture 52 |
53 |

DevOps

54 |
55 |
56 |
57 |

58 |

Keep Learning ..

59 |

Learning is a Treasure that will follow it's Owner Everywhere..

60 |
61 | 62 |
63 | 64 | 65 |
66 |

TECHNOLOGIES

67 |
68 | 69 |
70 |
71 |
72 | DevOps 73 |
74 |
75 |
76 |
77 | DevOps 78 |
79 |
80 |
81 |
82 | DevOps 83 |
84 |
85 |
86 |
87 | DevOps 88 |
89 |
90 |
91 | 92 |
93 |
94 |
95 | DevOps 96 |
97 |
98 |
99 |
100 | DevOps 101 |
102 |
103 |
104 |
105 | DevOps 106 |
107 |
108 |
109 |
110 | DevOps 111 |
112 |
113 |
114 | 115 | 116 |
117 |

ABOUT

118 |
119 |

VisualPath is an IT Educational Institute.Established in 2001,and Institute offers world class quality of education and wide range of courses.VisualPath Institute has a dedicated placement team to help students get job placement in various IT job roles with major companies. 120 |

121 |

Address: Flat no: 205, 2nd Floor,NILGIRI Block,Aditya Encalve,Ameerpet, Hyderabad-16

122 |

Ph No: +91-9704455959,9618245689

123 |

E-Mail ID : visualpath999@gmail.com

124 |
125 |
126 | 127 | 128 |
129 |

CONTACT

130 |

Lets get in touch and talk about your and our next project.

131 |
132 | 133 | 134 | 135 | 136 | 139 |
140 |
141 | 142 | 143 |
144 | 145 | 146 | 147 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/login.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 3 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | LOGIN 18 | 19 | 20 | 21 | 22 | 23 | 27 | 28 | Welcome 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 |
37 |
38 | 69 |
70 |
71 |
72 | 73 | 88 | 89 |
90 | 91 | 92 | 93 | 94 | 95 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/rabbitmq.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | 4 | 5 | 6 | 7 | Rabbitmq 8 | 9 | 10 |

Rabbitmq initiated

11 |

Generated 2 Connections

12 |

6 Chanels 1 Exchage and 2 Que

13 | 14 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/registration.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 3 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | SIGNUP 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 30 | 31 | 32 | 33 |
34 |
35 | 66 |
67 |
68 | 69 |
70 | 71 | 106 | 107 |
108 | 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/upload.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 3 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 4 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 5 | <%@ page session="false" %> 6 | 7 | 8 | 9 | Upload File Request Page 10 | 11 | 12 | 13 | 28 | 29 | 30 |
31 |
32 |

Upload Image

33 |
34 | ${pageContext.request.userPrincipal.name}
35 |
36 | 37 | 38 |
39 |
40 | 41 | 42 |
43 |
44 | 45 | 46 | 47 |
48 |
49 |
50 |
51 | 52 | 53 | 54 | 55 | 56 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/user.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | 7 | 8 | 9 | UserData 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 32 | 33 |
34 |
35 | 67 |
68 |
69 | 70 | 71 |
72 |
73 |

${{Result}} Back

74 |

User Primary Details

75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 88 | 91 | 94 | 97 | 100 | 103 | 104 |
IdNameFather's NameMother's NameEmailPhone Number
86 | 87 | 89 | 90 | 92 | 93 | 95 | 96 | 98 | 99 | 101 | 102 |
105 |

User Extra Details

106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 125 | 128 | 131 | 134 | 137 | 140 | 143 | 146 | 149 | 152 | 155 | 158 | 159 |
Date Of BirthGenderMarital StatusPermanent AddressTemporary AddressPrimary OccupationSecondary OccupationSkillsSecondary PhoneNumberNationalityLanguageWorking Experience
123 | 124 | 126 | 127 | 129 | 130 | 132 | 133 | 135 | 136 | 138 | 139 | 141 | 142 | 144 | 145 | 147 | 148 | 150 | 151 | 153 | 154 | 156 | 157 |
160 |
161 |
162 | 163 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/userList.jsp: -------------------------------------------------------------------------------- 1 | <%@ page language="java" contentType="text/html; charset=UTF-8" 2 | pageEncoding="UTF-8"%> 3 | <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %> 4 | 5 | 6 | 7 | 8 | allUser 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 32 | 33 |
34 |
35 | 67 |
68 |
69 | 70 |
71 |
72 |

Users List

73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 83 | 86 | 87 | 88 | 89 |
User NameUser Id
81 | 82 | 84 | 85 |
90 |
91 |
92 | 93 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/views/userUpdate.jsp: -------------------------------------------------------------------------------- 1 | <%@ taglib prefix="spring" uri="http://www.springframework.org/tags" %> 2 | <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> 3 | <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %> 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | update user 18 | 19 | 20 | 21 | 22 | 31 | 32 | 33 | 34 | 35 |
36 |
37 |
38 | 39 |
40 | 41 |
42 | 43 | Name : 44 |
45 |
46 |
47 | 48 |
49 | 51 |
52 |
53 |
54 |
55 |
56 | 57 | Email : 58 |
59 |
60 |
61 | 62 |
63 | 65 |
66 |
67 |
68 |
69 |
70 | 71 | Date Of Birth : 72 |
73 |
74 |
75 | 76 |
77 | 79 |
80 |
81 |
82 |
83 |
84 | 85 | Father's Name : 86 |
87 |
88 |
89 | 90 |
91 | 93 |
94 |
95 |
96 |
97 |
98 | 99 | Mother's Name : 100 |
101 |
102 |
103 | 104 |
105 | 107 |
108 |
109 |
110 |
111 |
112 | 113 | Gender 114 |
115 | 116 | 117 | Male 118 | 119 | 120 | 121 | Female 122 | 123 | 124 | 125 | Other 126 | 127 |
128 |
129 |
130 |
131 | 132 | Marital Status: 133 |
134 | 135 | 136 | Married 137 | 138 | 139 | 140 | Unmarried 141 | 142 |
143 |
144 |
145 | 146 |
147 | 148 | Permanent Address : 149 |
150 |
151 |
152 | 153 |
154 | 156 |
157 |
158 |
159 |
160 |
161 | 162 | Temporary Address : 163 |
164 |
165 |
166 | 167 |
168 | 170 |
171 |
172 |
173 |
174 |
175 | 176 | Primary Occupation : 177 |
178 |
179 |
180 | 181 |
182 | 184 |
185 |
186 |
187 |
188 |
189 | 190 | Secondary Occupation : 191 |
192 |
193 |
194 | 195 |
196 | 198 |
199 |
200 |
201 |
202 |
203 | 204 | Skills : 205 |
206 |
207 |
208 | 209 |
210 | 212 |
213 |
214 |
215 |
216 |
217 | 218 | Phone Number : 219 |
220 |
221 |
222 | 223 |
224 | 226 |
227 |
228 |
229 |
230 |
231 | 232 | Secondary PhoneNumber : 233 |
234 |
235 |
236 | 237 |
238 | 240 |
241 |
242 |
243 |
244 |
245 | 246 | Nationality : 247 |
248 |
249 |
250 | 251 |
252 | 254 |
255 |
256 |
257 |
258 |
259 | 260 | Mother Tongue 261 |
262 | 263 | 264 | English 265 | 266 | 267 | 268 | Spanish 269 | 270 | 271 | 272 | German 273 | 274 | 275 | 276 | Hindi 277 | 278 | 279 | 280 | Other 281 | 282 |
283 |
284 |
285 |
286 | 287 | Work Experience : 288 |
289 |
290 |
291 | 292 |
293 | 295 |
296 |
297 |
298 |
299 |
300 | 301 |
302 | 303 | Cancel 304 |
305 |
306 |
307 |
308 |
309 |
310 |
311 | 312 | 313 | 314 | 315 | -------------------------------------------------------------------------------- /src/main/webapp/WEB-INF/web.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | Account Registration Web Application 4 | 5 | contextConfigLocation 6 | /WEB-INF/appconfig-root.xml 7 | 8 | 9 | springSecurityFilterChain 10 | org.springframework.web.filter.DelegatingFilterProxy 11 | 12 | 13 | springSecurityFilterChain 14 | /* 15 | 16 | 17 | dispatcher 18 | org.springframework.web.servlet.DispatcherServlet 19 | 20 | contextConfigLocation 21 | 22 | 23 | 1 24 | 25 | 26 | dispatcher 27 | / 28 | 29 | 30 | org.springframework.web.context.ContextLoaderListener 31 | 32 | -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/background.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopshydclub/vprofile-project/a4cd8e41e653023e1dbb6a900d392fb3fc1ebdee/src/main/webapp/resources/Images/background.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/header.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopshydclub/vprofile-project/a4cd8e41e653023e1dbb6a900d392fb3fc1ebdee/src/main/webapp/resources/Images/header.jpg -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/technologies/Ansible_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopshydclub/vprofile-project/a4cd8e41e653023e1dbb6a900d392fb3fc1ebdee/src/main/webapp/resources/Images/technologies/Ansible_logo.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/technologies/Vagrant.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopshydclub/vprofile-project/a4cd8e41e653023e1dbb6a900d392fb3fc1ebdee/src/main/webapp/resources/Images/technologies/Vagrant.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/technologies/aws.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopshydclub/vprofile-project/a4cd8e41e653023e1dbb6a900d392fb3fc1ebdee/src/main/webapp/resources/Images/technologies/aws.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/technologies/docker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopshydclub/vprofile-project/a4cd8e41e653023e1dbb6a900d392fb3fc1ebdee/src/main/webapp/resources/Images/technologies/docker.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/technologies/git.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopshydclub/vprofile-project/a4cd8e41e653023e1dbb6a900d392fb3fc1ebdee/src/main/webapp/resources/Images/technologies/git.jpg -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/technologies/jenkins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopshydclub/vprofile-project/a4cd8e41e653023e1dbb6a900d392fb3fc1ebdee/src/main/webapp/resources/Images/technologies/jenkins.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/technologies/puppet.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopshydclub/vprofile-project/a4cd8e41e653023e1dbb6a900d392fb3fc1ebdee/src/main/webapp/resources/Images/technologies/puppet.jpg -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/technologies/python-logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopshydclub/vprofile-project/a4cd8e41e653023e1dbb6a900d392fb3fc1ebdee/src/main/webapp/resources/Images/technologies/python-logo.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/user/giphy.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopshydclub/vprofile-project/a4cd8e41e653023e1dbb6a900d392fb3fc1ebdee/src/main/webapp/resources/Images/user/giphy.gif -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/user/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopshydclub/vprofile-project/a4cd8e41e653023e1dbb6a900d392fb3fc1ebdee/src/main/webapp/resources/Images/user/logo.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/user/user.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopshydclub/vprofile-project/a4cd8e41e653023e1dbb6a900d392fb3fc1ebdee/src/main/webapp/resources/Images/user/user.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/user/user2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopshydclub/vprofile-project/a4cd8e41e653023e1dbb6a900d392fb3fc1ebdee/src/main/webapp/resources/Images/user/user2.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/user/user3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopshydclub/vprofile-project/a4cd8e41e653023e1dbb6a900d392fb3fc1ebdee/src/main/webapp/resources/Images/user/user3.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/visualpath.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopshydclub/vprofile-project/a4cd8e41e653023e1dbb6a900d392fb3fc1ebdee/src/main/webapp/resources/Images/visualpath.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/visualpathlogo2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopshydclub/vprofile-project/a4cd8e41e653023e1dbb6a900d392fb3fc1ebdee/src/main/webapp/resources/Images/visualpathlogo2.png -------------------------------------------------------------------------------- /src/main/webapp/resources/Images/visualpathlogo3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/devopshydclub/vprofile-project/a4cd8e41e653023e1dbb6a900d392fb3fc1ebdee/src/main/webapp/resources/Images/visualpathlogo3.png -------------------------------------------------------------------------------- /src/main/webapp/resources/css/common.css: -------------------------------------------------------------------------------- 1 | body { 2 | padding-top: 100px; 3 | padding-bottom: 50px; 4 | background-color: #ffffff; 5 | 6 | } 7 | form { 8 | border: 3px solid #204a87; 9 | } 10 | 11 | img.logo { 12 | display: block; 13 | margin-left: auto; 14 | margin-right: auto; 15 | width: 300px; 16 | height: 70px; 17 | 18 | } 19 | .form-signin { 20 | max-width: 330px; 21 | padding: 15px; 22 | margin: 0 auto; 23 | } 24 | .btn-custom,.btn-custom:hover, .btn-custom:focus, .btn-custom:active { 25 | border-radius: 0; 26 | color: #ffffff; 27 | background-color: #ef2929; 28 | border-color: #ef2929; 29 | 30 | } 31 | .btn-custom-LOGIN { 32 | border-radius: 0; 33 | color: #ffffff; 34 | height:3em; 35 | background-color: #26C6DA; 36 | border-color: #ef2929; 37 | 38 | } 39 | 40 | .form-signin .form-signin-heading, 41 | .form-signin .checkbox { 42 | margin-bottom: 10px; 43 | } 44 | 45 | .form-signin .checkbox { 46 | font-weight: normal; 47 | } 48 | 49 | .form-signin .form-control { 50 | position: relative; 51 | height: auto; 52 | -webkit-box-sizing: border-box; 53 | -moz-box-sizing: border-box; 54 | box-sizing: border-box; 55 | padding: 10px; 56 | font-size: 16px; 57 | } 58 | 59 | .form-signin .form-control:focus { 60 | z-index: 2; 61 | } 62 | 63 | .form-signin input { 64 | margin-top: 10px; 65 | border-bottom-right-radius: 0; 66 | border-bottom-left-radius: 0; 67 | } 68 | 69 | .form-signin button { 70 | margin-top: 10px; 71 | } 72 | 73 | .has-error { 74 | color: red 75 | } -------------------------------------------------------------------------------- /src/main/webapp/resources/css/profile.css: -------------------------------------------------------------------------------- 1 | .mainbody { 2 | background:#f0f0f0; 3 | } 4 | /* Special class on .container surrounding .navbar, used for positioning it into place. */ 5 | .navbar-wrapper { 6 | position: fixed; 7 | top: 0; 8 | left: 0; 9 | right: 0; 10 | z-index: 20; 11 | margin-left: -15px; 12 | margin-right: -15px; 13 | //background-color:#1C3B47; 14 | } 15 | .navbar-custom { 16 | background-color: #1C3B47; 17 | border-color: #E7E7E7; 18 | 19 | } 20 | 21 | /* Flip around the padding for proper display in narrow viewports */ 22 | .navbar-wrapper .container { 23 | padding-left: 0; 24 | padding-right: 0; 25 | } 26 | .navbar-wrapper .navbar { 27 | padding-left: 15px; 28 | padding-right: 15px; 29 | } 30 | 31 | .navbar-content 32 | { 33 | width:320px; 34 | padding: 15px; 35 | padding-bottom:0px; 36 | } 37 | .navbar-content:before, .navbar-content:after 38 | { 39 | display: table; 40 | content: ""; 41 | line-height: 0; 42 | } 43 | .navbar-nav.navbar-right:last-child { 44 | margin-right: 15px !important; 45 | } 46 | .navbar-footer 47 | { 48 | background-color:#DDD; 49 | } 50 | .navbar-brand,.navbar-toggle,.brand_network{ 51 | color: #FFFFFF; 52 | font-weight: bold; 53 | 54 | } 55 | .navbar-custom .navbar-nav > li > a { 56 | color:#FFFFFF; 57 | font-weight: bold; 58 | } 59 | .navbar-custom .navbar-toggle{ 60 | color: #f57900; 61 | background: #f57900; 62 | } 63 | .navbar-footer-content { padding:15px 15px 15px 15px; } 64 | .dropdown-menu { 65 | padding: 0px; 66 | overflow: hidden; 67 | } 68 | 69 | .brand_network { 70 | color: #9D9D9D; 71 | float: left; 72 | position: absolute; 73 | left: 70px; 74 | top: 30px; 75 | font-size: smaller; 76 | } 77 | 78 | .post-content { 79 | margin-left:58px; 80 | } 81 | 82 | .badge-important { 83 | margin-top: 3px; 84 | margin-left: 25px; 85 | position: absolute; 86 | } 87 | 88 | body { 89 | background-color: #e8e8e8; 90 | } 91 | //contact forms 92 | 93 | .container { 94 | max-width:700px; 95 | width:100%; 96 | margin:0 auto; 97 | position:relative; 98 | } 99 | 100 | #contact input[type="text"], #contact input[type="email"], #contact input[type="tel"], #contact input[type="url"], #contact textarea, #contact button[type="submit"] { font:400 12px/16px "Open Sans", Helvetica, Arial, sans-serif; } 101 | 102 | #contact,#technologies,#about { 103 | background:#F9F9F9; 104 | padding:25px; 105 | margin:50px 0; 106 | } 107 | 108 | #contact h3,#technologies h3,#about h3 { 109 | color: #F96; 110 | display: block; 111 | font-size: 30px; 112 | font-weight: 400; 113 | } 114 | 115 | #contact h4,#technologies h4,#about h4 { 116 | margin:5px 0 15px; 117 | display:block; 118 | font-size:13px; 119 | } 120 | 121 | fieldset { 122 | border: medium none !important; 123 | margin: 0 0 10px; 124 | min-width: 100%; 125 | padding: 0; 126 | width: 100%; 127 | } 128 | 129 | #contact input[type="text"], #contact input[type="email"], #contact input[type="tel"], #contact input[type="url"], #contact textarea { 130 | width:100%; 131 | border:1px solid #CCC; 132 | background:#FFF; 133 | margin:0 0 5px; 134 | padding:10px; 135 | } 136 | 137 | #contact input[type="text"]:hover, #contact input[type="email"]:hover, #contact input[type="tel"]:hover, #contact input[type="url"]:hover, #contact textarea:hover { 138 | -webkit-transition:border-color 0.3s ease-in-out; 139 | -moz-transition:border-color 0.3s ease-in-out; 140 | transition:border-color 0.3s ease-in-out; 141 | border:1px solid #AAA; 142 | } 143 | 144 | #contact textarea { 145 | height:100px; 146 | max-width:100%; 147 | resize:none; 148 | } 149 | 150 | #contact button[type="submit"] { 151 | cursor:pointer; 152 | width:100%; 153 | border:none; 154 | background:#0CF; 155 | color:#FFF; 156 | margin:0 0 5px; 157 | padding:10px; 158 | font-size:15px; 159 | } 160 | 161 | #contact button[type="submit"]:hover { 162 | background:#09C; 163 | -webkit-transition:background 0.3s ease-in-out; 164 | -moz-transition:background 0.3s ease-in-out; 165 | transition:background-color 0.3s ease-in-out; 166 | } 167 | 168 | #contact button[type="submit"]:active { box-shadow:inset 0 1px 3px rgba(0, 0, 0, 0.5); } 169 | 170 | #contact input:focus, #contact textarea:focus { 171 | outline:0; 172 | border:1px solid #999; 173 | } 174 | ::-webkit-input-placeholder { 175 | color:#888; 176 | } 177 | :-moz-placeholder { 178 | color:#888; 179 | } 180 | ::-moz-placeholder { 181 | color:#888; 182 | } 183 | :-ms-input-placeholder { 184 | color:#888; 185 | } 186 | blockquote{ 187 | display:block; 188 | background: #fff; 189 | padding: 15px 20px 15px 45px; 190 | margin: 0 0 20px; 191 | position: relative; 192 | 193 | /*Font*/ 194 | font-family: Georgia, serif; 195 | font-size: 16px; 196 | line-height: 1.2; 197 | color: #666; 198 | text-align: justify; 199 | 200 | /*Borders - (Optional)*/ 201 | border-left: 15px solid #c76c0c; 202 | border-right: 2px solid #c76c0c; 203 | 204 | /*Box Shadow - (Optional)*/ 205 | -moz-box-shadow: 2px 2px 15px #ccc; 206 | -webkit-box-shadow: 2px 2px 15px #ccc; 207 | box-shadow: 2px 2px 15px #ccc; 208 | } 209 | 210 | blockquote::before{ 211 | //content: "\201C"; /*Unicode for Left Double Quote*/ 212 | 213 | /*Font*/ 214 | font-family: Verdana,sans-serif; 215 | font-size: 60px; 216 | font-weight: bold; 217 | color: #1C3B47; 218 | 219 | /*Positioning*/ 220 | position: absolute; 221 | left: 25px; 222 | top:5px; 223 | } 224 | 225 | blockquote::after{ 226 | /*Reset to make sure*/ 227 | content: ""; 228 | } 229 | 230 | blockquote a{ 231 | text-decoration: none; 232 | background: #eee; 233 | cursor: pointer; 234 | padding: 0 4px; 235 | color: #c76c0c; 236 | } 237 | 238 | blockquote a:hover{ 239 | color: #1C3B47; 240 | } 241 | 242 | blockquote em{ 243 | font-style: italic; 244 | } -------------------------------------------------------------------------------- /src/main/webapp/resources/css/w3.css: -------------------------------------------------------------------------------- 1 | /* W3.CSS 4.06 November 2017 by Jan Egil and Borge Refsnes */ 2 | html{box-sizing:border-box}*,*:before,*:after{box-sizing:inherit} 3 | /* Extract from normalize.css by Nicolas Gallagher and Jonathan Neal git.io/normalize */ 4 | html{-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0} 5 | article,aside,details,figcaption,figure,footer,header,main,menu,nav,section,summary{display:block} 6 | audio,canvas,progress,video{display:inline-block}progress{vertical-align:baseline} 7 | audio:not([controls]){display:none;height:0}[hidden],template{display:none} 8 | a{background-color:transparent;-webkit-text-decoration-skip:objects} 9 | a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted} 10 | dfn{font-style:italic}mark{background:#ff0;color:#000} 11 | small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline} 12 | sub{bottom:-0.25em}sup{top:-0.5em}figure{margin:1em 40px}img{border-style:none}svg:not(:root){overflow:hidden} 13 | code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}hr{box-sizing:content-box;height:0;overflow:visible} 14 | button,input,select,textarea{font:inherit;margin:0}optgroup{font-weight:bold} 15 | button,input{overflow:visible}button,select{text-transform:none} 16 | button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button} 17 | button::-moz-focus-inner, [type=button]::-moz-focus-inner, [type=reset]::-moz-focus-inner, [type=submit]::-moz-focus-inner{border-style:none;padding:0} 18 | button:-moz-focusring, [type=button]:-moz-focusring, [type=reset]:-moz-focusring, [type=submit]:-moz-focusring{outline:1px dotted ButtonText} 19 | fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:.35em .625em .75em} 20 | legend{color:inherit;display:table;max-width:100%;padding:0;white-space:normal}textarea{overflow:auto} 21 | [type=checkbox],[type=radio]{padding:0} 22 | [type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto} 23 | [type=search]{-webkit-appearance:textfield;outline-offset:-2px} 24 | [type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none} 25 | ::-webkit-input-placeholder{color:inherit;opacity:0.54} 26 | ::-webkit-file-upload-button{-webkit-appearance:button;font:inherit} 27 | /* End extract */ 28 | html,body{font-family:Verdana,sans-serif;font-size:15px;line-height:1.5}html{overflow-x:hidden} 29 | h1{font-size:36px}h2{font-size:30px}h3{font-size:24px}h4{font-size:20px}h5{font-size:18px}h6{font-size:16px}.w3-serif{font-family:serif} 30 | h1,h2,h3,h4,h5,h6{font-family:"Segoe UI",Arial,sans-serif;font-weight:400;margin:10px 0}.w3-wide{letter-spacing:4px} 31 | hr{border:0;border-top:1px solid #eee;margin:20px 0} 32 | .w3-image{max-width:100%;height:auto}img{margin-bottom:-5px}a{color:inherit} 33 | .w3-table,.w3-table-all{border-collapse:collapse;border-spacing:0;width:100%;display:table}.w3-table-all{border:1px solid #ccc} 34 | .w3-bordered tr,.w3-table-all tr{border-bottom:1px solid #ddd}.w3-striped tbody tr:nth-child(even){background-color:#f1f1f1} 35 | .w3-table-all tr:nth-child(odd){background-color:#fff}.w3-table-all tr:nth-child(even){background-color:#f1f1f1} 36 | .w3-hoverable tbody tr:hover,.w3-ul.w3-hoverable li:hover{background-color:#ccc}.w3-centered tr th,.w3-centered tr td{text-align:center} 37 | .w3-table td,.w3-table th,.w3-table-all td,.w3-table-all th{padding:8px 8px;display:table-cell;text-align:left;vertical-align:top} 38 | .w3-table th:first-child,.w3-table td:first-child,.w3-table-all th:first-child,.w3-table-all td:first-child{padding-left:16px} 39 | .w3-btn,.w3-button{border:none;display:inline-block;outline:0;padding:8px 16px;vertical-align:middle;overflow:hidden;text-decoration:none;color:inherit;background-color:inherit;text-align:center;cursor:pointer;white-space:nowrap} 40 | .w3-btn:hover{box-shadow:0 8px 16px 0 rgba(0,0,0,0.2),0 6px 20px 0 rgba(0,0,0,0.19)} 41 | .w3-btn,.w3-button{-webkit-touch-callout:none;-webkit-user-select:none;-khtml-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} 42 | .w3-disabled,.w3-btn:disabled,.w3-button:disabled{cursor:not-allowed;opacity:0.3}.w3-disabled *,:disabled *{pointer-events:none} 43 | .w3-btn.w3-disabled:hover,.w3-btn:disabled:hover{box-shadow:none} 44 | .w3-badge,.w3-tag{background-color:#000;color:#fff;display:inline-block;padding-left:8px;padding-right:8px;text-align:center}.w3-badge{border-radius:50%} 45 | .w3-ul{list-style-type:none;padding:0;margin:0}.w3-ul li{padding:8px 16px;border-bottom:1px solid #ddd}.w3-ul li:last-child{border-bottom:none} 46 | .w3-tooltip,.w3-display-container{position:relative}.w3-tooltip .w3-text{display:none}.w3-tooltip:hover .w3-text{display:inline-block} 47 | .w3-ripple:active{opacity:0.5}.w3-ripple{transition:opacity 0s} 48 | .w3-input{padding:8px;display:block;border:none;border-bottom:1px solid #ccc;width:100%} 49 | .w3-select{padding:9px 0;width:100%;border:none;border-bottom:1px solid #ccc} 50 | .w3-dropdown-click,.w3-dropdown-hover{position:relative;display:inline-block;cursor:pointer} 51 | .w3-dropdown-hover:hover .w3-dropdown-content{display:block;z-index:1} 52 | .w3-dropdown-hover:first-child,.w3-dropdown-click:hover{background-color:#ccc;color:#000} 53 | .w3-dropdown-hover:hover > .w3-button:first-child,.w3-dropdown-click:hover > .w3-button:first-child{background-color:#ccc;color:#000} 54 | .w3-dropdown-content{cursor:auto;color:#000;background-color:#fff;display:none;position:absolute;min-width:160px;margin:0;padding:0} 55 | .w3-check,.w3-radio{width:24px;height:24px;position:relative;top:6px} 56 | .w3-sidebar{height:100%;width:200px;background-color:#fff;position:fixed!important;z-index:1;overflow:auto} 57 | .w3-bar-block .w3-dropdown-hover,.w3-bar-block .w3-dropdown-click{width:100%} 58 | .w3-bar-block .w3-dropdown-hover .w3-dropdown-content,.w3-bar-block .w3-dropdown-click .w3-dropdown-content{min-width:100%} 59 | .w3-bar-block .w3-dropdown-hover .w3-button,.w3-bar-block .w3-dropdown-click .w3-button{width:100%;text-align:left;padding:8px 16px} 60 | .w3-main,#main{transition:margin-left .4s} 61 | .w3-modal{z-index:3;display:none;padding-top:100px;position:fixed;left:0;top:0;width:100%;height:100%;overflow:auto;background-color:rgb(0,0,0);background-color:rgba(0,0,0,0.4)} 62 | .w3-modal-content{margin:auto;background-color:#fff;position:relative;padding:0;outline:0;width:600px} 63 | .w3-bar{width:100%;overflow:hidden}.w3-center .w3-bar{display:inline-block;width:auto} 64 | .w3-bar .w3-bar-item{padding:8px 16px;float:left;width:auto;border:none;outline:none;display:block} 65 | .w3-bar .w3-dropdown-hover,.w3-bar .w3-dropdown-click{position:static;float:left} 66 | .w3-bar .w3-button{white-space:normal} 67 | .w3-bar-block .w3-bar-item{width:100%;display:block;padding:8px 16px;text-align:left;border:none;outline:none;white-space:normal;float:none} 68 | .w3-bar-block.w3-center .w3-bar-item{text-align:center}.w3-block{display:block;width:100%} 69 | .w3-responsive{display:block;overflow-x:auto} 70 | .w3-container:after,.w3-container:before,.w3-panel:after,.w3-panel:before,.w3-row:after,.w3-row:before,.w3-row-padding:after,.w3-row-padding:before, 71 | .w3-cell-row:before,.w3-cell-row:after,.w3-clear:after,.w3-clear:before,.w3-bar:before,.w3-bar:after{content:"";display:table;clear:both} 72 | .w3-col,.w3-half,.w3-third,.w3-twothird,.w3-threequarter,.w3-quarter{float:left;width:100%} 73 | .w3-col.s1{width:8.33333%}.w3-col.s2{width:16.66666%}.w3-col.s3{width:24.99999%}.w3-col.s4{width:33.33333%} 74 | .w3-col.s5{width:41.66666%}.w3-col.s6{width:49.99999%}.w3-col.s7{width:58.33333%}.w3-col.s8{width:66.66666%} 75 | .w3-col.s9{width:74.99999%}.w3-col.s10{width:83.33333%}.w3-col.s11{width:91.66666%}.w3-col.s12{width:99.99999%} 76 | @media (min-width:601px){.w3-col.m1{width:8.33333%}.w3-col.m2{width:16.66666%}.w3-col.m3,.w3-quarter{width:24.99999%}.w3-col.m4,.w3-third{width:33.33333%} 77 | .w3-col.m5{width:41.66666%}.w3-col.m6,.w3-half{width:49.99999%}.w3-col.m7{width:58.33333%}.w3-col.m8,.w3-twothird{width:66.66666%} 78 | .w3-col.m9,.w3-threequarter{width:74.99999%}.w3-col.m10{width:83.33333%}.w3-col.m11{width:91.66666%}.w3-col.m12{width:99.99999%}} 79 | @media (min-width:993px){.w3-col.l1{width:8.33333%}.w3-col.l2{width:16.66666%}.w3-col.l3{width:24.99999%}.w3-col.l4{width:33.33333%} 80 | .w3-col.l5{width:41.66666%}.w3-col.l6{width:49.99999%}.w3-col.l7{width:58.33333%}.w3-col.l8{width:66.66666%} 81 | .w3-col.l9{width:74.99999%}.w3-col.l10{width:83.33333%}.w3-col.l11{width:91.66666%}.w3-col.l12{width:99.99999%}} 82 | .w3-content{max-width:980px;margin:auto}.w3-rest{overflow:hidden} 83 | .w3-cell-row{display:table;width:100%}.w3-cell{display:table-cell} 84 | .w3-cell-top{vertical-align:top}.w3-cell-middle{vertical-align:middle}.w3-cell-bottom{vertical-align:bottom} 85 | .w3-hide{display:none!important}.w3-show-block,.w3-show{display:block!important}.w3-show-inline-block{display:inline-block!important} 86 | @media (max-width:600px){.w3-modal-content{margin:0 10px;width:auto!important}.w3-modal{padding-top:30px} 87 | .w3-dropdown-hover.w3-mobile .w3-dropdown-content,.w3-dropdown-click.w3-mobile .w3-dropdown-content{position:relative} 88 | .w3-hide-small{display:none!important}.w3-mobile{display:block;width:100%!important}.w3-bar-item.w3-mobile,.w3-dropdown-hover.w3-mobile,.w3-dropdown-click.w3-mobile{text-align:center} 89 | .w3-dropdown-hover.w3-mobile,.w3-dropdown-hover.w3-mobile .w3-btn,.w3-dropdown-hover.w3-mobile .w3-button,.w3-dropdown-click.w3-mobile,.w3-dropdown-click.w3-mobile .w3-btn,.w3-dropdown-click.w3-mobile .w3-button{width:100%}} 90 | @media (max-width:768px){.w3-modal-content{width:500px}.w3-modal{padding-top:50px}} 91 | @media (min-width:993px){.w3-modal-content{width:900px}.w3-hide-large{display:none!important}.w3-sidebar.w3-collapse{display:block!important}} 92 | @media (max-width:992px) and (min-width:601px){.w3-hide-medium{display:none!important}} 93 | @media (max-width:992px){.w3-sidebar.w3-collapse{display:none}.w3-main{margin-left:0!important;margin-right:0!important}} 94 | .w3-top,.w3-bottom{position:fixed;width:100%;z-index:1}.w3-top{top:0}.w3-bottom{bottom:0} 95 | .w3-overlay{position:fixed;display:none;width:100%;height:100%;top:0;left:0;right:0;bottom:0;background-color:rgba(0,0,0,0.5);z-index:2} 96 | .w3-display-topleft{position:absolute;left:0;top:0}.w3-display-topright{position:absolute;right:0;top:0} 97 | .w3-display-bottomleft{position:absolute;left:0;bottom:0}.w3-display-bottomright{position:absolute;right:0;bottom:0} 98 | .w3-display-middle{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);-ms-transform:translate(-50%,-50%)} 99 | .w3-display-left{position:absolute;top:50%;left:0%;transform:translate(0%,-50%);-ms-transform:translate(-0%,-50%)} 100 | .w3-display-right{position:absolute;top:50%;right:0%;transform:translate(0%,-50%);-ms-transform:translate(0%,-50%)} 101 | .w3-display-topmiddle{position:absolute;left:50%;top:0;transform:translate(-50%,0%);-ms-transform:translate(-50%,0%)} 102 | .w3-display-bottommiddle{position:absolute;left:50%;bottom:0;transform:translate(-50%,0%);-ms-transform:translate(-50%,0%)} 103 | .w3-display-container:hover .w3-display-hover{display:block}.w3-display-container:hover span.w3-display-hover{display:inline-block}.w3-display-hover{display:none} 104 | .w3-display-position{position:absolute} 105 | .w3-circle{border-radius:50%} 106 | .w3-round-small{border-radius:2px}.w3-round,.w3-round-medium{border-radius:4px}.w3-round-large{border-radius:8px}.w3-round-xlarge{border-radius:16px}.w3-round-xxlarge{border-radius:32px} 107 | .w3-row-padding,.w3-row-padding>.w3-half,.w3-row-padding>.w3-third,.w3-row-padding>.w3-twothird,.w3-row-padding>.w3-threequarter,.w3-row-padding>.w3-quarter,.w3-row-padding>.w3-col{padding:0 8px} 108 | .w3-container,.w3-panel{padding:0.01em 16px}.w3-panel{margin-top:16px;margin-bottom:16px} 109 | .w3-code,.w3-codespan{font-family:Consolas,"courier new";font-size:16px} 110 | .w3-code{width:auto;background-color:#fff;padding:8px 12px;border-left:4px solid #4CAF50;word-wrap:break-word} 111 | .w3-codespan{color:crimson;background-color:#f1f1f1;padding-left:4px;padding-right:4px;font-size:110%} 112 | .w3-card,.w3-card-2{box-shadow:0 2px 5px 0 rgba(0,0,0,0.16),0 2px 10px 0 rgba(0,0,0,0.12)} 113 | .w3-card-4,.w3-hover-shadow:hover{box-shadow:0 4px 10px 0 rgba(0,0,0,0.2),0 4px 20px 0 rgba(0,0,0,0.19)} 114 | .w3-spin{animation:w3-spin 2s infinite linear}@keyframes w3-spin{0%{transform:rotate(0deg)}100%{transform:rotate(359deg)}} 115 | .w3-animate-fading{animation:fading 10s infinite}@keyframes fading{0%{opacity:0}50%{opacity:1}100%{opacity:0}} 116 | .w3-animate-opacity{animation:opac 0.8s}@keyframes opac{from{opacity:0} to{opacity:1}} 117 | .w3-animate-top{position:relative;animation:animatetop 0.4s}@keyframes animatetop{from{top:-300px;opacity:0} to{top:0;opacity:1}} 118 | .w3-animate-left{position:relative;animation:animateleft 0.4s}@keyframes animateleft{from{left:-300px;opacity:0} to{left:0;opacity:1}} 119 | .w3-animate-right{position:relative;animation:animateright 0.4s}@keyframes animateright{from{right:-300px;opacity:0} to{right:0;opacity:1}} 120 | .w3-animate-bottom{position:relative;animation:animatebottom 0.4s}@keyframes animatebottom{from{bottom:-300px;opacity:0} to{bottom:0;opacity:1}} 121 | .w3-animate-zoom {animation:animatezoom 0.6s}@keyframes animatezoom{from{transform:scale(0)} to{transform:scale(1)}} 122 | .w3-animate-input{transition:width 0.4s ease-in-out}.w3-animate-input:focus{width:100%!important} 123 | .w3-opacity,.w3-hover-opacity:hover{opacity:0.60}.w3-opacity-off,.w3-hover-opacity-off:hover{opacity:1} 124 | .w3-opacity-max{opacity:0.25}.w3-opacity-min{opacity:0.75} 125 | .w3-greyscale-max,.w3-grayscale-max,.w3-hover-greyscale:hover,.w3-hover-grayscale:hover{filter:grayscale(100%)} 126 | .w3-greyscale,.w3-grayscale{filter:grayscale(75%)}.w3-greyscale-min,.w3-grayscale-min{filter:grayscale(50%)} 127 | .w3-sepia{filter:sepia(75%)}.w3-sepia-max,.w3-hover-sepia:hover{filter:sepia(100%)}.w3-sepia-min{filter:sepia(50%)} 128 | .w3-tiny{font-size:10px!important}.w3-small{font-size:12px!important}.w3-medium{font-size:15px!important}.w3-large{font-size:18px!important} 129 | .w3-xlarge{font-size:24px!important}.w3-xxlarge{font-size:36px!important}.w3-xxxlarge{font-size:48px!important}.w3-jumbo{font-size:64px!important} 130 | .w3-left-align{text-align:left!important}.w3-right-align{text-align:right!important}.w3-justify{text-align:justify!important}.w3-center{text-align:center!important} 131 | .w3-border-0{border:0!important}.w3-border{border:1px solid #ccc!important} 132 | .w3-border-top{border-top:1px solid #ccc!important}.w3-border-bottom{border-bottom:1px solid #ccc!important} 133 | .w3-border-left{border-left:1px solid #ccc!important}.w3-border-right{border-right:1px solid #ccc!important} 134 | .w3-topbar{border-top:6px solid #ccc!important}.w3-bottombar{border-bottom:6px solid #ccc!important} 135 | .w3-leftbar{border-left:6px solid #ccc!important}.w3-rightbar{border-right:6px solid #ccc!important} 136 | .w3-section,.w3-code{margin-top:16px!important;margin-bottom:16px!important} 137 | .w3-margin{margin:16px!important}.w3-margin-top{margin-top:16px!important}.w3-margin-bottom{margin-bottom:16px!important} 138 | .w3-margin-left{margin-left:16px!important}.w3-margin-right{margin-right:16px!important} 139 | .w3-padding-small{padding:4px 8px!important}.w3-padding{padding:8px 16px 8px 50px}.w3-padding-large{padding:12px 24px!important} 140 | .w3-padding-16{padding-top:16px!important;padding-bottom:16px!important}.w3-padding-24{padding-top:24px!important;padding-bottom:24px!important} 141 | .w3-padding-32{padding-top:32px!important;padding-bottom:32px!important}.w3-padding-48{padding-top:48px!important;padding-bottom:48px!important} 142 | .w3-padding-64{padding-top:64px!important;padding-bottom:64px!important} 143 | .w3-left{float:left!important}.w3-right{float:right!important} 144 | .w3-button:hover{color:#000!important;background-color:#ccc!important} 145 | .w3-transparent,.w3-hover-none:hover{background-color:transparent!important} 146 | .w3-hover-none:hover{box-shadow:none!important} 147 | /* Colors */ 148 | .w3-amber,.w3-hover-amber:hover{color:#000!important;background-color:#ffc107!important} 149 | .w3-aqua,.w3-hover-aqua:hover{color:#000!important;background-color:#00ffff!important} 150 | .w3-blue,.w3-hover-blue:hover{color:#fff!important;background-color:#2196F3!important} 151 | .w3-light-blue,.w3-hover-light-blue:hover{color:#000!important;background-color:#87CEEB!important} 152 | .w3-brown,.w3-hover-brown:hover{color:#fff!important;background-color:#795548!important} 153 | .w3-cyan,.w3-hover-cyan:hover{color:#000!important;background-color:#00bcd4!important} 154 | .w3-blue-grey,.w3-hover-blue-grey:hover,.w3-blue-gray,.w3-hover-blue-gray:hover{color:#fff!important;background-color:#607d8b!important} 155 | .w3-green,.w3-hover-green:hover{color:#fff!important;background-color:#4CAF50!important} 156 | .w3-light-green,.w3-hover-light-green:hover{color:#000!important;background-color:#8bc34a!important} 157 | .w3-indigo,.w3-hover-indigo:hover{color:#fff!important;background-color:#3f51b5!important} 158 | .w3-khaki,.w3-hover-khaki:hover{color:#000!important;background-color:#f0e68c!important} 159 | .w3-lime,.w3-hover-lime:hover{color:#000!important;background-color:#cddc39!important} 160 | .w3-orange,.w3-hover-orange:hover{color:#000!important;background-color:#ff9800!important} 161 | .w3-deep-orange,.w3-hover-deep-orange:hover{color:#fff!important;background-color:#ff5722!important} 162 | .w3-pink,.w3-hover-pink:hover{color:#fff!important;background-color:#e91e63!important} 163 | .w3-purple,.w3-hover-purple:hover{color:#fff!important;background-color:#9c27b0!important} 164 | .w3-deep-purple,.w3-hover-deep-purple:hover{color:#fff!important;background-color:#673ab7!important} 165 | .w3-red,.w3-hover-red:hover{color:#fff!important;background-color:#f44336!important} 166 | .w3-sand,.w3-hover-sand:hover{color:#000!important;background-color:#fdf5e6!important} 167 | .w3-teal,.w3-hover-teal:hover{color:#fff!important;background-color:#009688!important} 168 | .w3-yellow,.w3-hover-yellow:hover{color:#000!important;background-color:#ffeb3b!important} 169 | .w3-white,.w3-hover-white:hover{color:#000!important;background-color:#fff!important} 170 | .w3-black,.w3-hover-black:hover{color:#fff!important;background-color:#000!important} 171 | .w3-grey,.w3-hover-grey:hover,.w3-gray,.w3-hover-gray:hover{color:#000!important;background-color:#9e9e9e!important} 172 | .w3-light-grey,.w3-hover-light-grey:hover,.w3-light-gray,.w3-hover-light-gray:hover{color:#000!important;background-color:#f1f1f1!important} 173 | .w3-dark-grey,.w3-hover-dark-grey:hover,.w3-dark-gray,.w3-hover-dark-gray:hover{color:#fff!important;background-color:#616161!important} 174 | .w3-pale-red,.w3-hover-pale-red:hover{color:#000!important;background-color:#ffdddd!important} 175 | .w3-pale-green,.w3-hover-pale-green:hover{color:#000!important;background-color:#ddffdd!important} 176 | .w3-pale-yellow,.w3-hover-pale-yellow:hover{color:#000!important;background-color:#ffffcc!important} 177 | .w3-pale-blue,.w3-hover-pale-blue:hover{color:#000!important;background-color:#ddffff!important} 178 | .w3-text-amber,.w3-hover-text-amber:hover{color:#ffc107!important} 179 | .w3-text-aqua,.w3-hover-text-aqua:hover{color:#00ffff!important} 180 | .w3-text-blue,.w3-hover-text-blue:hover{color:#2196F3!important} 181 | .w3-text-light-blue,.w3-hover-text-light-blue:hover{color:#87CEEB!important} 182 | .w3-text-brown,.w3-hover-text-brown:hover{color:#795548!important} 183 | .w3-text-cyan,.w3-hover-text-cyan:hover{color:#00bcd4!important} 184 | .w3-text-blue-grey,.w3-hover-text-blue-grey:hover,.w3-text-blue-gray,.w3-hover-text-blue-gray:hover{color:#607d8b!important} 185 | .w3-text-green,.w3-hover-text-green:hover{color:#4CAF50!important} 186 | .w3-text-light-green,.w3-hover-text-light-green:hover{color:#8bc34a!important} 187 | .w3-text-indigo,.w3-hover-text-indigo:hover{color:#3f51b5!important} 188 | .w3-text-khaki,.w3-hover-text-khaki:hover{color:#b4aa50!important} 189 | .w3-text-lime,.w3-hover-text-lime:hover{color:#cddc39!important} 190 | .w3-text-orange,.w3-hover-text-orange:hover{color:#ff9800!important} 191 | .w3-text-deep-orange,.w3-hover-text-deep-orange:hover{color:#ff5722!important} 192 | .w3-text-pink,.w3-hover-text-pink:hover{color:#e91e63!important} 193 | .w3-text-purple,.w3-hover-text-purple:hover{color:#9c27b0!important} 194 | .w3-text-deep-purple,.w3-hover-text-deep-purple:hover{color:#673ab7!important} 195 | .w3-text-red,.w3-hover-text-red:hover{color:#f44336!important} 196 | .w3-text-sand,.w3-hover-text-sand:hover{color:#fdf5e6!important} 197 | .w3-text-teal,.w3-hover-text-teal:hover{color:#009688!important} 198 | .w3-text-yellow,.w3-hover-text-yellow:hover{color:#d2be0e!important} 199 | .w3-text-white,.w3-hover-text-white:hover{color:#fff!important} 200 | .w3-text-black,.w3-hover-text-black:hover{color:#000!important} 201 | .w3-text-grey,.w3-hover-text-grey:hover,.w3-text-gray,.w3-hover-text-gray:hover{color:#757575!important} 202 | .w3-text-light-grey,.w3-hover-text-light-grey:hover,.w3-text-light-gray,.w3-hover-text-light-gray:hover{color:#f1f1f1!important} 203 | .w3-text-dark-grey,.w3-hover-text-dark-grey:hover,.w3-text-dark-gray,.w3-hover-text-dark-gray:hover{color:#3a3a3a!important} 204 | .w3-border-amber,.w3-hover-border-amber:hover{border-color:#ffc107!important} 205 | .w3-border-aqua,.w3-hover-border-aqua:hover{border-color:#00ffff!important} 206 | .w3-border-blue,.w3-hover-border-blue:hover{border-color:#2196F3!important} 207 | .w3-border-light-blue,.w3-hover-border-light-blue:hover{border-color:#87CEEB!important} 208 | .w3-border-brown,.w3-hover-border-brown:hover{border-color:#795548!important} 209 | .w3-border-cyan,.w3-hover-border-cyan:hover{border-color:#00bcd4!important} 210 | .w3-border-blue-grey,.w3-hover-border-blue-grey:hover,.w3-border-blue-gray,.w3-hover-border-blue-gray:hover{border-color:#607d8b!important} 211 | .w3-border-green,.w3-hover-border-green:hover{border-color:#4CAF50!important} 212 | .w3-border-light-green,.w3-hover-border-light-green:hover{border-color:#8bc34a!important} 213 | .w3-border-indigo,.w3-hover-border-indigo:hover{border-color:#3f51b5!important} 214 | .w3-border-khaki,.w3-hover-border-khaki:hover{border-color:#f0e68c!important} 215 | .w3-border-lime,.w3-hover-border-lime:hover{border-color:#cddc39!important} 216 | .w3-border-orange,.w3-hover-border-orange:hover{border-color:#ff9800!important} 217 | .w3-border-deep-orange,.w3-hover-border-deep-orange:hover{border-color:#ff5722!important} 218 | .w3-border-pink,.w3-hover-border-pink:hover{border-color:#e91e63!important} 219 | .w3-border-purple,.w3-hover-border-purple:hover{border-color:#9c27b0!important} 220 | .w3-border-deep-purple,.w3-hover-border-deep-purple:hover{border-color:#673ab7!important} 221 | .w3-border-red,.w3-hover-border-red:hover{border-color:#f44336!important} 222 | .w3-border-sand,.w3-hover-border-sand:hover{border-color:#fdf5e6!important} 223 | .w3-border-teal,.w3-hover-border-teal:hover{border-color:#009688!important} 224 | .w3-border-yellow,.w3-hover-border-yellow:hover{border-color:#ffeb3b!important} 225 | .w3-border-white,.w3-hover-border-white:hover{border-color:#fff!important} 226 | .w3-border-black,.w3-hover-border-black:hover{border-color:#000!important} 227 | .w3-border-grey,.w3-hover-border-grey:hover,.w3-border-gray,.w3-hover-border-gray:hover{border-color:#9e9e9e!important} 228 | .w3-border-light-grey,.w3-hover-border-light-grey:hover,.w3-border-light-gray,.w3-hover-border-light-gray:hover{border-color:#f1f1f1!important} 229 | .w3-border-dark-grey,.w3-hover-border-dark-grey:hover,.w3-border-dark-gray,.w3-hover-border-dark-gray:hover{border-color:#616161!important} 230 | .w3-border-pale-red,.w3-hover-border-pale-red:hover{border-color:#ffe7e7!important}.w3-border-pale-green,.w3-hover-border-pale-green:hover{border-color:#e7ffe7!important} 231 | .w3-border-pale-yellow,.w3-hover-border-pale-yellow:hover{border-color:#ffffcc!important}.w3-border-pale-blue,.w3-hover-border-pale-blue:hover{border-color:#e7ffff!important} -------------------------------------------------------------------------------- /src/test/java/com/visualpathit/account/controllerTest/SampleTest.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.controllerTest; 2 | 3 | import static org.junit.Assert.assertEquals; 4 | 5 | import org.junit.Test; 6 | 7 | public class SampleTest { 8 | @Test 9 | public void SampleTestHappyFlow(){ 10 | assertEquals("Hello".length(), 5); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/test/java/com/visualpathit/account/controllerTest/UserControllerTest.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.controllerTest; 2 | 3 | import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get; 4 | import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post; 5 | import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.forwardedUrl; 6 | import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status; 7 | import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.view; 8 | 9 | import org.junit.Before; 10 | import org.junit.Test; 11 | import org.mockito.InjectMocks; 12 | import org.mockito.Mock; 13 | import org.mockito.MockitoAnnotations; 14 | import org.springframework.test.web.servlet.MockMvc; 15 | import org.springframework.test.web.servlet.setup.MockMvcBuilders; 16 | 17 | import com.visualpathit.account.controller.UserController; 18 | import com.visualpathit.account.model.User; 19 | import com.visualpathit.account.service.UserService; 20 | import com.visualpathit.account.setup.StandaloneMvcTestViewResolver; 21 | 22 | 23 | public class UserControllerTest { 24 | 25 | @Mock 26 | private UserService controllerSer; 27 | @InjectMocks 28 | private UserController controller; 29 | private MockMvc mockMvc; 30 | 31 | @Before 32 | public void setup(){ 33 | MockitoAnnotations.initMocks(this); 34 | 35 | /*InternalResourceViewResolver viewResolver = new InternalResourceViewResolver(); 36 | viewResolver.setPrefix("/WEB-INF/views/"); 37 | viewResolver.setSuffix(".jsp"); 38 | */ 39 | mockMvc = MockMvcBuilders.standaloneSetup(controller) 40 | .setViewResolvers(new StandaloneMvcTestViewResolver()).build(); 41 | } 42 | 43 | @Test 44 | public void registrationTestforHappyFlow() throws Exception{ 45 | User user = new User(); 46 | mockMvc.perform(get("/registration")) 47 | .andExpect(status().isOk()) 48 | .andExpect(view().name("registration")) 49 | .andExpect(forwardedUrl("registration")); 50 | 51 | } 52 | @Test 53 | public void registrationTestforNullValueHappyFlow() throws Exception{ 54 | mockMvc.perform(get("/registration")) 55 | .andExpect(status().isOk()) 56 | .andExpect(view().name("registration")) 57 | .andExpect(forwardedUrl("registration")); 58 | 59 | } 60 | /*@Test 61 | public void registrationTestforPostValueHappyFlow() throws Exception{ 62 | String description =new String("Error String"); 63 | UserValidator userValidator; 64 | BindingResult bindingResult; 65 | when(userValidator.validate(new User(),bindingResult)) 66 | .thenThrow(bindingResult.hasErrors()); 67 | mockMvc.perform(post("/registration").contentType(MediaType.APPLICATION_FORM_URLENCODED) 68 | .param("userForm","userForm")) 69 | 70 | .andExpect(status().isOk()); 71 | //.andExpect(view().name("redirect:/welcome")) 72 | //.andExpect(forwardedUrl("redirect:/welcome")); 73 | 74 | }*/ 75 | @Test 76 | public void loginTestHappyFlow() throws Exception{ 77 | String error = "Your username and password is invalid"; 78 | mockMvc.perform(get("/login").param(error, error)) 79 | .andExpect(status().isOk()) 80 | .andExpect(view().name("login")) 81 | .andExpect(forwardedUrl("login")); 82 | 83 | } 84 | @Test 85 | public void welcomeTestHappyFlow() throws Exception{ 86 | mockMvc.perform(get("/welcome")) 87 | .andExpect(status().isOk()) 88 | .andExpect(view().name("welcome")) 89 | .andExpect(forwardedUrl("welcome")); 90 | 91 | } 92 | @Test 93 | public void welcomeAfterDirectLoginTestHappyFlow() throws Exception{ 94 | mockMvc.perform(get("/")) 95 | .andExpect(status().isOk()) 96 | .andExpect(view().name("welcome")) 97 | .andExpect(forwardedUrl("welcome")); 98 | 99 | } 100 | @Test 101 | public void indexTestHappyFlow() throws Exception{ 102 | mockMvc.perform(get("/index")) 103 | .andExpect(status().isOk()) 104 | .andExpect(view().name("index_home")) 105 | .andExpect(forwardedUrl("index_home")); 106 | 107 | } 108 | 109 | } 110 | -------------------------------------------------------------------------------- /src/test/java/com/visualpathit/account/modelTest/RoleTest.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.modelTest; 2 | 3 | import junit.framework.Assert; 4 | 5 | import java.util.HashSet; 6 | import java.util.Set; 7 | 8 | import org.junit.After; 9 | import org.junit.Before; 10 | import org.junit.Test; 11 | 12 | import com.visualpathit.account.model.Role; 13 | import com.visualpathit.account.model.User; 14 | 15 | /** {@author waheedk} !*/ 16 | public class RoleTest { 17 | 18 | public static final Long EXPECTED_ID = 1L; 19 | public static final String EXPECTED_ROLENAME = "Admin"; 20 | public static final int EXPECTED_SIZE = 1; 21 | private Role role; 22 | @Before 23 | public void setUp() throws Exception { 24 | User user = new User(); 25 | user.setId(1L); 26 | user.setUsername("Wahidkhan74"); 27 | user.setPassword("Wahidkhan74"); 28 | user.setUserEmail("XXXXX@gmail.com"); 29 | 30 | Set users = new HashSet(); 31 | users.add(user); 32 | role = new Role(); 33 | role.setId(1L); 34 | role.setName("Admin"); 35 | role.setUsers(users); 36 | } 37 | 38 | @After 39 | public void tearDown() throws Exception { 40 | System.out.println("Test Completed"); 41 | 42 | } 43 | 44 | @Test 45 | public void testUserDetailsHappyFlow() throws Exception { 46 | Assert.assertEquals(EXPECTED_ID, role.getId()); 47 | Assert.assertEquals(EXPECTED_ROLENAME, role.getName()); 48 | Assert.assertEquals(EXPECTED_SIZE,role.getUsers().size()); 49 | 50 | } 51 | } -------------------------------------------------------------------------------- /src/test/java/com/visualpathit/account/modelTest/UserTest.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.modelTest; 2 | 3 | import junit.framework.Assert; 4 | 5 | import java.util.HashSet; 6 | import java.util.Set; 7 | 8 | import org.junit.After; 9 | import org.junit.Before; 10 | import org.junit.Test; 11 | 12 | import com.visualpathit.account.model.Role; 13 | import com.visualpathit.account.model.User; 14 | 15 | /** {@author waheedk} !*/ 16 | public class UserTest { 17 | 18 | public static final Long EXPECTED_ID = 1L; 19 | public static final int EXPECTED_SIZE = 1; 20 | public static final String EXPECTED_USERNAME = "Wahidkhan74"; 21 | public static final String EXPECTED_PASSWD = "Wahidkhan74"; 22 | public static final String EXPECTED_USEREMAIL = "XXXXX@gmail.com"; 23 | private User user; 24 | @Before 25 | public void setUp() throws Exception { 26 | 27 | Role role = new Role(); 28 | role.setId(1L); 29 | role.setName("Admin"); 30 | Set roles = new HashSet(); 31 | roles.add(role); 32 | 33 | user = new User(); 34 | user.setId(1L); 35 | user.setUsername("Wahidkhan74"); 36 | user.setPassword("Wahidkhan74"); 37 | user.setUserEmail("XXXXX@gmail.com"); 38 | user.setRoles(roles); 39 | } 40 | 41 | @After 42 | public void tearDown() throws Exception { 43 | System.out.println("Test Completed"); 44 | 45 | } 46 | 47 | @Test 48 | public void testUserDetailsHappyFlow() throws Exception { 49 | Assert.assertEquals(EXPECTED_ID, user.getId()); 50 | Assert.assertEquals(EXPECTED_USERNAME, user.getUsername()); 51 | Assert.assertEquals(EXPECTED_PASSWD, user.getPassword()); 52 | Assert.assertEquals(EXPECTED_USEREMAIL, user.getUserEmail()); 53 | Assert.assertEquals(EXPECTED_SIZE,user.getRoles().size()); 54 | 55 | } 56 | } -------------------------------------------------------------------------------- /src/test/java/com/visualpathit/account/setup/StandaloneMvcTestViewResolver.java: -------------------------------------------------------------------------------- 1 | package com.visualpathit.account.setup; 2 | 3 | import org.springframework.web.servlet.view.AbstractUrlBasedView; 4 | import org.springframework.web.servlet.view.InternalResourceView; 5 | import org.springframework.web.servlet.view.InternalResourceViewResolver; 6 | 7 | public class StandaloneMvcTestViewResolver extends InternalResourceViewResolver { 8 | 9 | public StandaloneMvcTestViewResolver() { 10 | super(); 11 | } 12 | 13 | @Override 14 | protected AbstractUrlBasedView buildView(final String viewName) throws Exception { 15 | final InternalResourceView view = (InternalResourceView) super.buildView(viewName); 16 | // prevent checking for circular view paths 17 | view.setPreventDispatchLoop(false); 18 | return view; 19 | } 20 | } 21 | --------------------------------------------------------------------------------