Version2 - Spring Boot 3.2.2 and jakarta EE
This commit is contained in:
parent
9dd7da73c2
commit
8bcd8cb9a1
24
.classpath
24
.classpath
|
@ -9,17 +9,11 @@
|
||||||
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="var" path="M2_REPO/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2.jar" sourcepath="M2_REPO/javax/annotation/javax.annotation-api/1.3.2/javax.annotation-api-1.3.2-sources.jar"/>
|
|
||||||
<classpathentry kind="var" path="M2_REPO/javax/enterprise/cdi-api/2.0/cdi-api-2.0.jar" sourcepath="M2_REPO/javax/enterprise/cdi-api/2.0/cdi-api-2.0-sources.jar"/>
|
|
||||||
<classpathentry kind="var" path="M2_REPO/javax/interceptor/javax.interceptor-api/1.2/javax.interceptor-api-1.2.jar" sourcepath="M2_REPO/javax/interceptor/javax.interceptor-api/1.2/javax.interceptor-api-1.2-sources.jar"/>
|
|
||||||
<classpathentry kind="var" path="M2_REPO/javax/inject/javax.inject/1/javax.inject-1.jar" sourcepath="M2_REPO/javax/inject/javax.inject/1/javax.inject-1-sources.jar"/>
|
|
||||||
<classpathentry kind="var" path="M2_REPO/javax/transaction/javax.transaction-api/1.3/javax.transaction-api-1.3.jar" sourcepath="M2_REPO/javax/transaction/javax.transaction-api/1.3/javax.transaction-api-1.3-sources.jar"/>
|
|
||||||
<classpathentry kind="var" path="M2_REPO/javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar" sourcepath="M2_REPO/javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1-sources.jar"/>
|
<classpathentry kind="var" path="M2_REPO/javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1.jar" sourcepath="M2_REPO/javax/xml/bind/jaxb-api/2.3.1/jaxb-api-2.3.1-sources.jar"/>
|
||||||
<classpathentry kind="var" path="M2_REPO/javax/activation/javax.activation-api/1.2.0/javax.activation-api-1.2.0.jar" sourcepath="M2_REPO/javax/activation/javax.activation-api/1.2.0/javax.activation-api-1.2.0-sources.jar"/>
|
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-17">
|
||||||
<classpathentry kind="var" path="M2_REPO/javax/persistence/javax.persistence-api/2.2/javax.persistence-api-2.2.jar" sourcepath="M2_REPO/javax/persistence/javax.persistence-api/2.2/javax.persistence-api-2.2-sources.jar"/>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
|
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
|
@ -60,14 +54,12 @@
|
||||||
<classpathentry kind="var" path="M2_REPO/org/apache/tomcat/embed/tomcat-embed-jasper/9.0.12/tomcat-embed-jasper-9.0.12.jar" sourcepath="M2_REPO/org/apache/tomcat/embed/tomcat-embed-jasper/9.0.12/tomcat-embed-jasper-9.0.12-sources.jar"/>
|
<classpathentry kind="var" path="M2_REPO/org/apache/tomcat/embed/tomcat-embed-jasper/9.0.12/tomcat-embed-jasper-9.0.12.jar" sourcepath="M2_REPO/org/apache/tomcat/embed/tomcat-embed-jasper/9.0.12/tomcat-embed-jasper-9.0.12-sources.jar"/>
|
||||||
<classpathentry kind="var" path="M2_REPO/org/eclipse/jdt/ecj/3.13.102/ecj-3.13.102.jar" sourcepath="M2_REPO/org/eclipse/jdt/ecj/3.13.102/ecj-3.13.102-sources.jar"/>
|
<classpathentry kind="var" path="M2_REPO/org/eclipse/jdt/ecj/3.13.102/ecj-3.13.102.jar" sourcepath="M2_REPO/org/eclipse/jdt/ecj/3.13.102/ecj-3.13.102-sources.jar"/>
|
||||||
<classpathentry kind="var" path="M2_REPO/org/joinfaces/mojarra-spring-boot-starter/3.3.0-rc2/mojarra-spring-boot-starter-3.3.0-rc2.jar" sourcepath="M2_REPO/org/joinfaces/mojarra-spring-boot-starter/3.3.0-rc2/mojarra-spring-boot-starter-3.3.0-rc2-sources.jar"/>
|
<classpathentry kind="var" path="M2_REPO/org/joinfaces/mojarra-spring-boot-starter/3.3.0-rc2/mojarra-spring-boot-starter-3.3.0-rc2.jar" sourcepath="M2_REPO/org/joinfaces/mojarra-spring-boot-starter/3.3.0-rc2/mojarra-spring-boot-starter-3.3.0-rc2-sources.jar"/>
|
||||||
<classpathentry kind="var" path="M2_REPO/org/glassfish/javax.faces/2.3.7/javax.faces-2.3.7.jar" sourcepath="M2_REPO/org/glassfish/javax.faces/2.3.7/javax.faces-2.3.7-sources.jar"/>
|
|
||||||
<classpathentry kind="var" path="M2_REPO/org/joinfaces/omnifaces1-spring-boot-starter/3.3.0-rc2/omnifaces1-spring-boot-starter-3.3.0-rc2.jar" sourcepath="M2_REPO/org/joinfaces/omnifaces1-spring-boot-starter/3.3.0-rc2/omnifaces1-spring-boot-starter-3.3.0-rc2-sources.jar"/>
|
<classpathentry kind="var" path="M2_REPO/org/joinfaces/omnifaces1-spring-boot-starter/3.3.0-rc2/omnifaces1-spring-boot-starter-3.3.0-rc2.jar" sourcepath="M2_REPO/org/joinfaces/omnifaces1-spring-boot-starter/3.3.0-rc2/omnifaces1-spring-boot-starter-3.3.0-rc2-sources.jar"/>
|
||||||
<classpathentry kind="var" path="M2_REPO/org/omnifaces/omnifaces/1.14.1/omnifaces-1.14.1.jar" sourcepath="M2_REPO/org/omnifaces/omnifaces/1.14.1/omnifaces-1.14.1-sources.jar"/>
|
<classpathentry kind="var" path="M2_REPO/org/omnifaces/omnifaces/1.14.1/omnifaces-1.14.1.jar" sourcepath="M2_REPO/org/omnifaces/omnifaces/1.14.1/omnifaces-1.14.1-sources.jar"/>
|
||||||
<classpathentry kind="var" path="M2_REPO/org/joinfaces/spring-security-jsf-taglib/3.3.0-rc2/spring-security-jsf-taglib-3.3.0-rc2.jar" sourcepath="M2_REPO/org/joinfaces/spring-security-jsf-taglib/3.3.0-rc2/spring-security-jsf-taglib-3.3.0-rc2-sources.jar"/>
|
<classpathentry kind="var" path="M2_REPO/org/joinfaces/spring-security-jsf-taglib/3.3.0-rc2/spring-security-jsf-taglib-3.3.0-rc2.jar" sourcepath="M2_REPO/org/joinfaces/spring-security-jsf-taglib/3.3.0-rc2/spring-security-jsf-taglib-3.3.0-rc2-sources.jar"/>
|
||||||
<classpathentry kind="var" path="M2_REPO/org/primefaces/primefaces/6.2/primefaces-6.2.jar" sourcepath="M2_REPO/org/primefaces/primefaces/6.2/primefaces-6.2-sources.jar"/>
|
<classpathentry kind="var" path="M2_REPO/org/primefaces/primefaces/6.2/primefaces-6.2.jar" sourcepath="M2_REPO/org/primefaces/primefaces/6.2/primefaces-6.2-sources.jar"/>
|
||||||
<classpathentry kind="var" path="M2_REPO/org/primefaces/extensions/primefaces-extensions/6.2.9/primefaces-extensions-6.2.9.jar" sourcepath="M2_REPO/org/primefaces/extensions/primefaces-extensions/6.2.9/primefaces-extensions-6.2.9-sources.jar"/>
|
<classpathentry kind="var" path="M2_REPO/org/primefaces/extensions/primefaces-extensions/6.2.9/primefaces-extensions-6.2.9.jar" sourcepath="M2_REPO/org/primefaces/extensions/primefaces-extensions/6.2.9/primefaces-extensions-6.2.9-sources.jar"/>
|
||||||
<classpathentry kind="var" path="M2_REPO/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar" sourcepath="M2_REPO/com/google/code/gson/gson/2.8.5/gson-2.8.5-sources.jar"/>
|
<classpathentry kind="var" path="M2_REPO/com/google/code/gson/gson/2.8.5/gson-2.8.5.jar" sourcepath="M2_REPO/com/google/code/gson/gson/2.8.5/gson-2.8.5-sources.jar"/>
|
||||||
<classpathentry kind="var" path="M2_REPO/org/springframework/boot/spring-boot-starter-data-jpa/2.1.0.RELEASE/spring-boot-starter-data-jpa-2.1.0.RELEASE.jar"/>
|
|
||||||
<classpathentry kind="var" path="M2_REPO/org/springframework/boot/spring-boot-starter-aop/2.1.0.RELEASE/spring-boot-starter-aop-2.1.0.RELEASE.jar"/>
|
<classpathentry kind="var" path="M2_REPO/org/springframework/boot/spring-boot-starter-aop/2.1.0.RELEASE/spring-boot-starter-aop-2.1.0.RELEASE.jar"/>
|
||||||
<classpathentry kind="var" path="M2_REPO/org/aspectj/aspectjweaver/1.9.2/aspectjweaver-1.9.2.jar" sourcepath="M2_REPO/org/aspectj/aspectjweaver/1.9.2/aspectjweaver-1.9.2-sources.jar"/>
|
<classpathentry kind="var" path="M2_REPO/org/aspectj/aspectjweaver/1.9.2/aspectjweaver-1.9.2.jar" sourcepath="M2_REPO/org/aspectj/aspectjweaver/1.9.2/aspectjweaver-1.9.2-sources.jar"/>
|
||||||
<classpathentry kind="var" path="M2_REPO/org/springframework/boot/spring-boot-starter-jdbc/2.1.0.RELEASE/spring-boot-starter-jdbc-2.1.0.RELEASE.jar"/>
|
<classpathentry kind="var" path="M2_REPO/org/springframework/boot/spring-boot-starter-jdbc/2.1.0.RELEASE/spring-boot-starter-jdbc-2.1.0.RELEASE.jar"/>
|
||||||
|
@ -89,16 +81,24 @@
|
||||||
<classpathentry kind="var" path="M2_REPO/com/h2database/h2/1.4.197/h2-1.4.197.jar" sourcepath="M2_REPO/com/h2database/h2/1.4.197/h2-1.4.197-sources.jar"/>
|
<classpathentry kind="var" path="M2_REPO/com/h2database/h2/1.4.197/h2-1.4.197.jar" sourcepath="M2_REPO/com/h2database/h2/1.4.197/h2-1.4.197-sources.jar"/>
|
||||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
||||||
<attributes>
|
<attributes>
|
||||||
|
<attribute name="test" value="true"/>
|
||||||
<attribute name="optional" value="true"/>
|
<attribute name="optional" value="true"/>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
<attribute name="test" value="true"/>
|
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
|
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/>
|
||||||
|
<classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources">
|
||||||
|
<attributes>
|
||||||
|
<attribute name="test" value="true"/>
|
||||||
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
|
<attribute name="optional" value="true"/>
|
||||||
|
</attributes>
|
||||||
|
</classpathentry>
|
||||||
|
<classpathentry kind="var" path="M2_REPO/org/glassfish/javax.faces/2.3.7/javax.faces-2.3.7.jar" sourcepath="M2_REPO/org/glassfish/javax.faces/2.3.7/javax.faces-2.3.7-sources.jar"/>
|
||||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
||||||
<attributes>
|
<attributes>
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
<attribute name="maven.pomderived" value="true"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/5"/>
|
|
||||||
<classpathentry kind="output" path="target/classes"/>
|
<classpathentry kind="output" path="target/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
8
.project
8
.project
|
@ -5,6 +5,11 @@
|
||||||
<projects>
|
<projects>
|
||||||
</projects>
|
</projects>
|
||||||
<buildSpec>
|
<buildSpec>
|
||||||
|
<buildCommand>
|
||||||
|
<name>org.eclipse.wst.common.project.facet.core.builder</name>
|
||||||
|
<arguments>
|
||||||
|
</arguments>
|
||||||
|
</buildCommand>
|
||||||
<buildCommand>
|
<buildCommand>
|
||||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
<name>org.eclipse.jdt.core.javabuilder</name>
|
||||||
<arguments>
|
<arguments>
|
||||||
|
@ -17,7 +22,8 @@
|
||||||
</buildCommand>
|
</buildCommand>
|
||||||
</buildSpec>
|
</buildSpec>
|
||||||
<natures>
|
<natures>
|
||||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||||
|
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
||||||
|
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
||||||
</natures>
|
</natures>
|
||||||
</projectDescription>
|
</projectDescription>
|
||||||
|
|
|
@ -1,13 +1,8 @@
|
||||||
|
|
||||||
# THIS is the application properties used when testing in the IDE
|
# THIS is the application properties used when testing in the IDE
|
||||||
# The application.yml (production) is ignored.
|
# or running stand-alone from the command line.
|
||||||
#joinfaces.jsf.project-stage=development
|
# It augments/overrides application.yml in the JAR
|
||||||
# They lied. This doesn't work:
|
|
||||||
joinfaces.primefaces.theme=cupertino
|
|
||||||
joinfaces.jsf.webapp-resources-directory=/resources
|
joinfaces.jsf.webapp-resources-directory=/resources
|
||||||
# This works. Note that ONLY THE FIRST theme set will work unless
|
|
||||||
# you delete the old primefaces.THEME from ServletContext
|
|
||||||
server.servlet.context-parameters.primefaces.THEME=omega
|
|
||||||
server.servlet.session.timeout=30m
|
server.servlet.session.timeout=30m
|
||||||
|
|
||||||
spring.thymeleaf.enabled=false
|
spring.thymeleaf.enabled=false
|
||||||
|
@ -19,10 +14,11 @@ spring.datasource.username=recipes
|
||||||
pring.datasource.password=yumyumyum
|
pring.datasource.password=yumyumyum
|
||||||
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver
|
||||||
#org.sqlite.JDBC
|
#org.sqlite.JDBC
|
||||||
#spring.jpa.hibernate.dialect=org.hibernate.dialect.SQLServer2012Dialect
|
#Obs, no longer required:
|
||||||
spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
|
#spring.jpa.database-platform=org.hibernate.dialect.MySQLDialect
|
||||||
#org.sqlite.hibernate.dialect.SQLiteDialect
|
#org.sqlite.hibernate.dialect.SQLiteDialect
|
||||||
#spring.jpa.show-sql: true
|
#spring.jpa.show-sql: true
|
||||||
|
|
||||||
# My special properties
|
# My special properties
|
||||||
gourmet.password.file=${user.home}/.gourmetpw
|
gourmet.password.file=${user.home}/.gourmetpw
|
||||||
|
|
||||||
|
|
103
pom.xml
103
pom.xml
|
@ -7,7 +7,7 @@
|
||||||
|
|
||||||
<groupId>com.mousetech.gourmet</groupId>
|
<groupId>com.mousetech.gourmet</groupId>
|
||||||
<artifactId>gourmetj</artifactId>
|
<artifactId>gourmetj</artifactId>
|
||||||
<version>0.1.4-SNAPSHOT</version>
|
<version>0.2.0-SNAPSHOT</version>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
<name>GourmetJ</name>
|
<name>GourmetJ</name>
|
||||||
|
@ -17,7 +17,7 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>2.1.0.RELEASE</version>
|
<version>3.2.2</version>
|
||||||
<relativePath /> <!-- lookup parent from repository -->
|
<relativePath /> <!-- lookup parent from repository -->
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
|
@ -30,25 +30,44 @@
|
||||||
</repositories>
|
</repositories>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
|
<!-- compile library versions -->
|
||||||
|
<jakarta.validation-api.version>3.0.2</jakarta.validation-api.version>
|
||||||
|
<joinfaces.version>5.2.2</joinfaces.version>
|
||||||
|
<maven-model.version>3.9.6</maven-model.version>
|
||||||
|
|
||||||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
|
||||||
<java.version>11</java.version>
|
<java.version>17</java.version>
|
||||||
<joinfaces.version>3.3.0-rc2</joinfaces.version>
|
<spring-boot.version>3.2.2</spring-boot.version>
|
||||||
|
<faces.version>4.0.5</faces.version>
|
||||||
|
<joinfaces.version>5.2.2</joinfaces.version>
|
||||||
|
<twelvemonkeys.version>3.10.1</twelvemonkeys.version>
|
||||||
<junit.jupiter.version>5.4.0</junit.jupiter.version>
|
<junit.jupiter.version>5.4.0</junit.jupiter.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>jakarta.validation</groupId>
|
||||||
|
<artifactId>jakarta.validation-api</artifactId>
|
||||||
|
<version>${jakarta.validation-api.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.joinfaces</groupId>
|
<groupId>org.joinfaces</groupId>
|
||||||
<artifactId>joinfaces-dependencies</artifactId>
|
<artifactId>joinfaces-bom</artifactId>
|
||||||
<version>${joinfaces.version}</version>
|
<version>${joinfaces.version}</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.apache.maven</groupId>
|
||||||
|
<artifactId>maven-model</artifactId>
|
||||||
|
<version>${maven-model.version}</version>
|
||||||
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.joinfaces</groupId>
|
<groupId>org.joinfaces</groupId>
|
||||||
|
@ -59,10 +78,10 @@
|
||||||
<artifactId>all-themes</artifactId>
|
<artifactId>all-themes</artifactId>
|
||||||
<version>1.0.10</version>
|
<version>1.0.10</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<!-- <dependency>
|
||||||
<groupId>javax.enterprise</groupId>
|
<groupId>javax.enterprise</groupId>
|
||||||
<artifactId>cdi-api</artifactId>
|
<artifactId>cdi-api</artifactId>
|
||||||
</dependency>
|
</dependency>-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-security</artifactId>
|
<artifactId>spring-boot-starter-security</artifactId>
|
||||||
|
@ -71,55 +90,72 @@
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<!--
|
||||||
|
https://mvnrepository.com/artifact/jakarta.persistence/jakarta.persistence-api -->
|
||||||
|
<!-- <dependency>
|
||||||
|
<groupId>javax.persistence</groupId>
|
||||||
|
<artifactId>javax.persistence-api</artifactId>
|
||||||
|
<version>2.2</version>
|
||||||
|
</dependency>-->
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>javax.validation</groupId>
|
<groupId>jakarta.validation</groupId>
|
||||||
<artifactId>validation-api</artifactId>
|
<artifactId>jakarta.validation-api</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- https://mvnrepository.com/artifact/org.hibernate.validator/hibernate-validator -->
|
<!--
|
||||||
|
https://mvnrepository.com/artifact/org.hibernate.validator/hibernate-validator -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.hibernate.validator</groupId>
|
<groupId>org.hibernate.validator</groupId>
|
||||||
<artifactId>hibernate-validator</artifactId>
|
<artifactId>hibernate-validator</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web -->
|
<!--
|
||||||
|
https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-web -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-web</artifactId>
|
<artifactId>spring-boot-starter-web</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<!-- <dependency>
|
||||||
<groupId>javax.servlet.jsp</groupId>
|
<groupId>jakarta.servlet.jsp</groupId>
|
||||||
<artifactId>javax.servlet.jsp-api</artifactId>
|
<artifactId>jakarta.servlet.jsp-api</artifactId>
|
||||||
<version>2.3.3</version>
|
<version>2.3.3</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>-->
|
||||||
<dependency>
|
<!-- <dependency>
|
||||||
<groupId>javax.servlet</groupId>
|
<groupId>jakarta.servlet</groupId>
|
||||||
<artifactId>jstl</artifactId>
|
<artifactId>jstl</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.tomcat.embed</groupId>
|
<groupId>org.apache.tomcat.embed</groupId>
|
||||||
<artifactId>tomcat-embed-jasper</artifactId>
|
<artifactId>tomcat-embed-jasper</artifactId>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<!-- <dependency>
|
||||||
<groupId>org.glassfish</groupId>
|
<groupId>org.glassfish</groupId>
|
||||||
<artifactId>javax.el</artifactId>
|
<artifactId>jakarta.el</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
-->
|
||||||
|
|
||||||
<!-- https://mvnrepository.com/artifact/com.twelvemonkeys.imageio/imageio-core -->
|
<!--
|
||||||
|
https://mvnrepository.com/artifact/com.twelvemonkeys.imageio/imageio-core -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||||
<artifactId>imageio-core</artifactId>
|
<artifactId>imageio-core</artifactId>
|
||||||
<version>3.8.1</version>
|
<version>${twelvemonkeys.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- https://mvnrepository.com/artifact/com.twelvemonkeys.imageio/imageio-webp -->
|
<dependency>
|
||||||
|
<groupId>org.apache.commons</groupId>
|
||||||
|
<artifactId>commons-lang3</artifactId>
|
||||||
|
</dependency>
|
||||||
|
<!--
|
||||||
|
https://mvnrepository.com/artifact/com.twelvemonkeys.imageio/imageio-webp -->
|
||||||
<!-- In Core??? -->
|
<!-- In Core??? -->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.twelvemonkeys.imageio</groupId>
|
<groupId>com.twelvemonkeys.imageio</groupId>
|
||||||
<artifactId>imageio-webp</artifactId>
|
<artifactId>imageio-webp</artifactId>
|
||||||
<version>3.8.1</version>
|
<version>${twelvemonkeys.version}</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- Needed only if you deploy ImageIO plugins as part of a web app.
|
<!-- Needed only if you deploy ImageIO plugins as part of a web app.
|
||||||
|
@ -128,7 +164,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.twelvemonkeys.servlet</groupId>
|
<groupId>com.twelvemonkeys.servlet</groupId>
|
||||||
<artifactId>servlet</artifactId>
|
<artifactId>servlet</artifactId>
|
||||||
<version>3.8.1</version>
|
<version>${twelvemonkeys.version}</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
@ -141,21 +177,15 @@
|
||||||
<version>8.0.30</version>
|
<version>8.0.30</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!-- SQLite DB -->
|
<!-- <dependency>
|
||||||
<dependency>
|
<groupId>org.glassfish</groupId>
|
||||||
<groupId>org.xerial</groupId>
|
<artifactId>jakarta.faces</artifactId>
|
||||||
<artifactId>sqlite-jdbc</artifactId>
|
<version>${com.sun.faces.version}</version>
|
||||||
</dependency>
|
</dependency>-->
|
||||||
<dependency>
|
|
||||||
<groupId>com.github.gwenn</groupId>
|
|
||||||
<artifactId>sqlite-dialect</artifactId>
|
|
||||||
<version>0.1.2</version>
|
|
||||||
</dependency>
|
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.junit.jupiter</groupId>
|
<groupId>org.junit.jupiter</groupId>
|
||||||
<artifactId>junit-jupiter</artifactId>
|
<artifactId>junit-jupiter</artifactId>
|
||||||
<version>${junit.jupiter.version}</version>
|
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -164,7 +194,6 @@
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
<plugins>
|
<plugins>
|
||||||
<plugin>
|
<plugin>
|
||||||
|
|
|
@ -2,13 +2,13 @@ package com.mousetech.gourmetj;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
import javax.faces.event.AjaxBehaviorEvent;
|
import jakarta.faces.event.AjaxBehaviorEvent;
|
||||||
import javax.faces.model.DataModel;
|
import jakarta.faces.model.DataModel;
|
||||||
import javax.faces.model.ListDataModel;
|
import jakarta.faces.model.ListDataModel;
|
||||||
import javax.faces.view.ViewScoped;
|
import jakarta.faces.view.ViewScoped;
|
||||||
import javax.inject.Inject;
|
import jakarta.inject.Inject;
|
||||||
import javax.inject.Named;
|
import jakarta.inject.Named;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
@ -177,6 +177,7 @@ public class AdminMainBean implements Serializable {
|
||||||
*/
|
*/
|
||||||
public String doFind() {
|
public String doFind() {
|
||||||
List<Recipe> recipes = null;
|
List<Recipe> recipes = null;
|
||||||
|
searchText = searchText.trim();
|
||||||
|
|
||||||
switch (this.getUserSession().getSearchType()) {
|
switch (this.getUserSession().getSearchType()) {
|
||||||
case rst_BY_NAME:
|
case rst_BY_NAME:
|
||||||
|
|
|
@ -2,10 +2,10 @@ package com.mousetech.gourmetj;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
import javax.faces.view.ViewScoped;
|
import jakarta.faces.view.ViewScoped;
|
||||||
import javax.inject.Inject;
|
import jakarta.inject.Inject;
|
||||||
import javax.inject.Named;
|
import jakarta.inject.Named;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
|
@ -8,9 +8,9 @@ package com.mousetech.gourmetj;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
import javax.inject.Inject;
|
import jakarta.inject.Inject;
|
||||||
import javax.inject.Named;
|
import jakarta.inject.Named;
|
||||||
|
|
||||||
import com.mousetech.gourmetj.persistence.service.RecipeService;
|
import com.mousetech.gourmetj.persistence.service.RecipeService;
|
||||||
|
|
||||||
|
|
|
@ -3,12 +3,12 @@ package com.mousetech.gourmetj;
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
import javax.faces.event.AjaxBehaviorEvent;
|
import jakarta.faces.event.AjaxBehaviorEvent;
|
||||||
import javax.faces.event.ValueChangeEvent;
|
import jakarta.faces.event.ValueChangeEvent;
|
||||||
import javax.faces.view.ViewScoped;
|
import jakarta.faces.view.ViewScoped;
|
||||||
import javax.inject.Inject;
|
import jakarta.inject.Inject;
|
||||||
import javax.inject.Named;
|
import jakarta.inject.Named;
|
||||||
|
|
||||||
import com.mousetech.gourmetj.persistence.dao.ShopcatRepository;
|
import com.mousetech.gourmetj.persistence.dao.ShopcatRepository;
|
||||||
|
|
||||||
|
|
|
@ -2,10 +2,10 @@ package com.mousetech.gourmetj;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
import javax.faces.application.FacesMessage;
|
import jakarta.faces.application.FacesMessage;
|
||||||
import javax.faces.context.ExternalContext;
|
import jakarta.faces.context.ExternalContext;
|
||||||
import javax.faces.context.FacesContext;
|
import jakarta.faces.context.FacesContext;
|
||||||
import javax.faces.context.Flash;
|
import jakarta.faces.context.Flash;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
|
@ -7,24 +7,23 @@ import java.util.List;
|
||||||
import java.util.Objects;
|
import java.util.Objects;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
|
|
||||||
import javax.faces.event.AjaxBehaviorEvent;
|
import jakarta.faces.model.DataModel;
|
||||||
import javax.faces.model.DataModel;
|
import jakarta.faces.model.ListDataModel;
|
||||||
import javax.faces.model.ListDataModel;
|
import jakarta.faces.view.ViewScoped;
|
||||||
import javax.faces.view.ViewScoped;
|
import jakarta.inject.Inject;
|
||||||
import javax.inject.Inject;
|
import jakarta.inject.Named;
|
||||||
import javax.inject.Named;
|
import jakarta.servlet.http.Part;
|
||||||
import javax.servlet.http.Part;
|
import jakarta.faces.event.AjaxBehaviorEvent;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.primefaces.event.FileUploadEvent;
|
import org.primefaces.event.FileUploadEvent;
|
||||||
import org.primefaces.model.UploadedFile;
|
import org.primefaces.model.file.UploadedFile;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import com.mousetech.gourmetj.IngredientUI;
|
|
||||||
import com.mousetech.gourmetj.UserSession;
|
|
||||||
import com.mousetech.gourmetj.persistence.model.Category;
|
import com.mousetech.gourmetj.persistence.model.Category;
|
||||||
import com.mousetech.gourmetj.persistence.model.Ingredient;
|
import com.mousetech.gourmetj.persistence.model.Ingredient;
|
||||||
import com.mousetech.gourmetj.persistence.model.Recipe;
|
import com.mousetech.gourmetj.persistence.model.Recipe;
|
||||||
|
@ -391,7 +390,7 @@ public class RecipeDetailBean implements Serializable {
|
||||||
*
|
*
|
||||||
* @param event Unused
|
* @param event Unused
|
||||||
*/
|
*/
|
||||||
public void ajaxAddIngredient(AjaxBehaviorEvent event) {
|
public void ajaxAddIngredient(jakarta.faces.event.AjaxBehaviorEvent event) {
|
||||||
doAddIngredient();
|
doAddIngredient();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1088,7 +1087,7 @@ public class RecipeDetailBean implements Serializable {
|
||||||
public void ajaxUploadImage(FileUploadEvent event) {
|
public void ajaxUploadImage(FileUploadEvent event) {
|
||||||
UploadedFile foo = event.getFile();
|
UploadedFile foo = event.getFile();
|
||||||
|
|
||||||
PictureController.importImage(recipe, foo.getContents());
|
PictureController.importImage(recipe, foo.getContent());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -6,10 +6,10 @@ import java.util.Comparator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import jakarta.annotation.PostConstruct;
|
||||||
import javax.faces.view.ViewScoped;
|
import jakarta.faces.view.ViewScoped;
|
||||||
import javax.inject.Inject;
|
import jakarta.inject.Inject;
|
||||||
import javax.inject.Named;
|
import jakarta.inject.Named;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.primefaces.model.StreamedContent;
|
import org.primefaces.model.StreamedContent;
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package com.mousetech.gourmetj;
|
package com.mousetech.gourmetj;
|
||||||
|
|
||||||
import javax.faces.application.ViewExpiredException;
|
import jakarta.faces.application.ViewExpiredException;
|
||||||
import javax.servlet.ServletContext;
|
import jakarta.servlet.ServletContext;
|
||||||
import javax.servlet.ServletException;
|
import jakarta.servlet.ServletException;
|
||||||
|
|
||||||
import org.primefaces.application.resource.PrimeResourceHandler;
|
import org.primefaces.application.resource.PrimeResourceHandler;
|
||||||
import org.primefaces.renderkit.HeadRenderer;
|
import org.primefaces.renderkit.HeadRenderer;
|
||||||
|
@ -41,18 +41,19 @@ public class SpringPrimeFacesApplication {
|
||||||
/* Note that we cannot set theme here since it was
|
/* Note that we cannot set theme here since it was
|
||||||
* already set earlier. Default value is "aristo".
|
* already set earlier. Default value is "aristo".
|
||||||
*/
|
*/
|
||||||
// servletContext.setInitParameter(
|
|
||||||
// "primefaces.THEME", "bluesky");
|
|
||||||
servletContext.setInitParameter(
|
servletContext.setInitParameter(
|
||||||
"javax.faces.FACELETS_SKIP_COMMENTS",
|
"joinfaces.primefaces.theme", "vela");
|
||||||
|
servletContext.setInitParameter(
|
||||||
|
"primefaces.THEME", "overcast");
|
||||||
|
servletContext.setInitParameter(
|
||||||
|
"jakarta.faces.FACELETS_SKIP_COMMENTS",
|
||||||
"true");
|
"true");
|
||||||
servletContext.setInitParameter(
|
servletContext.setInitParameter(
|
||||||
"com.sun.faces.expressionFactory",
|
"com.sun.faces.expressionFactory",
|
||||||
"com.sun.el.ExpressionFactoryImpl");
|
"com.sun.el.ExpressionFactoryImpl");
|
||||||
servletContext.setInitParameter(
|
servletContext.setInitParameter(
|
||||||
"primefaces.UPLOADER", "native");
|
"primefaces.UPLOADER", "native");
|
||||||
|
////servletContext.addListener(IMAGE_IIO_PROVIDER_CONTEXT_LISTENER);
|
||||||
servletContext.addListener(IMAGE_IIO_PROVIDER_CONTEXT_LISTENER);
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,6 @@ package com.mousetech.gourmetj;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.io.FileReader;
|
import java.io.FileReader;
|
||||||
import java.io.LineNumberInputStream;
|
|
||||||
import java.io.LineNumberReader;
|
import java.io.LineNumberReader;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
|
||||||
|
@ -10,52 +9,43 @@ import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.beans.factory.annotation.Value;
|
import org.springframework.beans.factory.annotation.Value;
|
||||||
|
import org.springframework.context.annotation.Bean;
|
||||||
import org.springframework.context.annotation.Configuration;
|
import org.springframework.context.annotation.Configuration;
|
||||||
|
import org.springframework.security.config.Customizer;
|
||||||
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
|
import org.springframework.security.config.annotation.authentication.builders.AuthenticationManagerBuilder;
|
||||||
import org.springframework.security.config.annotation.authentication.configurers.provisioning.InMemoryUserDetailsManagerConfigurer;
|
import org.springframework.security.config.annotation.authentication.configurers.provisioning.InMemoryUserDetailsManagerConfigurer;
|
||||||
import org.springframework.security.config.annotation.authentication.configurers.provisioning.UserDetailsManagerConfigurer;
|
import org.springframework.security.config.annotation.authentication.configurers.provisioning.UserDetailsManagerConfigurer;
|
||||||
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||||
import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
|
import org.springframework.security.config.annotation.web.configuration.WebSecurityCustomizer;
|
||||||
|
import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
|
||||||
|
import org.springframework.security.web.SecurityFilterChain;
|
||||||
|
|
||||||
|
import jakarta.servlet.DispatcherType;
|
||||||
|
|
||||||
@Configuration
|
@Configuration
|
||||||
@EnableWebSecurity
|
@EnableWebSecurity
|
||||||
public class SpringSecurityConfig
|
public class SpringSecurityConfig {
|
||||||
extends WebSecurityConfigurerAdapter {
|
//extends WebSecurityConfigurerAdapter {
|
||||||
|
|
||||||
/* Logger */
|
/* Logger */
|
||||||
|
|
||||||
private static final Logger log =
|
private static final Logger log =
|
||||||
LoggerFactory.getLogger(SpringSecurityConfig.class);
|
LoggerFactory.getLogger(SpringSecurityConfig.class);
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void configure(HttpSecurity http)
|
|
||||||
throws Exception {
|
|
||||||
// require all requests to be authenticated except
|
|
||||||
// for the resources
|
|
||||||
http.authorizeRequests()
|
|
||||||
.antMatchers("/javax.faces.resource/**",
|
|
||||||
"/",
|
|
||||||
"/index.jsf",
|
|
||||||
"/main.jsf",
|
|
||||||
"/img/**",
|
|
||||||
"/recipeDetails.jsf",
|
|
||||||
"/recipePrint.jsf")
|
|
||||||
.permitAll().anyRequest().authenticated();
|
|
||||||
// login
|
|
||||||
http.formLogin()// .loginPage("/login.xhtml")
|
|
||||||
.permitAll();
|
|
||||||
// .failureUrl("/login.xhtml?error=true");
|
|
||||||
// logout
|
|
||||||
// http.logout().logoutSuccessUrl("/login.xhtml");
|
|
||||||
// not needed as JSF 2.2 is implicitly protected
|
|
||||||
// against CSRF
|
|
||||||
http.csrf().disable();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Value("${gourmet.password.file}")
|
@Value("${gourmet.password.file}")
|
||||||
private String passwordFile;
|
private String passwordFile;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load in config file with in-memory credentials.
|
||||||
|
* For practical use, this should probably be
|
||||||
|
* replace with JdbcUserDetailsManager and credentials in
|
||||||
|
* the recipe database.
|
||||||
|
*
|
||||||
|
* @param auth Builder for the authenticator
|
||||||
|
* @throws Exception
|
||||||
|
*/
|
||||||
@Autowired
|
@Autowired
|
||||||
public void configureGlobal(
|
public void configureGlobal(
|
||||||
AuthenticationManagerBuilder auth) throws Exception {
|
AuthenticationManagerBuilder auth) throws Exception {
|
||||||
|
@ -72,17 +62,21 @@ public class SpringSecurityConfig
|
||||||
LineNumberReader rdr =
|
LineNumberReader rdr =
|
||||||
new LineNumberReader(new FileReader(pwFile));
|
new LineNumberReader(new FileReader(pwFile));
|
||||||
String pwLine;
|
String pwLine;
|
||||||
InMemoryUserDetailsManagerConfigurer<AuthenticationManagerBuilder> authenticator =
|
InMemoryUserDetailsManagerConfigurer<AuthenticationManagerBuilder>
|
||||||
|
authenticator =
|
||||||
auth.inMemoryAuthentication();
|
auth.inMemoryAuthentication();
|
||||||
while ((pwLine = rdr.readLine()) != null) {
|
while ((pwLine = rdr.readLine()) != null) {
|
||||||
pwLine = pwLine.trim();
|
pwLine = pwLine.trim();
|
||||||
if (( pwLine.length() == 0) || (pwLine.charAt(0) == '#')) {
|
if ((pwLine.length() == 0)
|
||||||
|
|| (pwLine.charAt(0) == '#')) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
String[] creds = parseCreds(pwLine);
|
String[] creds = parseCreds(pwLine);
|
||||||
UserDetailsManagerConfigurer<AuthenticationManagerBuilder, InMemoryUserDetailsManagerConfigurer<AuthenticationManagerBuilder>>.UserDetailsBuilder bar =
|
UserDetailsManagerConfigurer<AuthenticationManagerBuilder,
|
||||||
|
InMemoryUserDetailsManagerConfigurer<AuthenticationManagerBuilder>>
|
||||||
|
.UserDetailsBuilder bar =
|
||||||
authenticator.withUser(creds[0])
|
authenticator.withUser(creds[0])
|
||||||
.password("{noop}"+creds[1]);
|
.password("{noop}" + creds[1]);
|
||||||
int credlen = creds.length;
|
int credlen = creds.length;
|
||||||
for (int i = 2; i < credlen; i++) {
|
for (int i = 2; i < credlen; i++) {
|
||||||
bar.roles(creds[i]);
|
bar.roles(creds[i]);
|
||||||
|
@ -104,4 +98,36 @@ public class SpringSecurityConfig
|
||||||
.toArray(String[]::new);
|
.toArray(String[]::new);
|
||||||
return ocreds;
|
return ocreds;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Bean
|
||||||
|
SecurityFilterChain securityFilterChain(HttpSecurity http) throws Exception {
|
||||||
|
|
||||||
|
http
|
||||||
|
.csrf(AbstractHttpConfigurer::disable)
|
||||||
|
.cors(AbstractHttpConfigurer::disable)
|
||||||
|
.formLogin(Customizer.withDefaults())
|
||||||
|
.authorizeHttpRequests((authorize)-> authorize
|
||||||
|
.dispatcherTypeMatchers(DispatcherType.FORWARD, DispatcherType.ERROR).permitAll()
|
||||||
|
.anyRequest().authenticated()
|
||||||
|
);
|
||||||
|
|
||||||
|
return http.build();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Replaces old antMatchers for determining secured URLs.
|
||||||
|
* @return customizer
|
||||||
|
*/
|
||||||
|
@Bean
|
||||||
|
public WebSecurityCustomizer webSecurityCustomizer() {
|
||||||
|
return (web) -> web.ignoring().requestMatchers(
|
||||||
|
"/javax.faces.resource/**",
|
||||||
|
"/",
|
||||||
|
"/index.jsf",
|
||||||
|
"/index.xhtml",
|
||||||
|
"/main.jsf",
|
||||||
|
"/img/**",
|
||||||
|
"/recipeDetails.jsf",
|
||||||
|
"/recipePrint.jsf");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -4,9 +4,9 @@ import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.enterprise.context.SessionScoped;
|
import jakarta.enterprise.context.SessionScoped;
|
||||||
import javax.faces.model.SelectItem;
|
import jakarta.faces.model.SelectItem;
|
||||||
import javax.inject.Named;
|
import jakarta.inject.Named;
|
||||||
|
|
||||||
import org.primefaces.PrimeFaces;
|
import org.primefaces.PrimeFaces;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
|
|
@ -2,7 +2,7 @@ package com.mousetech.gourmetj.persistence.dao;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.transaction.Transactional;
|
import jakarta.transaction.Transactional;
|
||||||
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.data.jpa.repository.Modifying;
|
import org.springframework.data.jpa.repository.Modifying;
|
||||||
|
|
|
@ -2,7 +2,7 @@ package com.mousetech.gourmetj.persistence.dao;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.transaction.Transactional;
|
import jakarta.transaction.Transactional;
|
||||||
|
|
||||||
import org.springframework.data.jpa.repository.JpaRepository;
|
import org.springframework.data.jpa.repository.JpaRepository;
|
||||||
import org.springframework.data.jpa.repository.Modifying;
|
import org.springframework.data.jpa.repository.Modifying;
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.mousetech.gourmetj.persistence.model;
|
package com.mousetech.gourmetj.persistence.model;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import javax.persistence.*;
|
import jakarta.persistence.*;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.mousetech.gourmetj.persistence.model;
|
package com.mousetech.gourmetj.persistence.model;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import javax.persistence.*;
|
import jakarta.persistence.*;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.mousetech.gourmetj.persistence.model;
|
package com.mousetech.gourmetj.persistence.model;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import javax.persistence.*;
|
import jakarta.persistence.*;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.mousetech.gourmetj.persistence.model;
|
package com.mousetech.gourmetj.persistence.model;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import javax.persistence.*;
|
import jakarta.persistence.*;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.mousetech.gourmetj.persistence.model;
|
package com.mousetech.gourmetj.persistence.model;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import javax.persistence.*;
|
import jakarta.persistence.*;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
package com.mousetech.gourmetj.persistence.model;
|
package com.mousetech.gourmetj.persistence.model;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import javax.persistence.*;
|
import jakarta.persistence.*;
|
||||||
import javax.validation.constraints.NotNull;
|
import jakarta.validation.constraints.NotNull;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The persistent class for the "ingredients" database table. The
|
* The persistent class for the "ingredients" database table. The
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.mousetech.gourmetj.persistence.model;
|
package com.mousetech.gourmetj.persistence.model;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import javax.persistence.*;
|
import jakarta.persistence.*;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.mousetech.gourmetj.persistence.model;
|
package com.mousetech.gourmetj.persistence.model;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import javax.persistence.*;
|
import jakarta.persistence.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The persistent class for the "pantry" database table.
|
* The persistent class for the "pantry" database table.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.mousetech.gourmetj.persistence.model;
|
package com.mousetech.gourmetj.persistence.model;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import javax.persistence.*;
|
import jakarta.persistence.*;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -6,7 +6,7 @@ import java.util.HashSet;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.persistence.*;
|
import jakarta.persistence.*;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The persistent class for the "recipe" database table.
|
* The persistent class for the "recipe" database table.
|
||||||
|
|
|
@ -4,17 +4,17 @@ import java.io.Serializable;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import javax.persistence.Column;
|
import jakarta.persistence.Column;
|
||||||
import javax.persistence.Entity;
|
import jakarta.persistence.Entity;
|
||||||
import javax.persistence.FetchType;
|
import jakarta.persistence.FetchType;
|
||||||
import javax.persistence.GeneratedValue;
|
import jakarta.persistence.GeneratedValue;
|
||||||
import javax.persistence.GenerationType;
|
import jakarta.persistence.GenerationType;
|
||||||
import javax.persistence.Id;
|
import jakarta.persistence.Id;
|
||||||
import javax.persistence.ManyToOne;
|
import jakarta.persistence.ManyToOne;
|
||||||
import javax.persistence.NamedQueries;
|
import jakarta.persistence.NamedQueries;
|
||||||
import javax.persistence.NamedQuery;
|
import jakarta.persistence.NamedQuery;
|
||||||
import javax.persistence.OneToMany;
|
import jakarta.persistence.OneToMany;
|
||||||
import javax.persistence.Table;
|
import jakarta.persistence.Table;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The persistent class for the "shopcats" database table.
|
* The persistent class for the "shopcats" database table.
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.mousetech.gourmetj.persistence.model;
|
package com.mousetech.gourmetj.persistence.model;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import javax.persistence.*;
|
import jakarta.persistence.*;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
package com.mousetech.gourmetj.persistence.model;
|
package com.mousetech.gourmetj.persistence.model;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import javax.persistence.*;
|
import jakarta.persistence.*;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -2,9 +2,9 @@ package com.mousetech.gourmetj.persistence.service;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import javax.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
import javax.inject.Inject;
|
import jakarta.inject.Inject;
|
||||||
import javax.inject.Named;
|
import jakarta.inject.Named;
|
||||||
|
|
||||||
import org.springframework.transaction.annotation.Transactional;
|
import org.springframework.transaction.annotation.Transactional;
|
||||||
|
|
||||||
|
|
|
@ -4,9 +4,9 @@ import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
|
|
||||||
import javax.enterprise.context.ApplicationScoped;
|
import jakarta.enterprise.context.ApplicationScoped;
|
||||||
import javax.inject.Inject;
|
import jakarta.inject.Inject;
|
||||||
import javax.inject.Named;
|
import jakarta.inject.Named;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
|
@ -17,9 +17,9 @@ import java.io.InputStream;
|
||||||
|
|
||||||
import javax.imageio.ImageIO;
|
import javax.imageio.ImageIO;
|
||||||
import javax.imageio.stream.ImageInputStream;
|
import javax.imageio.stream.ImageInputStream;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpSession;
|
import jakarta.servlet.http.HttpSession;
|
||||||
import javax.servlet.http.Part;
|
import jakarta.servlet.http.Part;
|
||||||
|
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
import org.slf4j.LoggerFactory;
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
|
@ -6,13 +6,13 @@
|
||||||
*/
|
*/
|
||||||
package com.mousetech.gourmetj.utils;
|
package com.mousetech.gourmetj.utils;
|
||||||
|
|
||||||
import javax.faces.application.FacesMessage;
|
import jakarta.faces.application.FacesMessage;
|
||||||
import javax.faces.component.UIComponent;
|
import jakarta.faces.component.UIComponent;
|
||||||
import javax.faces.context.FacesContext;
|
import jakarta.faces.context.FacesContext;
|
||||||
import javax.faces.convert.Converter;
|
import jakarta.faces.convert.Converter;
|
||||||
import javax.faces.convert.ConverterException;
|
import jakarta.faces.convert.ConverterException;
|
||||||
import javax.faces.convert.FacesConverter;
|
import jakarta.faces.convert.FacesConverter;
|
||||||
import javax.faces.validator.ValidatorException;
|
import jakarta.faces.validator.ValidatorException;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
|
@ -48,6 +48,9 @@ public class TimeConverter implements Converter<Integer> {
|
||||||
@Override
|
@Override
|
||||||
public String getAsString(FacesContext context,
|
public String getAsString(FacesContext context,
|
||||||
UIComponent component, Integer value) {
|
UIComponent component, Integer value) {
|
||||||
|
if ( value == null ) {
|
||||||
|
return "--";
|
||||||
|
}
|
||||||
return TimeFormatter.formatTime(Long.valueOf(value));
|
return TimeFormatter.formatTime(Long.valueOf(value));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,18 +1,22 @@
|
||||||
package com.mousetech.gourmetj.utils;
|
package com.mousetech.gourmetj.utils;
|
||||||
|
|
||||||
|
import java.io.ByteArrayInputStream;
|
||||||
import java.io.ByteArrayOutputStream;
|
import java.io.ByteArrayOutputStream;
|
||||||
|
import java.io.InputStream;
|
||||||
|
import java.io.OutputStream;
|
||||||
import java.io.PrintWriter;
|
import java.io.PrintWriter;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.primefaces.model.ByteArrayContent;
|
import org.primefaces.model.DefaultStreamedContent;
|
||||||
import org.primefaces.model.StreamedContent;
|
import org.primefaces.model.StreamedContent;
|
||||||
|
import org.primefaces.util.SerializableSupplier;
|
||||||
import com.mousetech.gourmetj.ShopIngredient;
|
import com.mousetech.gourmetj.ShopIngredient;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Construct a Primefaces file output content for an ingredient
|
* Construct a Primefaces file output content for an ingredient
|
||||||
* list in YAML format.
|
* list in YAML format.
|
||||||
|
* @see ShoppingListBean
|
||||||
*
|
*
|
||||||
* @author timh
|
* @author timh
|
||||||
* @since Jan 15, 2022
|
* @since Jan 15, 2022
|
||||||
|
@ -20,18 +24,30 @@ import com.mousetech.gourmetj.ShopIngredient;
|
||||||
|
|
||||||
public class YamlShoppingList {
|
public class YamlShoppingList {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Create "file" to download in YAML format
|
||||||
|
* @param ingredientList Ingredient list to format
|
||||||
|
* @return Http response for file download
|
||||||
|
*/
|
||||||
public static StreamedContent createDownload(
|
public static StreamedContent createDownload(
|
||||||
List<ShopIngredient> ingredientList) {
|
List<ShopIngredient> ingredientList) {
|
||||||
|
StreamedContent file;
|
||||||
|
|
||||||
|
|
||||||
ByteArrayOutputStream ary = new ByteArrayOutputStream();
|
ByteArrayOutputStream ary = new ByteArrayOutputStream();
|
||||||
PrintWriter wtr = new PrintWriter(ary);
|
PrintWriter wtr = new PrintWriter(ary);
|
||||||
wtr.println("---");
|
wtr.println("---");
|
||||||
formatContent(wtr, ingredientList);
|
formatContent(wtr, ingredientList);
|
||||||
wtr.close();
|
wtr.close();
|
||||||
byte[] bas = ary.toByteArray();
|
|
||||||
|
|
||||||
StreamedContent dlList = new ByteArrayContent(bas,
|
InputStream airy = new ByteArrayInputStream(ary.toByteArray());
|
||||||
"text/text", "shopping_list.yml");
|
file = DefaultStreamedContent.
|
||||||
return dlList;
|
builder().contentEncoding("text/text")
|
||||||
|
.name("shopping_list.yml")
|
||||||
|
.stream(() -> airy)
|
||||||
|
.build();
|
||||||
|
|
||||||
|
return file;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -20,7 +20,7 @@ spring:
|
||||||
hibernate:
|
hibernate:
|
||||||
ddl-auto: none
|
ddl-auto: none
|
||||||
#database-platform: org.sqlite.hibernate.dialect.SQLiteDialect
|
#database-platform: org.sqlite.hibernate.dialect.SQLiteDialect
|
||||||
database-platform: org.hibernate.dialect.MySQLDialect
|
###database-platform: org.hibernate.dialect.MySQLDialect
|
||||||
|
|
||||||
server:
|
server:
|
||||||
servlet:
|
servlet:
|
||||||
|
@ -30,3 +30,7 @@ server:
|
||||||
gourmet:
|
gourmet:
|
||||||
password:
|
password:
|
||||||
file: .gourmetpw
|
file: .gourmetpw
|
||||||
|
|
||||||
|
joinfaces:
|
||||||
|
primefaces:
|
||||||
|
theme: saga
|
||||||
|
|
Loading…
Reference in New Issue
Block a user