Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hw7 #178

Open
wants to merge 84 commits into
base: master
Choose a base branch
from
Open

Hw7 #178

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
693f687
Prepare to HW0
Ilya547 Jan 28, 2023
b846d77
1_2_HW0_war.patch
Ilya547 Feb 3, 2023
ab4dd6d
1_3_servlet_api.patch
Ilya547 Feb 3, 2023
b83f830
1_4_forward_to_redirect.patch
Ilya547 Feb 3, 2023
7cf040b
1_5_simple_logging.patch
Ilya547 Feb 3, 2023
2849307
1_6_logging_config.patch
Ilya547 Feb 3, 2023
01ce5a0
HW_2
Ilya547 Feb 10, 2023
131e46f
2_1_HW1.patch
Ilya547 Feb 10, 2023
2d8d45a
2_2_HW1_optional.patch
Ilya547 Feb 10, 2023
934fd02
2_3_app_layers.patch
Ilya547 Feb 10, 2023
c8cfd7d
2_4_add_spring.patch
Ilya547 Feb 10, 2023
483bf80
2_5_add_spring_context.patch
Ilya547 Feb 10, 2023
6f83db8
2_6_dependency_injection.patch
Ilya547 Feb 10, 2023
29a2cfc
2_7_annotation_processing.patch
Ilya547 Feb 10, 2023
b304438
3_0_fix.patch
Ilya547 Feb 16, 2023
263d85d
3_01_HW2_repositories.patch
Ilya547 Feb 16, 2023
a463bfa
3_01_HW2_repositories.patch
Ilya547 Feb 16, 2023
2bd57d2
3_02_HW2_repo_filters.patch
Ilya547 Feb 16, 2023
2a2b192
3_03_HW2_meal_layers.patch
Ilya547 Feb 16, 2023
ffde48f
3_04_refactor_repository.patch
Ilya547 Feb 16, 2023
073144f
3_05_HW2_optional_MealServlet.patch
Ilya547 Feb 16, 2023
f47f398
3_06_HW2_optional_filter.patch
Ilya547 Feb 16, 2023
18efa18
3_07_HW2_optional_select_user.patch
Ilya547 Feb 16, 2023
5af4500
3_08_bean_life_cycle.patch
Ilya547 Feb 16, 2023
6fa976c
3_09_add_junit.patch
Ilya547 Feb 16, 2023
e97e1e0
3_10_add_spring_test.patch
Ilya547 Feb 16, 2023
809d960
3_11_add_postgresql.patch
Ilya547 Feb 16, 2023
a614840
3_12_db_implementation.patch
Ilya547 Feb 16, 2023
53535b6
3_13_test_UserService.patch
Ilya547 Feb 17, 2023
5be35a3
3_14_test_logging.patch
Ilya547 Feb 17, 2023
80f5947
3_15_fix_servlet.patch
Ilya547 Feb 17, 2023
6df5924
4_1_HW3.patch
Ilya547 Feb 23, 2023
61edb3d
4_2_HW3_optional.patch
Ilya547 Feb 23, 2023
f2f7684
4_3_tests_refactoring.patch
Ilya547 Feb 23, 2023
af38437
4_4_HW3_fix_logging.patch
Ilya547 Feb 23, 2023
e09b142
add button code quality in readme
Ilya547 Feb 23, 2023
b339283
4_5_improve_code.patch
Ilya547 Feb 23, 2023
a1be988
4_6_init_and_populate_db.patch
Ilya547 Feb 23, 2023
ddbc3ce
4_7_create_inmemory_test_ctx.patch
Ilya547 Feb 23, 2023
9c9d30a
4_8_add_jpa.patch
Ilya547 Feb 23, 2023
898c75c
4_9_add_named_query_and_transaction.patch
Ilya547 Feb 23, 2023
e6b0700
4_10_add_hsqldb.patch
Ilya547 Feb 23, 2023
5f97a8e
5_1_jdk_17.patch
Ilya547 Mar 2, 2023
6c55f72
5_2_HW4.patch
Ilya547 Mar 2, 2023
c58249d
5_2_HW4.patch
Ilya547 Mar 2, 2023
bb202e3
5_3_fix_hibernate_issue.patch
Ilya547 Mar 2, 2023
0911e62
5_4_HW4_optional.patch
Ilya547 Mar 2, 2023
685d87b
5_5_profiles_connection_pool.patch
Ilya547 Mar 2, 2023
fbc3a60
5_6_profile_resolver.patch
Ilya547 Mar 2, 2023
8cae4ad
5_7_spring_data_jpa.patch
Ilya547 Mar 3, 2023
81cafa0
5_8_spring_cache.patch
Ilya547 Mar 3, 2023
444f465
6_01_HW5_data_jpa.patch
Ilya547 Mar 10, 2023
67c9a74
6_02_HW5_profile_test.patch
Ilya547 Mar 10, 2023
c3e1cff
6_03_extract_rules.patch
Ilya547 Mar 10, 2023
0241e73
6_04_HW5_optional_fix_jdbc_profiles.patch
Ilya547 Mar 10, 2023
40a82ff
6_05_update_hsqldb.patch
Ilya547 Mar 10, 2023
96949d5
6_06_HW5_optional_fetch_join.patch
Ilya547 Mar 10, 2023
12924df
6_07_HW5_graph_batch_size.patch
Ilya547 Mar 10, 2023
9f35d80
6_08_add_test_validation.patch
Ilya547 Mar 10, 2023
505f8d9
6_09_hibernate_cache.patch
Ilya547 Mar 23, 2023
9162322
6_10_cascade_ddl.patch
Ilya547 Mar 23, 2023
7f802ed
6_11_spring_web.patch
Ilya547 Mar 23, 2023
abd3a64
6_12_jsp_jstl_i18n.patch
Ilya547 Mar 23, 2023
f73553c
6_13_tomcat_pool_jndi_cargo.patch
Ilya547 Mar 23, 2023
802d650
6_14_spring_webmvc.patch
Ilya547 Mar 23, 2023
46ec4d4
6_15_spring_i18n.patch
Ilya547 Mar 23, 2023
4b2023a
7_0_ignore_test.patch
Ilya547 Mar 27, 2023
f1306eb
7_01_HW6_fix_tests.patch
Ilya547 Mar 27, 2023
d9605e4
7_02_HW6_meals.patch
Ilya547 Mar 27, 2023
3db056f
7_03_HW6_fix_relative_url_utf8.patch
Ilya547 Mar 27, 2023
a442480
7_04_HW6_optional_add_role.patch
Ilya547 Mar 27, 2023
2de98ab
7_05_HW6_fix_hint_graph.patch
Ilya547 Mar 27, 2023
06daf84
7_06_HW6_jdbc_transaction_roles.patch
Ilya547 Mar 27, 2023
7d646c9
7_07_HW6_jdbc_validation.patch
Ilya547 Mar 27, 2023
3918ca6
7_08_HW06_disable_tests_cache.patch
Ilya547 Mar 27, 2023
060aed1
7_09_controller_test.patch
Ilya547 Mar 27, 2023
9dc66e7
7_10_JUnit5.patch
Ilya547 Mar 27, 2023
b29bcc4
7_11_rest_controller.patch
Ilya547 Mar 27, 2023
1e64321
7_12_rest_test_jackson.patch
Ilya547 Mar 27, 2023
bdcbed7
7_13_jackson_object_mapper.patch
Ilya547 Mar 27, 2023
75ed6af
7_14_json_assert_tests.patch
Ilya547 Mar 27, 2023
a3d97f2
7_15_tests_refactoring.patch
Ilya547 Mar 27, 2023
1dba013
7_16_soapui_utf8_converter.patch
Ilya547 Mar 27, 2023
a18bf3f
implement homework 7
Ilya547 Mar 29, 2023
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
5 changes: 5 additions & 0 deletions .codacy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
exclude_paths:
- 'src/main/webapp/**'
- '**.md'
- '**.sql'
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Java Enterprise Online Project
===============================
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/4dc4622071c24e26a0a56310aa41968d)](https://www.codacy.com/gh/Ilya547/topjava/dashboard?utm_source=github.com&utm_medium=referral&utm_content=Ilya547/topjava&utm_campaign=Badge_Grade)

Разработка полнофункционального Spring/JPA Enterprise приложения c авторизацией и правами доступа на основе ролей с использованием наиболее популярных инструментов и технологий Java: Maven, Spring MVC, Security, JPA(Hibernate), REST(Jackson), Bootstrap (css,js), DataTables, jQuery + plugins, Java 8 Stream and Time API и хранением в базах данных Postgresql и HSQLDB.

![topjava_structure](https://javaops.ru/static/images/projects/top-scheme.jpg)
Expand Down
395 changes: 395 additions & 0 deletions config/Topjava-soapui-project.xml

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions config/messages/app.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
app.title=Calories management
app.home=Home
app.footer=Internship <a href="https://github.com/JavaOPs/topjava" target=_blank>Spring 5/JPA Enterprise (Topjava)</a> application
app.login=Login as

user.title=Users
user.name=Name
user.email=Email
user.roles=Roles
user.active=Active
user.registered=Registered

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

common.select=Select
common.delete=Delete
common.update=Update
common.save=Save
common.cancel=Cancel
12 changes: 12 additions & 0 deletions config/messages/app_ru.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
app.title=??????? ???????
app.home=???????
app.footer=?????????? ?????????? <a href="https://github.com/JavaOPs/topjava" target=_blank>Spring 5/JPA Enterprise (Topjava)</a>
app.login=????? ???
user.title=????????????
user.name=???
user.email=?????
user.roles=????
user.active=????????
user.registered=???????????????
meal.title=??? ???
common.select=???????
281 changes: 278 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,23 +4,51 @@

<groupId>ru.javawebinar</groupId>
<artifactId>topjava</artifactId>
<packaging>jar</packaging>
<packaging>war</packaging>

<version>1.0-SNAPSHOT</version>

<name>Calories Management</name>
<url>http://topjava.herokuapp.com/</url>

<properties>
<java.version>1.8</java.version>
<java.version>17</java.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<spring.version>5.3.25</spring.version>
<spring-data-jpa.version>2.7.8</spring-data-jpa.version>
<jackson.version>2.14.2</jackson.version>
<tomcat.version>9.0.72</tomcat.version>

<!-- Hibernate -->
<hibernate.version>5.6.15.Final</hibernate.version>
<hibernate-validator.version>6.2.5.Final</hibernate-validator.version>
<javax-el.version>3.0.1-b12</javax-el.version>

<!--Cache-->
<ehcache.version>3.10.8</ehcache.version>

<!-- Logging -->
<logback.version>1.2.11</logback.version>
<slf4j.version>1.7.36</slf4j.version>

<!--DB-->
<postgresql.version>42.5.3</postgresql.version>
<!-- Tests -->
<junit.jupiter.version>5.9.2</junit.jupiter.version>
<assertj.version>3.24.2</assertj.version>
<hamcrest.version>2.2</hamcrest.version>
</properties>

<build>
<finalName>topjava</finalName>
<defaultGoal>install</defaultGoal>
<defaultGoal>package</defaultGoal>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-war-plugin</artifactId>
<version>3.3.2</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
Expand All @@ -30,15 +58,262 @@
<target>${java.version}</target>
</configuration>
</plugin>
<plugin>
<!--https://junit.org/junit5/docs/current/user-guide/#running-tests-build-maven -->
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<argLine>-Dfile.encoding=UTF-8</argLine>
</configuration>
</plugin>

<!-- http://stackoverflow.com/questions/4305935/is-it-possible-to-supply-tomcat6s-context-xml-file-via-the-maven-cargo-plugin#4417945 -->
<!-- https://codehaus-cargo.github.io/cargo/Tomcat+9.x.html -->
<plugin>
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven3-plugin</artifactId>
<version>1.10.5</version>
<configuration>
<container>
<containerId>tomcat9x</containerId>
<systemProperties>
<file.encoding>UTF-8</file.encoding>
<spring.profiles.active>tomcat,datajpa</spring.profiles.active>
</systemProperties>
<dependencies>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
</dependency>
</dependencies>
</container>
<configuration>
<configfiles>
<configfile>
<file>src/main/resources/tomcat/context.xml</file>
<todir>conf/Catalina/localhost/</todir>
<tofile>${project.build.finalName}.xml</tofile>
</configfile>
</configfiles>
</configuration>
<deployables>
<deployable>
<groupId>ru.javawebinar</groupId>
<artifactId>topjava</artifactId>
<type>war</type>
<properties>
<context>${project.build.finalName}</context>
</properties>
</deployable>
</deployables>
</configuration>
</plugin>
</plugins>
</build>

<dependencies>
<!-- Logging with SLF4J & LogBack -->
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>${slf4j.version}</version>
</dependency>

<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>${logback.version}</version>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>javax.annotation</groupId>
<artifactId>javax.annotation-api</artifactId>
<version>1.3.2</version>
</dependency>

<!-- Spring -->
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-context-support</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.data</groupId>
<artifactId>spring-data-jpa</artifactId>
<version>${spring-data-jpa.version}</version>
</dependency>

<!--- ORM -->
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-core</artifactId>
<version>${hibernate.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate.validator</groupId>
<artifactId>hibernate-validator</artifactId>
<version>${hibernate-validator.version}</version>
</dependency>
<dependency>
<groupId>org.hibernate</groupId>
<artifactId>hibernate-jcache</artifactId>
<version>${hibernate.version}</version>
</dependency>

<!--http://hibernate.org/validator/documentation/getting-started/#unified-expression-language-el-->
<dependency>
<groupId>org.glassfish</groupId>
<artifactId>javax.el</artifactId>
<version>${javax-el.version}</version>
<scope>provided</scope>
</dependency>

<!-- Cache -->
<dependency>
<groupId>javax.cache</groupId>
<artifactId>cache-api</artifactId>
<version>1.1.0</version>
</dependency>
<dependency>
<groupId>org.ehcache</groupId>
<artifactId>ehcache</artifactId>
<scope>runtime</scope>
<version>${ehcache.version}</version>
<exclusions>
<exclusion>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
</exclusion>
</exclusions>
</dependency>

<!--https://medium.com/criciumadev/its-time-migrating-to-java-11-5eb3868354f9-->
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.4.0-b180830.0438</version>
</dependency>

<!--Web-->
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-servlet-api</artifactId>
<version>${tomcat.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>javax.servlet</groupId>
<artifactId>jstl</artifactId>
<version>1.2</version>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
</dependency>

<!--JSON-->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-hibernate5</artifactId>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson.version}</version>
</dependency>

<!--Test-->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
<version>${junit.jupiter.version}</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>${hamcrest.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-test</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
<version>${assertj.version}</version>
<scope>test</scope>
</dependency>

<!-- https://youtrack.jetbrains.com/issue/IDEA-231927 -->
<dependency>
<groupId>org.junit.platform</groupId>
<artifactId>junit-platform-launcher</artifactId>
<version>1.9.2</version>
<scope>test</scope>
</dependency>
</dependencies>

<profiles>
<profile>
<id>hsqldb</id>
<dependencies>
<dependency>
<groupId>org.hsqldb</groupId>
<artifactId>hsqldb</artifactId>
<version>2.7.1</version>
</dependency>
</dependencies>
</profile>

<profile>
<id>postgres</id>
<dependencies>
<dependency>
<groupId>org.postgresql</groupId>
<artifactId>postgresql</artifactId>
<version>${postgresql.version}</version>
</dependency>
<dependency>
<groupId>org.apache.tomcat</groupId>
<artifactId>tomcat-jdbc</artifactId>
<version>${tomcat.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jul-to-slf4j</artifactId>
<version>${slf4j.version}</version>
<scope>runtime</scope>
</dependency>
</dependencies>
<activation>
<activeByDefault>true</activeByDefault>
</activation>
</profile>
</profiles>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>${spring.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
</project>
11 changes: 0 additions & 11 deletions src/main/java/ru/javawebinar/topjava/Main.java

This file was deleted.

Loading