├── .gitignore ├── README.md ├── docImages ├── highlevelarc.png └── tunerLinks.png ├── mobile └── iOS │ ├── Cars Mobile Sample │ ├── Cars Mobile Sample.xcodeproj │ │ ├── project.pbxproj │ │ ├── project.xcworkspace │ │ │ ├── contents.xcworkspacedata │ │ │ ├── xcshareddata │ │ │ │ └── IDEWorkspaceChecks.plist │ │ │ └── xcuserdata │ │ │ │ └── tom.batchelor.xcuserdatad │ │ │ │ └── UserInterfaceState.xcuserstate │ │ └── xcuserdata │ │ │ └── tom.batchelor.xcuserdatad │ │ │ ├── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ │ │ └── xcschemes │ │ │ ├── Cars Mobile Sample.xcscheme │ │ │ └── xcschememanagement.plist │ ├── Cars Mobile Sample.xcworkspace │ │ ├── contents.xcworkspacedata │ │ └── xcuserdata │ │ │ └── tom.batchelor.xcuserdatad │ │ │ ├── UserInterfaceState.xcuserstate │ │ │ └── xcdebugger │ │ │ └── Breakpoints_v2.xcbkptlist │ ├── Cars Mobile Sample │ │ ├── AppDelegate.swift │ │ ├── Assets.xcassets │ │ │ ├── AppIcon.appiconset │ │ │ │ ├── Contents.json │ │ │ │ ├── Icon-App-29x29@1x.png │ │ │ │ ├── Icon-App-29x29@2x-1.png │ │ │ │ ├── Icon-App-29x29@2x.png │ │ │ │ ├── Icon-App-29x29@3x.png │ │ │ │ ├── Icon-App-40x40@1x.png │ │ │ │ ├── Icon-App-40x40@2x-1.png │ │ │ │ ├── Icon-App-40x40@2x.png │ │ │ │ ├── Icon-App-60x60@2x-1.png │ │ │ │ ├── Icon-App-60x60@2x.png │ │ │ │ ├── Icon-App-60x60@3x.png │ │ │ │ ├── Icon-App-76x76@1x.png │ │ │ │ ├── Icon-App-76x76@2x-1.png │ │ │ │ └── Icon-App-76x76@2x.png │ │ │ ├── Contents.json │ │ │ └── sample.imageset │ │ │ │ ├── Contents.json │ │ │ │ └── PinkTeapot.jpeg │ │ ├── Base.lproj │ │ │ ├── LaunchScreen.storyboard │ │ │ └── Main.storyboard │ │ ├── Car.swift │ │ ├── CarTableViewCell.swift │ │ ├── CarTableViewController.swift │ │ ├── CarViewController.swift │ │ ├── HomeViewController.swift │ │ ├── Info.plist │ │ ├── LoginViewController.swift │ │ ├── Manufacturer.swift │ │ ├── ManufacturerTableViewCell.swift │ │ ├── ManufacturerTableViewController.swift │ │ ├── RestApiManager.swift │ │ ├── SearchViewController.swift │ │ ├── SellViewController.swift │ │ └── User.swift │ └── Cars Mobile SampleTests │ │ ├── Cars_Mobile_SampleTests.swift │ │ └── Info.plist │ └── README.md ├── nb-configuration.xml ├── pom.xml ├── src └── main │ ├── java │ ├── com │ │ └── supercars │ │ │ ├── Car.java │ │ │ ├── Engine.java │ │ │ ├── Enquiry.java │ │ │ ├── Leak.java │ │ │ ├── Manufacturer.java │ │ │ ├── XMLException.java │ │ │ ├── dataloader │ │ │ ├── CarDataLoader.java │ │ │ ├── Constants.java │ │ │ ├── EnquiryDataLoader.java │ │ │ └── ManufacturerDataLoader.java │ │ │ ├── externaldata │ │ │ └── FuelPrices.java │ │ │ ├── logging │ │ │ ├── LogLevel.java │ │ │ └── Logger.java │ │ │ ├── preferences │ │ │ ├── Preference.java │ │ │ ├── PreferenceException.java │ │ │ └── PreferenceManager.java │ │ │ ├── rest │ │ │ ├── CarService.java │ │ │ ├── EnquiryService.java │ │ │ ├── FuelService.java │ │ │ ├── LeakService.java │ │ │ ├── ManufacturerService.java │ │ │ ├── PreferenceService.java │ │ │ └── UserService.java │ │ │ └── usermanagement │ │ │ ├── User.java │ │ │ └── UserManager.java │ └── conf │ │ └── MANIFEST.MF │ ├── resources │ └── db │ │ └── mysql.sql │ └── webapp │ ├── META-INF │ └── context.xml │ ├── WEB-INF │ ├── c.tld │ ├── jboss-web.xml │ ├── validator-rules.xml │ └── web.xml │ ├── angular │ ├── about.html │ ├── alpina.html │ ├── amg.html │ ├── angular-route.js │ ├── angular.js │ ├── car.html │ ├── cars.html │ ├── enquire.html │ ├── gembella.html │ ├── home.html │ ├── images │ │ ├── about_car.gif │ │ ├── aboutus_but.gif │ │ ├── cars │ │ │ ├── 0.gif │ │ │ ├── 0.jpg │ │ │ ├── 10.jpg │ │ │ ├── 11.jpg │ │ │ ├── 12.jpg │ │ │ ├── 13.jpg │ │ │ ├── 14.jpg │ │ │ ├── 15.jpg │ │ │ ├── 16.jpg │ │ │ ├── 17.jpg │ │ │ ├── 18.jpg │ │ │ ├── 19.jpg │ │ │ ├── 2.jpg │ │ │ ├── 20.jpg │ │ │ ├── 21.jpg │ │ │ ├── 22.jpg │ │ │ ├── 23.jpg │ │ │ ├── 24.jpg │ │ │ ├── 25.jpg │ │ │ ├── 26.jpg │ │ │ ├── 27.jpg │ │ │ ├── 28.jpg │ │ │ ├── 29.jpg │ │ │ ├── 3.jpg │ │ │ ├── 30.jpg │ │ │ ├── 31.jpg │ │ │ ├── 32.jpg │ │ │ ├── 33.jpg │ │ │ ├── 34.jpg │ │ │ ├── 35.jpg │ │ │ ├── 4.jpg │ │ │ ├── 5.jpg │ │ │ ├── 6.jpg │ │ │ ├── 7.jpg │ │ │ ├── 8.jpg │ │ │ └── 9.jpg │ │ ├── enquire_but.gif │ │ ├── enquire_button.gif │ │ ├── homepage_car.gif │ │ ├── insurance_but.gif │ │ ├── insurance_car.gif │ │ ├── line.gif │ │ ├── logo.gif │ │ ├── magnify.gif │ │ ├── manufacturers │ │ │ ├── AstonMartin.gif │ │ │ ├── Bmw.gif │ │ │ ├── Ferrari.gif │ │ │ ├── Ford.gif │ │ │ ├── Jaguar.gif │ │ │ ├── Lamborghini.gif │ │ │ ├── Lotus.gif │ │ │ ├── Mazda.gif │ │ │ ├── Mercedes.gif │ │ │ ├── Porsche.gif │ │ │ ├── Subaru.gif │ │ │ └── Tvr.gif │ │ ├── performance │ │ │ ├── alpina.gif │ │ │ ├── amg.gif │ │ │ ├── b10.gif │ │ │ ├── gcar.gif │ │ │ ├── gembella.gif │ │ │ ├── mazda.gif │ │ │ ├── rgt.gif │ │ │ ├── ruf.gif │ │ │ ├── rx8.gif │ │ │ └── slk.gif │ │ ├── pipe.gif │ │ ├── search_but.gif │ │ ├── search_button.gif │ │ ├── sell_but.gif │ │ ├── small_search_but.gif │ │ ├── submit_button.gif │ │ ├── supercars_but.gif │ │ ├── ukmap.gif │ │ └── view_enquiries_button.gif │ ├── index.html │ ├── index.jsp │ ├── insurance.html │ ├── login.html │ ├── logout.html │ ├── manufacturers.html │ ├── mazdaspeed.html │ ├── preferences.html │ ├── ruf.html │ ├── search.html │ ├── sell.html │ ├── superCars.js │ ├── superCarsController.js │ ├── thankyou.html │ ├── trader.css │ └── tuner.jsp │ └── trader.css └── updateDeployLocalhost.sh /.gitignore: -------------------------------------------------------------------------------- 1 | target/ 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Cars Sample App Readme 2 | 3 | This is a simple web app which provides for a Super car store which has a couple of performance/code issues. The app can be build with Maven. 4 | 5 | ## Architecture 6 | 7 | The app is based on a Angular 1 front end, calling back to RESTful services, base on [Jersey](https://jersey.java.net), with a [MySQL](https://www.mysql.com) back end. 8 | 9 |  10 | 11 | There is also a iOS mobile app which uses the same REST endpoints. This app is described in it's own [README](mobile/iOS/README.md). 12 | 13 | The internals of the web app are fairly simple. The packages in the code are: 14 | 15 | * com.supercars - Contains classes to describe the different business entities, e.g. car, manufacturer etc. 16 | * com.supercars.dataloader - Classes to access the DB and retrieve or persist the different business entities 17 | * com.supercars.externaldata - Classes to retrieve data from 3rd party services of HTTP - This is where the fuel prices come from on the home page 18 | * com.supercars.logging - Classes for custom logging, used to help with exercises for AppDynamics 19 | * com.supercars.rest - Classes which exposes the REST services 20 | * com.supercars.usermanagement - Classes for user management 21 | 22 | ### A JSP Page 23 | 24 | There is one application page which isn't Angular, but is a standalone JSP page this is "/Cars_Sample_App/angular/tuner.jsp". This page is access using the links from the performance accessories section on the home page: 25 | 26 |  27 | 28 | ## Database 29 | 30 | The app uses a MySQL DB in the backend, this be default is expected to be the "supercars" schema, and MySQL running locally to the app. The schema build is in src/main/resources/db/mysql.sql. Execute this script against the schema you create in MySQL. 31 | 32 | The datasouce is defined in context.xml in src/webapp/META-INF 33 | 34 | ## Building 35 | 36 | This app uses [Maven](https://maven.apache.org) for the build. To get a build environment working: 37 | 38 | 1. Have [git](https://git-scm.com) installed and working 39 | 1. Get [Maven](https://maven.apache.org) installed 40 | 1. Get the tar.gz or zip package from the Maven site 41 | 1. Unpack somewhere on your file system, e.g. "/opt/maven/apache-maven-3.3.9/" 42 | 1. Add the Maven bin directory to your path, e.g. in "vi .bash_profile" add: 43 |
44 | export M2_HOME=/opt/maven/apache-maven-3.3.9
45 | export M2=$M2_HOME/bin
46 | export PATH=$PATH:$M2
47 |
48 | 1. Login and out of your shell to get the new path
49 | 1. Test using the command "mvn". This should run Maven and indicate "Build Failure"
50 | 1. Use git to get the source code
51 |
52 | git clone https://github.com/Appdynamics/Cars_Sample_App.git
53 |
54 | 1. Change to the Cars_Sample_App directory and then execute the following for the build
55 |
56 | mvn install
57 |
58 | 1. This should run and leave "Cars_Sample_App.war" in the "target/" directory
59 |
60 | It is also possible to have Maven auto deploy right into Tomcat.
61 |
62 | 1. First step is to configure a user for the Tomcat Manager. In "$TOMCAT_HOME/conf/tomcat-users.xml" add a line line the following:
63 |
64 | <user username="user" password="pass" roles="manager-script,manager-gui"/>
65 |
66 | 1. Restart Tomcat
67 | 1. Update our Maven config with this information. This is in the file "$M2_HOME/conf/settings.xml".
68 | 1. Locate the "<servers>" tag
69 | 1. Inside here add a server entry like the following:
70 |
71 | <server>
72 | <id>Tomcat</id>
73 | <username>user</username>
74 | <password>pass</password>
75 | </server>
76 |
77 | 1. Note that the user/pass must match what you set in the Tomcat config
78 | 1. Now go back to the Cars_Sample_App source. Instead of "mvn install", the following will build and deploy:
79 |
80 | mvn tomcat7:deploy
81 |
82 | 1. If the app is already deployed into the Tomcat the following will build and re-deploy
83 |
84 | mvn tomcat7:redeploy
85 |
86 | 1. Now the app is available on "/Cars_Sample_App/angular/index.jsp" on your Tomcat
87 |
88 |
--------------------------------------------------------------------------------
/docImages/highlevelarc.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Appdynamics/Cars_Sample_App/56ccb134e09fccfa7a7a5ea90e4ebfe0ec43598e/docImages/highlevelarc.png
--------------------------------------------------------------------------------
/docImages/tunerLinks.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Appdynamics/Cars_Sample_App/56ccb134e09fccfa7a7a5ea90e4ebfe0ec43598e/docImages/tunerLinks.png
--------------------------------------------------------------------------------
/mobile/iOS/Cars Mobile Sample/Cars Mobile Sample.xcodeproj/project.xcworkspace/contents.xcworkspacedata:
--------------------------------------------------------------------------------
1 |
2 |
7 | About Us
8 |
9 |
11 |
12 |
14 | Supercar Trader is published in 13 regional editions. To find details of your local edition, simply click on the links below or use the map to locate your local Supercar Trader magazine. 15 |
16 |17 | Launched in 2004, Supercar Trader is the biggest selling motoring magazine in Britain and is published across thirteen regional editions. More people buy and read Supercar Trader than any other motoring title and the magazine continues to be the market leader with a circulation of 351,654 (ABC Jan-June 2004) and a readership of 1,800,000 (NRS Jan-Dec 2003). 18 |
19 |20 | Supercar Trader has positioned itself as the synonymous choice for buying and selling a motor vehicle with the success of the magazine built on the combination of photo-ads, choice and a unique structure of regional publishing, offering the combined advantages of local targeting and comprehensive national coverage. 21 |
22 |26 | Memory leaks! Under the covers this is a LinkedList of Byte arrays. the form below sets how many arrays and their size to add. 27 |
28 |29 | Current list size is: {{leakSize}} 30 |
31 |
2 | Alpina
3 |
4 |
6 |
7 |
9 |
10 |
12 | Throughout ALPINA's 40-year history, its automobiles have been known for their notion of exclusivity. 13 | Over this period, BMW ALPINA's have evolved, taking advantage of, and improving upon, the technology 14 | offered at the time - and not just in the pursuit of more power, for improving performance is only one 15 | part of ALPINA's philosophy. The ALPINA customer is an enthusiast who appreciates high technology and 16 | seeks great driving pleasure from his car, yet prefers a car more refined and more practical than today's 17 | sports cars. The BMW ALPINA B10 V8 S is high performance in a most subtle guise. 18 |
19 | -------------------------------------------------------------------------------- /src/main/webapp/angular/amg.html: -------------------------------------------------------------------------------- 1 |
2 | AMG
3 |
4 |
6 |
7 |
9 |
10 |
12 | Inspired by the core values of Mercedes-Benz - like quality, safety, comfort and environmental 13 | protection - Mercedes-AMG GmbH develops and builds high-performance sports cars, options and accessories. 14 | 15 | Development work at Mercedes-AMG is driven by the pursuit of performance, sporting prowess and 16 | individuality. The dynamism and sporty character of these fascinating and unique vehicles catapult 17 | them into "pole position" in their respective Mercedes-Benz model ranges. 18 |
-------------------------------------------------------------------------------- /src/main/webapp/angular/car.html: -------------------------------------------------------------------------------- 1 | 6 |
9 |
10 |
16 | Performance Summary:
17 | Name: {{car.name}} |
28 |
31 | ![]() |
33 |
37 |
38 | From:{{enquiry.name}}, {{enquiry.email}} |
43 |
46 | | 47 |
{{cars.length}} cars found:
10 | |
12 | 13 | {{car.model}} {{car.name}} {{car.summary}} 14 | | 15 |
Enquire
7 |
8 |
2 | Gembella
3 |
4 |
6 |
7 |
9 |
10 |
12 | Porsche customizer Gemballa from Leonberg thrills the hearts of the drivers of the 13 | noble Porsche-SUV by its new high-performance cure, the Gemballa V6 Turbo conversion 14 | kit for the Porsche Cayenne V6, for the Cayenne V6 reaches new dimensions of 15 | performance with the help of the new Gemballa conversion kit. 16 |
17 | -------------------------------------------------------------------------------- /src/main/webapp/angular/home.html: -------------------------------------------------------------------------------- 1 |Welcome: {{currentUser.username}}![]() |
4 |
9 |
|
40 |
41 |
|
58 |
59 |
|
102 |
14 |
15 | ![]() |
18 | |||||
21 |
22 | ![]() |
25 |
26 |
27 | ![]() |
30 |
31 |
32 | ![]() |
35 |
36 |
37 | ![]() |
40 |
41 |
42 | ![]() |
45 |
46 |
47 | ![]() |
50 |
21 |
22 | ![]() |
25 | |||||
28 |
29 | ![]() |
32 |
33 |
34 | ![]() |
37 |
38 |
39 | ![]() |
42 |
43 |
44 | ![]() |
47 |
48 |
49 | ![]() |
52 |
53 |
54 | ![]() |
57 |
7 | Insurance
8 |
9 |
11 |
12 |
14 | Welcome to Supercar Insurance If you're looking for a cheap car insurance quote, you're in the right place. 15 | 16 | Because we're direct on the net our overheads are lower, so we can offer car insurance for less. So if you're looking for cheap car insurance, why not get a quote from us now? 17 | 18 | Our secure quote pages will provide you with a car insurance quote in minutes. This means that paying for your motor insurance online is completely safe. 19 | 20 | And if you want to talk to someone for help or advice about your car insurance quote, there's a national rate number to call. You can even pay for your car insurance over the phone! 21 |
-------------------------------------------------------------------------------- /src/main/webapp/angular/login.html: -------------------------------------------------------------------------------- 1 | 2 | 7 |Login
Please enter your credentials:
9 | 30 | -------------------------------------------------------------------------------- /src/main/webapp/angular/logout.html: -------------------------------------------------------------------------------- 1 | 2 | 7 |You have been logged out {{currentUser.username}}!
8 | -------------------------------------------------------------------------------- /src/main/webapp/angular/manufacturers.html: -------------------------------------------------------------------------------- 1 | 6 |
9 |
10 | |
13 |
2 | MazdaSpeed
3 |
4 |
6 |
7 |
9 |
10 |
12 | Mazda Motor Corporation announces the release of a limited edition RX-8 Mazdaspeed 13 | Version, which is based on the RX-8 and fitted with Mazdaspeed* brand tune-up parts 14 | for enhanced sports driving performance. The RX-8 Mazdaspeed Version goes on sale 15 | from the middle of February at Mazda Anfini and Mazda dealerships throughout Japan. 16 |
17 |18 | The new RX-8 Mazdaspeed Version is based on the RX-8 Type S. Mazda has tuned 19 | up the engine using it`s exclusively designed PCM (Powertrain Control Module) 20 | to match the modified intake and exhaust systems of the Mazdaspeed Version, 21 | as well as going through balance adjustments around the eccentric shaft in 22 | response to the lightweight flywheel. Mazda has also tuned up the suspension 23 | and fitted aero parts to further enhance sports driving performance. Those 24 | modifications, carried out under Mazda`s strict quality control system, 25 | provide the RX-8 Mazdaspeed Version with well-balanced performance. 26 |
-------------------------------------------------------------------------------- /src/main/webapp/angular/preferences.html: -------------------------------------------------------------------------------- 1 | 2 | 7 |Preferences
Available preferences:
9 |12 | Name 13 | | 14 |15 | Value 16 | | 17 |18 | Description 19 | | 20 |
23 | {{preference.name}} 24 | | 25 |26 | 27 | | 28 |29 | {{preference.description}} 30 | | 31 |
2 | Ruf
3 |
4 |
6 |
7 |
9 |
10 |
12 | The latest year 2003 release from RUF Automobiles. A RUF manufactured sports 13 | version of the 996 Carrera constructed on the basis of a natural aspirated 14 | engine, that has a dry oil sump with a separate oil tank. Built at the RUF 15 | headquarters in Pfaffenhausen. 16 |
17 |
18 | The RUF RGT with an elevated power output of 395 bhp. This normally 19 | aspirated power-plant performance is achieved through equipping motorsports 20 | based engine with four new camshafts, a performance exhaust system, air 21 | filter and a re-mapped engine management system. 22 | [> -------------------------------------------------------------------------------- /src/main/webapp/angular/search.html: -------------------------------------------------------------------------------- 1 | 6 |
7 | Search
8 |
9 |
11 | Please enter your search criteria, for example 'Lamborghini', or '911'
12 |
13 |
14 |
15 |
16 |
20 | 21 | | 22 |
23 | 24 | {{car.manufacturer.name}} - {{car.model}} {{car.name}} 25 | {{car.summary}} 26 | 27 | |
28 |
Sell
Please enter details of your supercar:
8 | -------------------------------------------------------------------------------- /src/main/webapp/angular/superCars.js: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | var app = angular.module('superCars', ["ngRoute"]); 8 | app.config(function ($routeProvider) { 9 | $routeProvider.when("/", { 10 | templateUrl: "home.html", 11 | controller: "homeController" 12 | }) 13 | .when("/home", { 14 | templateUrl: "home.html", 15 | controller: "homeController" 16 | }) 17 | .when("/manufacturers", { 18 | templateUrl: "manufacturers.html", 19 | controller: "manufacturerController" 20 | }) 21 | .when("/cars", { 22 | templateUrl: "cars.html", 23 | controller: "carsController" 24 | }) 25 | .when("/car", { 26 | templateUrl: "car.html", 27 | controller: "carController" 28 | }) 29 | .when("/search", { 30 | templateUrl: "search.html", 31 | controller: "searchController" 32 | }) 33 | .when("/sell", { 34 | templateUrl: "sell.html", 35 | controller: "sellController" 36 | }) 37 | .when("/enquire", { 38 | templateUrl: "enquire.html", 39 | controller: "enquireController" 40 | }) 41 | .when("/insurance", { 42 | templateUrl: "insurance.html" 43 | }) 44 | .when("/about", { 45 | templateUrl: "about.html", 46 | controller: "leakController" 47 | }) 48 | .when("/thankyou", { 49 | templateUrl: "thankyou.html" 50 | }) 51 | .when('/alpina', { 52 | templateUrl: "alpina.html" 53 | }) 54 | .when("/amg", { 55 | templateUrl: "amg.html" 56 | }) 57 | .when("/gembella", { 58 | templateUrl: "gembella.html" 59 | }) 60 | .when("/mazdaspeed", { 61 | templateUrl: "mazdaspeed.html" 62 | }) 63 | .when("/ruf", { 64 | templateUrl: "ruf.html" 65 | }) 66 | .when("/login", { 67 | templateUrl: "login.html", 68 | controller: "loginController" 69 | }) 70 | .when("/logout", { 71 | templateUrl: "logout.html", 72 | controller: "logoutController" 73 | }) 74 | .when("/preferences", { 75 | templateUrl: "preferences.html", 76 | controller: "preferencesController" 77 | }); 78 | }); 79 | 80 | app.factory('carsUtils', function () { 81 | var manufacturerId; 82 | var carId; 83 | var searchTerm; 84 | var carsUtilsService = {}; 85 | 86 | carsUtilsService.setCarId = function (id) { 87 | carId = id; 88 | }; 89 | 90 | carsUtilsService.getCarId = function () { 91 | return carId; 92 | }; 93 | 94 | carsUtilsService.setManufacturerId = function (id) { 95 | manufacturerId = id; 96 | }; 97 | 98 | carsUtilsService.getManufacturerId = function () { 99 | return manufacturerId; 100 | }; 101 | 102 | carsUtilsService.setSearchTerm = function (term) { 103 | searchTerm = term; 104 | }; 105 | 106 | carsUtilsService.getSearchTerm = function () { 107 | return searchTerm; 108 | }; 109 | 110 | return carsUtilsService; 111 | }); 112 | -------------------------------------------------------------------------------- /src/main/webapp/angular/superCarsController.js: -------------------------------------------------------------------------------- 1 | /* 2 | * To change this license header, choose License Headers in Project Properties. 3 | * To change this template file, choose Tools | Templates 4 | * and open the template in the editor. 5 | */ 6 | 7 | app.controller('mainController', function ($scope) { 8 | 9 | }); 10 | 11 | app.controller('homeController', function ($scope, $http, $location, carsUtils) { 12 | $http.get("../public/fuel") 13 | .then(function (response) { 14 | $scope.fuelPrices = response.data; 15 | }); 16 | $http.get("../public/user") 17 | .then(function (response) { 18 | $scope.currentUser = response.data; 19 | }); 20 | $scope.search = function () { 21 | carsUtils.setSearchTerm($scope.searchTerm) 22 | $location.path("/search"); 23 | }; 24 | }); 25 | 26 | app.controller('manufacturerController', function ($scope, $http, $location, carsUtils) { 27 | $http.get("../public/manufacturer") 28 | .then(function (response) { 29 | $scope.manufacturers = response.data; 30 | }); 31 | $scope.manufacturerLink = function (manufacturerId) { 32 | carsUtils.setManufacturerId(manufacturerId); 33 | $location.path("/cars"); 34 | }; 35 | }); 36 | 37 | app.controller('carsController', function ($scope, $http, $location, carsUtils) { 38 | $scope.manufacturerId = carsUtils.getManufacturerId(); 39 | $http.get("../public/car/manufacturer/" + $scope.manufacturerId) 40 | .then(function (response) { 41 | $scope.cars = response.data; 42 | }); 43 | $http.get("../public/manufacturer/" + $scope.manufacturerId) 44 | .then(function (response) { 45 | $scope.manufacturer = response.data; 46 | }); 47 | $scope.carLink = function (carId) { 48 | carsUtils.setCarId(carId); 49 | $location.path("/car"); 50 | }; 51 | }); 52 | 53 | app.controller('carController', function ($scope, $http, $location, carsUtils) { 54 | $scope.carId = carsUtils.getCarId(); 55 | $http.get("../public/car/" + $scope.carId) 56 | .then(function (response) { 57 | $scope.car = response.data; 58 | }); 59 | $http.post("../public/enquiry/" + $scope.carId) 60 | .then(function (response) { 61 | $scope.enquiries = response.data; 62 | }); 63 | $scope.enquireLink = function (carId) { 64 | carsUtils.setCarId(carId); 65 | $location.path("/enquire"); 66 | }; 67 | $scope.doError = function () { 68 | adddlert("This will error!"); 69 | }; 70 | }); 71 | 72 | app.controller('searchController', function ($scope, $http, $location, carsUtils) { 73 | if (carsUtils.getSearchTerm() !== null) { 74 | $scope.searchTerm = carsUtils.getSearchTerm(); 75 | } 76 | if ($scope.searchTerm !== null) { 77 | $http.post("../public/car/" + $scope.searchTerm) 78 | .then(function (response) { 79 | $scope.cars = response.data; 80 | }); 81 | } 82 | $scope.search = function () { 83 | $http.post("../public/car/" + $scope.searchTerm) 84 | .then(function (response) { 85 | $scope.cars = response.data; 86 | }); 87 | }; 88 | $scope.carLink = function (carId) { 89 | carsUtils.setCarId(carId); 90 | $location.path("/car"); 91 | }; 92 | }); 93 | 94 | app.controller('sellController', function ($scope, $http, $location) { 95 | $http.get("../public/manufacturer") 96 | .then(function (response) { 97 | $scope.manufacturers = response.data; 98 | }); 99 | $scope.saveCar = function () { 100 | var carJSON = {}; 101 | carJSON["name"] = $scope.name; 102 | carJSON["model"] = $scope.model; 103 | carJSON["manufacturerId"] = parseInt($scope.manufacturer); 104 | carJSON["colour"] = $scope.colour; 105 | carJSON["year"] = $scope.year; 106 | carJSON["price"] = $scope.price; 107 | carJSON["summary"] = $scope.summary; 108 | carJSON["description"] = $scope.description; 109 | carJSON["wheelSize"] = 0; 110 | carJSON["tyreSize"] = 0; 111 | carJSON["photo"] = "0"; 112 | carJSON["manual"] = false; 113 | $http.put("../public/car", carJSON); 114 | $location.path("/thankyou"); 115 | }; 116 | }); 117 | 118 | app.controller('enquireController', function ($scope, $http, $location, carsUtils) { 119 | $scope.carId = carsUtils.getCarId(); 120 | $http.get("../public/car/" + $scope.carId) 121 | .then(function (response) { 122 | $scope.car = response.data; 123 | }); 124 | $scope.saveEnquiry = function () { 125 | enquiryJSON = {}; 126 | enquiryJSON["name"] = $scope.name; 127 | enquiryJSON["email"] = $scope.email; 128 | enquiryJSON["comment"] = $scope.comment; 129 | enquiryJSON["carId"] = $scope.car.carId; 130 | $http.put("../public/enquiry", enquiryJSON); 131 | $location.path("/thankyou"); 132 | }; 133 | }); 134 | 135 | app.controller('leakController', function ($scope, $http) { 136 | $http.get("../public/leak") 137 | .then(function (response) { 138 | $scope.leakSize = response.data; 139 | }); 140 | $scope.addToLeak = function () { 141 | $http.get("../public/leak/" + $scope.number + "/" + $scope.size); 142 | $http.get('../public/leak') 143 | .then(function (response) { 144 | $scope.leakSize = response.data; 145 | }); 146 | }; 147 | $scope.resetLeak = function () { 148 | $http.delete("../public/leak"); 149 | $http.get('../public/leak') 150 | .then(function (response) { 151 | $scope.leakSize = response.data; 152 | }); 153 | }; 154 | }); 155 | 156 | app.controller('loginController', function ($scope, $http, $location) { 157 | $scope.login = function () { 158 | var loginJSON = {}; 159 | loginJSON["username"] = $scope.username; 160 | loginJSON["password"] = $scope.password; 161 | $http.post("../public/user/login", loginJSON); 162 | $location.path("/home"); 163 | }; 164 | }); 165 | 166 | app.controller('logoutController', function ($scope, $http) { 167 | $http.get("../public/user") 168 | .then(function (response) { 169 | $scope.currentUser = response.data; 170 | }); 171 | $http.get("../public/user/logout"); 172 | }); 173 | 174 | app.controller('preferencesController', function ($scope, $http) { 175 | $http.get("../public/preferences/all") 176 | .then(function (response) { 177 | $scope.preferences = response.data; 178 | }); 179 | $scope.savePreferences = function() { 180 | $http.post("../public/preferences/all", $scope.preferences); 181 | $location.path("/preferences"); 182 | } 183 | }); -------------------------------------------------------------------------------- /src/main/webapp/angular/thankyou.html: -------------------------------------------------------------------------------- 1 | 6 | 7 |9 | Thank you for your submission! 10 |
11 |
27 |
28 | ![]() |
31 |
37 |
41 |
42 |
44 |
45 |
47 | Inspired by the core values of Mercedes-Benz - like quality, safety, comfort and environmental 48 | protection - Mercedes-AMG GmbH develops and builds high-performance sports cars, options and accessories. 49 | 50 | Development work at Mercedes-AMG is driven by the pursuit of performance, sporting prowess and 51 | individuality. The dynamism and sporty character of these fascinating and unique vehicles catapult 52 | them into "pole position" in their respective Mercedes-Benz model ranges. 53 |
54 | <% } %> 55 | 56 | <% if (tunerName.equals("Alpina")) { %> 57 |58 |
62 |
63 |
65 |
66 |
68 | Throughout ALPINA's 40-year history, its automobiles have been known for their notion of exclusivity. 69 | Over this period, BMW ALPINA's have evolved, taking advantage of, and improving upon, the technology 70 | offered at the time - and not just in the pursuit of more power, for improving performance is only one 71 | part of ALPINA's philosophy. The ALPINA customer is an enthusiast who appreciates high technology and 72 | seeks great driving pleasure from his car, yet prefers a car more refined and more practical than today's 73 | sports cars. The BMW ALPINA B10 V8 S is high performance in a most subtle guise. 74 |
75 | <% } %> 76 | 77 | <% if (tunerName.equals("Gembella")) { %> 78 |79 |
83 |
84 |
86 |
87 |
89 | Porsche customizer Gemballa from Leonberg thrills the hearts of the drivers of the 90 | noble Porsche-SUV by its new high-performance cure, the Gemballa V6 Turbo conversion 91 | kit for the Porsche Cayenne V6, for the Cayenne V6 reaches new dimensions of 92 | performance with the help of the new Gemballa conversion kit. 93 |
94 | <% } %> 95 | 96 | <% if (tunerName.equals("Mazdaspeed")) { %> 97 |98 |
102 |
103 |
105 |
106 |
108 | Mazda Motor Corporation announces the release of a limited edition RX-8 Mazdaspeed 109 | Version, which is based on the RX-8 and fitted with Mazdaspeed* brand tune-up parts 110 | for enhanced sports driving performance. The RX-8 Mazdaspeed Version goes on sale 111 | from the middle of February at Mazda Anfini and Mazda dealerships throughout Japan. 112 |
113 |114 | The new RX-8 Mazdaspeed Version is based on the RX-8 Type S. Mazda has tuned 115 | up the engine using it`s exclusively designed PCM (Powertrain Control Module) 116 | to match the modified intake and exhaust systems of the Mazdaspeed Version, 117 | as well as going through balance adjustments around the eccentric shaft in 118 | response to the lightweight flywheel. Mazda has also tuned up the suspension 119 | and fitted aero parts to further enhance sports driving performance. Those 120 | modifications, carried out under Mazda`s strict quality control system, 121 | provide the RX-8 Mazdaspeed Version with well-balanced performance. 122 |
123 | <% } %> 124 | 125 | <% if (tunerName.equals("RUF")) { %> 126 |127 |
131 |
132 |
134 |
135 |
137 | The latest year 2003 release from RUF Automobiles. A RUF manufactured sports 138 | version of the 996 Carrera constructed on the basis of a natural aspirated 139 | engine, that has a dry oil sump with a separate oil tank. Built at the RUF 140 | headquarters in Pfaffenhausen. 141 |
142 |
143 | The RUF RGT with an elevated power output of 395 bhp. This normally
144 | aspirated power-plant performance is achieved through equipping motorsports
145 | based engine with four new camshafts, a performance exhaust system, air
146 | filter and a re-mapped engine management system.
147 | [>
148 | <% }%>
149 |
150 |
151 |
152 |
153 |
--------------------------------------------------------------------------------
/src/main/webapp/trader.css:
--------------------------------------------------------------------------------
1 | table
2 | { text-align: center;
3 | font-family: Verdana;
4 | font-weight: normal;
5 | font-size: 11px;
6 | color: #404040;
7 | border: 0px #d79900 solid;
8 | border-collapse: collapse;
9 | border-spacing: 0px;}
10 |
11 | td.home
12 | { text-align: center;
13 | font-family: Verdana;
14 | font-weight: normal;
15 | font-size: 11px;
16 | color: #404040;
17 | width: 203px;
18 | border: 0px #d79900 solid;
19 | border-collapse: collapse;
20 | border-spacing: 0px;}
21 |
22 | td.ad
23 | { text-align: center;
24 | font-family: Verdana;
25 | font-weight: normal;
26 | font-size: 11px;
27 | background-color: #E6F1F5;
28 | border: 0px #d79900 solid;
29 | border-collapse: collapse;
30 | border-spacing: 10px;}
31 |
32 |
33 | img
34 | { text-align: left;
35 | background-color: #fafafa;
36 | border: 0px #d79900 solid;
37 | border-collapse: collapse;
38 | border-spacing: 0px;}
39 |
40 | tr.grey
41 | {;
42 | background-color: #F9F7F7;
43 | font-family: Verdana;
44 | font-weight: normal;
45 | font-size: 11px;
46 | border: 0px #d79900 solid;
47 | border-collapse: collapse;
48 | border-spacing: 0px;}
49 |
50 | td
51 | {
52 | text-align: left;
53 | font-family: Verdana;
54 | font-weight: normal;
55 | font-size: 11px;
56 | border: 0px #d79900 solid;
57 | border-collapse: collapse;
58 | border-spacing: 0px;}
59 |
60 | table.car
61 | {
62 | background-color: #F9F7F7;
63 | font-family: Verdana;
64 | font-weight: normal;
65 | font-size: 11px;
66 | width: 550px;
67 | border: 0px #d79900 solid;
68 | border-collapse: collapse;
69 | border-spacing: 0px;}
70 |
71 | p.car
72 | {
73 | background-color: #F9F7F7;
74 | font-family: Verdana;
75 | font-weight: normal;
76 | font-size: 11px;
77 | width: 550px;
78 | border: 0px #d79900 solid;
79 | border-collapse: collapse;
80 | border-spacing: 0px;}
81 |
82 | p
83 | {
84 | background-color: #FFFFFF;
85 | font-family: Verdana;
86 | font-weight: normal;
87 | font-size: 11px;
88 | border: 0px #d79900 solid;
89 | border-collapse: collapse;
90 | border-spacing: 0px;}
91 |
92 | p.normal
93 | {
94 | background-color: #FFFFFF;
95 | font-family: Verdana;
96 | font-weight: normal;
97 | font-size: 11px;
98 | width:550;
99 | border: 0px #d79900 solid;
100 | border-collapse: collapse;
101 | border-spacing: 0px;}
102 |
103 | p.summary
104 | {
105 | text-align: left;
106 | background-color: #F9F7F7;
107 | font-family: Verdana;
108 | font-weight: normal;
109 | font-size: 11px;
110 | width: 430px;
111 | border: 0px #d79900 solid;
112 | border-collapse: collapse;
113 | border-spacing: 0px;}
114 |
--------------------------------------------------------------------------------
/updateDeployLocalhost.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | git pull
4 | mvn tomcat7:redeploy
5 |
--------------------------------------------------------------------------------