Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
e8ef694
3_0_1_correction
JavaWebinar Jul 26, 2017
3d3fc9c
3_0_2_constructor_di
JavaWebinar Jul 26, 2017
de0b637
3_01_HW2_repository
JavaWebinar Jul 26, 2017
4aaec58
3_02_HW2_meal_layers
JavaWebinar Jul 26, 2017
d367013
3_03_HW2_optional_MealServlet
JavaWebinar Jul 26, 2017
1494610
3_04_HW2_optional_filter
JavaWebinar Jul 26, 2017
2f9c7b6
3_05_HW2_optional_select_user
JavaWebinar Jul 26, 2017
f44ed8a
3_06_bean_life_cycle
JavaWebinar Jul 26, 2017
4b3c5ec
3_07_add_junit
JavaWebinar Jul 26, 2017
975d9bc
3_08_add_spring_test
JavaWebinar Jul 26, 2017
bfc2717
3_09_add_postgresql
JavaWebinar Jul 26, 2017
101b01c
3_10_db_implementation
JavaWebinar Jul 26, 2017
61689b2
3_11_test_UserService
JavaWebinar Jul 26, 2017
862db3d
3_12_test_logging
JavaWebinar Jul 26, 2017
590db2e
3_13_fix_servlet
JavaWebinar Aug 1, 2017
c90938b
Add github tools integration
JavaWebinar Aug 3, 2017
20cc432
Update README.md
JavaWebinar Aug 3, 2017
417e33b
4_0_fix
JavaWebinar Aug 3, 2017
bd8e4b5
4_1_HW3
JavaWebinar Aug 3, 2017
88a8be1
4_2_HW3_optional
JavaWebinar Aug 3, 2017
3bace3a
4_3_improve_code
JavaWebinar Aug 3, 2017
71e6774
4_4_init_and_populate_db
JavaWebinar Aug 3, 2017
f1991f0
4_5_create_mock_test_ctx
JavaWebinar Aug 3, 2017
c0e3455
4_6_add_jpa
JavaWebinar Aug 3, 2017
ae4b519
4_7_add_named_query_and_transaction
JavaWebinar Aug 3, 2017
fe33a16
4_8_add_hsqldb
JavaWebinar Aug 3, 2017
b8a7a8d
5_0_fix
JavaWebinar Aug 9, 2017
2fdb59f
5_1_HW4
JavaWebinar Aug 9, 2017
652b13e
5_2_fix_hibernate_issue
JavaWebinar Aug 9, 2017
9178c25
5_3_HW4_optional
JavaWebinar Aug 9, 2017
d9fe393
5_4_log_colored
JavaWebinar Aug 9, 2017
1ed7b4f
5_5_profiles_connection_pool
JavaWebinar Aug 9, 2017
2a7f24a
5_6_profile_resolver
JavaWebinar Aug 9, 2017
0d7f6ac
5_7_spring_data_jpa
JavaWebinar Aug 9, 2017
54590a6
5_8_spring_cache
JavaWebinar Aug 9, 2017
423a283
6_01_HW5_data_jpa
JavaWebinar Aug 13, 2017
334762d
6_02_HW5_profile_test
JavaWebinar Aug 13, 2017
82ff1da
6_03_HW5_optional_fix_jdbc_profiles
JavaWebinar Aug 13, 2017
2bb65cf
6_04_update_hsqldb
JavaWebinar Aug 13, 2017
32b1c5a
6_05_HW5_optional_fetch_join
JavaWebinar Aug 13, 2017
1928389
6_06_HW5_graph_batch_size
JavaWebinar Aug 13, 2017
833ba2a
6_07_add_test_validation
JavaWebinar Aug 13, 2017
579faec
6_08_hibernate_cache
JavaWebinar Aug 13, 2017
a9c5db1
6_09_cascade_ddl
JavaWebinar Aug 13, 2017
d255d7a
6_10_spring_web
JavaWebinar Aug 13, 2017
5795863
6_11_jsp_jstl_i18n
JavaWebinar Aug 16, 2017
3e758c9
6_12_tomcat_pool_jndi_cargo
JavaWebinar Aug 16, 2017
2d47ec7
6_13_spring_webmvc
JavaWebinar Aug 16, 2017
c29d71c
6_14_spring_i18n
JavaWebinar Aug 16, 2017
f36f515
Change dependencyci to versioneye
JavaWebinar Aug 28, 2017
04f6061
7_0_1_update_version
JavaWebinar Aug 28, 2017
83538f2
7_0_2_fix_user
JavaWebinar Aug 28, 2017
cc54e21
7_0_3_fix_matcher
JavaWebinar Aug 28, 2017
01a1197
7_0_4_mapping_change
JavaWebinar Aug 28, 2017
bcdd4b5
7_01_HW6_fix_tests
JavaWebinar Aug 28, 2017
7e90fe6
7_02_HW6_meals
JavaWebinar Aug 28, 2017
7aef6dc
7_03_HW6_fix_relative_url_utf8
JavaWebinar Aug 28, 2017
ce602ec
7_04_HW6_optional_add_role
JavaWebinar Aug 28, 2017
9016d9f
7_05_hint_distinct
JavaWebinar Aug 28, 2017
c46c0b8
7_06_HW6_optional_jdbc
JavaWebinar Aug 28, 2017
65c4d1f
7_07_controller_test
JavaWebinar Aug 28, 2017
0ddafa8
7_08_rest_controller
JavaWebinar Aug 28, 2017
b055187
7_09_rest_test_jackson
JavaWebinar Aug 28, 2017
2b2cbb6
7_10_jackson_hibernate
JavaWebinar Aug 28, 2017
644feb4
7_11_jackson_jsr310
JavaWebinar Aug 28, 2017
7a02de3
7_12_test_with_matcher
JavaWebinar Aug 28, 2017
ff10e4e
7_13_soapui_utf8_converter
JavaWebinar Aug 28, 2017
49d93cb
8_0_1_fix_fetch
JavaWebinar Sep 6, 2017
c4e59a1
8_0_2_fix_update
JavaWebinar Sep 6, 2017
6e4d85b
8_01_HW07_controller_test
JavaWebinar Sep 6, 2017
d04f173
8_02_HW07_rest_controller
JavaWebinar Sep 6, 2017
9a6bd05
8_03_jsonassert
JavaWebinar Sep 6, 2017
fb42e4c
8_04_HW07_formatters
JavaWebinar Sep 6, 2017
f16009f
8_05_HW07_soapui_curl
JavaWebinar Sep 6, 2017
7830dd1
8_06_webjars
JavaWebinar Sep 6, 2017
d4694e4
8_07_bootstrap
JavaWebinar Sep 6, 2017
b85a157
8_08_ajax_datatables
JavaWebinar Sep 6, 2017
065286f
8_09_notification
JavaWebinar Sep 6, 2017
675e6da
8_10_add_security
JavaWebinar Sep 6, 2017
627acff
9_0_fix
JavaWebinar Sep 13, 2017
6b06121
9_01_HW8
JavaWebinar Sep 13, 2017
a995393
9_02_HW8_clear_filter
JavaWebinar Sep 13, 2017
7a939ce
9_03_HW8_enable_disable
JavaWebinar Sep 13, 2017
9b1e9f5
9_04_binding
JavaWebinar Sep 13, 2017
1c369be
9_05_update
JavaWebinar Sep 13, 2017
9799e06
9_06_validation
JavaWebinar Sep 13, 2017
b10e88b
9_07_datatable_via_ajax
JavaWebinar Sep 13, 2017
a9f809b
9_08_js_i18n
JavaWebinar Sep 13, 2017
677967b
9_09_min_form_login
JavaWebinar Sep 13, 2017
212f73f
9_10_jsp_form_login
JavaWebinar Sep 13, 2017
3b8d81e
9_11_auth_via_user_service
JavaWebinar Sep 13, 2017
3024550
9_12_spring_security_test
JavaWebinar Sep 13, 2017
b6a5e22
10_0_fix
JavaWebinar Sep 20, 2017
e1f816b
10_01_HW9_binding_ajax
JavaWebinar Sep 20, 2017
40c6894
10_02_HW9_test
JavaWebinar Sep 20, 2017
4814df5
10_03_HW9_datetimepicker
JavaWebinar Sep 20, 2017
c83c815
10_04_json_view
JavaWebinar Sep 20, 2017
f1433e0
10_05_validated_groups
JavaWebinar Sep 20, 2017
5c2ebae
10_06_secure_tag_annotation
JavaWebinar Sep 20, 2017
6d5001b
10_07_interceptor
JavaWebinar Sep 20, 2017
59e8a80
10_08_profile_jsptag
JavaWebinar Sep 20, 2017
cf0c156
10_09_registration
JavaWebinar Sep 20, 2017
247d88c
10_10_not_found_422
JavaWebinar Sep 20, 2017
4fd8717
10_11_global_exception
JavaWebinar Sep 20, 2017
460b119
10_12_controller_advice_exception
JavaWebinar Sep 20, 2017
6f38ffd
10_13_password_encoding
JavaWebinar Sep 20, 2017
f80fe67
10_14_read_write_access
JavaWebinar Sep 20, 2017
a80f31d
10_15_csrf
JavaWebinar Sep 20, 2017
5f29527
11_0_0_fix
JavaWebinar Sep 27, 2017
7a697ac
11_0_1_dateTime_refactoring
JavaWebinar Sep 27, 2017
5c062b8
11_0_2_validation_refactoring
JavaWebinar Sep 27, 2017
71a9b55
11_0_3_test_refactoring
JavaWebinar Sep 27, 2017
a0836d8
11_0_4_error_refactoring
JavaWebinar Sep 27, 2017
757fe1d
11_01_HW10_fix_encoding
JavaWebinar Sep 27, 2017
b2df055
11_02_HW10_validation
JavaWebinar Sep 27, 2017
1b284ca
11_03_HW10_duplicate_email
JavaWebinar Sep 27, 2017
0af12f1
11_04_HW10_duplicate_datetime
JavaWebinar Sep 27, 2017
1e10739
11_05_HW10_change_locale
JavaWebinar Sep 27, 2017
c90cc18
11_06_i18n
JavaWebinar Sep 27, 2017
56dc50f
11_07_XSS
JavaWebinar Sep 27, 2017
c98a6f2
11_08_404
JavaWebinar Sep 27, 2017
898fd91
11_09_auth_user
JavaWebinar Sep 27, 2017
24fe0a3
11_10_restrict_modification
JavaWebinar Sep 28, 2017
b52d776
11_11_heroku
JavaWebinar Sep 28, 2017
09c3ca4
11_12_fix
JavaWebinar Oct 4, 2017
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 26 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
# https://docs.travis-ci.com/user/languages/java/
language: java
jdk: oraclejdk8

#https://dzone.com/articles/travis-ci-tutorial-java-projects
cache:
directories:
- $HOME/.m2

# https://docs.travis-ci.com/user/database-setup/#PostgreSQL
before_script:
- psql -c 'create database topjava' -U postgres
- psql -c 'create user "user"; grant all privileges on database topjava to "user"' -U postgres

# https://docs.travis-ci.com/user/customizing-the-build#Building-Specific-Branches
branches:
only:
- master

#https://docs.travis-ci.com/user/environment-variables#Default-Environment-Variables
env:
- TOPJAVA_ROOT=$TRAVIS_BUILD_DIR

# https://docs.travis-ci.com/user/notifications#Configuring-email-notifications
#notifications:
# email: false
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: java $JAVA_OPTS -Dspring.profiles.active="datajpa,heroku" -DTOPJAVA_ROOT="." -jar target/dependency/webapp-runner.jar --port $PORT target/*.war
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/a3090cdac212404d80d8d289dbc61870)](https://www.codacy.com/app/javawebinar/topjava)
[![Build Status](https://travis-ci.org/JavaWebinar/topjava.svg?branch=master)](https://travis-ci.org/JavaWebinar/topjava)
[![VersionEye](https://www.versioneye.com/user/projects/59a1dbe46725bd0037d98369/badge.svg)](https://www.versioneye.com/user/projects/59a1dbe46725bd0037d98369)

Java Enterprise Online Project
===============================

Expand Down Expand Up @@ -73,7 +77,7 @@ Maven/ Spring/ Security/ JPA(Hibernate)/ REST(Jackson)/ Bootstrap(CSS)/ jQuery +
- Spring Internationalization
- Домашнее задание (HW6 + Optional)

#### 24.08: 7-е занятие
#### 31.08: 7-е занятие
- Разбор домашнего задания HW6 + Optional
- Автогенерация DDL по модели
- Тестирование Spring MVC
Expand All @@ -83,7 +87,7 @@ Maven/ Spring/ Security/ JPA(Hibernate)/ REST(Jackson)/ Bootstrap(CSS)/ jQuery +
- Тестирование через SoapUi. UTF-8
- Домашнее задание (HW7 + Optional)

#### 31.08: 8-е занятие
#### 07.09: 8-е занятие
- Разбор домашнего задания HW7 + Optional
- WebJars. jQuery и JavaScript frameworks
- Bootstrap
Expand All @@ -92,7 +96,7 @@ Maven/ Spring/ Security/ JPA(Hibernate)/ REST(Jackson)/ Bootstrap(CSS)/ jQuery +
- Добавление Spring Security
- Домашнее задание (HW8 + Optional)

#### 07.09: 9-е занятие
#### 014.09: 9-е занятие
- Разбор домашнего задания HW8 + Optional
- Spring Binding
- Spring Validation
Expand All @@ -104,7 +108,7 @@ Maven/ Spring/ Security/ JPA(Hibernate)/ REST(Jackson)/ Bootstrap(CSS)/ jQuery +
- Cookie. Session
- Домашнее задание (HW9 + Optional)

#### 14.09: 10-е занятие
#### 21.09: 10-е занятие
- Разбор домашнего задания HW10 + Optional
- Spring Security Taglib. Method Security Expressions
- Интерсепторы. Редактирование профиля. JSP tag files
Expand All @@ -114,7 +118,7 @@ Maven/ Spring/ Security/ JPA(Hibernate)/ REST(Jackson)/ Bootstrap(CSS)/ jQuery +
- Защита от межсайтовой подделки запросов (CSRF)
- Домашнее задание (HW10)

#### 21.09: Заключительное 11-е занятие
#### 28.09: Заключительное 11-е занятие
- Разбор домашнего задания HW10 + Optional
- Локализация datatables, ошибок валидации
- Защита от XSS (Cross Site Scripting)
Expand All @@ -125,4 +129,4 @@ Maven/ Spring/ Security/ JPA(Hibernate)/ REST(Jackson)/ Bootstrap(CSS)/ jQuery +
- Собеседование. Разработка ПО
- Возможные доработки приложения

[История изменений проекта](https://github.com/JavaOPs/topjava/blob/master/ReleaseNotes.md)
[История изменений проекта](https://github.com/JavaOPs/topjava/blob/master/ReleaseNotes.md)
573 changes: 573 additions & 0 deletions config/Topjava-soapui-project.xml

Large diffs are not rendered by default.

33 changes: 33 additions & 0 deletions config/curl.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
### Test MealRestController (application deployed in application context `topjava`).
> For windows use `Git Bash`

#### get All Users
`curl -s http://localhost:8080/topjava/rest/admin/users --user [email protected]:admin`

#### get Users 100001
`curl -s http://localhost:8080/topjava/rest/admin/users/100001 --user [email protected]:admin`

#### get All Meals
`curl -s http://localhost:8080/topjava/rest/profile/meals --user [email protected]:password`

#### get Meals 100003
`curl -s http://localhost:8080/topjava/rest/profile/meals/100003 --user [email protected]:password`

#### filter Meals
`curl -s "http://localhost:8080/topjava/rest/profile/meals/filter?startDate=2015-05-30&startTime=07:00:00&endDate=2015-05-31&endTime=11:00:00" --user [email protected]:password`

#### get Meals not found
`curl -s -v http://localhost:8080/topjava/rest/profile/meals/100008 --user [email protected]:password`

#### delete Meals
`curl -s -X DELETE http://localhost:8080/rest/profile/meals/100002 --user [email protected]:password`

#### create Meals
`curl -s -X POST -d '{"dateTime":"2015-06-01T12:00","description":"Created lunch","calories":300}' -H 'Content-Type:application/json;charset=UTF-8' http://localhost:8080/topjava/rest/profile/meals --user [email protected]:password`

#### update Meals
`curl -s -X PUT -d '{"dateTime":"2015-05-30T07:00", "description":"Updated breakfast", "calories":200}' -H 'Content-Type: application/json' http://localhost:8080/topjava/rest/profile/meals/100003 --user [email protected]:password`#### update Meals

#### validate with Error
`curl -s -X PUT -d '{"dateTime":"2015-05-30T07:00"}' -H 'Content-Type: application/json' http://localhost:8080/topjava/rest/profile/meals/100003 --user [email protected]:password`
`curl -s -X POST -d '{}' -H 'Content-Type: application/json' http://localhost:8080/topjava/rest/admin/users --user [email protected]:admin`
61 changes: 61 additions & 0 deletions config/messages/app.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
app.title=Calories management
app.footer=Project <a href="https://github.com/JavaOPs/topjava" target=_blank>Maven/ Spring/ Security/ JPA(Hibernate)/ Jackson/jQuery</a> application
app.enter=Enter as
app.profile=profile
app.register=Registration
app.registered=You are registered. Please Sign in.

user.title=Users
user.edit=Edit user
user.add=Add user
user.name=Name
user.email=Email
user.roles=Roles
user.active=Active
user.registered=Registered
user.password=Password
user.caloriesPerDay=Daily calorie limit

userTo.name=Name
userTo.email=Email
userTo.password=Password
userTo.caloriesPerDay=Daily calorie limit

meal.title=Meals
meal.edit=Edit meal
meal.add=Add meal
meal.startDate=From date
meal.endDate=To date
meal.startTime=From time
meal.endTime=To time
meal.description=Description
meal.dateTime=Date/Time
meal.calories=Calories

common.add=Add
common.select=Select
common.search=Search
common.deleted=Record deleted
common.saved=Record saved
common.enabled=Record enabled
common.disabled=Record disabled
common.errorStatus=Error status

error.appError=Application error
error.dataNotFound=Data not found
error.dataError=Data error
error.validationError=Validation error

exception.common.notFound=Not found entity with {0}
exception.user.duplicateEmail=User with this email already exists
exception.user.modificationRestriction=Admin/User modification is forbidden
exception.meal.duplicateDateTime=You already have meal with this date/time

NotEmpty="{0}" must not be empty
NotBlank="{0}" must not be empty
NotNull="{0}" must not be empty
Email= Invalid format of "{0}"
Range="{0}" must be between {2} and {1}
Length="{0}" length must be between {2} and {1}
Size="{0}" size must be between {2} and {1}
SafeHtml="{0}" may has unsafe html content
61 changes: 61 additions & 0 deletions config/messages/app_ru.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
app.title=Подсчет калорий
app.footer=Приложение по проекту <a href="https://github.com/JavaOPs/topjava" target=_blank>Maven/ Spring/ Security/ JPA(Hibernate)/ Jackson/jQuery</a>
app.enter=Войти как
app.profile=профиль
app.register=Регистрирация
app.registered=Вы зарегистрированы. Введите ваш логин/пароль.

user.title=Пользователи
user.edit=Редактирование пользователя
user.add=Добавление пользователя
user.name=Имя
user.email=Почта
user.roles=Роли
user.active=Активный
user.registered=Зарегистрирован
user.password=Пароль
user.caloriesPerDay=Норма калорий в день

userTo.name=Имя
userTo.email=Почта
userTo.password=Пароль
userTo.caloriesPerDay=Норма калорий в день

meal.title=Моя еда
meal.edit=Редактирование еды
meal.add=Добавление еды
meal.startDate=От даты
meal.endDate=До даты
meal.startTime=От времени
meal.endTime=До времени
meal.description=Описание
meal.dateTime=Дата/Время
meal.calories=Калории

common.add=Добавить
common.select=Выбрать
common.search=Искать
common.deleted=Запись удалена
common.saved=Запись сохранена
common.enabled=Запись активирована
common.disabled=Запись деактивирована
common.errorStatus=Статус ошибки

error.appError=Ошибка приложения
error.dataNotFound=Данные не найдены
error.dataError=Ошибка в данных
error.validationError=Ошибка формата данных

exception.common.notFound=Не найдена запись с {0}
exception.user.duplicateEmail=Пользователь с такой почтой уже есть в приложении
exception.user.modificationRestriction=Модификация Admin/User запрещена
exception.meal.duplicateDateTime=У вас уже есть еда с такой датой/временем

NotEmpty=Поле "{0}" не должно быть пустым
NotBlank=Поле "{0}" не должно быть пустым
NotNull=Поле "{0}" не должно быть пустым
Email=Неверный формат поля "{0}"
Range=Поле "{0}" должно быть между {2} и {1}
Length=Длинна поля "{0}" должена быть между {2} и {1}
Size=Размер поля "{0}" должен быть между {2} и {1}
SafeHtml=Поле "{0}" может содержать небезопасный html контент
2 changes: 2 additions & 0 deletions hr.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
call mvn -B -s settings.xml -DskipTests=true clean package
call java -Dspring.profiles.active="datajpa,heroku" -DDATABASE_URL="postgres://user:password@localhost:5432/topjava" -jar target/dependency/webapp-runner.jar target/*.war
Loading