initial commit
Change-Id: I0cbba3ab47a624a312bbb0d00caa3e4d67bc2239
7
src/main/resources/application-mysql.properties
Normal file
@@ -0,0 +1,7 @@
|
||||
# database init, supports mysql too
|
||||
database=mysql
|
||||
spring.datasource.url=${MYSQL_URL:jdbc:mysql://localhost/petclinic}
|
||||
spring.datasource.username=${MYSQL_USER:petclinic}
|
||||
spring.datasource.password=${MYSQL_PASS:petclinic}
|
||||
# SQL is written to be idempotent so this is safe
|
||||
spring.sql.init.mode=always
|
||||
7
src/main/resources/application-postgres.properties
Normal file
@@ -0,0 +1,7 @@
|
||||
# database init, supports postgres too
|
||||
database=postgres
|
||||
spring.datasource.url=${POSTGRES_URL:jdbc:postgresql://localhost/petclinic}
|
||||
spring.datasource.username=${POSTGRES_USER:petclinic}
|
||||
spring.datasource.password=${POSTGRES_PASS:petclinic}
|
||||
# SQL is written to be idempotent so this is safe
|
||||
spring.sql.init.mode=always
|
||||
27
src/main/resources/application.properties
Normal file
@@ -0,0 +1,27 @@
|
||||
# database init, supports mysql too
|
||||
database=h2
|
||||
spring.sql.init.schema-locations=classpath*:db/${database}/schema.sql
|
||||
spring.sql.init.data-locations=classpath*:db/${database}/data.sql
|
||||
|
||||
# Web
|
||||
spring.thymeleaf.mode=HTML
|
||||
|
||||
# JPA
|
||||
spring.jpa.hibernate.ddl-auto=none
|
||||
spring.jpa.open-in-view=false
|
||||
spring.jpa.hibernate.naming.physical-strategy=org.hibernate.boot.model.naming.PhysicalNamingStrategySnakeCaseImpl
|
||||
spring.jpa.properties.hibernate.default_batch_fetch_size=16
|
||||
|
||||
# Internationalization
|
||||
spring.messages.basename=messages/messages
|
||||
|
||||
# Actuator
|
||||
management.endpoints.web.exposure.include=*
|
||||
|
||||
# Logging
|
||||
logging.level.org.springframework=INFO
|
||||
# logging.level.org.springframework.web=DEBUG
|
||||
# logging.level.org.springframework.context.annotation=TRACE
|
||||
|
||||
# Maximum time static resources should be cached
|
||||
spring.web.resources.cache.cachecontrol.max-age=12h
|
||||
15
src/main/resources/banner.txt
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
|
||||
|\ _,,,--,,_
|
||||
/,`.-'`' ._ \-;;,_
|
||||
_______ __|,4- ) )_ .;.(__`'-'__ ___ __ _ ___ _______
|
||||
| | '---''(_/._)-'(_\_) | | | | | | | | |
|
||||
| _ | ___|_ _| | | | | |_| | | | __ _ _
|
||||
| |_| | |___ | | | | | | | | | | \ \ \ \
|
||||
| ___| ___| | | | _| |___| | _ | | _| \ \ \ \
|
||||
| | | |___ | | | |_| | | | | | | |_ ) ) ) )
|
||||
|___| |_______| |___| |_______|_______|___|_| |__|___|_______| / / / /
|
||||
==================================================================/_/_/_/
|
||||
|
||||
:: Built with Spring Boot :: ${spring-boot.version}
|
||||
|
||||
53
src/main/resources/db/h2/data.sql
Normal file
@@ -0,0 +1,53 @@
|
||||
INSERT INTO vets VALUES (default, 'James', 'Carter');
|
||||
INSERT INTO vets VALUES (default, 'Helen', 'Leary');
|
||||
INSERT INTO vets VALUES (default, 'Linda', 'Douglas');
|
||||
INSERT INTO vets VALUES (default, 'Rafael', 'Ortega');
|
||||
INSERT INTO vets VALUES (default, 'Henry', 'Stevens');
|
||||
INSERT INTO vets VALUES (default, 'Sharon', 'Jenkins');
|
||||
|
||||
INSERT INTO specialties VALUES (default, 'radiology');
|
||||
INSERT INTO specialties VALUES (default, 'surgery');
|
||||
INSERT INTO specialties VALUES (default, 'dentistry');
|
||||
|
||||
INSERT INTO vet_specialties VALUES (2, 1);
|
||||
INSERT INTO vet_specialties VALUES (3, 2);
|
||||
INSERT INTO vet_specialties VALUES (3, 3);
|
||||
INSERT INTO vet_specialties VALUES (4, 2);
|
||||
INSERT INTO vet_specialties VALUES (5, 1);
|
||||
|
||||
INSERT INTO types VALUES (default, 'cat');
|
||||
INSERT INTO types VALUES (default, 'dog');
|
||||
INSERT INTO types VALUES (default, 'lizard');
|
||||
INSERT INTO types VALUES (default, 'snake');
|
||||
INSERT INTO types VALUES (default, 'bird');
|
||||
INSERT INTO types VALUES (default, 'hamster');
|
||||
|
||||
INSERT INTO owners VALUES (default, 'George', 'Franklin', '110 W. Liberty St.', 'Madison', '6085551023');
|
||||
INSERT INTO owners VALUES (default, 'Betty', 'Davis', '638 Cardinal Ave.', 'Sun Prairie', '6085551749');
|
||||
INSERT INTO owners VALUES (default, 'Eduardo', 'Rodriquez', '2693 Commerce St.', 'McFarland', '6085558763');
|
||||
INSERT INTO owners VALUES (default, 'Harold', 'Davis', '563 Friendly St.', 'Windsor', '6085553198');
|
||||
INSERT INTO owners VALUES (default, 'Peter', 'McTavish', '2387 S. Fair Way', 'Madison', '6085552765');
|
||||
INSERT INTO owners VALUES (default, 'Jean', 'Coleman', '105 N. Lake St.', 'Monona', '6085552654');
|
||||
INSERT INTO owners VALUES (default, 'Jeff', 'Black', '1450 Oak Blvd.', 'Monona', '6085555387');
|
||||
INSERT INTO owners VALUES (default, 'Maria', 'Escobito', '345 Maple St.', 'Madison', '6085557683');
|
||||
INSERT INTO owners VALUES (default, 'David', 'Schroeder', '2749 Blackhawk Trail', 'Madison', '6085559435');
|
||||
INSERT INTO owners VALUES (default, 'Carlos', 'Estaban', '2335 Independence La.', 'Waunakee', '6085555487');
|
||||
|
||||
INSERT INTO pets VALUES (default, 'Leo', '2010-09-07', 1, 1);
|
||||
INSERT INTO pets VALUES (default, 'Basil', '2012-08-06', 6, 2);
|
||||
INSERT INTO pets VALUES (default, 'Rosy', '2011-04-17', 2, 3);
|
||||
INSERT INTO pets VALUES (default, 'Jewel', '2010-03-07', 2, 3);
|
||||
INSERT INTO pets VALUES (default, 'Iggy', '2010-11-30', 3, 4);
|
||||
INSERT INTO pets VALUES (default, 'George', '2010-01-20', 4, 5);
|
||||
INSERT INTO pets VALUES (default, 'Samantha', '2012-09-04', 1, 6);
|
||||
INSERT INTO pets VALUES (default, 'Max', '2012-09-04', 1, 6);
|
||||
INSERT INTO pets VALUES (default, 'Lucky', '2011-08-06', 5, 7);
|
||||
INSERT INTO pets VALUES (default, 'Mulligan', '2007-02-24', 2, 8);
|
||||
INSERT INTO pets VALUES (default, 'Freddy', '2010-03-09', 5, 9);
|
||||
INSERT INTO pets VALUES (default, 'Lucky', '2010-06-24', 2, 10);
|
||||
INSERT INTO pets VALUES (default, 'Sly', '2012-06-08', 1, 10);
|
||||
|
||||
INSERT INTO visits VALUES (default, 7, '2013-01-01', 'rabies shot');
|
||||
INSERT INTO visits VALUES (default, 8, '2013-01-02', 'rabies shot');
|
||||
INSERT INTO visits VALUES (default, 8, '2013-01-03', 'neutered');
|
||||
INSERT INTO visits VALUES (default, 7, '2013-01-04', 'spayed');
|
||||
64
src/main/resources/db/h2/schema.sql
Normal file
@@ -0,0 +1,64 @@
|
||||
DROP TABLE vet_specialties IF EXISTS;
|
||||
DROP TABLE vets IF EXISTS;
|
||||
DROP TABLE specialties IF EXISTS;
|
||||
DROP TABLE visits IF EXISTS;
|
||||
DROP TABLE pets IF EXISTS;
|
||||
DROP TABLE types IF EXISTS;
|
||||
DROP TABLE owners IF EXISTS;
|
||||
|
||||
|
||||
CREATE TABLE vets (
|
||||
id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
|
||||
first_name VARCHAR(30),
|
||||
last_name VARCHAR(30)
|
||||
);
|
||||
CREATE INDEX vets_last_name ON vets (last_name);
|
||||
|
||||
CREATE TABLE specialties (
|
||||
id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
|
||||
name VARCHAR(80)
|
||||
);
|
||||
CREATE INDEX specialties_name ON specialties (name);
|
||||
|
||||
CREATE TABLE vet_specialties (
|
||||
vet_id INTEGER NOT NULL,
|
||||
specialty_id INTEGER NOT NULL
|
||||
);
|
||||
ALTER TABLE vet_specialties ADD CONSTRAINT fk_vet_specialties_vets FOREIGN KEY (vet_id) REFERENCES vets (id);
|
||||
ALTER TABLE vet_specialties ADD CONSTRAINT fk_vet_specialties_specialties FOREIGN KEY (specialty_id) REFERENCES specialties (id);
|
||||
|
||||
CREATE TABLE types (
|
||||
id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
|
||||
name VARCHAR(80)
|
||||
);
|
||||
CREATE INDEX types_name ON types (name);
|
||||
|
||||
CREATE TABLE owners (
|
||||
id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
|
||||
first_name VARCHAR(30),
|
||||
last_name VARCHAR_IGNORECASE(30),
|
||||
address VARCHAR(255),
|
||||
city VARCHAR(80),
|
||||
telephone VARCHAR(20)
|
||||
);
|
||||
CREATE INDEX owners_last_name ON owners (last_name);
|
||||
|
||||
CREATE TABLE pets (
|
||||
id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
|
||||
name VARCHAR(30),
|
||||
birth_date DATE,
|
||||
type_id INTEGER NOT NULL,
|
||||
owner_id INTEGER
|
||||
);
|
||||
ALTER TABLE pets ADD CONSTRAINT fk_pets_owners FOREIGN KEY (owner_id) REFERENCES owners (id);
|
||||
ALTER TABLE pets ADD CONSTRAINT fk_pets_types FOREIGN KEY (type_id) REFERENCES types (id);
|
||||
CREATE INDEX pets_name ON pets (name);
|
||||
|
||||
CREATE TABLE visits (
|
||||
id INTEGER GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
|
||||
pet_id INTEGER,
|
||||
visit_date DATE,
|
||||
description VARCHAR(255)
|
||||
);
|
||||
ALTER TABLE visits ADD CONSTRAINT fk_visits_pets FOREIGN KEY (pet_id) REFERENCES pets (id);
|
||||
CREATE INDEX visits_pet_id ON visits (pet_id);
|
||||
53
src/main/resources/db/mysql/data.sql
Normal file
@@ -0,0 +1,53 @@
|
||||
INSERT IGNORE INTO vets VALUES (1, 'James', 'Carter');
|
||||
INSERT IGNORE INTO vets VALUES (2, 'Helen', 'Leary');
|
||||
INSERT IGNORE INTO vets VALUES (3, 'Linda', 'Douglas');
|
||||
INSERT IGNORE INTO vets VALUES (4, 'Rafael', 'Ortega');
|
||||
INSERT IGNORE INTO vets VALUES (5, 'Henry', 'Stevens');
|
||||
INSERT IGNORE INTO vets VALUES (6, 'Sharon', 'Jenkins');
|
||||
|
||||
INSERT IGNORE INTO specialties VALUES (1, 'radiology');
|
||||
INSERT IGNORE INTO specialties VALUES (2, 'surgery');
|
||||
INSERT IGNORE INTO specialties VALUES (3, 'dentistry');
|
||||
|
||||
INSERT IGNORE INTO vet_specialties VALUES (2, 1);
|
||||
INSERT IGNORE INTO vet_specialties VALUES (3, 2);
|
||||
INSERT IGNORE INTO vet_specialties VALUES (3, 3);
|
||||
INSERT IGNORE INTO vet_specialties VALUES (4, 2);
|
||||
INSERT IGNORE INTO vet_specialties VALUES (5, 1);
|
||||
|
||||
INSERT IGNORE INTO types VALUES (1, 'cat');
|
||||
INSERT IGNORE INTO types VALUES (2, 'dog');
|
||||
INSERT IGNORE INTO types VALUES (3, 'lizard');
|
||||
INSERT IGNORE INTO types VALUES (4, 'snake');
|
||||
INSERT IGNORE INTO types VALUES (5, 'bird');
|
||||
INSERT IGNORE INTO types VALUES (6, 'hamster');
|
||||
|
||||
INSERT IGNORE INTO owners VALUES (1, 'George', 'Franklin', '110 W. Liberty St.', 'Madison', '6085551023');
|
||||
INSERT IGNORE INTO owners VALUES (2, 'Betty', 'Davis', '638 Cardinal Ave.', 'Sun Prairie', '6085551749');
|
||||
INSERT IGNORE INTO owners VALUES (3, 'Eduardo', 'Rodriquez', '2693 Commerce St.', 'McFarland', '6085558763');
|
||||
INSERT IGNORE INTO owners VALUES (4, 'Harold', 'Davis', '563 Friendly St.', 'Windsor', '6085553198');
|
||||
INSERT IGNORE INTO owners VALUES (5, 'Peter', 'McTavish', '2387 S. Fair Way', 'Madison', '6085552765');
|
||||
INSERT IGNORE INTO owners VALUES (6, 'Jean', 'Coleman', '105 N. Lake St.', 'Monona', '6085552654');
|
||||
INSERT IGNORE INTO owners VALUES (7, 'Jeff', 'Black', '1450 Oak Blvd.', 'Monona', '6085555387');
|
||||
INSERT IGNORE INTO owners VALUES (8, 'Maria', 'Escobito', '345 Maple St.', 'Madison', '6085557683');
|
||||
INSERT IGNORE INTO owners VALUES (9, 'David', 'Schroeder', '2749 Blackhawk Trail', 'Madison', '6085559435');
|
||||
INSERT IGNORE INTO owners VALUES (10, 'Carlos', 'Estaban', '2335 Independence La.', 'Waunakee', '6085555487');
|
||||
|
||||
INSERT IGNORE INTO pets VALUES (1, 'Leo', '2000-09-07', 1, 1);
|
||||
INSERT IGNORE INTO pets VALUES (2, 'Basil', '2002-08-06', 6, 2);
|
||||
INSERT IGNORE INTO pets VALUES (3, 'Rosy', '2001-04-17', 2, 3);
|
||||
INSERT IGNORE INTO pets VALUES (4, 'Jewel', '2000-03-07', 2, 3);
|
||||
INSERT IGNORE INTO pets VALUES (5, 'Iggy', '2000-11-30', 3, 4);
|
||||
INSERT IGNORE INTO pets VALUES (6, 'George', '2000-01-20', 4, 5);
|
||||
INSERT IGNORE INTO pets VALUES (7, 'Samantha', '1995-09-04', 1, 6);
|
||||
INSERT IGNORE INTO pets VALUES (8, 'Max', '1995-09-04', 1, 6);
|
||||
INSERT IGNORE INTO pets VALUES (9, 'Lucky', '1999-08-06', 5, 7);
|
||||
INSERT IGNORE INTO pets VALUES (10, 'Mulligan', '1997-02-24', 2, 8);
|
||||
INSERT IGNORE INTO pets VALUES (11, 'Freddy', '2000-03-09', 5, 9);
|
||||
INSERT IGNORE INTO pets VALUES (12, 'Lucky', '2000-06-24', 2, 10);
|
||||
INSERT IGNORE INTO pets VALUES (13, 'Sly', '2002-06-08', 1, 10);
|
||||
|
||||
INSERT IGNORE INTO visits VALUES (1, 7, '2010-03-04', 'rabies shot');
|
||||
INSERT IGNORE INTO visits VALUES (2, 8, '2011-03-04', 'rabies shot');
|
||||
INSERT IGNORE INTO visits VALUES (3, 8, '2009-06-04', 'neutered');
|
||||
INSERT IGNORE INTO visits VALUES (4, 7, '2008-09-04', 'spayed');
|
||||
36
src/main/resources/db/mysql/petclinic_db_setup_mysql.txt
Normal file
@@ -0,0 +1,36 @@
|
||||
================================================================================
|
||||
=== Spring PetClinic sample application - MySQL Configuration ===
|
||||
================================================================================
|
||||
|
||||
@author Sam Brannen
|
||||
@author Costin Leau
|
||||
@author Dave Syer
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
1) Download and install the MySQL database (e.g., MySQL Community Server 5.1.x),
|
||||
which can be found here: https://dev.mysql.com/downloads/. Or run the
|
||||
"docker-compose.yml" from the root of the project (if you have docker installed
|
||||
locally):
|
||||
|
||||
$ docker-compose up
|
||||
...
|
||||
mysql_1_eedb4818d817 | MySQL init process done. Ready for start up.
|
||||
...
|
||||
|
||||
2) (Once only) create the PetClinic database and user by executing the "db/mysql/user.sql"
|
||||
scripts. You can connect to the database running in the docker container using
|
||||
`mysql -u root -h localhost --protocol tcp`, but you don't need to run the script there
|
||||
because the petclinic user is already set up if you use the provided `docker-compose.yml`.
|
||||
|
||||
3) Run the app with `spring.profiles.active=mysql` (e.g. as a System property via the command
|
||||
line, but any way that sets that property in a Spring Boot app should work). For example use
|
||||
|
||||
mvn spring-boot:run -Dspring-boot.run.profiles=mysql
|
||||
|
||||
To activate the profile on the command line.
|
||||
|
||||
N.B. the "petclinic" database has to exist for the app to work with the JDBC URL value
|
||||
as it is configured by default. This condition is taken care of automatically by the
|
||||
docker-compose configuration provided, or by the `user.sql` script if you run that as
|
||||
root.
|
||||
55
src/main/resources/db/mysql/schema.sql
Normal file
@@ -0,0 +1,55 @@
|
||||
CREATE TABLE IF NOT EXISTS vets (
|
||||
id INT(4) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
first_name VARCHAR(30),
|
||||
last_name VARCHAR(30),
|
||||
INDEX(last_name)
|
||||
) engine=InnoDB;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS specialties (
|
||||
id INT(4) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
name VARCHAR(80),
|
||||
INDEX(name)
|
||||
) engine=InnoDB;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS vet_specialties (
|
||||
vet_id INT(4) UNSIGNED NOT NULL,
|
||||
specialty_id INT(4) UNSIGNED NOT NULL,
|
||||
FOREIGN KEY (vet_id) REFERENCES vets(id),
|
||||
FOREIGN KEY (specialty_id) REFERENCES specialties(id),
|
||||
UNIQUE (vet_id,specialty_id)
|
||||
) engine=InnoDB;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS types (
|
||||
id INT(4) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
name VARCHAR(80),
|
||||
INDEX(name)
|
||||
) engine=InnoDB;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS owners (
|
||||
id INT(4) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
first_name VARCHAR(30),
|
||||
last_name VARCHAR(30),
|
||||
address VARCHAR(255),
|
||||
city VARCHAR(80),
|
||||
telephone VARCHAR(20),
|
||||
INDEX(last_name)
|
||||
) engine=InnoDB;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS pets (
|
||||
id INT(4) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
name VARCHAR(30),
|
||||
birth_date DATE,
|
||||
type_id INT(4) UNSIGNED NOT NULL,
|
||||
owner_id INT(4) UNSIGNED,
|
||||
INDEX(name),
|
||||
FOREIGN KEY (owner_id) REFERENCES owners(id),
|
||||
FOREIGN KEY (type_id) REFERENCES types(id)
|
||||
) engine=InnoDB;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS visits (
|
||||
id INT(4) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
|
||||
pet_id INT(4) UNSIGNED,
|
||||
visit_date DATE,
|
||||
description VARCHAR(255),
|
||||
FOREIGN KEY (pet_id) REFERENCES pets(id)
|
||||
) engine=InnoDB;
|
||||
11
src/main/resources/db/mysql/user.sql
Normal file
@@ -0,0 +1,11 @@
|
||||
CREATE DATABASE IF NOT EXISTS petclinic;
|
||||
|
||||
ALTER DATABASE petclinic
|
||||
DEFAULT CHARACTER SET utf8
|
||||
DEFAULT COLLATE utf8_general_ci;
|
||||
|
||||
CREATE USER IF NOT EXISTS 'petclinic'@'%' IDENTIFIED BY 'petclinic';
|
||||
|
||||
GRANT ALL PRIVILEGES ON petclinic.* TO 'petclinic'@'%';
|
||||
|
||||
FLUSH PRIVILEGES;
|
||||
53
src/main/resources/db/postgres/data.sql
Normal file
@@ -0,0 +1,53 @@
|
||||
INSERT INTO vets (first_name, last_name) SELECT 'James', 'Carter' WHERE NOT EXISTS (SELECT * FROM vets WHERE id=1);
|
||||
INSERT INTO vets (first_name, last_name) SELECT 'Helen', 'Leary' WHERE NOT EXISTS (SELECT * FROM vets WHERE id=2);
|
||||
INSERT INTO vets (first_name, last_name) SELECT 'Linda', 'Douglas' WHERE NOT EXISTS (SELECT * FROM vets WHERE id=3);
|
||||
INSERT INTO vets (first_name, last_name) SELECT 'Rafael', 'Ortega' WHERE NOT EXISTS (SELECT * FROM vets WHERE id=4);
|
||||
INSERT INTO vets (first_name, last_name) SELECT 'Henry', 'Stevens' WHERE NOT EXISTS (SELECT * FROM vets WHERE id=5);
|
||||
INSERT INTO vets (first_name, last_name) SELECT 'Sharon', 'Jenkins' WHERE NOT EXISTS (SELECT * FROM vets WHERE id=6);
|
||||
|
||||
INSERT INTO specialties (name) SELECT 'radiology' WHERE NOT EXISTS (SELECT * FROM specialties WHERE name='radiology');
|
||||
INSERT INTO specialties (name) SELECT 'surgery' WHERE NOT EXISTS (SELECT * FROM specialties WHERE name='surgery');
|
||||
INSERT INTO specialties (name) SELECT 'dentistry' WHERE NOT EXISTS (SELECT * FROM specialties WHERE name='dentistry');
|
||||
|
||||
INSERT INTO vet_specialties VALUES (2, 1) ON CONFLICT (vet_id, specialty_id) DO NOTHING;
|
||||
INSERT INTO vet_specialties VALUES (3, 2) ON CONFLICT (vet_id, specialty_id) DO NOTHING;
|
||||
INSERT INTO vet_specialties VALUES (3, 3) ON CONFLICT (vet_id, specialty_id) DO NOTHING;
|
||||
INSERT INTO vet_specialties VALUES (4, 2) ON CONFLICT (vet_id, specialty_id) DO NOTHING;
|
||||
INSERT INTO vet_specialties VALUES (5, 1) ON CONFLICT (vet_id, specialty_id) DO NOTHING;
|
||||
|
||||
INSERT INTO types (name) SELECT 'cat' WHERE NOT EXISTS (SELECT * FROM types WHERE name='cat');
|
||||
INSERT INTO types (name) SELECT 'dog' WHERE NOT EXISTS (SELECT * FROM types WHERE name='dog');
|
||||
INSERT INTO types (name) SELECT 'lizard' WHERE NOT EXISTS (SELECT * FROM types WHERE name='lizard');
|
||||
INSERT INTO types (name) SELECT 'snake' WHERE NOT EXISTS (SELECT * FROM types WHERE name='snake');
|
||||
INSERT INTO types (name) SELECT 'bird' WHERE NOT EXISTS (SELECT * FROM types WHERE name='bird');
|
||||
INSERT INTO types (name) SELECT 'hamster' WHERE NOT EXISTS (SELECT * FROM types WHERE name='hamster');
|
||||
|
||||
INSERT INTO owners (first_name, last_name, address, city, telephone) SELECT 'George', 'Franklin', '110 W. Liberty St.', 'Madison', '6085551023' WHERE NOT EXISTS (SELECT * FROM owners WHERE id=1);
|
||||
INSERT INTO owners (first_name, last_name, address, city, telephone) SELECT 'Betty', 'Davis', '638 Cardinal Ave.', 'Sun Prairie', '6085551749' WHERE NOT EXISTS (SELECT * FROM owners WHERE id=2);
|
||||
INSERT INTO owners (first_name, last_name, address, city, telephone) SELECT 'Eduardo', 'Rodriquez', '2693 Commerce St.', 'McFarland', '6085558763' WHERE NOT EXISTS (SELECT * FROM owners WHERE id=3);
|
||||
INSERT INTO owners (first_name, last_name, address, city, telephone) SELECT 'Harold', 'Davis', '563 Friendly St.', 'Windsor', '6085553198' WHERE NOT EXISTS (SELECT * FROM owners WHERE id=4);
|
||||
INSERT INTO owners (first_name, last_name, address, city, telephone) SELECT 'Peter', 'McTavish', '2387 S. Fair Way', 'Madison', '6085552765' WHERE NOT EXISTS (SELECT * FROM owners WHERE id=5);
|
||||
INSERT INTO owners (first_name, last_name, address, city, telephone) SELECT 'Jean', 'Coleman', '105 N. Lake St.', 'Monona', '6085552654' WHERE NOT EXISTS (SELECT * FROM owners WHERE id=6);
|
||||
INSERT INTO owners (first_name, last_name, address, city, telephone) SELECT 'Jeff', 'Black', '1450 Oak Blvd.', 'Monona', '6085555387' WHERE NOT EXISTS (SELECT * FROM owners WHERE id=7);
|
||||
INSERT INTO owners (first_name, last_name, address, city, telephone) SELECT 'Maria', 'Escobito', '345 Maple St.', 'Madison', '6085557683' WHERE NOT EXISTS (SELECT * FROM owners WHERE id=8);
|
||||
INSERT INTO owners (first_name, last_name, address, city, telephone) SELECT 'David', 'Schroeder', '2749 Blackhawk Trail', 'Madison', '6085559435' WHERE NOT EXISTS (SELECT * FROM owners WHERE id=9);
|
||||
INSERT INTO owners (first_name, last_name, address, city, telephone) SELECT 'Carlos', 'Estaban', '2335 Independence La.', 'Waunakee', '6085555487' WHERE NOT EXISTS (SELECT * FROM owners WHERE id=10);
|
||||
|
||||
INSERT INTO pets (name, birth_date, type_id, owner_id) SELECT 'Leo', '2000-09-07', 1, 1 WHERE NOT EXISTS (SELECT * FROM pets WHERE id=1);
|
||||
INSERT INTO pets (name, birth_date, type_id, owner_id) SELECT 'Basil', '2002-08-06', 6, 2 WHERE NOT EXISTS (SELECT * FROM pets WHERE id=2);
|
||||
INSERT INTO pets (name, birth_date, type_id, owner_id) SELECT 'Rosy', '2001-04-17', 2, 3 WHERE NOT EXISTS (SELECT * FROM pets WHERE id=3);
|
||||
INSERT INTO pets (name, birth_date, type_id, owner_id) SELECT 'Jewel', '2000-03-07', 2, 3 WHERE NOT EXISTS (SELECT * FROM pets WHERE id=4);
|
||||
INSERT INTO pets (name, birth_date, type_id, owner_id) SELECT 'Iggy', '2000-11-30', 3, 4 WHERE NOT EXISTS (SELECT * FROM pets WHERE id=5);
|
||||
INSERT INTO pets (name, birth_date, type_id, owner_id) SELECT 'George', '2000-01-20', 4, 5 WHERE NOT EXISTS (SELECT * FROM pets WHERE id=6);
|
||||
INSERT INTO pets (name, birth_date, type_id, owner_id) SELECT 'Samantha', '1995-09-04', 1, 6 WHERE NOT EXISTS (SELECT * FROM pets WHERE id=7);
|
||||
INSERT INTO pets (name, birth_date, type_id, owner_id) SELECT 'Max', '1995-09-04', 1, 6 WHERE NOT EXISTS (SELECT * FROM pets WHERE id=8);
|
||||
INSERT INTO pets (name, birth_date, type_id, owner_id) SELECT 'Lucky', '1999-08-06', 5, 7 WHERE NOT EXISTS (SELECT * FROM pets WHERE id=9);
|
||||
INSERT INTO pets (name, birth_date, type_id, owner_id) SELECT 'Mulligan', '1997-02-24', 2, 8 WHERE NOT EXISTS (SELECT * FROM pets WHERE id=10);
|
||||
INSERT INTO pets (name, birth_date, type_id, owner_id) SELECT 'Freddy', '2000-03-09', 5, 9 WHERE NOT EXISTS (SELECT * FROM pets WHERE id=11);
|
||||
INSERT INTO pets (name, birth_date, type_id, owner_id) SELECT 'Lucky', '2000-06-24', 2, 10 WHERE NOT EXISTS (SELECT * FROM pets WHERE id=12);
|
||||
INSERT INTO pets (name, birth_date, type_id, owner_id) SELECT 'Sly', '2002-06-08', 1, 10 WHERE NOT EXISTS (SELECT * FROM pets WHERE id=13);
|
||||
|
||||
INSERT INTO visits (pet_id, visit_date, description) SELECT 7, '2010-03-04', 'rabies shot' WHERE NOT EXISTS (SELECT * FROM visits WHERE id=1);
|
||||
INSERT INTO visits (pet_id, visit_date, description) SELECT 8, '2011-03-04', 'rabies shot' WHERE NOT EXISTS (SELECT * FROM visits WHERE id=2);
|
||||
INSERT INTO visits (pet_id, visit_date, description) SELECT 8, '2009-06-04', 'neutered' WHERE NOT EXISTS (SELECT * FROM visits WHERE id=3);
|
||||
INSERT INTO visits (pet_id, visit_date, description) SELECT 7, '2008-09-04', 'spayed' WHERE NOT EXISTS (SELECT * FROM visits WHERE id=4);
|
||||
@@ -0,0 +1,19 @@
|
||||
===============================================================================
|
||||
=== Spring PetClinic sample application - PostgreSQL Configuration ===
|
||||
===============================================================================
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
|
||||
1) Run the "docker-compose.yml" from the root of the project:
|
||||
|
||||
$ docker-compose up
|
||||
...
|
||||
spring-petclinic-postgres-1 | The files belonging to this database system will be owned by user "postgres".
|
||||
...
|
||||
|
||||
2) Run the app with `spring.profiles.active=postgres` (e.g. as a System property via the command
|
||||
line, but any way that sets that property in a Spring Boot app should work). For example use
|
||||
|
||||
mvn spring-boot:run -Dspring-boot.run.profiles=postgres
|
||||
|
||||
To activate the profile on the command line.
|
||||
52
src/main/resources/db/postgres/schema.sql
Normal file
@@ -0,0 +1,52 @@
|
||||
CREATE TABLE IF NOT EXISTS vets (
|
||||
id INT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
|
||||
first_name TEXT,
|
||||
last_name TEXT
|
||||
);
|
||||
CREATE INDEX ON vets (last_name);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS specialties (
|
||||
id INT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
|
||||
name TEXT
|
||||
);
|
||||
CREATE INDEX ON specialties (name);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS vet_specialties (
|
||||
vet_id INT NOT NULL REFERENCES vets (id),
|
||||
specialty_id INT NOT NULL REFERENCES specialties (id),
|
||||
UNIQUE (vet_id, specialty_id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS types (
|
||||
id INT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
|
||||
name TEXT
|
||||
);
|
||||
CREATE INDEX ON types (name);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS owners (
|
||||
id INT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
|
||||
first_name TEXT,
|
||||
last_name TEXT,
|
||||
address TEXT,
|
||||
city TEXT,
|
||||
telephone TEXT
|
||||
);
|
||||
CREATE INDEX ON owners (last_name);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS pets (
|
||||
id INT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
|
||||
name TEXT,
|
||||
birth_date DATE,
|
||||
type_id INT NOT NULL REFERENCES types (id),
|
||||
owner_id INT REFERENCES owners (id)
|
||||
);
|
||||
CREATE INDEX ON pets (name);
|
||||
CREATE INDEX ON pets (owner_id);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS visits (
|
||||
id INT GENERATED BY DEFAULT AS IDENTITY PRIMARY KEY,
|
||||
pet_id INT REFERENCES pets (id),
|
||||
visit_date DATE,
|
||||
description TEXT
|
||||
);
|
||||
CREATE INDEX ON visits (pet_id);
|
||||
51
src/main/resources/messages/messages.properties
Normal file
@@ -0,0 +1,51 @@
|
||||
welcome=Welcome
|
||||
required=is required
|
||||
notFound=has not been found
|
||||
duplicate=is already in use
|
||||
nonNumeric=must be all numeric
|
||||
duplicateFormSubmission=Duplicate form submission is not allowed
|
||||
typeMismatch.date=invalid date
|
||||
typeMismatch.birthDate=invalid date
|
||||
owner=Owner
|
||||
firstName=First Name
|
||||
lastName=Last Name
|
||||
address=Address
|
||||
city=City
|
||||
telephone=Telephone
|
||||
owners=Owners
|
||||
addOwner=Add Owner
|
||||
findOwner=Find Owner
|
||||
findOwners=Find Owners
|
||||
updateOwner=Update Owner
|
||||
vets=Veterinarians
|
||||
name=Name
|
||||
specialties=Specialties
|
||||
none=none
|
||||
pages=pages
|
||||
first=First
|
||||
next=Next
|
||||
previous=Previous
|
||||
last=Last
|
||||
somethingHappened=Something happened...
|
||||
pets=Pets
|
||||
home=Home
|
||||
error=Error
|
||||
telephone.invalid=Telephone must be a 10-digit number
|
||||
layoutTitle=PetClinic :: a Spring Framework demonstration
|
||||
pet=Pet
|
||||
birthDate=Birth Date
|
||||
type=Type
|
||||
previousVisits=Previous Visits
|
||||
date=Date
|
||||
description=Description
|
||||
new=New
|
||||
addVisit=Add Visit
|
||||
editPet=Edit Pet
|
||||
ownerInformation=Owner Information
|
||||
visitDate=Visit Date
|
||||
editOwner=Edit Owner
|
||||
addNewPet=Add New Pet
|
||||
petsAndVisits=Pets and Visits
|
||||
error.404=The requested page was not found.
|
||||
error.500=An internal server error occurred.
|
||||
error.general=An unexpected error occurred.
|
||||
51
src/main/resources/messages/messages_de.properties
Normal file
@@ -0,0 +1,51 @@
|
||||
welcome=Willkommen
|
||||
required=muss angegeben werden
|
||||
notFound=wurde nicht gefunden
|
||||
duplicate=ist bereits vergeben
|
||||
nonNumeric=darf nur numerisch sein
|
||||
duplicateFormSubmission=Wiederholtes Absenden des Formulars ist nicht erlaubt
|
||||
typeMismatch.date=ung<EFBFBD>ltiges Datum
|
||||
typeMismatch.birthDate=ung<EFBFBD>ltiges Datum
|
||||
owner=Besitzer
|
||||
firstName=Vorname
|
||||
lastName=Nachname
|
||||
address=Adresse
|
||||
city=Stadt
|
||||
telephone=Telefon
|
||||
owners=Besitzer
|
||||
addOwner=Besitzer hinzufügen
|
||||
findOwner=Besitzer finden
|
||||
findOwners=Besitzer suchen
|
||||
updateOwner=Besitzer aktualisieren
|
||||
vets=Tierärzte
|
||||
name=Name
|
||||
specialties=Fachgebiete
|
||||
none=keine
|
||||
pages=Seiten
|
||||
first=Erste
|
||||
next=Nächste
|
||||
previous=Vorherige
|
||||
last=Letzte
|
||||
somethingHappened=Etwas ist passiert...
|
||||
pets=Haustiere
|
||||
home=Startseite
|
||||
error=Fehler
|
||||
telephone.invalid=Telefonnummer muss aus 10 Ziffern bestehen
|
||||
layoutTitle=PetClinic :: eine Demonstration des Spring Frameworks
|
||||
pet=Haustier
|
||||
birthDate=Geburtsdatum
|
||||
type=Typ
|
||||
previousVisits=Frühere Besuche
|
||||
date=Datum
|
||||
description=Beschreibung
|
||||
new=Neu
|
||||
addVisit=Besuch hinzufügen
|
||||
editPet=Haustier bearbeiten
|
||||
ownerInformation=Besitzerinformationen
|
||||
visitDate=Besuchsdatum
|
||||
editOwner=Besitzer bearbeiten
|
||||
addNewPet=Neues Haustier hinzufügen
|
||||
petsAndVisits=Haustiere und Besuche
|
||||
error.404=Die angeforderte Seite wurde nicht gefunden.
|
||||
error.500=Ein interner Serverfehler ist aufgetreten.
|
||||
error.general=Ein unerwarteter Fehler ist aufgetreten.
|
||||
1
src/main/resources/messages/messages_en.properties
Normal file
@@ -0,0 +1 @@
|
||||
# This file is intentionally empty. Message look-ups will fall back to the default "messages.properties" file.
|
||||
51
src/main/resources/messages/messages_es.properties
Normal file
@@ -0,0 +1,51 @@
|
||||
welcome=Bienvenido
|
||||
required=Es requerido
|
||||
notFound=No ha sido encontrado
|
||||
duplicate=Ya se encuentra en uso
|
||||
nonNumeric=Sólo debe contener numeros
|
||||
duplicateFormSubmission=No se permite el envío de formularios duplicados
|
||||
typeMismatch.date=Fecha invalida
|
||||
typeMismatch.birthDate=Fecha invalida
|
||||
owner=Propietario
|
||||
firstName=Nombre
|
||||
lastName=Apellido
|
||||
address=Dirección
|
||||
city=Ciudad
|
||||
telephone=Teléfono
|
||||
owners=Propietarios
|
||||
addOwner=Añadir propietario
|
||||
findOwner=Buscar propietario
|
||||
findOwners=Buscar propietarios
|
||||
updateOwner=Actualizar propietario
|
||||
vets=Veterinarios
|
||||
name=Nombre
|
||||
specialties=Especialidades
|
||||
none=ninguno
|
||||
pages=páginas
|
||||
first=Primero
|
||||
next=Siguiente
|
||||
previous=Anterior
|
||||
last=Último
|
||||
somethingHappened=Algo pasó...
|
||||
pets=Mascotas
|
||||
home=Inicio
|
||||
error=Error
|
||||
telephone.invalid=El número de teléfono debe tener 10 dígitos
|
||||
layoutTitle=PetClinic :: una demostración de Spring Framework
|
||||
pet=Mascota
|
||||
birthDate=Fecha de nacimiento
|
||||
type=Tipo
|
||||
previousVisits=Visitas anteriores
|
||||
date=Fecha
|
||||
description=Descripción
|
||||
new=Nuevo
|
||||
addVisit=Agregar visita
|
||||
editPet=Editar mascota
|
||||
ownerInformation=Información del propietario
|
||||
visitDate=Fecha de visita
|
||||
editOwner=Editar propietario
|
||||
addNewPet=Agregar nueva mascota
|
||||
petsAndVisits=Mascotas y visitas
|
||||
error.404=La página solicitada no fue encontrada.
|
||||
error.500=Ocurrió un error interno del servidor.
|
||||
error.general=Ocurrió un error inesperado.
|
||||
51
src/main/resources/messages/messages_fa.properties
Normal file
@@ -0,0 +1,51 @@
|
||||
welcome=خوش آمدید
|
||||
required=الزامی
|
||||
notFound=یافت نشد
|
||||
duplicate=قبلا استفاده شده
|
||||
nonNumeric=باید عددی باشد
|
||||
duplicateFormSubmission=ارسال تکراری فرم مجاز نیست
|
||||
typeMismatch.date=تاریخ نامعتبر
|
||||
typeMismatch.birthDate=تاریخ تولد نامعتبر
|
||||
owner=مالک
|
||||
firstName=نام
|
||||
lastName=نام خانوادگی
|
||||
address=آدرس
|
||||
city=شهر
|
||||
telephone=تلفن
|
||||
owners=مالکان
|
||||
addOwner=افزودن مالک
|
||||
findOwner=یافتن مالک
|
||||
findOwners=یافتن مالکان
|
||||
updateOwner=ویرایش مالک
|
||||
vets=دامپزشکان
|
||||
name=نام
|
||||
specialties=تخصصها
|
||||
none=هیچکدام
|
||||
pages=صفحات
|
||||
first=اول
|
||||
next=بعدی
|
||||
previous=قبلی
|
||||
last=آخر
|
||||
somethingHappened=مشکلی پیش آمد...
|
||||
pets=حیوانات خانگی
|
||||
home=خانه
|
||||
error=خطا
|
||||
telephone.invalid=شماره تلفن باید ۱۰ رقمی باشد
|
||||
layoutTitle=PetClinic :: یک نمایش از Spring Framework
|
||||
pet=حیوان خانگی
|
||||
birthDate=تاریخ تولد
|
||||
type=نوع
|
||||
previousVisits=ویزیتهای قبلی
|
||||
date=تاریخ
|
||||
description=توضیحات
|
||||
new=جدید
|
||||
addVisit=افزودن ویزیت
|
||||
editPet=ویرایش حیوان خانگی
|
||||
ownerInformation=اطلاعات مالک
|
||||
visitDate=تاریخ ویزیت
|
||||
editOwner=ویرایش مالک
|
||||
addNewPet=افزودن حیوان خانگی جدید
|
||||
petsAndVisits=حیوانات و ویزیتها
|
||||
error.404=صفحه درخواستی پیدا نشد.
|
||||
error.500=خطای داخلی سرور رخ داد.
|
||||
error.general=خطای غیرمنتظرهای رخ داد.
|
||||
51
src/main/resources/messages/messages_ko.properties
Normal file
@@ -0,0 +1,51 @@
|
||||
welcome=환영합니다
|
||||
required=입력이 필요합니다
|
||||
notFound=찾을 수 없습니다
|
||||
duplicate=이미 존재합니다
|
||||
nonNumeric=모두 숫자로 입력해야 합니다
|
||||
duplicateFormSubmission=중복 제출은 허용되지 않습니다
|
||||
typeMismatch.date=잘못된 날짜입니다
|
||||
typeMismatch.birthDate=잘못된 날짜입니다
|
||||
owner=소유자
|
||||
firstName=이름
|
||||
lastName=성
|
||||
address=주소
|
||||
city=도시
|
||||
telephone=전화번호
|
||||
owners=소유자 목록
|
||||
addOwner=소유자 추가
|
||||
findOwner=소유자 찾기
|
||||
findOwners=소유자들 찾기
|
||||
updateOwner=소유자 수정
|
||||
vets=수의사
|
||||
name=이름
|
||||
specialties=전문 분야
|
||||
none=없음
|
||||
pages=페이지
|
||||
first=첫 번째
|
||||
next=다음
|
||||
previous=이전
|
||||
last=마지막
|
||||
somethingHappened=문제가 발생했습니다...
|
||||
pets=반려동물
|
||||
home=홈
|
||||
error=오류
|
||||
telephone.invalid=전화번호는 10자리 숫자여야 합니다
|
||||
layoutTitle=PetClinic :: Spring Framework 데모
|
||||
pet=반려동물
|
||||
birthDate=생년월일
|
||||
type=종류
|
||||
previousVisits=이전 방문
|
||||
date=날짜
|
||||
description=설명
|
||||
new=새로운
|
||||
addVisit=방문 추가
|
||||
editPet=반려동물 수정
|
||||
ownerInformation=소유자 정보
|
||||
visitDate=방문 날짜
|
||||
editOwner=소유자 수정
|
||||
addNewPet=새 반려동물 추가
|
||||
petsAndVisits=반려동물 및 방문
|
||||
error.404=요청하신 페이지를 찾을 수 없습니다.
|
||||
error.500=서버 내부 오류가 발생했습니다.
|
||||
error.general=알 수 없는 오류가 발생했습니다.
|
||||
51
src/main/resources/messages/messages_pt.properties
Normal file
@@ -0,0 +1,51 @@
|
||||
welcome=Bem-vindo
|
||||
required=E necessario
|
||||
notFound=Nao foi encontrado
|
||||
duplicate=Ja esta em uso
|
||||
nonNumeric=Deve ser tudo numerico
|
||||
duplicateFormSubmission=O envio duplicado de formulario nao e permitido
|
||||
typeMismatch.date=Data invalida
|
||||
typeMismatch.birthDate=Data de nascimento invalida
|
||||
owner=Proprietário
|
||||
firstName=Primeiro Nome
|
||||
lastName=Sobrenome
|
||||
address=Endereço
|
||||
city=Cidade
|
||||
telephone=Telefone
|
||||
owners=Proprietários
|
||||
addOwner=Adicionar proprietário
|
||||
findOwner=Encontrar proprietário
|
||||
findOwners=Encontrar proprietários
|
||||
updateOwner=Atualizar proprietário
|
||||
vets=Veterinários
|
||||
name=Nome
|
||||
specialties=Especialidades
|
||||
none=nenhum
|
||||
pages=páginas
|
||||
first=Primeiro
|
||||
next=Próximo
|
||||
previous=Anterior
|
||||
last=Último
|
||||
somethingHappened=Algo aconteceu...
|
||||
pets=Animais de estimação
|
||||
home=Início
|
||||
error=Erro
|
||||
telephone.invalid=O número de telefone deve conter 10 dígitos
|
||||
layoutTitle=PetClinic :: uma demonstração do Spring Framework
|
||||
pet=Animal de estimação
|
||||
birthDate=Data de nascimento
|
||||
type=Tipo
|
||||
previousVisits=Visitas anteriores
|
||||
date=Data
|
||||
description=Descrição
|
||||
new=Novo
|
||||
addVisit=Adicionar visita
|
||||
editPet=Editar animal
|
||||
ownerInformation=Informações do proprietário
|
||||
visitDate=Data da visita
|
||||
editOwner=Editar proprietário
|
||||
addNewPet=Adicionar novo animal
|
||||
petsAndVisits=Animais e visitas
|
||||
error.404=A página solicitada não foi encontrada.
|
||||
error.500=Ocorreu um erro interno no servidor.
|
||||
error.general=Ocorreu um erro inesperado.
|
||||
51
src/main/resources/messages/messages_ru.properties
Normal file
@@ -0,0 +1,51 @@
|
||||
welcome=Добро пожаловать
|
||||
required=необходимо
|
||||
notFound=не найдено
|
||||
duplicate=уже используется
|
||||
nonNumeric=должно быть все числовое значение
|
||||
duplicateFormSubmission=Дублирование формы не допускается
|
||||
typeMismatch.date=неправильная даные
|
||||
typeMismatch.birthDate=неправильная дата
|
||||
owner=Владелец
|
||||
firstName=Имя
|
||||
lastName=Фамилия
|
||||
address=Адрес
|
||||
city=Город
|
||||
telephone=Телефон
|
||||
owners=Владельцы
|
||||
addOwner=Добавить владельца
|
||||
findOwner=Найти владельца
|
||||
findOwners=Найти владельцев
|
||||
updateOwner=Обновить владельца
|
||||
vets=Ветеринары
|
||||
name=Имя
|
||||
specialties=Специальности
|
||||
none=нет
|
||||
pages=страницы
|
||||
first=Первый
|
||||
next=Следующий
|
||||
previous=Предыдущий
|
||||
last=Последний
|
||||
somethingHappened=Что-то пошло не так...
|
||||
pets=Питомцы
|
||||
home=Главная
|
||||
error=Ошибка
|
||||
telephone.invalid=Телефон должен содержать 10 цифр
|
||||
layoutTitle=PetClinic :: демонстрация Spring Framework
|
||||
pet=Питомец
|
||||
birthDate=Дата рождения
|
||||
type=Тип
|
||||
previousVisits=Предыдущие визиты
|
||||
date=Дата
|
||||
description=Описание
|
||||
new=Новый
|
||||
addVisit=Добавить визит
|
||||
editPet=Редактировать питомца
|
||||
ownerInformation=Информация о владельце
|
||||
visitDate=Дата визита
|
||||
editOwner=Редактировать владельца
|
||||
addNewPet=Добавить нового питомца
|
||||
petsAndVisits=Питомцы и визиты
|
||||
error.404=Запрашиваемая страница не найдена.
|
||||
error.500=Произошла внутренняя ошибка сервера.
|
||||
error.general=Произошла непредвиденная ошибка.
|
||||
51
src/main/resources/messages/messages_tr.properties
Normal file
@@ -0,0 +1,51 @@
|
||||
welcome=hoş geldiniz
|
||||
required=gerekli
|
||||
notFound=bulunamadı
|
||||
duplicate=zaten kullanılıyor
|
||||
nonNumeric=sadece sayısal olmalıdır
|
||||
duplicateFormSubmission=Formun tekrar gönderilmesine izin verilmez
|
||||
typeMismatch.date=geçersiz tarih
|
||||
typeMismatch.birthDate=geçersiz tarih
|
||||
owner=Sahip
|
||||
firstName=Ad
|
||||
lastName=Soyad
|
||||
address=Adres
|
||||
city=Şehir
|
||||
telephone=Telefon
|
||||
owners=Sahipler
|
||||
addOwner=Sahip Ekle
|
||||
findOwner=Sahip Bul
|
||||
findOwners=Sahipleri Bul
|
||||
updateOwner=Sahip Güncelle
|
||||
vets=Veterinerler
|
||||
name=İsim
|
||||
specialties=Uzmanlıklar
|
||||
none=yok
|
||||
pages=sayfalar
|
||||
first=İlk
|
||||
next=Sonraki
|
||||
previous=Önceki
|
||||
last=Son
|
||||
somethingHappened=Bir şey oldu...
|
||||
pets=Evcil Hayvanlar
|
||||
home=Ana Sayfa
|
||||
error=Hata
|
||||
telephone.invalid=Telefon numarası 10 basamaklı olmalıdır
|
||||
layoutTitle=PetClinic :: bir Spring Framework demosu
|
||||
pet=Evcil Hayvan
|
||||
birthDate=Doğum Tarihi
|
||||
type=Tür
|
||||
previousVisits=Önceki Ziyaretler
|
||||
date=Tarih
|
||||
description=Açıklama
|
||||
new=Yeni
|
||||
addVisit=Ziyaret Ekle
|
||||
editPet=Evcil Hayvanı Düzenle
|
||||
ownerInformation=Sahip Bilgileri
|
||||
visitDate=Ziyaret Tarihi
|
||||
editOwner=Sahibi Düzenle
|
||||
addNewPet=Yeni Evcil Hayvan Ekle
|
||||
petsAndVisits=Evcil Hayvanlar ve Ziyaretler
|
||||
error.404=İstenen sayfa bulunamadı.
|
||||
error.500=Sunucuda dahili bir hata oluştu.
|
||||
error.general=Beklenmeyen bir hata oluştu.
|
||||
9532
src/main/resources/static/resources/css/petclinic.css
Normal file
BIN
src/main/resources/static/resources/fonts/montserrat-webfont.eot
Normal file
1283
src/main/resources/static/resources/fonts/montserrat-webfont.svg
Normal file
|
After Width: | Height: | Size: 83 KiB |
BIN
src/main/resources/static/resources/fonts/montserrat-webfont.ttf
Normal file
7875
src/main/resources/static/resources/fonts/varela_round-webfont.svg
Normal file
|
After Width: | Height: | Size: 362 KiB |
BIN
src/main/resources/static/resources/images/favicon.png
Normal file
|
After Width: | Height: | Size: 528 B |
BIN
src/main/resources/static/resources/images/pets.png
Normal file
|
After Width: | Height: | Size: 66 KiB |
|
After Width: | Height: | Size: 3.6 KiB |
|
After Width: | Height: | Size: 6.7 KiB |
66
src/main/resources/static/resources/images/spring-logo.svg
Normal file
@@ -0,0 +1,66 @@
|
||||
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" viewBox="0 0 2674.9 417">
|
||||
<style>
|
||||
.st0, .st1 {
|
||||
fill: #6db33f;
|
||||
}
|
||||
.st3 {
|
||||
fill: #fff;
|
||||
}
|
||||
</style>
|
||||
<g>
|
||||
<path class="st0"
|
||||
d="M366.9,29c-5.8,14.1-13.3,26.6-21.6,37.8c-36.6-37.3-87.8-61-144.3-61C90,5.8-0.7,96-0.7,207.4 c0,58.2,24.9,110.6,64.4,147.6l7.5,6.7c34.9,29.5,80.3,47.4,129.7,47.4c106,0,193.3-82.7,200.8-187.1 C407.7,171.3,392.3,106.4,366.9,29z M92.9,356.7c-5.8,7.5-16.6,8.3-24.1,2.5s-8.3-16.6-2.5-24.1s16.6-8.3,24.1-2.5 C97.5,338.4,98.7,349.2,92.9,356.7z M365.7,296.4c-49.5,66.1-155.9,43.7-223.7,47c0,0-12.1,0.8-24.1,2.5c0,0,4.6-2.1,10.4-4.2 c47.8-16.6,70.3-20,99.4-34.9c54.5-27.9,108.9-89,119.8-152.2c-20.8,60.7-84,113.1-141.4,134.3c-39.5,14.6-110.6,28.7-110.6,28.7 l-2.9-1.7c-48.2-23.7-49.9-128.5,38.3-162.2c38.7-15,75.3-6.7,117.3-16.6c44.5-10.4,96.1-43.7,116.8-87.3 C388.1,120.1,416.4,229,365.7,296.4z"></path>
|
||||
<g>
|
||||
<path class="st1"
|
||||
d="M516.2,286.4c-5-2.5-8.3-8.3-8.3-15.4c0-10,7.9-18.3,18.3-18.3c3.7,0,7.1,1.2,9.6,2.5 c18.7,12.5,38.7,18.7,56.1,18.7c19.1,0,30.4-8.3,30.4-21.2v-0.8c0-15.4-20.8-20.4-43.7-27.4c-28.7-8.3-61.1-20-61.1-57.4v-0.8 c0-37,30.8-59.5,69.4-59.5c20.8,0,42.4,5.8,61.5,15.8c6.2,3.3,10.8,9.1,10.8,17c0,10.4-8.3,18.3-18.7,18.3c-3.7,0-5.8-0.8-8.7-2.1 c-15.8-8.3-32-13.3-45.7-13.3c-17.5,0-27.4,8.3-27.4,19.1v0.8c0,14.6,21.2,20.4,44.1,27.9c28.7,8.7,60.7,22,60.7,57v0.8 c0,41.2-32,61.5-72.3,61.5C565.7,309.7,538.6,301.8,516.2,286.4z"></path>
|
||||
<path class="st1"
|
||||
d="M680,129.7c0-12.5,9.6-22.5,22-22.5s22.5,10,22.5,22.5V143c14.6-20.4,34.9-36.6,66.5-36.6 c45.7,0,90.6,36.2,90.6,101.5v0.8c0,64.9-44.5,101.5-90.6,101.5c-32.4,0-52.8-16.2-66.5-34.5v69c0,12.5-10,22.5-22.5,22.5 c-12.1,0-22-9.6-22-22.5V129.7z M836.8,208.7v-0.8c0-37.8-25.4-62.4-55.7-62.4c-30.4,0-57,25.4-57,62.4v0.8 c0,37.4,26.6,62.4,57,62.4C811.4,271.5,836.8,247.3,836.8,208.7z"></path>
|
||||
<path class="st1"
|
||||
d="M899.1,129.7c0-12.5,9.6-22.5,22-22.5s22.5,10,22.5,22.5v10.8c2.1-16.6,29.5-33.3,49.1-33.3 c14.1,0,22,9.1,22,22c0,11.6-7.9,19.5-17.9,21.6c-32,5.4-53.6,33.3-53.6,71.9v64.4c0,12.1-10,22-22.5,22c-12.1,0-22-9.6-22-22 V129.7H899.1z"></path>
|
||||
<path class="st1"
|
||||
d="M1032.6,130.1c0-12.5,9.6-22.5,22-22.5s22.5,10,22.5,22.5v157.6c0,12.5-10,22-22.5,22c-12.1,0-22-9.6-22-22 V130.1z"></path>
|
||||
<path class="st1"
|
||||
d="M1100,130.1c0-12.5,9.6-22.5,22-22.5s22.5,10,22.5,22.5v9.1c12.5-18.3,30.8-32,61.1-32 c44.1,0,69.4,29.5,69.4,74.8v105.2c0,12.5-9.6,22-22,22s-22.5-9.6-22.5-22v-91.5c0-30.4-15-47.8-42-47.8 c-25.8,0-44.1,18.3-44.1,48.6v91.1c0,12.5-10,22-22.5,22c-12.1,0-22-9.6-22-22L1100,130.1L1100,130.1z"></path>
|
||||
<path class="st1"
|
||||
d="M1472.1,106.8c-12.5,0-22.5,10-22.5,22.5v13.3c-14.6-20.4-34.9-36.6-66.5-36.6c-45.7,0-90.6,36.2-90.6,101.5 v0.8c0,64.9,44.5,101.5,90.6,101.5c32.4,0,52.8-16.2,66.5-34.1c-2.1,35.3-23.7,53.6-61.5,53.6c-22.5,0-42-5.4-59.9-15.4 c-2.1-1.2-5-1.7-7.9-1.7c-10.4,0-19.1,8.3-19.1,18.3c0,8.7,5,15,12.5,17.9c23.7,11.6,48.2,17.5,75.7,17.5 c35.3,0,62.8-8.3,80.3-26.2c16.2-16.2,24.9-40.7,24.9-73.6V129.7C1494.6,116.8,1484.6,106.8,1472.1,106.8z M1393.5,271 c-30.8,0-55.7-24.1-55.7-62.8v-0.8c0-37.8,25.4-62.4,55.7-62.4s57,25.4,57,62.4v0.8C1450.9,245.7,1424.3,271,1393.5,271z"></path>
|
||||
<path class="st1"
|
||||
d="M1077.5,53.6c0,12.5-10,22.5-22.5,22.5s-22.5-10-22.5-22.5s10-22.5,22.5-22.5 C1067.1,30.7,1077.5,40.7,1077.5,53.6z"></path>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st1"
|
||||
d="M1545.7,153.8c-12.5,0-22.9-10.4-22.9-22.9c0-12.9,10.4-22.9,22.9-22.9c12.9,0,22.9,10.4,22.9,22.9 S1558.6,153.8,1545.7,153.8z M1545.7,111.4c-10.8,0-19.5,8.7-19.5,19.5s8.7,19.5,19.5,19.5s19.5-8.7,19.5-19.5 C1565.2,119.7,1556.5,111.4,1545.7,111.4z M1551.9,143.8l-6.7-10.4h-4.6v10.4h-3.7v-26.2h10.8c4.6,0,8.7,3.3,8.7,7.9 c0,5.8-5.4,7.9-6.7,7.9l7.1,10.4H1551.9L1551.9,143.8z M1547.4,120.9h-6.7v9.1h7.1c2.1,0,4.6-1.7,4.6-4.6 C1552.4,122.6,1549.9,120.9,1547.4,120.9z"></path>
|
||||
</g>
|
||||
<g>
|
||||
<path class="st1"
|
||||
d="M1652.3,260.1c0,20-12.8,34.1-30,34.1c-10.4,0-18.8-5.2-23.7-13.7v12.2h-9.4v-88h9.4v35.1 c4.9-8.6,13.2-13.7,23.7-13.7C1639.4,226.1,1652.3,240.2,1652.3,260.1z M1642.3,260.1c0-15-9.1-25.6-21.8-25.6 c-12.8,0-21.9,10.6-21.9,25.6s9.1,25.7,21.9,25.7C1633.3,285.8,1642.3,275.1,1642.3,260.1z"></path>
|
||||
<path class="st1"
|
||||
d="M1668,313.3l2.3-8.1c2.3,1.1,4.9,1.6,7.7,1.6c4.2,0,6.9-1.4,9.4-5.8l3.8-8.1l-28.3-65.3h10.4l22.8,54.1 l21.5-54.1h10.2l-29.7,72.4c-4.5,11.1-10.8,15.2-19.8,15.4C1674.6,315.4,1671,314.6,1668,313.3z"></path>
|
||||
<path class="st1"
|
||||
d="M1861.3,206.2l-38.1,86.5h-10.7l-38.1-86.5h10.7l32.9,74.4l32.7-74.4L1861.3,206.2L1861.3,206.2z"></path>
|
||||
<path class="st1"
|
||||
d="M1877.1,206.2h9.8l32.1,60.3l32.1-60.3h9.8v86.5h-9.8v-65.3l-32.1,60.3l-32.1-60.3v65.3h-9.8V206.2z"></path>
|
||||
<path class="st1"
|
||||
d="M1977.2,227.6h10.1l16.2,52.5l17.8-52.5h8.2l17.8,52.5l16.2-52.5h10.1l-21.9,65.1h-8.9l-17.2-52l-17.5,52 h-8.9L1977.2,227.6z"></path>
|
||||
<path class="st1"
|
||||
d="M2140.1,253.1v39.7h-9.4v-10.2c-4.7,7.7-14.4,11.7-22.9,11.7c-13.7,0-23.8-7.9-23.8-20.8 c0-13,11.6-21.7,25.6-21.7c7,0,14.5,1.5,21.2,3.7v-2.4c0-8.8-3.5-18.9-17.6-18.9c-6.5,0-13.1,2.9-19,5.9l-3.8-7.7 c9.3-4.7,17.1-6.3,23.4-6.3C2131.4,226.1,2140.1,237.3,2140.1,253.1z M2130.7,272.3v-9.9c-5.9-1.6-12.6-2.6-19.6-2.6 c-9.7,0-17.9,5.5-17.9,13.3c0,8.1,7,12.8,16.2,12.8C2118,285.9,2128.2,281.5,2130.7,272.3z"></path>
|
||||
<path class="st1"
|
||||
d="M2194.9,226.1v8.4c-14.7,0-25.2,9.1-25.2,21.8v36.4h-9.4v-65.1h9.4v12.7 C2173.6,231.7,2182.9,226.1,2194.9,226.1z"></path>
|
||||
<path class="st1"
|
||||
d="M2257.8,278l5.8,6.2c-5.7,6.2-17.1,10.1-26.2,10.1c-17.4,0-33-14.2-33-34.2c0-19.4,14.6-33.9,32.1-33.9 c19.6,0,30.8,14.9,30.8,37.6H2214c1.4,12.7,10.3,22,23.2,22C2245,285.8,2253.8,282.4,2257.8,278z M2214.3,255.3h43.8 c-1.3-11.7-8.2-20.8-21.2-20.8C2225.4,234.6,2216.1,242.7,2214.3,255.3z"></path>
|
||||
<path class="st1"
|
||||
d="M2344.6,215.6h-29.1v-9.3h68v9.3h-29.1v77.2h-9.8L2344.6,215.6L2344.6,215.6z"></path>
|
||||
<path class="st1"
|
||||
d="M2451.6,253.1v39.7h-9.4v-10.2c-4.7,7.7-14.4,11.7-22.9,11.7c-13.7,0-23.8-7.9-23.8-20.8 c0-13,11.6-21.7,25.6-21.7c7,0,14.5,1.5,21.2,3.7v-2.4c0-8.8-3.5-18.9-17.6-18.9c-6.5,0-13.1,2.9-19,5.9l-3.8-7.7 c9.3-4.7,17.1-6.3,23.4-6.3C2442.9,226.1,2451.6,237.3,2451.6,253.1z M2442.2,272.3v-9.9c-5.9-1.6-12.6-2.6-19.6-2.6 c-9.7,0-17.9,5.5-17.9,13.3c0,8.1,7,12.8,16.2,12.8C2429.4,285.9,2439.6,281.5,2442.2,272.3z"></path>
|
||||
<path class="st1"
|
||||
d="M2526.3,251.3v41.4h-9.4v-40.2c0-10.6-6.7-18-16.2-18c-11,0-20.1,7.7-20.1,16.7v41.4h-9.4v-65.1h9.4v10.4 c3.8-6.9,12.2-12,21.4-12C2516.2,226.1,2526.3,236.6,2526.3,251.3z"></path>
|
||||
<path class="st1"
|
||||
d="M2542.6,285.3l38.4-48.7h-37.6v-8.9h50.4v7.4l-38.5,48.7h38.8v8.9h-51.4L2542.6,285.3L2542.6,285.3z"></path>
|
||||
<path class="st1"
|
||||
d="M2665.4,227.6v65.1h-9.4v-10.4c-3.8,6.9-12.2,12-21.4,12c-14.4,0-24.4-10.4-24.4-25.2v-41.4h9.4v40.2 c0,10.6,6.7,18,16.2,18c11,0,20.1-7.7,20.1-16.7v-41.4h9.5V227.6z"></path>
|
||||
</g>
|
||||
</g>
|
||||
<path class="st3"
|
||||
d="M92.9,356.7c-5.8,7.5-16.6,8.3-24.1,2.5s-8.3-16.6-2.5-24.1s16.6-8.3,24.1-2.5 C97.5,338.4,98.7,349.2,92.9,356.7z"></path>
|
||||
<path class="st3"
|
||||
d="M365.7,296.4c-49.5,66.1-155.9,43.7-223.7,47c0,0-12.1,0.8-24.1,2.5c0,0,4.6-2.1,10.4-4.2 c47.8-16.6,70.3-20,99.4-34.9c54.5-27.9,108.9-89,119.8-152.2c-20.8,60.7-84,113.1-141.4,134.3c-39.5,14.6-110.6,28.7-110.6,28.7 l-2.9-1.7c-48.2-23.7-49.9-128.5,38.3-162.2c38.7-15,75.3-6.7,117.3-16.6c44.5-10.4,96.1-43.7,116.8-87.3 C388.1,120.1,416.4,229,365.7,296.4z"></path>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 7.7 KiB |
21
src/main/resources/templates/error.html
Normal file
@@ -0,0 +1,21 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns:th="https://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'error')}">
|
||||
|
||||
<body>
|
||||
<img src="../static/resources/images/pets.png" th:src="@{/resources/images/pets.png}" />
|
||||
<!-- Title: Something happened -->
|
||||
<h2 th:text="#{somethingHappened}">Something happened...</h2>
|
||||
|
||||
<!-- Status-specific error message -->
|
||||
<p th:switch="${status}">
|
||||
<span th:case="404" th:text="#{error.404}">The requested page was not found.</span>
|
||||
<span th:case="500" th:text="#{error.500}">An internal server error occurred.</span>
|
||||
<span th:case="*" th:text="#{error.general}">An unexpected error occurred.</span>
|
||||
</p>
|
||||
|
||||
<!-- Exception message (for developers) -->
|
||||
<p th:text="${message}">Exception message</p>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
27
src/main/resources/templates/fragments/inputField.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns:th="https://www.thymeleaf.org">
|
||||
|
||||
<body>
|
||||
<form>
|
||||
<th:block th:fragment="input (label, name, type)">
|
||||
<div th:with="valid=${!#fields.hasErrors(name)}" th:class="${'form-group' + (valid ? '' : ' has-error')}"
|
||||
class="form-group">
|
||||
<label th:for="${name}" class="col-sm-2 control-label" th:text="${label}">Label</label>
|
||||
<div class="col-sm-10">
|
||||
<div th:switch="${type}">
|
||||
<input th:case="'text'" class="form-control" type="text" th:field="*{__${name}__}" />
|
||||
<input th:case="'date'" class="form-control" type="date" th:field="*{__${name}__}" />
|
||||
</div>
|
||||
<span th:if="${valid}" class="fa fa-ok form-control-feedback" aria-hidden="true"></span>
|
||||
<th:block th:if="${!valid}">
|
||||
<span class="fa fa-remove form-control-feedback" aria-hidden="true"></span>
|
||||
<span class="help-inline" th:errors="*{__${name}__}" th:text="#{error}">Error</span>
|
||||
</th:block>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
</form>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
88
src/main/resources/templates/fragments/layout.html
Normal file
@@ -0,0 +1,88 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html th:fragment="layout (template, menu)" xmlns:th="https://www.thymeleaf.org">
|
||||
|
||||
<head>
|
||||
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
||||
<meta charset="utf-8">
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<link rel="shortcut icon" type="image/x-icon" th:href="@{/resources/images/favicon.png}">
|
||||
<title th:text="#{layoutTitle}">PetClinic :: a Spring Framework demonstration</title>
|
||||
<link th:href="@{/webjars/font-awesome/css/font-awesome.min.css}" rel="stylesheet">
|
||||
<link rel="stylesheet" th:href="@{/resources/css/petclinic.css}" />
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
||||
<nav class="navbar navbar-expand-lg navbar-dark" role="navigation">
|
||||
<div class="container-fluid">
|
||||
<a class="navbar-brand" th:href="@{/}"><span></span></a>
|
||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#main-navbar">
|
||||
<span class="navbar-toggler-icon"></span>
|
||||
</button>
|
||||
<div class="collapse navbar-collapse" id="main-navbar" style>
|
||||
|
||||
<ul class="navbar-nav me-auto mb-2 mb-lg-0" th:remove="all">
|
||||
|
||||
<li th:fragment="menuItem (link,active,title,glyph,text)" th:class="nav-item">
|
||||
<a th:class="${active==menu ? 'nav-link active' : 'nav-link'}" th:href="@{__${link}__}" th:title="${title}">
|
||||
<span th:class="'fa fa-'+${glyph}" class="fa fa-home"></span>
|
||||
<span th:text="${text}">Template</span>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav me-auto">
|
||||
|
||||
<li th:replace="~{::menuItem ('/','home','home page','home',#{home})}">
|
||||
<span class="fa fa-home" aria-hidden="true"></span>
|
||||
<span th:text="#{home}">Home</span>
|
||||
</li>
|
||||
|
||||
<li th:replace="~{::menuItem ('/owners/find','owners','find owners','search',#{findOwners})}">
|
||||
<span class="fa fa-search" aria-hidden="true"></span>
|
||||
<span th:text="#{findOwners}">Find owners</span>
|
||||
</li>
|
||||
|
||||
<li th:replace="~{::menuItem ('/vets.html','vets','veterinarians','th-list',#{vets})}">
|
||||
<span class="fa fa-th-list" aria-hidden="true"></span>
|
||||
<span th:text="#{vets}">Veterinarians</span>
|
||||
</li>
|
||||
|
||||
<li
|
||||
th:replace="~{::menuItem ('/oups','error','trigger a RuntimeException to see how it is handled','exclamation-triangle',#{error})}">
|
||||
<span class="fa exclamation-triangle" aria-hidden="true"></span>
|
||||
<span th:text="#{error}">Error</span>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</nav>
|
||||
<div class="container-fluid">
|
||||
<div class="container xd-container">
|
||||
|
||||
<th:block th:insert="${template}" />
|
||||
|
||||
<br />
|
||||
<br />
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12 text-center">
|
||||
<img src="../static/images/spring-logo.svg" th:src="@{/resources/images/spring-logo.svg}"
|
||||
alt="VMware Tanzu Logo" class="logo">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script th:src="@{/webjars/bootstrap/dist/js/bootstrap.bundle.min.js}"></script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
27
src/main/resources/templates/fragments/selectField.html
Normal file
@@ -0,0 +1,27 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns:th="https://www.thymeleaf.org">
|
||||
|
||||
<body>
|
||||
<form>
|
||||
<th:block th:fragment="select (label, name, items)">
|
||||
<div th:with="valid=${!#fields.hasErrors(name)}" th:class="${'form-group' + (valid ? '' : ' has-error')}"
|
||||
class="form-group">
|
||||
<label th:for="${name}" class="col-sm-2 control-label" th:text="${label}">Label</label>
|
||||
|
||||
<div class="col-sm-10">
|
||||
<select th:field="*{__${name}__}">
|
||||
<option th:each="item : ${items}" th:value="${item}" th:text="${item}">dog</option>
|
||||
</select>
|
||||
<span th:if="${valid}" class="fa fa-ok form-control-feedback" aria-hidden="true"></span>
|
||||
<th:block th:if="${!valid}">
|
||||
<span class="fa fa-remove form-control-feedback" aria-hidden="true"></span>
|
||||
<span class="help-inline" th:errors="*{__${name}__}" th:text="#{error}">Error</span>
|
||||
</th:block>
|
||||
</div>
|
||||
</div>
|
||||
</th:block>
|
||||
</form>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,25 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns:th="https://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'owners')}">
|
||||
|
||||
<body>
|
||||
|
||||
<h2 th:text="#{owner}">Owner</h2>
|
||||
<form th:object="${owner}" class="form-horizontal" id="add-owner-form" method="post">
|
||||
<div class="form-group has-feedback">
|
||||
<input th:replace="~{fragments/inputField :: input (#{firstName}, 'firstName', 'text')}" />
|
||||
<input th:replace="~{fragments/inputField :: input (#{lastName}, 'lastName', 'text')}" />
|
||||
<input th:replace="~{fragments/inputField :: input (#{address}, 'address', 'text')}" />
|
||||
<input th:replace="~{fragments/inputField :: input (#{city}, 'city', 'text')}" />
|
||||
<input th:replace="~{fragments/inputField :: input (#{telephone}, 'telephone', 'text')}" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button th:with="text=${owner['new']} ? #{addOwner} : #{updateOwner}" class="btn btn-primary" type="submit"
|
||||
th:text="${text}">Add Owner</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
35
src/main/resources/templates/owners/findOwners.html
Normal file
@@ -0,0 +1,35 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns:th="https://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'owners')}">
|
||||
|
||||
<body>
|
||||
|
||||
<h2 th:text="#{findOwners}">Find Owners</h2>
|
||||
|
||||
<form th:object="${owner}" th:action="@{/owners}" method="get" class="form-horizontal" id="search-owner-form">
|
||||
<div class="form-group">
|
||||
<div class="control-group" id="lastNameGroup">
|
||||
<label class="col-sm-2 control-label" th:text="#{lastName}">Last name </label>
|
||||
<div class="col-sm-10">
|
||||
<input class="form-control" th:field="*{lastName}" size="30" maxlength="80" />
|
||||
<span class="help-inline">
|
||||
<div th:if="${#fields.hasAnyErrors()}">
|
||||
<p th:each="err : ${#fields.allErrors()}" th:text="${err}">Error</p>
|
||||
</div>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button type="submit" class="btn btn-primary" th:text="#{findOwner}">Find Owner</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<a class="btn btn-primary" th:href="@{/owners/new}" th:text="#{addOwner}">Add Owner</a>
|
||||
|
||||
</form>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
96
src/main/resources/templates/owners/ownerDetails.html
Normal file
@@ -0,0 +1,96 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns:th="https://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'owners')}">
|
||||
|
||||
<body>
|
||||
|
||||
<h2 th:text="#{ownerInformation}">Owner Information</h2>
|
||||
|
||||
<div th:if="${message}" class="alert alert-success" id="success-message">
|
||||
<span th:text="${message}"></span>
|
||||
</div>
|
||||
|
||||
<div th:if="${error}" class="alert alert-danger" id="error-message">
|
||||
<span th:text="${error}"></span>
|
||||
</div>
|
||||
|
||||
<table class="table table-striped" th:object="${owner}">
|
||||
<tr>
|
||||
<th th:text="#{name}">Name</th>
|
||||
<td><b th:text="*{firstName + ' ' + lastName}"></b></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th th:text="#{address}">Address</th>
|
||||
<td th:text="*{address}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th th:text="#{city}">City</th>
|
||||
<td th:text="*{city}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th th:text="#{telephone}">Telephone</th>
|
||||
<td th:text="*{telephone}"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<a th:href="@{__${owner.id}__/edit}" class="btn btn-primary" th:text="#{editOwner}">Edit
|
||||
Owner</a>
|
||||
<a th:href="@{__${owner.id}__/pets/new}" class="btn btn-primary" th:text="#{addNewPet}">Add
|
||||
New Pet</a>
|
||||
|
||||
<br />
|
||||
<br />
|
||||
<br />
|
||||
<h2 th:text="#{petsAndVisits}">Pets and Visits</h2>
|
||||
|
||||
<table class="table table-striped">
|
||||
|
||||
<tr th:each="pet : ${owner.pets}">
|
||||
<td valign="top">
|
||||
<dl class="dl-horizontal">
|
||||
<dt th:text="#{name}">Name</dt>
|
||||
<dd th:text="${pet.name}"></dd>
|
||||
<dt th:text="#{birthDate}">Birth Date</dt>
|
||||
<dd th:text="${#temporals.format(pet.birthDate, 'yyyy-MM-dd')}"></dd>
|
||||
<dt th:text="#{type}">Type</dt>
|
||||
<dd th:text="${pet.type}"></dd>
|
||||
</dl>
|
||||
</td>
|
||||
<td valign="top">
|
||||
<table class="table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th th:text="#{visitDate}">Visit Date</th>
|
||||
<th th:text="#{description}">Description</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr th:each="visit : ${pet.visits}">
|
||||
<td th:text="${#temporals.format(visit.date, 'yyyy-MM-dd')}"></td>
|
||||
<td th:text="${visit?.description}"></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><a th:href="@{__${owner.id}__/pets/__${pet.id}__/edit}" th:text="#{editPet}">Edit Pet</a></td>
|
||||
<td><a th:href="@{__${owner.id}__/pets/__${pet.id}__/visits/new}" th:text="#{addVisit}">Add Visit</a></td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</table>
|
||||
<script>
|
||||
// Function to hide the success and error messages after 3 seconds
|
||||
function hideMessages() {
|
||||
setTimeout(function () {
|
||||
document.getElementById("success-message").style.display = "none";
|
||||
document.getElementById("error-message").style.display = "none";
|
||||
}, 3000); // 3000 milliseconds (3 seconds)
|
||||
}
|
||||
|
||||
// Call the function to hide messages
|
||||
hideMessages();
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
</html>
|
||||
61
src/main/resources/templates/owners/ownersList.html
Normal file
@@ -0,0 +1,61 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns:th="https://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'owners')}">
|
||||
|
||||
<body>
|
||||
|
||||
<h2 th:text="#{owners}">Owners</h2>
|
||||
|
||||
<table id="owners" class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th th:text="#{name}" style="width: 150px;">Name</th>
|
||||
<th th:text="#{address}" style="width: 200px;">Address</th>
|
||||
<th th:text="#{city}">City</th>
|
||||
<th th:text="#{telephone}" style="width: 120px">Telephone</th>
|
||||
<th th:text="#{pets}">Pets</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:each="owner : ${listOwners}">
|
||||
<td>
|
||||
<a th:href="@{/owners/__${owner.id}__}" th:text="${owner.firstName + ' ' + owner.lastName}" /></a>
|
||||
</td>
|
||||
<td th:text="${owner.address}" />
|
||||
<td th:text="${owner.city}" />
|
||||
<td th:text="${owner.telephone}" />
|
||||
<td><span th:text="${#strings.listJoin(owner.pets, ', ')}" /></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div th:if="${totalPages > 1}">
|
||||
<span th:text="#{pages}">Pages:</span>
|
||||
<span>[</span>
|
||||
<span th:each="i: ${#numbers.sequence(1, totalPages)}">
|
||||
<a th:if="${currentPage != i}" th:href="@{'/owners?page=' + ${i}}">[[${i}]]</a>
|
||||
<span th:unless="${currentPage != i}">[[${i}]]</span>
|
||||
</span>
|
||||
<span>] </span>
|
||||
<span>
|
||||
<a th:if="${currentPage > 1}" th:href="@{'/owners?page=1'}" th:title="#{first}" class="fa fa-fast-backward"></a>
|
||||
<span th:unless="${currentPage > 1}" th:title="#{first}" class="fa fa-fast-backward"></span>
|
||||
</span>
|
||||
<span>
|
||||
<a th:if="${currentPage > 1}" th:href="@{'/owners?page=__${currentPage - 1}__'}" th:title="#{previous}"
|
||||
class="fa fa-step-backward"></a>
|
||||
<span th:unless="${currentPage > 1}" th:title="#{previous}" class="fa fa-step-backward"></span>
|
||||
</span>
|
||||
<span>
|
||||
<a th:if="${currentPage < totalPages}" th:href="@{'/owners?page=__${currentPage + 1}__'}" th:title="#{next}"
|
||||
class="fa fa-step-forward"></a>
|
||||
<span th:unless="${currentPage < totalPages}" th:title="#{next}" class="fa fa-step-forward"></span>
|
||||
</span>
|
||||
<span>
|
||||
<a th:if="${currentPage < totalPages}" th:href="@{'/owners?page=__${totalPages}__'}" th:title="#{last}"
|
||||
class="fa fa-fast-forward"></a>
|
||||
<span th:unless="${currentPage < totalPages}" th:title="#{last}" class="fa fa-fast-forward"></span>
|
||||
</span>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
34
src/main/resources/templates/pets/createOrUpdatePetForm.html
Normal file
@@ -0,0 +1,34 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns:th="https://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'owners')}">
|
||||
|
||||
<body>
|
||||
|
||||
<h2>
|
||||
<th:block th:if="${pet['new']}" th:text="#{new}">New </th:block>
|
||||
<span th:text="#{pet}">Pet</span>
|
||||
</h2>
|
||||
<form th:object="${pet}" class="form-horizontal" method="post">
|
||||
<input type="hidden" name="id" th:value="*{id}" />
|
||||
<div class="form-group has-feedback">
|
||||
<div class="form-group">
|
||||
<label class="col-sm-2 control-label" th:text="#{owner}">Owner</label>
|
||||
<div class="col-sm-10">
|
||||
<span th:text="${owner?.firstName + ' ' + owner?.lastName}" />
|
||||
</div>
|
||||
</div>
|
||||
<input th:replace="~{fragments/inputField :: input ('Name', 'name', 'text')}" />
|
||||
<input th:replace="~{fragments/inputField :: input ('Birth Date', 'birthDate', 'date')}" />
|
||||
<input th:replace="~{fragments/selectField :: select ('Type', 'type', ${types})}" />
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<button th:with="text=${pet['new']} ? 'Add Pet' : 'Update Pet'" class="btn btn-primary" type="submit"
|
||||
th:text="${text}">Add Pet</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,59 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns:th="https://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'owners')}">
|
||||
|
||||
<body>
|
||||
|
||||
<h2>
|
||||
<th:block th:if="${visit['new']}" th:text="#{new}">New </th:block>
|
||||
Visit
|
||||
</h2>
|
||||
|
||||
<b th:text="#{pet}">Pet</b>
|
||||
<table class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th th:text="#{name}">Name</th>
|
||||
<th th:text="#{birthDate}">Birth Date</th>
|
||||
<th th:text="#{type}">Type</th>
|
||||
<th th:text="#{owner}">Owner</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tr>
|
||||
<td th:text="${pet.name}"></td>
|
||||
<td th:text="${#temporals.format(pet.birthDate, 'yyyy-MM-dd')}"></td>
|
||||
<td th:text="${pet.type}"></td>
|
||||
<td th:text="${owner?.firstName + ' ' + owner?.lastName}"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<form th:object="${visit}" class="form-horizontal" method="post">
|
||||
<div class="form-group has-feedback">
|
||||
<input th:replace="~{fragments/inputField :: input ('Date', 'date', 'date')}" />
|
||||
<input th:replace="~{fragments/inputField :: input ('Description', 'description', 'text')}" />
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-sm-offset-2 col-sm-10">
|
||||
<input type="hidden" name="petId" th:value="${pet.id}" />
|
||||
<button class="btn btn-primary" type="submit" th:text="#{addVisit}">Add Visit</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<br />
|
||||
<b th:text="#{previousVisits}">Previous Visits</b>
|
||||
<table class="table table-striped">
|
||||
<tr>
|
||||
<th th:text="#{date}">Date</th>
|
||||
<th th:text="#{description}">Description</th>
|
||||
</tr>
|
||||
<tr th:if="${!visit['new']}" th:each="visit : ${pet.visits}">
|
||||
<td th:text="${#temporals.format(visit.date, 'yyyy-MM-dd')}"></td>
|
||||
<td th:text=" ${visit.description}"></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
57
src/main/resources/templates/vets/vetList.html
Normal file
@@ -0,0 +1,57 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns:th="https://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'vets')}">
|
||||
|
||||
<body>
|
||||
|
||||
<h2 th:text="#{vets}">Veterinarians</h2>
|
||||
|
||||
<table id="vets" class="table table-striped">
|
||||
<thead>
|
||||
<tr>
|
||||
<th th:text="#{name}">Name</th>
|
||||
<th th:text="#{specialties}">Specialties</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr th:each="vet : ${listVets}">
|
||||
<td th:text="${vet.firstName + ' ' + vet.lastName}"></td>
|
||||
<td>
|
||||
<span th:each="specialty : ${vet.specialties}" th:text="${specialty.name + ' '}" /> <span
|
||||
th:if="${vet.nrOfSpecialties == 0}" th:text="#{none}">none</span>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div th:if="${totalPages > 1}">
|
||||
<span th:text="#{pages}">Pages:</span>
|
||||
<span>[</span>
|
||||
<span th:each="i: ${#numbers.sequence(1, totalPages)}">
|
||||
<a th:if="${currentPage != i}" th:href="@{'/vets.html?page=__${i}__'}">[[${i}]]</a>
|
||||
<span th:unless="${currentPage != i}">[[${i}]]</span>
|
||||
</span>
|
||||
<span>] </span>
|
||||
<span>
|
||||
<a th:if="${currentPage > 1}" th:href="@{'/vets.html?page=1'}" th:title="#{first}"
|
||||
class="fa fa-fast-backward"></a>
|
||||
<span th:unless="${currentPage > 1}" th:title="#{first}" class="fa fa-fast-backward"></span>
|
||||
</span>
|
||||
<span>
|
||||
<a th:if="${currentPage > 1}" th:href="@{'/vets.html?page=__${currentPage - 1}__'}" th:title="#{previous}"
|
||||
class="fa fa-step-backward"></a>
|
||||
<span th:unless="${currentPage > 1}" th:title="#{previous}" class="fa fa-step-backward"></span>
|
||||
</span>
|
||||
<span>
|
||||
<a th:if="${currentPage < totalPages}" th:href="@{'/vets.html?page=__${currentPage + 1}__'}" th:title="#{next}"
|
||||
class="fa fa-step-forward"></a>
|
||||
<span th:unless="${currentPage < totalPages}" th:title="#{next}" class="fa fa-step-forward"></span>
|
||||
</span>
|
||||
<span>
|
||||
<a th:if="${currentPage < totalPages}" th:href="@{'/vets.html?page=__${totalPages}__'}" th:title="#{last}"
|
||||
class="fa fa-fast-forward"></a>
|
||||
<span th:unless="${currentPage < totalPages}" th:title="#{last}" class="fa fa-fast-forward"></span>
|
||||
</span>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
16
src/main/resources/templates/welcome.html
Normal file
@@ -0,0 +1,16 @@
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns:th="https://www.thymeleaf.org" th:replace="~{fragments/layout :: layout (~{::body},'home')}">
|
||||
|
||||
<body>
|
||||
|
||||
<h2 th:text="#{welcome}">Welcome</h2>
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<img class="img-responsive" src="../static/resources/images/pets.png" th:src="@{/resources/images/pets.png}" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||