Compare commits
88
Commits
5bba424c34
...
ddb84f26f1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ddb84f26f1 | ||
|
|
bd288d4d1c | ||
|
|
179af51456 | ||
|
|
ddf670cc94 | ||
|
|
ab3a36859a | ||
|
|
4ec09ac16c | ||
|
|
4e24723358 | ||
|
|
3528c1d0d3 | ||
|
|
69b320b28b | ||
|
|
7fd2221e0a | ||
|
|
a14d2a6f33 | ||
|
|
577015fa3f | ||
|
|
b5d18c63ce | ||
|
|
4c56f2c0ab | ||
|
|
436142f546 | ||
|
|
e9e9cfca97 | ||
|
|
dfaf2c55e2 | ||
|
|
f63847a092 | ||
|
|
907db5fb36 | ||
|
|
2a8ba84bec | ||
|
|
0597edf116 | ||
|
|
4005fd4edb | ||
|
|
d56514a712 | ||
|
|
63f4e7c907 | ||
|
|
47beddf9c8 | ||
|
|
d7b6283ffe | ||
|
|
fb7b0271b3 | ||
|
|
f65ff26e48 | ||
|
|
d0f62b4ca6 | ||
|
|
221ebf1c2b | ||
|
|
5cfade336e | ||
|
|
80b20f2098 | ||
|
|
a37a1e1a91 | ||
|
|
6d83a513f1 | ||
|
|
3b0d0ec982 | ||
|
|
8946853604 | ||
|
|
03e5e1b455 | ||
|
|
b32cc63e76 | ||
|
|
3cd8670cef | ||
|
|
efc2bd7501 | ||
|
|
5202042894 | ||
|
|
512331d3ab | ||
|
|
4dd3468bef | ||
|
|
7a64b195ed | ||
|
|
5204322f40 | ||
|
|
9bf9f8acdc | ||
|
|
525ba69689 | ||
|
|
1ee5174207 | ||
|
|
3effc5364e | ||
|
|
32894e5469 | ||
|
|
75ccf7d28e | ||
|
|
a642ea9890 | ||
|
|
525074af15 | ||
|
|
361433bf22 | ||
|
|
6a6ef2b96d | ||
|
|
81befda3a9 | ||
|
|
7b4f460445 | ||
|
|
75ad93bde0 | ||
|
|
23e4a27d38 | ||
|
|
ae1ba8b9c5 | ||
|
|
780448537b | ||
|
|
7690d05fd2 | ||
|
|
b52d4b47b9 | ||
|
|
6dfe2a3329 | ||
|
|
27f80636f0 | ||
|
|
264bfa8bf0 | ||
|
|
ad91dbd5e9 | ||
|
|
c608a9d207 | ||
|
|
e1d8d81095 | ||
|
|
7713b1d3ec | ||
|
|
cd1e8787eb | ||
|
|
d7185572fc | ||
|
|
ad944b9616 | ||
|
|
37b45d998d | ||
|
|
55e2db138a | ||
|
|
64c7ed198f | ||
|
|
65cebb835a | ||
|
|
496ec030cb | ||
|
|
2a8d083e34 | ||
|
|
dbbdf9e24c | ||
|
|
de5634b10c | ||
|
|
2a2390feac | ||
|
|
f108d12beb | ||
|
|
3ecfb34e97 | ||
|
|
281f8811ca | ||
|
|
64d6228bdd | ||
|
|
05877782a9 | ||
|
|
1f810dbde6 |
+39
@@ -0,0 +1,39 @@
|
||||
HELP.md
|
||||
target/
|
||||
!.mvn/wrapper/maven-wrapper.jar
|
||||
!**/src/main/**/target/
|
||||
!**/src/test/**/target/
|
||||
Databases/
|
||||
logs/
|
||||
Results/
|
||||
|
||||
### STS ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
|
||||
### IntelliJ IDEA ###
|
||||
.idea
|
||||
*.iws
|
||||
*.iml
|
||||
*.ipr
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
build/
|
||||
!**/src/main/**/build/
|
||||
!**/src/test/**/build/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Logging ###
|
||||
*.log
|
||||
+117
@@ -0,0 +1,117 @@
|
||||
/*
|
||||
* Copyright 2007-present the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* https://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
import java.net.*;
|
||||
import java.io.*;
|
||||
import java.nio.channels.*;
|
||||
import java.util.Properties;
|
||||
|
||||
public class MavenWrapperDownloader {
|
||||
|
||||
private static final String WRAPPER_VERSION = "0.5.6";
|
||||
/**
|
||||
* Default URL to download the maven-wrapper.jar from, if no 'downloadUrl' is provided.
|
||||
*/
|
||||
private static final String DEFAULT_DOWNLOAD_URL = "https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/"
|
||||
+ WRAPPER_VERSION + "/maven-wrapper-" + WRAPPER_VERSION + ".jar";
|
||||
|
||||
/**
|
||||
* Path to the maven-wrapper.properties file, which might contain a downloadUrl property to
|
||||
* use instead of the default one.
|
||||
*/
|
||||
private static final String MAVEN_WRAPPER_PROPERTIES_PATH =
|
||||
".mvn/wrapper/maven-wrapper.properties";
|
||||
|
||||
/**
|
||||
* Path where the maven-wrapper.jar will be saved to.
|
||||
*/
|
||||
private static final String MAVEN_WRAPPER_JAR_PATH =
|
||||
".mvn/wrapper/maven-wrapper.jar";
|
||||
|
||||
/**
|
||||
* Name of the property which should be used to override the default download url for the wrapper.
|
||||
*/
|
||||
private static final String PROPERTY_NAME_WRAPPER_URL = "wrapperUrl";
|
||||
|
||||
public static void main(String args[]) {
|
||||
System.out.println("- Downloader started");
|
||||
File baseDirectory = new File(args[0]);
|
||||
System.out.println("- Using base directory: " + baseDirectory.getAbsolutePath());
|
||||
|
||||
// If the maven-wrapper.properties exists, read it and check if it contains a custom
|
||||
// wrapperUrl parameter.
|
||||
File mavenWrapperPropertyFile = new File(baseDirectory, MAVEN_WRAPPER_PROPERTIES_PATH);
|
||||
String url = DEFAULT_DOWNLOAD_URL;
|
||||
if(mavenWrapperPropertyFile.exists()) {
|
||||
FileInputStream mavenWrapperPropertyFileInputStream = null;
|
||||
try {
|
||||
mavenWrapperPropertyFileInputStream = new FileInputStream(mavenWrapperPropertyFile);
|
||||
Properties mavenWrapperProperties = new Properties();
|
||||
mavenWrapperProperties.load(mavenWrapperPropertyFileInputStream);
|
||||
url = mavenWrapperProperties.getProperty(PROPERTY_NAME_WRAPPER_URL, url);
|
||||
} catch (IOException e) {
|
||||
System.out.println("- ERROR loading '" + MAVEN_WRAPPER_PROPERTIES_PATH + "'");
|
||||
} finally {
|
||||
try {
|
||||
if(mavenWrapperPropertyFileInputStream != null) {
|
||||
mavenWrapperPropertyFileInputStream.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
// Ignore ...
|
||||
}
|
||||
}
|
||||
}
|
||||
System.out.println("- Downloading from: " + url);
|
||||
|
||||
File outputFile = new File(baseDirectory.getAbsolutePath(), MAVEN_WRAPPER_JAR_PATH);
|
||||
if(!outputFile.getParentFile().exists()) {
|
||||
if(!outputFile.getParentFile().mkdirs()) {
|
||||
System.out.println(
|
||||
"- ERROR creating output directory '" + outputFile.getParentFile().getAbsolutePath() + "'");
|
||||
}
|
||||
}
|
||||
System.out.println("- Downloading to: " + outputFile.getAbsolutePath());
|
||||
try {
|
||||
downloadFileFromURL(url, outputFile);
|
||||
System.out.println("Done");
|
||||
System.exit(0);
|
||||
} catch (Throwable e) {
|
||||
System.out.println("- Error downloading");
|
||||
e.printStackTrace();
|
||||
System.exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
private static void downloadFileFromURL(String urlString, File destination) throws Exception {
|
||||
if (System.getenv("MVNW_USERNAME") != null && System.getenv("MVNW_PASSWORD") != null) {
|
||||
String username = System.getenv("MVNW_USERNAME");
|
||||
char[] password = System.getenv("MVNW_PASSWORD").toCharArray();
|
||||
Authenticator.setDefault(new Authenticator() {
|
||||
@Override
|
||||
protected PasswordAuthentication getPasswordAuthentication() {
|
||||
return new PasswordAuthentication(username, password);
|
||||
}
|
||||
});
|
||||
}
|
||||
URL website = new URL(urlString);
|
||||
ReadableByteChannel rbc;
|
||||
rbc = Channels.newChannel(website.openStream());
|
||||
FileOutputStream fos = new FileOutputStream(destination);
|
||||
fos.getChannel().transferFrom(rbc, 0, Long.MAX_VALUE);
|
||||
fos.close();
|
||||
rbc.close();
|
||||
}
|
||||
|
||||
}
|
||||
Vendored
BIN
Binary file not shown.
+2
@@ -0,0 +1,2 @@
|
||||
distributionUrl=https://repo.maven.apache.org/maven2/org/apache/maven/apache-maven/3.6.3/apache-maven-3.6.3-bin.zip
|
||||
wrapperUrl=https://repo.maven.apache.org/maven2/io/takari/maven-wrapper/0.5.6/maven-wrapper-0.5.6.jar
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -1 +1,4 @@
|
||||
# AbizeitungVotingSystem
|
||||
Internet address: http://adolfinum-voting.tools/ <br>
|
||||
Server IP address: 192.168.2.159 <br>
|
||||
Port: 8000 <br>
|
||||
|
||||
+218
@@ -0,0 +1,218 @@
|
||||
2021-01-17 14:53:49,688 INFO [restartedMain] Starting AbizeitungVotingSystemApplication on bitecoding-System-Product-Name with PID 7976 (/home/bitecoding/Code/GitHub/AbizeitungVotingSystem/target/classes started by bitecoding in /home/bitecoding/Code/GitHub/AbizeitungVotingSystem)
|
||||
2021-01-17 14:53:49,692 INFO [restartedMain] No active profile set, falling back to default profiles: default
|
||||
2021-01-17 14:53:49,744 INFO [restartedMain] Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
|
||||
2021-01-17 14:53:49,744 INFO [restartedMain] For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
|
||||
2021-01-17 14:53:50,168 INFO [restartedMain] Bootstrapping Spring Data JPA repositories in DEFAULT mode.
|
||||
2021-01-17 14:53:50,231 INFO [restartedMain] Finished Spring Data repository scanning in 51ms. Found 5 JPA repository interfaces.
|
||||
2021-01-17 14:53:50,893 INFO [restartedMain] Tomcat initialized with port(s): 8000 (http)
|
||||
2021-01-17 14:53:50,906 INFO [restartedMain] Initializing ProtocolHandler ["http-nio-8000"]
|
||||
2021-01-17 14:53:50,907 INFO [restartedMain] Starting service [Tomcat]
|
||||
2021-01-17 14:53:50,907 INFO [restartedMain] Starting Servlet engine: [Apache Tomcat/9.0.38]
|
||||
2021-01-17 14:53:50,970 INFO [restartedMain] Initializing Spring embedded WebApplicationContext
|
||||
2021-01-17 14:53:50,970 INFO [restartedMain] Root WebApplicationContext: initialization completed in 1226 ms
|
||||
2021-01-17 14:53:51,174 INFO [restartedMain] HHH000204: Processing PersistenceUnitInfo [name: default]
|
||||
2021-01-17 14:53:51,223 INFO [restartedMain] HHH000412: Hibernate ORM core version 5.4.21.Final
|
||||
2021-01-17 14:53:51,341 INFO [restartedMain] HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
|
||||
2021-01-17 14:53:51,411 INFO [restartedMain] HikariPool-1 - Starting...
|
||||
2021-01-17 14:53:51,821 INFO [restartedMain] HikariPool-1 - Start completed.
|
||||
2021-01-17 14:53:51,844 INFO [restartedMain] HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect
|
||||
2021-01-17 14:53:52,466 INFO [restartedMain] HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
|
||||
2021-01-17 14:53:52,473 INFO [restartedMain] Initialized JPA EntityManagerFactory for persistence unit 'default'
|
||||
2021-01-17 14:53:52,484 INFO [restartedMain] LiveReload server is running on port 35729
|
||||
2021-01-17 14:53:52,839 INFO [restartedMain] Program started with arguments: votingPhase=true addingPhase=false
|
||||
2021-01-17 14:53:56,086 INFO [restartedMain] Candidates successfully set up
|
||||
2021-01-17 14:53:56,127 WARN [restartedMain] spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
|
||||
2021-01-17 14:53:56,238 INFO [restartedMain] Initializing ExecutorService 'applicationTaskExecutor'
|
||||
2021-01-17 14:53:56,439 INFO [restartedMain] Starting ProtocolHandler ["http-nio-8000"]
|
||||
2021-01-17 14:53:56,454 INFO [restartedMain] Tomcat started on port(s): 8000 (http) with context path ''
|
||||
2021-01-17 14:53:56,463 INFO [restartedMain] Started AbizeitungVotingSystemApplication in 7.114 seconds (JVM running for 7.878)
|
||||
2021-01-17 14:58:34,081 INFO [SpringContextShutdownHook] Shutting down ExecutorService 'applicationTaskExecutor'
|
||||
2021-01-17 14:58:34,084 INFO [SpringContextShutdownHook] Closing JPA EntityManagerFactory for persistence unit 'default'
|
||||
2021-01-17 14:58:34,088 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown initiated...
|
||||
2021-01-17 14:58:34,100 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown completed.
|
||||
2021-01-17 14:58:37,867 INFO [restartedMain] Starting AbizeitungVotingSystemApplication on bitecoding-System-Product-Name with PID 8368 (/home/bitecoding/Code/GitHub/AbizeitungVotingSystem/target/classes started by bitecoding in /home/bitecoding/Code/GitHub/AbizeitungVotingSystem)
|
||||
2021-01-17 14:58:37,871 INFO [restartedMain] No active profile set, falling back to default profiles: default
|
||||
2021-01-17 14:58:37,936 INFO [restartedMain] Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
|
||||
2021-01-17 14:58:37,937 INFO [restartedMain] For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
|
||||
2021-01-17 14:58:38,350 INFO [restartedMain] Bootstrapping Spring Data JPA repositories in DEFAULT mode.
|
||||
2021-01-17 14:58:38,397 INFO [restartedMain] Finished Spring Data repository scanning in 40ms. Found 5 JPA repository interfaces.
|
||||
2021-01-17 14:58:38,988 INFO [restartedMain] Tomcat initialized with port(s): 8000 (http)
|
||||
2021-01-17 14:58:38,996 INFO [restartedMain] Initializing ProtocolHandler ["http-nio-8000"]
|
||||
2021-01-17 14:58:38,997 INFO [restartedMain] Starting service [Tomcat]
|
||||
2021-01-17 14:58:38,997 INFO [restartedMain] Starting Servlet engine: [Apache Tomcat/9.0.38]
|
||||
2021-01-17 14:58:39,049 INFO [restartedMain] Initializing Spring embedded WebApplicationContext
|
||||
2021-01-17 14:58:39,049 INFO [restartedMain] Root WebApplicationContext: initialization completed in 1112 ms
|
||||
2021-01-17 14:58:39,198 INFO [restartedMain] HHH000204: Processing PersistenceUnitInfo [name: default]
|
||||
2021-01-17 14:58:39,228 INFO [restartedMain] HHH000412: Hibernate ORM core version 5.4.21.Final
|
||||
2021-01-17 14:58:39,304 INFO [restartedMain] HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
|
||||
2021-01-17 14:58:39,363 INFO [restartedMain] HikariPool-1 - Starting...
|
||||
2021-01-17 14:58:39,678 INFO [restartedMain] HikariPool-1 - Start completed.
|
||||
2021-01-17 14:58:39,699 INFO [restartedMain] HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect
|
||||
2021-01-17 14:58:40,252 INFO [restartedMain] HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
|
||||
2021-01-17 14:58:40,261 INFO [restartedMain] Initialized JPA EntityManagerFactory for persistence unit 'default'
|
||||
2021-01-17 14:58:40,272 INFO [restartedMain] LiveReload server is running on port 35729
|
||||
2021-01-17 14:58:40,603 INFO [restartedMain] Program started with arguments: votingPhase=true addingPhase=false
|
||||
2021-01-17 14:58:43,540 INFO [restartedMain] Candidates successfully set up
|
||||
2021-01-17 14:58:43,572 WARN [restartedMain] spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
|
||||
2021-01-17 14:58:43,663 INFO [restartedMain] Initializing ExecutorService 'applicationTaskExecutor'
|
||||
2021-01-17 14:58:43,819 INFO [restartedMain] Starting ProtocolHandler ["http-nio-8000"]
|
||||
2021-01-17 14:58:43,832 INFO [restartedMain] Tomcat started on port(s): 8000 (http) with context path ''
|
||||
2021-01-17 14:58:43,841 INFO [restartedMain] Started AbizeitungVotingSystemApplication in 6.33 seconds (JVM running for 6.868)
|
||||
2021-01-17 15:00:38,920 INFO [http-nio-8000-exec-1] Initializing Spring DispatcherServlet 'dispatcherServlet'
|
||||
2021-01-17 15:00:38,921 INFO [http-nio-8000-exec-1] Initializing Servlet 'dispatcherServlet'
|
||||
2021-01-17 15:00:38,927 INFO [http-nio-8000-exec-1] Completed initialization in 6 ms
|
||||
2021-01-17 15:00:38,951 WARN [http-nio-8000-exec-1] in Bounds
|
||||
2021-01-17 15:00:46,009 WARN [http-nio-8000-exec-4] simon.bussmann@adolfinum.de
|
||||
2021-01-17 15:01:01,586 WARN [http-nio-8000-exec-6] matched
|
||||
2021-01-17 15:16:30,676 INFO [SpringContextShutdownHook] Shutting down ExecutorService 'applicationTaskExecutor'
|
||||
2021-01-17 15:16:30,679 INFO [SpringContextShutdownHook] Closing JPA EntityManagerFactory for persistence unit 'default'
|
||||
2021-01-17 15:16:30,683 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown initiated...
|
||||
2021-01-17 15:16:30,693 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown completed.
|
||||
2021-01-17 15:16:32,386 INFO [restartedMain] Starting AbizeitungVotingSystemApplication on bitecoding-System-Product-Name with PID 9493 (/home/bitecoding/Code/GitHub/AbizeitungVotingSystem/target/classes started by bitecoding in /home/bitecoding/Code/GitHub/AbizeitungVotingSystem)
|
||||
2021-01-17 15:16:32,390 INFO [restartedMain] No active profile set, falling back to default profiles: default
|
||||
2021-01-17 15:16:32,444 INFO [restartedMain] Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
|
||||
2021-01-17 15:16:32,444 INFO [restartedMain] For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
|
||||
2021-01-17 15:16:32,883 INFO [restartedMain] Bootstrapping Spring Data JPA repositories in DEFAULT mode.
|
||||
2021-01-17 15:16:32,939 INFO [restartedMain] Finished Spring Data repository scanning in 48ms. Found 5 JPA repository interfaces.
|
||||
2021-01-17 15:16:33,628 INFO [restartedMain] Tomcat initialized with port(s): 8000 (http)
|
||||
2021-01-17 15:16:33,640 INFO [restartedMain] Initializing ProtocolHandler ["http-nio-8000"]
|
||||
2021-01-17 15:16:33,641 INFO [restartedMain] Starting service [Tomcat]
|
||||
2021-01-17 15:16:33,641 INFO [restartedMain] Starting Servlet engine: [Apache Tomcat/9.0.38]
|
||||
2021-01-17 15:16:33,708 INFO [restartedMain] Initializing Spring embedded WebApplicationContext
|
||||
2021-01-17 15:16:33,709 INFO [restartedMain] Root WebApplicationContext: initialization completed in 1265 ms
|
||||
2021-01-17 15:16:33,883 INFO [restartedMain] HHH000204: Processing PersistenceUnitInfo [name: default]
|
||||
2021-01-17 15:16:33,918 INFO [restartedMain] HHH000412: Hibernate ORM core version 5.4.21.Final
|
||||
2021-01-17 15:16:34,014 INFO [restartedMain] HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
|
||||
2021-01-17 15:16:34,084 INFO [restartedMain] HikariPool-1 - Starting...
|
||||
2021-01-17 15:16:34,444 INFO [restartedMain] HikariPool-1 - Start completed.
|
||||
2021-01-17 15:16:34,469 INFO [restartedMain] HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect
|
||||
2021-01-17 15:16:35,144 INFO [restartedMain] HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
|
||||
2021-01-17 15:16:35,151 INFO [restartedMain] Initialized JPA EntityManagerFactory for persistence unit 'default'
|
||||
2021-01-17 15:16:35,167 INFO [restartedMain] LiveReload server is running on port 35729
|
||||
2021-01-17 15:16:35,541 INFO [restartedMain] Program started with arguments: votingPhase=true addingPhase=false
|
||||
2021-01-17 15:16:35,766 WARN [restartedMain] spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
|
||||
2021-01-17 15:16:35,868 INFO [restartedMain] Initializing ExecutorService 'applicationTaskExecutor'
|
||||
2021-01-17 15:16:36,044 INFO [restartedMain] Starting ProtocolHandler ["http-nio-8000"]
|
||||
2021-01-17 15:16:36,058 INFO [restartedMain] Tomcat started on port(s): 8000 (http) with context path ''
|
||||
2021-01-17 15:16:36,067 INFO [restartedMain] Started AbizeitungVotingSystemApplication in 4.094 seconds (JVM running for 4.813)
|
||||
2021-01-17 15:17:23,695 INFO [http-nio-8000-exec-1] Initializing Spring DispatcherServlet 'dispatcherServlet'
|
||||
2021-01-17 15:17:23,696 INFO [http-nio-8000-exec-1] Initializing Servlet 'dispatcherServlet'
|
||||
2021-01-17 15:17:23,708 INFO [http-nio-8000-exec-1] Completed initialization in 11 ms
|
||||
2021-01-17 15:17:23,733 WARN [http-nio-8000-exec-1] in Bounds
|
||||
2021-01-17 15:17:30,136 WARN [http-nio-8000-exec-4] simon.bussmann@adolfinum.de
|
||||
2021-01-17 15:17:42,309 WARN [http-nio-8000-exec-6] matched
|
||||
2021-01-17 15:18:29,420 INFO [SpringContextShutdownHook] Shutting down ExecutorService 'applicationTaskExecutor'
|
||||
2021-01-17 15:18:29,421 INFO [SpringContextShutdownHook] Closing JPA EntityManagerFactory for persistence unit 'default'
|
||||
2021-01-17 15:18:29,424 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown initiated...
|
||||
2021-01-17 15:18:29,437 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown completed.
|
||||
2021-01-17 15:18:31,847 INFO [restartedMain] Starting AbizeitungVotingSystemApplication on bitecoding-System-Product-Name with PID 9761 (/home/bitecoding/Code/GitHub/AbizeitungVotingSystem/target/classes started by bitecoding in /home/bitecoding/Code/GitHub/AbizeitungVotingSystem)
|
||||
2021-01-17 15:18:31,850 INFO [restartedMain] No active profile set, falling back to default profiles: default
|
||||
2021-01-17 15:18:31,907 INFO [restartedMain] Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
|
||||
2021-01-17 15:18:31,908 INFO [restartedMain] For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
|
||||
2021-01-17 15:18:32,319 INFO [restartedMain] Bootstrapping Spring Data JPA repositories in DEFAULT mode.
|
||||
2021-01-17 15:18:32,372 INFO [restartedMain] Finished Spring Data repository scanning in 47ms. Found 5 JPA repository interfaces.
|
||||
2021-01-17 15:18:33,086 INFO [restartedMain] Tomcat initialized with port(s): 8000 (http)
|
||||
2021-01-17 15:18:33,096 INFO [restartedMain] Initializing ProtocolHandler ["http-nio-8000"]
|
||||
2021-01-17 15:18:33,097 INFO [restartedMain] Starting service [Tomcat]
|
||||
2021-01-17 15:18:33,097 INFO [restartedMain] Starting Servlet engine: [Apache Tomcat/9.0.38]
|
||||
2021-01-17 15:18:33,157 INFO [restartedMain] Initializing Spring embedded WebApplicationContext
|
||||
2021-01-17 15:18:33,157 INFO [restartedMain] Root WebApplicationContext: initialization completed in 1249 ms
|
||||
2021-01-17 15:18:33,334 INFO [restartedMain] HHH000204: Processing PersistenceUnitInfo [name: default]
|
||||
2021-01-17 15:18:33,371 INFO [restartedMain] HHH000412: Hibernate ORM core version 5.4.21.Final
|
||||
2021-01-17 15:18:33,477 INFO [restartedMain] HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
|
||||
2021-01-17 15:18:33,577 INFO [restartedMain] HikariPool-1 - Starting...
|
||||
2021-01-17 15:18:33,998 INFO [restartedMain] HikariPool-1 - Start completed.
|
||||
2021-01-17 15:18:34,029 INFO [restartedMain] HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect
|
||||
2021-01-17 15:18:34,724 INFO [restartedMain] HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
|
||||
2021-01-17 15:18:34,730 INFO [restartedMain] Initialized JPA EntityManagerFactory for persistence unit 'default'
|
||||
2021-01-17 15:18:34,744 INFO [restartedMain] LiveReload server is running on port 35729
|
||||
2021-01-17 15:18:35,270 INFO [restartedMain] Program started with arguments: votingPhase=true addingPhase=false
|
||||
2021-01-17 15:18:35,589 WARN [restartedMain] spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
|
||||
2021-01-17 15:18:35,735 INFO [restartedMain] Initializing ExecutorService 'applicationTaskExecutor'
|
||||
2021-01-17 15:18:35,936 INFO [restartedMain] Starting ProtocolHandler ["http-nio-8000"]
|
||||
2021-01-17 15:18:35,950 INFO [restartedMain] Tomcat started on port(s): 8000 (http) with context path ''
|
||||
2021-01-17 15:18:35,961 INFO [restartedMain] Started AbizeitungVotingSystemApplication in 4.494 seconds (JVM running for 5.13)
|
||||
2021-01-17 15:18:40,203 INFO [http-nio-8000-exec-1] Initializing Spring DispatcherServlet 'dispatcherServlet'
|
||||
2021-01-17 15:18:40,204 INFO [http-nio-8000-exec-1] Initializing Servlet 'dispatcherServlet'
|
||||
2021-01-17 15:18:40,216 INFO [http-nio-8000-exec-1] Completed initialization in 12 ms
|
||||
2021-01-17 15:18:40,244 WARN [http-nio-8000-exec-1] in Bounds
|
||||
2021-01-17 15:18:46,736 WARN [http-nio-8000-exec-3] simon.bussmann@adolfinum.de
|
||||
2021-01-17 15:18:56,942 WARN [http-nio-8000-exec-5] matched
|
||||
2021-01-17 15:19:49,251 WARN [http-nio-8000-exec-7] in Bounds
|
||||
2021-01-17 15:19:55,903 WARN [http-nio-8000-exec-9] simon.bussmann@adolfinum.de
|
||||
2021-01-17 15:20:18,347 WARN [http-nio-8000-exec-3] matched
|
||||
2021-01-17 15:23:22,895 INFO [SpringContextShutdownHook] Shutting down ExecutorService 'applicationTaskExecutor'
|
||||
2021-01-17 15:23:22,897 INFO [SpringContextShutdownHook] Closing JPA EntityManagerFactory for persistence unit 'default'
|
||||
2021-01-17 15:23:22,902 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown initiated...
|
||||
2021-01-17 15:23:22,910 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown completed.
|
||||
2021-01-17 15:23:25,390 INFO [restartedMain] Starting AbizeitungVotingSystemApplication on bitecoding-System-Product-Name with PID 10453 (/home/bitecoding/Code/GitHub/AbizeitungVotingSystem/target/classes started by bitecoding in /home/bitecoding/Code/GitHub/AbizeitungVotingSystem)
|
||||
2021-01-17 15:23:25,393 INFO [restartedMain] No active profile set, falling back to default profiles: default
|
||||
2021-01-17 15:23:25,466 INFO [restartedMain] Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
|
||||
2021-01-17 15:23:25,467 INFO [restartedMain] For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
|
||||
2021-01-17 15:23:25,907 INFO [restartedMain] Bootstrapping Spring Data JPA repositories in DEFAULT mode.
|
||||
2021-01-17 15:23:25,965 INFO [restartedMain] Finished Spring Data repository scanning in 51ms. Found 5 JPA repository interfaces.
|
||||
2021-01-17 15:23:26,765 INFO [restartedMain] Tomcat initialized with port(s): 8000 (http)
|
||||
2021-01-17 15:23:26,775 INFO [restartedMain] Initializing ProtocolHandler ["http-nio-8000"]
|
||||
2021-01-17 15:23:26,776 INFO [restartedMain] Starting service [Tomcat]
|
||||
2021-01-17 15:23:26,777 INFO [restartedMain] Starting Servlet engine: [Apache Tomcat/9.0.38]
|
||||
2021-01-17 15:23:26,848 INFO [restartedMain] Initializing Spring embedded WebApplicationContext
|
||||
2021-01-17 15:23:26,848 INFO [restartedMain] Root WebApplicationContext: initialization completed in 1381 ms
|
||||
2021-01-17 15:23:27,067 INFO [restartedMain] HHH000204: Processing PersistenceUnitInfo [name: default]
|
||||
2021-01-17 15:23:27,099 INFO [restartedMain] HHH000412: Hibernate ORM core version 5.4.21.Final
|
||||
2021-01-17 15:23:27,192 INFO [restartedMain] HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
|
||||
2021-01-17 15:23:27,264 INFO [restartedMain] HikariPool-1 - Starting...
|
||||
2021-01-17 15:23:27,633 INFO [restartedMain] HikariPool-1 - Start completed.
|
||||
2021-01-17 15:23:27,655 INFO [restartedMain] HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect
|
||||
2021-01-17 15:23:28,377 INFO [restartedMain] HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
|
||||
2021-01-17 15:23:28,382 INFO [restartedMain] Initialized JPA EntityManagerFactory for persistence unit 'default'
|
||||
2021-01-17 15:23:28,396 INFO [restartedMain] LiveReload server is running on port 35729
|
||||
2021-01-17 15:23:28,943 INFO [restartedMain] Program started with arguments: votingPhase=true addingPhase=false
|
||||
2021-01-17 15:23:29,269 WARN [restartedMain] spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
|
||||
2021-01-17 15:23:29,418 INFO [restartedMain] Initializing ExecutorService 'applicationTaskExecutor'
|
||||
2021-01-17 15:23:29,642 INFO [restartedMain] Starting ProtocolHandler ["http-nio-8000"]
|
||||
2021-01-17 15:23:29,659 INFO [restartedMain] Tomcat started on port(s): 8000 (http) with context path ''
|
||||
2021-01-17 15:23:29,672 INFO [restartedMain] Started AbizeitungVotingSystemApplication in 4.683 seconds (JVM running for 5.367)
|
||||
2021-01-17 15:23:38,361 INFO [http-nio-8000-exec-1] Initializing Spring DispatcherServlet 'dispatcherServlet'
|
||||
2021-01-17 15:23:38,362 INFO [http-nio-8000-exec-1] Initializing Servlet 'dispatcherServlet'
|
||||
2021-01-17 15:23:38,372 INFO [http-nio-8000-exec-1] Completed initialization in 10 ms
|
||||
2021-01-17 15:23:38,423 WARN [http-nio-8000-exec-1] wrong
|
||||
2021-01-17 15:24:04,259 WARN [http-nio-8000-exec-6] matched
|
||||
2021-01-17 15:24:18,325 WARN [http-nio-8000-exec-8] in Bounds
|
||||
2021-01-17 15:24:23,870 WARN [http-nio-8000-exec-10] simon.bussmann@adolfinum.de
|
||||
2021-01-17 15:24:42,834 WARN [http-nio-8000-exec-2] matched
|
||||
2021-01-17 15:26:25,702 INFO [http-nio-8000-exec-8] simon.bussmann@adolfinum.de has voted!
|
||||
2021-01-17 15:26:27,992 WARN [http-nio-8000-exec-10] in Bounds
|
||||
2021-01-17 15:43:46,110 WARN [http-nio-8000-exec-2] in Bounds
|
||||
2021-01-17 15:43:46,288 WARN [http-nio-8000-exec-5] Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]
|
||||
2021-01-17 15:43:46,294 WARN [http-nio-8000-exec-6] Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]
|
||||
2021-01-17 15:44:14,357 WARN [http-nio-8000-exec-7] Simon.bussmann@adolfinum.de
|
||||
2021-01-17 15:44:14,360 WARN [http-nio-8000-exec-7] Simon.bussmann@adolfinum.de has already voted
|
||||
2021-01-17 15:44:14,366 WARN [http-nio-8000-exec-8] Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]
|
||||
2021-01-17 15:44:14,375 WARN [http-nio-8000-exec-9] Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]
|
||||
2021-01-17 15:44:14,396 WARN [http-nio-8000-exec-1] Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]
|
||||
2021-01-17 15:44:14,403 WARN [http-nio-8000-exec-3] Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]
|
||||
2021-01-17 15:45:32,976 WARN [http-nio-8000-exec-5] Simon.bussmann@adolfinum.de
|
||||
2021-01-17 15:45:32,978 WARN [http-nio-8000-exec-5] Simon.bussmann@adolfinum.de has already voted
|
||||
2021-01-17 15:45:33,023 WARN [http-nio-8000-exec-7] Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]
|
||||
2021-01-17 15:45:33,030 WARN [http-nio-8000-exec-8] Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]
|
||||
2021-01-17 15:51:42,988 WARN [http-nio-8000-exec-1] in Bounds
|
||||
2021-01-17 15:51:42,993 WARN [http-nio-8000-exec-3] Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]
|
||||
2021-01-17 15:51:43,016 WARN [http-nio-8000-exec-4] Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]
|
||||
2021-01-17 15:51:43,044 WARN [http-nio-8000-exec-5] Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]
|
||||
2021-01-17 15:51:43,052 WARN [http-nio-8000-exec-6] Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]
|
||||
2021-01-17 15:51:54,850 WARN [http-nio-8000-exec-7] in Bounds
|
||||
2021-01-17 15:52:39,237 WARN [http-nio-8000-exec-3] simon.bussmann@adolfinum.de
|
||||
2021-01-17 15:53:04,490 WARN [http-nio-8000-exec-4] Simon.bussmann@adolfinum.de
|
||||
2021-01-17 15:53:04,498 WARN [http-nio-8000-exec-5] Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]
|
||||
2021-01-17 15:53:04,506 WARN [http-nio-8000-exec-6] Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]
|
||||
2021-01-17 15:53:04,537 WARN [http-nio-8000-exec-8] Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]
|
||||
2021-01-17 15:53:04,546 WARN [http-nio-8000-exec-10] Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]
|
||||
2021-01-17 15:53:29,699 WARN [http-nio-8000-exec-1] Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]
|
||||
2021-01-17 15:53:29,706 WARN [http-nio-8000-exec-3] Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]
|
||||
2021-01-17 15:53:29,707 WARN [http-nio-8000-exec-9] matched
|
||||
2021-01-17 15:53:29,881 WARN [http-nio-8000-exec-5] Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]
|
||||
2021-01-17 15:53:29,889 WARN [http-nio-8000-exec-4] Resolved [org.springframework.web.HttpMediaTypeNotAcceptableException: Could not find acceptable representation]
|
||||
2021-01-17 15:54:09,560 INFO [SpringContextShutdownHook] Shutting down ExecutorService 'applicationTaskExecutor'
|
||||
2021-01-17 15:54:09,562 INFO [SpringContextShutdownHook] Closing JPA EntityManagerFactory for persistence unit 'default'
|
||||
2021-01-17 15:54:09,564 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown initiated...
|
||||
2021-01-17 15:54:09,570 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown completed.
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,186 @@
|
||||
2020-11-10 00:01:16,168 INFO [SpringContextShutdownHook] Shutting down ExecutorService 'applicationTaskExecutor'
|
||||
2020-11-10 00:01:16,171 INFO [SpringContextShutdownHook] Closing JPA EntityManagerFactory for persistence unit 'default'
|
||||
2020-11-10 00:01:16,173 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown initiated...
|
||||
2020-11-10 00:01:16,183 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown completed.
|
||||
2020-11-10 23:29:40,574 INFO [main] Starting AbizeitungVotingSystemApplication on bitecoding-System-Product-Name with PID 19354 (/home/bitecoding/Documents/AbizeitungVotingSystem/target/classes started by bitecoding in /home/bitecoding/Documents/AbizeitungVotingSystem)
|
||||
2020-11-10 23:29:40,577 INFO [main] No active profile set, falling back to default profiles: default
|
||||
2020-11-10 23:29:41,113 INFO [main] Bootstrapping Spring Data JPA repositories in DEFAULT mode.
|
||||
2020-11-10 23:29:41,170 INFO [main] Finished Spring Data repository scanning in 47ms. Found 3 JPA repository interfaces.
|
||||
2020-11-10 23:29:41,898 INFO [main] Tomcat initialized with port(s): 8080 (http)
|
||||
2020-11-10 23:29:41,909 INFO [main] Initializing ProtocolHandler ["http-nio-8080"]
|
||||
2020-11-10 23:29:41,910 INFO [main] Starting service [Tomcat]
|
||||
2020-11-10 23:29:41,911 INFO [main] Starting Servlet engine: [Apache Tomcat/9.0.38]
|
||||
2020-11-10 23:29:42,020 INFO [main] Initializing Spring embedded WebApplicationContext
|
||||
2020-11-10 23:29:42,020 INFO [main] Root WebApplicationContext: initialization completed in 1376 ms
|
||||
2020-11-10 23:29:42,276 INFO [main] HHH000204: Processing PersistenceUnitInfo [name: default]
|
||||
2020-11-10 23:29:42,342 INFO [main] HHH000412: Hibernate ORM core version 5.4.21.Final
|
||||
2020-11-10 23:29:42,494 INFO [main] HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
|
||||
2020-11-10 23:29:42,582 INFO [main] HikariPool-1 - Starting...
|
||||
2020-11-10 23:29:43,071 INFO [main] HikariPool-1 - Start completed.
|
||||
2020-11-10 23:29:43,107 INFO [main] HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect
|
||||
2020-11-10 23:29:43,835 INFO [main] HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
|
||||
2020-11-10 23:29:43,843 INFO [main] Initialized JPA EntityManagerFactory for persistence unit 'default'
|
||||
2020-11-10 23:29:44,313 WARN [main] spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
|
||||
2020-11-10 23:29:44,447 INFO [main] Initializing ExecutorService 'applicationTaskExecutor'
|
||||
2020-11-10 23:29:44,651 INFO [main] Starting ProtocolHandler ["http-nio-8080"]
|
||||
2020-11-10 23:29:44,667 INFO [main] Tomcat started on port(s): 8080 (http) with context path ''
|
||||
2020-11-10 23:29:44,679 INFO [main] Started AbizeitungVotingSystemApplication in 4.532 seconds (JVM running for 5.135)
|
||||
2020-11-10 23:30:09,595 INFO [SpringContextShutdownHook] Shutting down ExecutorService 'applicationTaskExecutor'
|
||||
2020-11-10 23:30:09,597 INFO [SpringContextShutdownHook] Closing JPA EntityManagerFactory for persistence unit 'default'
|
||||
2020-11-10 23:30:09,600 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown initiated...
|
||||
2020-11-10 23:30:09,606 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown completed.
|
||||
2020-11-10 23:29:49,904 INFO [main] Starting AbizeitungVotingSystemApplication on coding-laptop with PID 273415 (/home/bitecoding/Documents/AbizeitungVotingSystem/target/classes started by bitecoding in /home/bitecoding/Documents/AbizeitungVotingSystem)
|
||||
2020-11-10 23:29:49,912 INFO [main] No active profile set, falling back to default profiles: default
|
||||
2020-11-10 23:29:51,345 INFO [main] Bootstrapping Spring Data JPA repositories in DEFAULT mode.
|
||||
2020-11-10 23:29:51,569 INFO [main] Finished Spring Data repository scanning in 189ms. Found 3 JPA repository interfaces.
|
||||
2020-11-10 23:29:53,369 INFO [main] Tomcat initialized with port(s): 8080 (http)
|
||||
2020-11-10 23:29:53,403 INFO [main] Initializing ProtocolHandler ["http-nio-8080"]
|
||||
2020-11-10 23:29:53,417 INFO [main] Starting service [Tomcat]
|
||||
2020-11-10 23:29:53,420 INFO [main] Starting Servlet engine: [Apache Tomcat/9.0.38]
|
||||
2020-11-10 23:29:53,738 INFO [main] Initializing Spring embedded WebApplicationContext
|
||||
2020-11-10 23:29:53,739 INFO [main] Root WebApplicationContext: initialization completed in 3649 ms
|
||||
2020-11-10 23:29:54,342 INFO [main] HHH000204: Processing PersistenceUnitInfo [name: default]
|
||||
2020-11-10 23:29:54,499 INFO [main] HHH000412: Hibernate ORM core version 5.4.21.Final
|
||||
2020-11-10 23:29:54,826 INFO [main] HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
|
||||
2020-11-10 23:29:55,059 INFO [main] HikariPool-1 - Starting...
|
||||
2020-11-10 23:29:57,149 ERROR [main] HikariPool-1 - Exception during pool initialization.
|
||||
java.sql.SQLException: Access denied for user 'root'@'localhost'
|
||||
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:129)
|
||||
at com.mysql.cj.jdbc.exceptions.SQLError.createSQLException(SQLError.java:97)
|
||||
at com.mysql.cj.jdbc.exceptions.SQLExceptionsMapping.translateException(SQLExceptionsMapping.java:122)
|
||||
at com.mysql.cj.jdbc.ConnectionImpl.createNewIO(ConnectionImpl.java:836)
|
||||
at com.mysql.cj.jdbc.ConnectionImpl.<init>(ConnectionImpl.java:456)
|
||||
at com.mysql.cj.jdbc.ConnectionImpl.getInstance(ConnectionImpl.java:246)
|
||||
at com.mysql.cj.jdbc.NonRegisteringDriver.connect(NonRegisteringDriver.java:197)
|
||||
at com.zaxxer.hikari.util.DriverDataSource.getConnection(DriverDataSource.java:138)
|
||||
at com.zaxxer.hikari.pool.PoolBase.newConnection(PoolBase.java:358)
|
||||
at com.zaxxer.hikari.pool.PoolBase.newPoolEntry(PoolBase.java:206)
|
||||
at com.zaxxer.hikari.pool.HikariPool.createPoolEntry(HikariPool.java:477)
|
||||
at com.zaxxer.hikari.pool.HikariPool.checkFailFast(HikariPool.java:560)
|
||||
at com.zaxxer.hikari.pool.HikariPool.<init>(HikariPool.java:115)
|
||||
at com.zaxxer.hikari.HikariDataSource.getConnection(HikariDataSource.java:112)
|
||||
at org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl.getConnection(DatasourceConnectionProviderImpl.java:122)
|
||||
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator$ConnectionProviderJdbcConnectionAccess.obtainConnection(JdbcEnvironmentInitiator.java:180)
|
||||
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:68)
|
||||
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35)
|
||||
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:101)
|
||||
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:263)
|
||||
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:237)
|
||||
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214)
|
||||
at org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.injectServices(DefaultIdentifierGeneratorFactory.java:152)
|
||||
at org.hibernate.service.internal.AbstractServiceRegistryImpl.injectDependencies(AbstractServiceRegistryImpl.java:286)
|
||||
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:243)
|
||||
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214)
|
||||
at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:176)
|
||||
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:118)
|
||||
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1224)
|
||||
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1255)
|
||||
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58)
|
||||
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365)
|
||||
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:391)
|
||||
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:378)
|
||||
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341)
|
||||
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1853)
|
||||
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1790)
|
||||
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594)
|
||||
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
|
||||
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
|
||||
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
|
||||
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
|
||||
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
|
||||
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1109)
|
||||
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869)
|
||||
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551)
|
||||
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
|
||||
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
|
||||
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
|
||||
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
|
||||
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
|
||||
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237)
|
||||
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
|
||||
at com.github.cato447.AbizeitungVotingSystem.AbizeitungVotingSystemApplication.main(AbizeitungVotingSystemApplication.java:12)
|
||||
2020-11-10 23:29:57,150 WARN [main] HHH000342: Could not obtain connection to query metadata : Access denied for user 'root'@'localhost'
|
||||
2020-11-10 23:29:57,155 WARN [main] Exception encountered during context initialization - cancelling refresh attempt: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
|
||||
2020-11-10 23:29:57,159 INFO [main] Stopping service [Tomcat]
|
||||
2020-11-10 23:29:57,173 INFO [main]
|
||||
|
||||
Error starting ApplicationContext. To display the conditions report re-run your application with 'debug' enabled.
|
||||
2020-11-10 23:29:57,175 ERROR [main] Application run failed
|
||||
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'entityManagerFactory' defined in class path resource [org/springframework/boot/autoconfigure/orm/jpa/HibernateJpaConfiguration.class]: Invocation of init method failed; nested exception is org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
|
||||
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1794)
|
||||
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594)
|
||||
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516)
|
||||
at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324)
|
||||
at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234)
|
||||
at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322)
|
||||
at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202)
|
||||
at org.springframework.context.support.AbstractApplicationContext.getBean(AbstractApplicationContext.java:1109)
|
||||
at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:869)
|
||||
at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551)
|
||||
at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143)
|
||||
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:758)
|
||||
at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:750)
|
||||
at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:397)
|
||||
at org.springframework.boot.SpringApplication.run(SpringApplication.java:315)
|
||||
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1237)
|
||||
at org.springframework.boot.SpringApplication.run(SpringApplication.java:1226)
|
||||
at com.github.cato447.AbizeitungVotingSystem.AbizeitungVotingSystemApplication.main(AbizeitungVotingSystemApplication.java:12)
|
||||
Caused by: org.hibernate.service.spi.ServiceException: Unable to create requested service [org.hibernate.engine.jdbc.env.spi.JdbcEnvironment]
|
||||
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:275)
|
||||
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:237)
|
||||
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214)
|
||||
at org.hibernate.id.factory.internal.DefaultIdentifierGeneratorFactory.injectServices(DefaultIdentifierGeneratorFactory.java:152)
|
||||
at org.hibernate.service.internal.AbstractServiceRegistryImpl.injectDependencies(AbstractServiceRegistryImpl.java:286)
|
||||
at org.hibernate.service.internal.AbstractServiceRegistryImpl.initializeService(AbstractServiceRegistryImpl.java:243)
|
||||
at org.hibernate.service.internal.AbstractServiceRegistryImpl.getService(AbstractServiceRegistryImpl.java:214)
|
||||
at org.hibernate.boot.internal.InFlightMetadataCollectorImpl.<init>(InFlightMetadataCollectorImpl.java:176)
|
||||
at org.hibernate.boot.model.process.spi.MetadataBuildingProcess.complete(MetadataBuildingProcess.java:118)
|
||||
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.metadata(EntityManagerFactoryBuilderImpl.java:1224)
|
||||
at org.hibernate.jpa.boot.internal.EntityManagerFactoryBuilderImpl.build(EntityManagerFactoryBuilderImpl.java:1255)
|
||||
at org.springframework.orm.jpa.vendor.SpringHibernateJpaPersistenceProvider.createContainerEntityManagerFactory(SpringHibernateJpaPersistenceProvider.java:58)
|
||||
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.createNativeEntityManagerFactory(LocalContainerEntityManagerFactoryBean.java:365)
|
||||
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.buildNativeEntityManagerFactory(AbstractEntityManagerFactoryBean.java:391)
|
||||
at org.springframework.orm.jpa.AbstractEntityManagerFactoryBean.afterPropertiesSet(AbstractEntityManagerFactoryBean.java:378)
|
||||
at org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet(LocalContainerEntityManagerFactoryBean.java:341)
|
||||
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1853)
|
||||
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1790)
|
||||
... 17 common frames omitted
|
||||
Caused by: org.hibernate.HibernateException: Access to DialectResolutionInfo cannot be null when 'hibernate.dialect' not set
|
||||
at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.determineDialect(DialectFactoryImpl.java:100)
|
||||
at org.hibernate.engine.jdbc.dialect.internal.DialectFactoryImpl.buildDialect(DialectFactoryImpl.java:54)
|
||||
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:137)
|
||||
at org.hibernate.engine.jdbc.env.internal.JdbcEnvironmentInitiator.initiateService(JdbcEnvironmentInitiator.java:35)
|
||||
at org.hibernate.boot.registry.internal.StandardServiceRegistryImpl.initiateService(StandardServiceRegistryImpl.java:101)
|
||||
at org.hibernate.service.internal.AbstractServiceRegistryImpl.createService(AbstractServiceRegistryImpl.java:263)
|
||||
... 34 common frames omitted
|
||||
2020-11-10 23:31:24,180 INFO [main] Starting AbizeitungVotingSystemApplication on bitecoding-System-Product-Name with PID 19558 (/home/bitecoding/Documents/AbizeitungVotingSystem/target/classes started by bitecoding in /home/bitecoding/Documents/AbizeitungVotingSystem)
|
||||
2020-11-10 23:31:24,183 INFO [main] No active profile set, falling back to default profiles: default
|
||||
2020-11-10 23:31:24,647 INFO [main] Bootstrapping Spring Data JPA repositories in DEFAULT mode.
|
||||
2020-11-10 23:31:24,695 INFO [main] Finished Spring Data repository scanning in 42ms. Found 3 JPA repository interfaces.
|
||||
2020-11-10 23:31:25,252 INFO [main] Tomcat initialized with port(s): 8080 (http)
|
||||
2020-11-10 23:31:25,260 INFO [main] Initializing ProtocolHandler ["http-nio-8080"]
|
||||
2020-11-10 23:31:25,261 INFO [main] Starting service [Tomcat]
|
||||
2020-11-10 23:31:25,261 INFO [main] Starting Servlet engine: [Apache Tomcat/9.0.38]
|
||||
2020-11-10 23:31:25,331 INFO [main] Initializing Spring embedded WebApplicationContext
|
||||
2020-11-10 23:31:25,331 INFO [main] Root WebApplicationContext: initialization completed in 1094 ms
|
||||
2020-11-10 23:31:25,479 INFO [main] HHH000204: Processing PersistenceUnitInfo [name: default]
|
||||
2020-11-10 23:31:25,517 INFO [main] HHH000412: Hibernate ORM core version 5.4.21.Final
|
||||
2020-11-10 23:31:25,598 INFO [main] HCANN000001: Hibernate Commons Annotations {5.1.0.Final}
|
||||
2020-11-10 23:31:25,658 INFO [main] HikariPool-1 - Starting...
|
||||
2020-11-10 23:31:25,964 INFO [main] HikariPool-1 - Start completed.
|
||||
2020-11-10 23:31:25,983 INFO [main] HHH000400: Using dialect: org.hibernate.dialect.MySQL8Dialect
|
||||
2020-11-10 23:31:26,433 INFO [main] HHH000490: Using JtaPlatform implementation: [org.hibernate.engine.transaction.jta.platform.internal.NoJtaPlatform]
|
||||
2020-11-10 23:31:26,440 INFO [main] Initialized JPA EntityManagerFactory for persistence unit 'default'
|
||||
2020-11-10 23:31:26,744 WARN [main] spring.jpa.open-in-view is enabled by default. Therefore, database queries may be performed during view rendering. Explicitly configure spring.jpa.open-in-view to disable this warning
|
||||
2020-11-10 23:31:26,844 INFO [main] Initializing ExecutorService 'applicationTaskExecutor'
|
||||
2020-11-10 23:31:27,015 INFO [main] Starting ProtocolHandler ["http-nio-8080"]
|
||||
2020-11-10 23:31:27,030 INFO [main] Tomcat started on port(s): 8080 (http) with context path ''
|
||||
2020-11-10 23:31:27,043 INFO [main] Started AbizeitungVotingSystemApplication in 3.141 seconds (JVM running for 3.568)
|
||||
2020-11-10 23:32:19,396 INFO [http-nio-8080-exec-1] Initializing Spring DispatcherServlet 'dispatcherServlet'
|
||||
2020-11-10 23:32:19,397 INFO [http-nio-8080-exec-1] Initializing Servlet 'dispatcherServlet'
|
||||
2020-11-10 23:32:19,405 INFO [http-nio-8080-exec-1] Completed initialization in 8 ms
|
||||
2020-11-10 23:32:19,531 INFO [http-nio-8080-exec-1] User IP: 127.0.0.1
|
||||
2020-11-10 23:45:30,922 INFO [SpringContextShutdownHook] Shutting down ExecutorService 'applicationTaskExecutor'
|
||||
2020-11-10 23:45:30,923 INFO [SpringContextShutdownHook] Closing JPA EntityManagerFactory for persistence unit 'default'
|
||||
2020-11-10 23:45:30,925 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown initiated...
|
||||
2020-11-10 23:45:30,933 INFO [SpringContextShutdownHook] HikariPool-1 - Shutdown completed.
|
||||
@@ -0,0 +1,95 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-parent</artifactId>
|
||||
<version>2.3.4.RELEASE</version>
|
||||
<relativePath/>
|
||||
<!-- lookup parent from repository -->
|
||||
</parent>
|
||||
<groupId>com.github.cato447</groupId>
|
||||
<artifactId>AbiVoting</artifactId>
|
||||
<version>1.0</version>
|
||||
<name>AbizeitungVotingSystem</name>
|
||||
<description>A Voting System to get voting information for our graduating book</description>
|
||||
|
||||
<distributionManagement>
|
||||
<repository>
|
||||
<id>ssh-repository</id>
|
||||
<url>scpexe://81.169.149.143/program</url>
|
||||
</repository>
|
||||
</distributionManagement>
|
||||
|
||||
<properties>
|
||||
<java.version>11</java.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-mail</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-data-jpa</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-jdbc</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-thymeleaf</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>mysql</groupId>
|
||||
<artifactId>mysql-connector-java</artifactId>
|
||||
<scope>runtime</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-test</artifactId>
|
||||
<scope>test</scope>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.junit.vintage</groupId>
|
||||
<artifactId>junit-vintage-engine</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-devtools</artifactId>
|
||||
<optional>true</optional>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.springframework</groupId>
|
||||
<artifactId>spring-context-support</artifactId>
|
||||
<version>5.2.9.RELEASE</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<extensions>
|
||||
<!-- Enabling the use of SSH -->
|
||||
<extension>
|
||||
<groupId>org.apache.maven.wagon</groupId>
|
||||
<artifactId>wagon-ssh-external</artifactId>
|
||||
<version>2.10</version>
|
||||
</extension>
|
||||
</extensions>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.github.cato447.AbizeitungVotingSystem;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.data.jpa.repository.config.EnableJpaRepositories;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
@SpringBootApplication
|
||||
@EnableJpaRepositories
|
||||
public class AbizeitungVotingSystemApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(AbizeitungVotingSystemApplication.class, args);
|
||||
}
|
||||
|
||||
}
|
||||
+253
@@ -0,0 +1,253 @@
|
||||
package com.github.cato447.AbizeitungVotingSystem.controller;
|
||||
|
||||
import com.github.cato447.AbizeitungVotingSystem.entities.*;
|
||||
import com.github.cato447.AbizeitungVotingSystem.helper.PossibleCandidateWrapper;
|
||||
import com.github.cato447.AbizeitungVotingSystem.helper.RandomNumber;
|
||||
import com.github.cato447.AbizeitungVotingSystem.repositories.*;
|
||||
import com.github.cato447.AbizeitungVotingSystem.table.TableAction;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.mail.SimpleMailMessage;
|
||||
import org.springframework.mail.javamail.JavaMailSender;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.ModelAttribute;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
import java.time.LocalDate;
|
||||
import java.time.Month;
|
||||
import java.util.*;
|
||||
|
||||
@Controller
|
||||
public class VotingController {
|
||||
|
||||
private boolean votingPhase;
|
||||
private boolean addingPhase;
|
||||
|
||||
private static final Logger LOGGER = LogManager.getLogger(VotingController.class);
|
||||
private TableAction tableAction = new TableAction();
|
||||
|
||||
@Autowired
|
||||
VoterRepository voterRepository;
|
||||
|
||||
@Autowired
|
||||
CandidateRepository candidateRepository;
|
||||
|
||||
@Autowired
|
||||
CategoryRepository categoryRepository;
|
||||
|
||||
@Autowired
|
||||
PossibleCandidateRepository possibleCandidateRepository;
|
||||
|
||||
@Autowired
|
||||
AuthCodesRepository authCodesRepository;
|
||||
|
||||
@Autowired
|
||||
JavaMailSender emailSender;
|
||||
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
votingPhase = true;
|
||||
addingPhase = false;
|
||||
|
||||
LOGGER.info("Program started with arguments: votingPhase="+ votingPhase + " addingPhase=" + addingPhase);
|
||||
|
||||
if (voterRepository.findAll().size() == 0) {
|
||||
tableAction.setUpVoters(voterRepository);
|
||||
LOGGER.info("Voters successfully set up");
|
||||
}
|
||||
|
||||
if (categoryRepository.findAll().size() == 0) {
|
||||
tableAction.setUpCategories(categoryRepository);
|
||||
possibleCandidateRepository.deleteAll();
|
||||
LOGGER.info("Categories successfully set up");
|
||||
}
|
||||
|
||||
if (candidateRepository.findAll().size() == 0 && votingPhase == true && possibleCandidateRepository.findAll().size() != 0) {
|
||||
tableAction.setUpCandidates(possibleCandidateRepository, candidateRepository);
|
||||
LOGGER.info("Candidates successfully set up");
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("/")
|
||||
public String WelcomeSite() {
|
||||
LocalDate finishDate = LocalDate.of(2021, Month.JANUARY,24);
|
||||
LocalDate now = LocalDate.now();
|
||||
|
||||
if(now.isAfter(finishDate)){
|
||||
LOGGER.warn("passed");
|
||||
return "errors/votingClosed.html";
|
||||
} else {
|
||||
LOGGER.warn("in Bounds");
|
||||
return "start.html";
|
||||
}
|
||||
}
|
||||
|
||||
public void sendSimpleMessage(String to, String subject, String text) {
|
||||
SimpleMailMessage message = new SimpleMailMessage();
|
||||
message.setTo(to);
|
||||
message.setSubject(subject);
|
||||
message.setText(text);
|
||||
emailSender.send(message);
|
||||
}
|
||||
|
||||
@RequestMapping("/checkStatus")
|
||||
public String VerifyName(@RequestParam String name, Model model) {
|
||||
if (name.strip().toLowerCase().matches("[a-z]+\\.[a-z]+@adolfinum+\\.de$")) {
|
||||
try {
|
||||
LOGGER.warn(name);
|
||||
Voter voter = voterRepository.findByEmail(name.toLowerCase().strip());
|
||||
if (voter == null){
|
||||
LOGGER.error(name + " is not allowed to vote");
|
||||
return "errors/notRegistered.html";
|
||||
}
|
||||
if (voter.getVote_status() && votingPhase) {
|
||||
LOGGER.warn(name + " has already voted");
|
||||
return "errors/alreadyVoted.html";
|
||||
} else if (voter.getCandidatesubmit_status() && addingPhase) {
|
||||
LOGGER.warn(name + " has already submitted its candidates");
|
||||
return "errors/alreadyVoted.html";
|
||||
} else {
|
||||
if (authCodesRepository.findByName(name) == null) {
|
||||
AuthCode authCode = tableAction.generateToken(name, RandomNumber.getRandomNumberString(), authCodesRepository);
|
||||
sendSimpleMessage(name, "Code zur Authentifizierung", "Dein Code lautet: " + authCode.getCode());
|
||||
} else if (authCodesRepository.findByName(name) != null && authCodesRepository.findByName(name).isExpired()) {
|
||||
AuthCode authCode = tableAction.generateToken(name, RandomNumber.getRandomNumberString(), authCodesRepository);
|
||||
sendSimpleMessage(name, "Code zur Authentifizierung", "Dein Code lautet: " + authCode.getCode());
|
||||
}
|
||||
model.addAttribute("name", name);
|
||||
model.addAttribute("codeTime", authCodesRepository.findByName(name).getExpirationTime());
|
||||
model.addAttribute("codeExpired", false);
|
||||
model.addAttribute("codeFalse", false);
|
||||
return "authenticate.html";
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
tableAction.deleteToken(name, authCodesRepository);
|
||||
return "error.html";
|
||||
}
|
||||
} else {
|
||||
return "errors/falseInput.html";
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("/newCode")
|
||||
public String provideNewCode(@RequestParam String name, Model model){
|
||||
AuthCode authCode = tableAction.generateToken(name, RandomNumber.getRandomNumberString(), authCodesRepository);
|
||||
sendSimpleMessage(name, "Code zur Authentifizierung", "Dein Code lautet: " + authCode.getCode());
|
||||
model.addAttribute("name", name);
|
||||
model.addAttribute("codeTime", authCodesRepository.findByName(name).getExpirationTime());
|
||||
model.addAttribute("codeExpired", false);
|
||||
model.addAttribute("codeFalse", false);
|
||||
return "authenticate.html";
|
||||
}
|
||||
|
||||
@RequestMapping("/vote")
|
||||
public String voting_adding(@RequestParam String code, @RequestParam String name, Model model) {
|
||||
String tokenStatus = tableAction.checkToken(name, code, authCodesRepository);
|
||||
if (tokenStatus.equals("matched")) {
|
||||
LOGGER.warn("matched");
|
||||
if (addingPhase) {
|
||||
PossibleCandidateWrapper possibleCandidates = new PossibleCandidateWrapper();
|
||||
List<Category> categories = categoryRepository.findAll();
|
||||
for (int i = 0; i < categories.size(); i++) {
|
||||
possibleCandidates.addPossibleCandidate(new PossibleCandidate());
|
||||
}
|
||||
model.addAttribute("categories", categories);
|
||||
model.addAttribute("form", possibleCandidates);
|
||||
model.addAttribute("name", name);
|
||||
return "addingCandidates.html";
|
||||
} else if (votingPhase) {
|
||||
List<Category> categories = categoryRepository.findAll();
|
||||
model.addAttribute("categories", categories);
|
||||
model.addAttribute("name", name);
|
||||
return "voting.html";
|
||||
}
|
||||
} else if (tokenStatus.equals("expired")) {
|
||||
LOGGER.warn("expired");
|
||||
model.addAttribute("name", name);
|
||||
model.addAttribute("codeExpired", true);
|
||||
model.addAttribute("codeFalse", false);
|
||||
return "authenticate.html";
|
||||
} else if (tokenStatus.equals("wrong")) {
|
||||
LOGGER.warn("wrong");
|
||||
model.addAttribute("name", name);
|
||||
model.addAttribute("codeExpired", false);
|
||||
model.addAttribute("codeFalse", true);
|
||||
return "authenticate.html";
|
||||
}
|
||||
return "fatalError";
|
||||
}
|
||||
|
||||
@RequestMapping("/saveCandidates")
|
||||
public String candidateSaving(@ModelAttribute PossibleCandidateWrapper possibleCandidates, @RequestParam String name) {
|
||||
if (voterRepository.findByEmail(name).getCandidatesubmit_status()) {
|
||||
return "errors/alreadyVoted.html";
|
||||
} else {
|
||||
LinkedList<PossibleCandidate> posCandidates = possibleCandidates.getPossibleCandidates();
|
||||
long index = 1;
|
||||
for (PossibleCandidate posCandidate : posCandidates) {
|
||||
if (posCandidate.getName() != "") {
|
||||
if (possibleCandidateRepository.findByNameAndCategory(posCandidate.getName(), categoryRepository.findById(index).get()) != null) {
|
||||
PossibleCandidate p = possibleCandidateRepository.findByNameAndCategory(posCandidate.getName(), categoryRepository.findById(index).get());
|
||||
p.setVotes(p.getVotes() + 1);
|
||||
possibleCandidateRepository.save(p);
|
||||
} else if (possibleCandidateRepository.findByNameAndCategory(posCandidate.getName().split(" ")[posCandidate.getName().split(" ").length-1], categoryRepository.findById(index).get()) != null){
|
||||
PossibleCandidate p = possibleCandidateRepository.findByNameAndCategory(posCandidate.getName().split(" ")[posCandidate.getName().split(" ").length-1], categoryRepository.findById(index).get());
|
||||
p.setVotes(p.getVotes() + 1);
|
||||
possibleCandidateRepository.save(p);
|
||||
} else {
|
||||
if (index > 31 && posCandidate.getName().indexOf(" ") != -1) {
|
||||
if (posCandidate.getName().split(" ")[posCandidate.getName().split(" ").length-1].equals("Neumann") ||
|
||||
posCandidate.getName().split(" ")[posCandidate.getName().split(" ").length-1].equals("neumann") ||
|
||||
posCandidate.getName().split(" ")[posCandidate.getName().split(" ").length-1].equals("Mecklenburg") ||
|
||||
posCandidate.getName().split(" ")[posCandidate.getName().split(" ").length-1].equals("mecklenburg")){
|
||||
PossibleCandidate possibleCandidate = new PossibleCandidate(posCandidate.getName(), categoryRepository.findById(index).get());
|
||||
possibleCandidateRepository.save(possibleCandidate);
|
||||
} else {
|
||||
posCandidate.setName(posCandidate.getName().split(" ")[posCandidate.getName().split(" ").length - 1]);
|
||||
PossibleCandidate possibleCandidate = new PossibleCandidate(posCandidate.getName(), categoryRepository.findById(index).get());
|
||||
possibleCandidateRepository.save(possibleCandidate);
|
||||
}
|
||||
} else {
|
||||
PossibleCandidate possibleCandidate = new PossibleCandidate(posCandidate.getName(), categoryRepository.findById(index).get());
|
||||
possibleCandidateRepository.save(possibleCandidate);
|
||||
}
|
||||
}
|
||||
}
|
||||
index++;
|
||||
}
|
||||
|
||||
tableAction.updateCandidatesubmit_status(name, voterRepository);
|
||||
return "voteSuccessful.html";
|
||||
}
|
||||
}
|
||||
|
||||
@RequestMapping("/processVote")
|
||||
public String ProcessVote(@RequestParam String name, @RequestParam String voteValues) {
|
||||
if (voterRepository.findByEmail(name).getVote_status()) {
|
||||
return "errors/alreadyVoted.html";
|
||||
} else {
|
||||
LinkedList<String> voteFor = new LinkedList<>();
|
||||
if(!voteValues.equals("")) {
|
||||
String[] partVoteValues = voteValues.split(",");
|
||||
for (String s : partVoteValues) {
|
||||
voteFor.add(s);
|
||||
}
|
||||
LOGGER.info(name + " has voted!");
|
||||
}
|
||||
for (String s: voteFor) {
|
||||
tableAction.voteForCandidate(s, candidateRepository);
|
||||
}
|
||||
|
||||
tableAction.updateVotingStatus(name, voterRepository);
|
||||
return "voteSuccessful.html";
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,55 @@
|
||||
package com.github.cato447.AbizeitungVotingSystem.entities;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Entity
|
||||
@Table(name="auth_codes")
|
||||
public class AuthCode {
|
||||
public AuthCode(){
|
||||
super();
|
||||
}
|
||||
|
||||
public AuthCode(String name, String code) {
|
||||
this.name = name;
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy= GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private String name;
|
||||
private String code;
|
||||
private long time = System.currentTimeMillis();
|
||||
|
||||
public String getCode() {
|
||||
return code;
|
||||
}
|
||||
|
||||
public void setCode(String code) {
|
||||
this.code = code;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public long getTime() {
|
||||
return time;
|
||||
}
|
||||
|
||||
public long getExpirationTime(){
|
||||
return time + 1800*1000;
|
||||
}
|
||||
|
||||
public boolean isExpired(){
|
||||
return System.currentTimeMillis() >= (time + 1800*1000);
|
||||
}
|
||||
|
||||
public void setTime(long time) {
|
||||
this.time = time;
|
||||
}
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,69 @@
|
||||
package com.github.cato447.AbizeitungVotingSystem.entities;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Entity
|
||||
@Table(name = "candidates")
|
||||
public class Candidate implements Comparable<Candidate>{
|
||||
|
||||
public Candidate() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Candidate(String name, Category category) {
|
||||
super();
|
||||
this.name = name;
|
||||
this.votes = 0;
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private String name;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "category_id")
|
||||
private Category category;
|
||||
|
||||
private Integer votes;
|
||||
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public Integer getVotes() {
|
||||
return votes;
|
||||
}
|
||||
|
||||
public Category getCategory() {return category;}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setVotes(Integer votes) {
|
||||
this.votes = votes;
|
||||
}
|
||||
|
||||
public void setCategory(Category category) {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public void votedFor() {
|
||||
this.votes += 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int compareTo(Candidate c) {
|
||||
if (getVotes() == null || c.getVotes() == null) {
|
||||
return 0;
|
||||
}
|
||||
return c.getVotes().compareTo(getVotes());
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
package com.github.cato447.AbizeitungVotingSystem.entities;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@Entity
|
||||
@Table(name="categories")
|
||||
public class Category {
|
||||
|
||||
public Category(){
|
||||
super();
|
||||
}
|
||||
|
||||
public Category(String name, List<Candidate> candidateList) {
|
||||
super();
|
||||
this.name = name;
|
||||
this.candidateList = candidateList;
|
||||
}
|
||||
|
||||
public Category(String name){
|
||||
super();
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy= GenerationType.IDENTITY)
|
||||
private long id;
|
||||
private String name;
|
||||
|
||||
@OneToMany(mappedBy = "category", fetch = FetchType.LAZY)
|
||||
private List<Candidate> candidateList;
|
||||
|
||||
public long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public List<Candidate> getCandidateList() {
|
||||
Collections.sort(candidateList);
|
||||
return candidateList;
|
||||
}
|
||||
|
||||
public int getCandidateListSize(){
|
||||
return candidateList.size();
|
||||
}
|
||||
}
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
package com.github.cato447.AbizeitungVotingSystem.entities;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Entity
|
||||
@Table(name = "possibleCandidates")
|
||||
public class PossibleCandidate{
|
||||
|
||||
public PossibleCandidate() {
|
||||
super();
|
||||
}
|
||||
|
||||
public PossibleCandidate(String name, Category category) {
|
||||
super();
|
||||
this.name = name;
|
||||
this.category = category;
|
||||
this.votes = 1;
|
||||
}
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private String name;
|
||||
private int votes;
|
||||
|
||||
@ManyToOne(fetch = FetchType.LAZY)
|
||||
@JoinColumn(name = "category_id")
|
||||
private Category category;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public Category getCategory() {return category;}
|
||||
|
||||
public Long getCategoryID(){
|
||||
return category.getId();
|
||||
}
|
||||
|
||||
public Integer getVotes() {
|
||||
return votes;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setCategory(Category category) {
|
||||
this.category = category;
|
||||
}
|
||||
|
||||
public void setVotes(int votes) {
|
||||
this.votes = votes;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,49 @@
|
||||
package com.github.cato447.AbizeitungVotingSystem.entities;
|
||||
|
||||
import javax.persistence.*;
|
||||
|
||||
@Entity
|
||||
@Table(name="voters")
|
||||
public class Voter {
|
||||
|
||||
public Voter(){
|
||||
super();
|
||||
}
|
||||
|
||||
public Voter(String email) {
|
||||
this.email = email;
|
||||
this.vote_status = false;
|
||||
this.candidatesubmit_status = false;
|
||||
}
|
||||
|
||||
@Id
|
||||
@GeneratedValue(strategy=GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private String email;
|
||||
private Boolean vote_status;
|
||||
private Boolean candidatesubmit_status;
|
||||
|
||||
public Long getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public String getEmail() {
|
||||
return email;
|
||||
}
|
||||
|
||||
public Boolean getVote_status() {
|
||||
return vote_status;
|
||||
}
|
||||
|
||||
public Boolean getCandidatesubmit_status() {
|
||||
return candidatesubmit_status;
|
||||
}
|
||||
|
||||
public void vote(){
|
||||
vote_status = true;
|
||||
}
|
||||
|
||||
public void submitCandidates() {
|
||||
candidatesubmit_status = true;
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
package com.github.cato447.AbizeitungVotingSystem.helper;
|
||||
|
||||
import com.github.cato447.AbizeitungVotingSystem.entities.PossibleCandidate;
|
||||
|
||||
import java.util.LinkedList;
|
||||
|
||||
|
||||
public class PossibleCandidateWrapper {
|
||||
|
||||
private LinkedList<PossibleCandidate> possibleCandidates;
|
||||
|
||||
public PossibleCandidateWrapper(){
|
||||
possibleCandidates = new LinkedList<>();
|
||||
}
|
||||
|
||||
public void addPossibleCandidate(PossibleCandidate possibleCandidate){
|
||||
this.possibleCandidates.add(possibleCandidate);
|
||||
}
|
||||
|
||||
public LinkedList<PossibleCandidate> getPossibleCandidates() {
|
||||
return possibleCandidates;
|
||||
}
|
||||
|
||||
public void setPossibleCandidates(LinkedList<PossibleCandidate> possibleCandidates) {
|
||||
this.possibleCandidates = possibleCandidates;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package com.github.cato447.AbizeitungVotingSystem.helper;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
public class RandomNumber {
|
||||
public static String getRandomNumberString() {
|
||||
// It will generate 6 digit random Number.
|
||||
// from 0 to 999999
|
||||
Random rnd = new Random();
|
||||
int number = rnd.nextInt(999999);
|
||||
|
||||
// this will convert any number sequence into 6 character.
|
||||
return String.format("%06d", number);
|
||||
}
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.github.cato447.AbizeitungVotingSystem.repositories;
|
||||
|
||||
import com.github.cato447.AbizeitungVotingSystem.entities.AuthCode;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.data.jpa.repository.Modifying;
|
||||
import org.springframework.data.jpa.repository.Query;
|
||||
|
||||
public interface AuthCodesRepository extends JpaRepository<AuthCode, Integer> {
|
||||
|
||||
public AuthCode findByName(String name);
|
||||
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
package com.github.cato447.AbizeitungVotingSystem.repositories;
|
||||
|
||||
import com.github.cato447.AbizeitungVotingSystem.entities.Candidate;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@Repository
|
||||
public interface CandidateRepository extends JpaRepository<Candidate, Integer> {
|
||||
|
||||
public Candidate findByName(String name);
|
||||
|
||||
Optional<Candidate> findById(Long id);
|
||||
|
||||
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
package com.github.cato447.AbizeitungVotingSystem.repositories;
|
||||
|
||||
import com.github.cato447.AbizeitungVotingSystem.entities.Category;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
public interface CategoryRepository extends JpaRepository<Category, Long> {
|
||||
|
||||
public Category findByName(String name);
|
||||
|
||||
}
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
package com.github.cato447.AbizeitungVotingSystem.repositories;
|
||||
|
||||
import com.github.cato447.AbizeitungVotingSystem.entities.Category;
|
||||
import com.github.cato447.AbizeitungVotingSystem.entities.PossibleCandidate;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
import java.util.Optional;
|
||||
|
||||
@Repository
|
||||
public interface PossibleCandidateRepository extends JpaRepository<PossibleCandidate, Integer> {
|
||||
|
||||
PossibleCandidate findByNameAndCategory(String name, Category category);
|
||||
|
||||
Optional<PossibleCandidate> findById(Long id);
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package com.github.cato447.AbizeitungVotingSystem.repositories;
|
||||
|
||||
import com.github.cato447.AbizeitungVotingSystem.entities.Voter;
|
||||
import org.springframework.data.jpa.repository.JpaRepository;
|
||||
import org.springframework.stereotype.Repository;
|
||||
|
||||
@Repository
|
||||
public interface VoterRepository extends JpaRepository<Voter, Integer> {
|
||||
|
||||
public Voter findByEmail(String email);
|
||||
|
||||
public Voter findById(Long id);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,139 @@
|
||||
package com.github.cato447.AbizeitungVotingSystem.table;
|
||||
|
||||
import com.github.cato447.AbizeitungVotingSystem.entities.*;
|
||||
import com.github.cato447.AbizeitungVotingSystem.repositories.*;
|
||||
|
||||
import java.io.*;
|
||||
import java.util.*;
|
||||
|
||||
public class TableAction {
|
||||
|
||||
public TableAction(){
|
||||
|
||||
}
|
||||
|
||||
public void updateVotingStatus(String email, VoterRepository voterRepository){
|
||||
Voter voter = voterRepository.findByEmail(email);
|
||||
voter.vote();
|
||||
voterRepository.save(voter);
|
||||
}
|
||||
|
||||
public void updateCandidatesubmit_status(String email, VoterRepository voterRepository){
|
||||
Voter voter = voterRepository.findByEmail(email);
|
||||
voter.submitCandidates();
|
||||
voterRepository.save(voter);
|
||||
}
|
||||
|
||||
public AuthCode generateToken(String name, String code, AuthCodesRepository authCodesRepository) {
|
||||
AuthCode authCode = new AuthCode(name, code);
|
||||
try{
|
||||
AuthCode existingCode = authCodesRepository.findByName(authCode.getName());
|
||||
existingCode.setCode(code);
|
||||
existingCode.setTime(System.currentTimeMillis());
|
||||
authCodesRepository.save(existingCode);
|
||||
return existingCode;
|
||||
} catch (Exception e){
|
||||
authCodesRepository.save(authCode);
|
||||
return authCode;
|
||||
}
|
||||
}
|
||||
|
||||
public String checkToken(String name, String code, AuthCodesRepository authCodesRepository){
|
||||
try {
|
||||
AuthCode authCode = authCodesRepository.findByName(name);
|
||||
if (authCode.getCode().equals(code) && !authCode.isExpired()) {
|
||||
authCodesRepository.delete(authCode);
|
||||
return "matched";
|
||||
} else if (authCode.isExpired()) {
|
||||
authCodesRepository.delete(authCode);
|
||||
return "expired";
|
||||
}
|
||||
} catch(Exception e){
|
||||
return "wrong";
|
||||
}
|
||||
return "wrong";
|
||||
}
|
||||
|
||||
public void deleteToken(String name, AuthCodesRepository authCodesRepository){
|
||||
authCodesRepository.delete(authCodesRepository.findByName(name));
|
||||
}
|
||||
|
||||
private int getLimit(List<PossibleCandidate> possibleCandidates){
|
||||
return possibleCandidates.size() <= 15 ? possibleCandidates.size() : 15;
|
||||
}
|
||||
|
||||
public void voteForCandidate(String id, CandidateRepository candidateRepository){
|
||||
long candidateID = Long.valueOf(id);
|
||||
Candidate candidate = candidateRepository.findById(candidateID).get();
|
||||
candidate.votedFor();
|
||||
candidateRepository.save(candidate);
|
||||
}
|
||||
|
||||
public void setUpVoters(VoterRepository voterRepository){
|
||||
try (InputStream inputStream = getClass().getResourceAsStream("/Email_Whitelist.txt");
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
|
||||
String line = "";
|
||||
ArrayList<Voter> voters = new ArrayList<Voter>();
|
||||
while ((line = reader.readLine())!= null){
|
||||
String email = line;
|
||||
Voter voter = new Voter(email);
|
||||
voters.add(voter);
|
||||
}
|
||||
voterRepository.saveAll(voters);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
public void setUpCandidates(PossibleCandidateRepository possibleCandidateRepository, CandidateRepository candidateRepository){
|
||||
List<PossibleCandidate> possibleCandidates = possibleCandidateRepository.findAll();
|
||||
Collections.sort(possibleCandidates, Comparator.comparing(PossibleCandidate::getCategoryID));
|
||||
long category_id = possibleCandidates.get(0).getCategory().getId();
|
||||
List<PossibleCandidate> possibleCandidatesPerCategory = new LinkedList<>();
|
||||
for (int i = 0; i < possibleCandidates.size(); i++) {
|
||||
PossibleCandidate p = possibleCandidates.get(i);
|
||||
if (category_id == p.getCategory().getId()){
|
||||
possibleCandidatesPerCategory.add(p);
|
||||
} else {
|
||||
category_id = p.getCategory().getId();
|
||||
Collections.sort(possibleCandidatesPerCategory, Comparator.comparing(PossibleCandidate::getVotes));
|
||||
Collections.reverse(possibleCandidatesPerCategory);
|
||||
for (int j = 0; j < getLimit(possibleCandidatesPerCategory); j++){
|
||||
if (j >= 10 && possibleCandidatesPerCategory.get(j).getVotes() == possibleCandidatesPerCategory.get(9).getVotes()){
|
||||
Candidate candidate = new Candidate(possibleCandidatesPerCategory.get(j).getName(), possibleCandidatesPerCategory.get(j).getCategory());
|
||||
candidateRepository.save(candidate);
|
||||
}
|
||||
if (j < 10){
|
||||
Candidate candidate = new Candidate(possibleCandidatesPerCategory.get(j).getName(), possibleCandidatesPerCategory.get(j).getCategory());
|
||||
candidateRepository.save(candidate);
|
||||
}
|
||||
if (j == 14){
|
||||
break;
|
||||
}
|
||||
}
|
||||
i += -1;
|
||||
possibleCandidatesPerCategory.clear();
|
||||
}
|
||||
}
|
||||
for (int j = 0; j < getLimit(possibleCandidatesPerCategory); j++){
|
||||
Candidate candidate = new Candidate(possibleCandidatesPerCategory.get(j).getName(), possibleCandidatesPerCategory.get(j).getCategory());
|
||||
candidateRepository.save(candidate);
|
||||
}
|
||||
}
|
||||
|
||||
public void setUpCategories(CategoryRepository categoryRepository){
|
||||
try (InputStream inputStream = getClass().getResourceAsStream("/Categories.txt");
|
||||
BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream))) {
|
||||
String line = "";
|
||||
ArrayList<Category> categories = new ArrayList<Category>();
|
||||
while ((line = reader.readLine())!= null){
|
||||
String name = line;
|
||||
Category category = new Category(name);
|
||||
categories.add(category);
|
||||
}
|
||||
categoryRepository.saveAll(categories);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
spring.datasource.url=jdbc:mysql://hostadress/database
|
||||
spring.datasource.username=mysql_username
|
||||
spring.datasource.password=mysql_password
|
||||
|
||||
spring.jpa.hibernate.ddl-auto=update
|
||||
|
||||
# Tomcat
|
||||
server.port = 8000
|
||||
|
||||
######Email Properties ######
|
||||
spring.mail.host=
|
||||
spring.mail.port=
|
||||
spring.mail.properties.mail.smtp.starttls.enable=true
|
||||
spring.mail.username=
|
||||
spring.mail.password=
|
||||
spring.mail.properties.mail.smtp.starttls.required=true
|
||||
spring.mail.properties.mail.smtp.auth=true
|
||||
spring.mail.properties.mail.smtp.connectiontimeout=5000
|
||||
spring.mail.properties.mail.smtp.timeout=5000
|
||||
spring.mail.properties.mail.smtp.writetimeout=5000
|
||||
Binary file not shown.
@@ -0,0 +1,41 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
|
||||
<property name="LOGS" value="./logs" />
|
||||
|
||||
<appender name="Console"
|
||||
class="ch.qos.logback.core.ConsoleAppender">
|
||||
<layout class="ch.qos.logback.classic.PatternLayout">
|
||||
<Pattern>
|
||||
%black(%d{ISO8601}) %highlight(%-5level) [%blue(%t)] %yellow(%C{1.}): %msg%n%throwable
|
||||
</Pattern>
|
||||
</layout>
|
||||
</appender>
|
||||
|
||||
<appender name="RollingFile"
|
||||
class="ch.qos.logback.core.rolling.RollingFileAppender">
|
||||
<file>${LOGS}/Voting.log</file>
|
||||
<encoder
|
||||
class="ch.qos.logback.classic.encoder.PatternLayoutEncoder">
|
||||
<Pattern>%d %p [%t] %m%n</Pattern>
|
||||
</encoder>
|
||||
|
||||
<rollingPolicy
|
||||
class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
|
||||
<!-- rollover daily and when the file reaches 10 MegaBytes -->
|
||||
<fileNamePattern>${LOGS}/archived/%d{yyyy-MM-dd}.%i.log
|
||||
</fileNamePattern>
|
||||
<timeBasedFileNamingAndTriggeringPolicy
|
||||
class="ch.qos.logback.core.rolling.SizeAndTimeBasedFNATP">
|
||||
<maxFileSize>10MB</maxFileSize>
|
||||
</timeBasedFileNamingAndTriggeringPolicy>
|
||||
</rollingPolicy>
|
||||
</appender>
|
||||
|
||||
<!-- LOG everything at INFO level -->
|
||||
<root level="info">
|
||||
<appender-ref ref="RollingFile" />
|
||||
<appender-ref ref="Console" />
|
||||
</root>
|
||||
|
||||
</configuration>
|
||||
@@ -0,0 +1,66 @@
|
||||
body {
|
||||
background-color: rgb(44, 49, 54);
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
.center-screen {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.centered {
|
||||
background: transparent;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
h2.categoryCategory {
|
||||
color: #bb1515;
|
||||
margin-top: 5%;
|
||||
margin-bottom: 1%;
|
||||
}
|
||||
|
||||
input {
|
||||
background: #bb1515b2;
|
||||
border: none;
|
||||
color: #FFF;
|
||||
font-size: .875rem;
|
||||
font-weight: normal;
|
||||
text-align: left;
|
||||
transition: opacity .25s .5s;
|
||||
}
|
||||
|
||||
.submitButton {
|
||||
margin-top: 5%;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
background: #bb1515;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
font-size: 2rem;
|
||||
width: 500px;
|
||||
letter-spacing: .0625rem;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 3px 5px 1px rgba(0, 0, 0, 0.25);
|
||||
text-shadow: 0 -2px 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: linear-gradient(to bottom right, #111E25 0%, #111 100%);
|
||||
font-family: 'Lato', sans-serif;
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
body {
|
||||
background-color: rgb(44, 49, 54);
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
.center-screen {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.centered {
|
||||
background: transparent;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #FFF;
|
||||
font-size: 75px;
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: #6d6d78;
|
||||
}
|
||||
|
||||
.submitButton {
|
||||
padding: .25em 0;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
background: #bb1515;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
font-size: 2rem;
|
||||
width: 500px;
|
||||
letter-spacing: .0625rem;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 3px 5px 1px rgba(0, 0, 0, 0.25);
|
||||
text-shadow: 0 -2px 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: linear-gradient(to bottom right, #111E25 0%, #111 100%);
|
||||
font-family: 'Lato', sans-serif;
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
body {
|
||||
background-color: rgb(44, 49, 54);
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
.center-screen {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.centered {
|
||||
background: transparent;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
transform: scale();
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
h1.end {
|
||||
color: #6d6d78;
|
||||
margin-bottom: 2%;
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
input {
|
||||
background-color: transparent;
|
||||
border: transparent;
|
||||
border-bottom: 2px solid red;
|
||||
color: #FFF;
|
||||
font-size: xx-large;
|
||||
width: 1ch;
|
||||
}
|
||||
|
||||
.submitButton {
|
||||
margin-top: 5%;
|
||||
margin-bottom: 1%;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
background: #bb1515;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
font-size: 2rem;
|
||||
width: 500px;
|
||||
letter-spacing: .0625rem;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 3px 5px 1px rgba(0, 0, 0, 0.25);
|
||||
text-shadow: 0 -2px 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.newCode {
|
||||
border: 0;
|
||||
outline: 0;
|
||||
background: #bb1515;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
font-size: 1rem;
|
||||
width: 250px;
|
||||
letter-spacing: .0625rem;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 3px 5px 1px rgba(0, 0, 0, 0.25);
|
||||
text-shadow: 0 -2px 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
.errorCode {
|
||||
margin-top: 10%;
|
||||
color: #bb1515;
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: linear-gradient(to bottom right, #111E25 0%, #111 100%);
|
||||
font-family: 'Lato', sans-serif;
|
||||
}
|
||||
@@ -0,0 +1,66 @@
|
||||
body {
|
||||
background-color: rgb(44, 49, 54);
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
.center-screen {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.centered {
|
||||
background: transparent;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #FFF;
|
||||
font-size: 75px;
|
||||
}
|
||||
|
||||
h2.mottoHeader {
|
||||
color: #FFF;
|
||||
font-size: 50px;
|
||||
}
|
||||
|
||||
button {
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: #FFF;
|
||||
font-size: 35px;
|
||||
font-weight: normal;
|
||||
letter-spacing: .125rem;
|
||||
text-transform: uppercase;
|
||||
text-align: center;
|
||||
transition: opacity .25s .5s;
|
||||
margin: 0.5%;
|
||||
}
|
||||
|
||||
.submitButton {
|
||||
margin-top: 5%;
|
||||
padding: .25em 0;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
background: #bb1515;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
font-size: 2rem;
|
||||
width: 500px;
|
||||
letter-spacing: .0625rem;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 3px 5px 1px rgba(0, 0, 0, 0.25);
|
||||
text-shadow: 0 -2px 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: linear-gradient(to bottom right, #111E25 0%, #111 100%);
|
||||
font-family: 'Lato', sans-serif;
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: linear-gradient(to bottom right, #111E25 0%, #111 100%);
|
||||
font-family: 'Lato', sans-serif;
|
||||
}
|
||||
|
||||
div.userLogin {
|
||||
position: absolute;
|
||||
left: 50%;
|
||||
top: 50%;
|
||||
-webkit-transform: translate(-50%, -50%);
|
||||
transform: translate(-50%, -50%);
|
||||
}
|
||||
|
||||
#signup_button {
|
||||
display: block;
|
||||
margin: auto;
|
||||
padding: .25em 0;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
background: #bb1515;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
font-size: 2rem;
|
||||
width: 500px;
|
||||
letter-spacing: .0625rem;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 3px 5px 1px rgba(0, 0, 0, 0.25);
|
||||
text-shadow: 0 -2px 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
input.email_input {
|
||||
background-color: transparent;
|
||||
border: transparent;
|
||||
border-bottom: 2px solid #bb1515;
|
||||
color: #FFF;
|
||||
font-size: xx-large;
|
||||
width: 500px;
|
||||
}
|
||||
|
||||
input.password_input {
|
||||
background-color: transparent;
|
||||
border: transparent;
|
||||
color: #FFF;
|
||||
font-size: medium;
|
||||
width: fit-content;
|
||||
}
|
||||
|
||||
label {
|
||||
color: #FFF;
|
||||
display: block;
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
body {
|
||||
background-color: rgb(44, 49, 54);
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
.center-screen {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.centered {
|
||||
background: transparent;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
h2 {
|
||||
color: #FFF;
|
||||
}
|
||||
|
||||
h2.time_remain {
|
||||
color: #6d6d78;
|
||||
}
|
||||
|
||||
.submitButton {
|
||||
padding: .25em 0;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
background: #bb1515;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
font-size: 2rem;
|
||||
width: 500px;
|
||||
letter-spacing: .0625rem;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 3px 5px 1px rgba(0, 0, 0, 0.25);
|
||||
text-shadow: 0 -2px 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: linear-gradient(to bottom right, #111E25 0%, #111 100%);
|
||||
font-family: 'Lato', sans-serif;
|
||||
}
|
||||
@@ -0,0 +1,83 @@
|
||||
body {
|
||||
background-color: rgb(44, 49, 54);
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
.center-screen {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.centered {
|
||||
background: transparent;
|
||||
margin: 0 auto;
|
||||
padding: 20px;
|
||||
width: 100%;
|
||||
overflow: auto;
|
||||
}
|
||||
|
||||
h1 {
|
||||
color: #FFF;
|
||||
font-size: 75px;
|
||||
}
|
||||
|
||||
h2.categoryHeader {
|
||||
color: #FFF;
|
||||
font-size: 50px;
|
||||
}
|
||||
|
||||
button {
|
||||
background: transparent;
|
||||
border: none;
|
||||
color: #FFF;
|
||||
font-size: 35px;
|
||||
font-weight: normal;
|
||||
letter-spacing: .125rem;
|
||||
text-transform: uppercase;
|
||||
text-align: center;
|
||||
transition: opacity .25s .5s;
|
||||
}
|
||||
|
||||
.submitButton {
|
||||
margin-top: 2%;
|
||||
margin-bottom: 5%;
|
||||
padding: .25em 0;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
background: #bb1515;
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
font-size: 2rem;
|
||||
width: 500px;
|
||||
letter-spacing: .0625rem;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 3px 5px 1px rgba(0, 0, 0, 0.25);
|
||||
text-shadow: 0 -2px 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
|
||||
@media only screen and (max-device-width: 480px) {
|
||||
.submitButton {
|
||||
margin-top: 2%;
|
||||
padding: .25em 0;
|
||||
border: 0;
|
||||
outline: 0;
|
||||
background: rgb(6, 216, 136);
|
||||
color: rgba(255, 255, 255, 0.85);
|
||||
font-size: 2rem;
|
||||
width: 500px;
|
||||
letter-spacing: .0625rem;
|
||||
border-radius: 12px;
|
||||
box-shadow: 0 3px 5px 1px rgba(0, 0, 0, 0.25);
|
||||
text-shadow: 0 -2px 0 rgba(0, 0, 0, 0.25), 0 1px 0 rgba(255, 255, 255, 0.2);
|
||||
}
|
||||
}
|
||||
|
||||
html,
|
||||
body {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: linear-gradient(to bottom right, #111E25 0%, #111 100%);
|
||||
font-family: 'Lato', sans-serif;
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de" xmlns:th="https://www.thymeleaf.org/">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<link th:href="@{/styles/addingCandidates.css}" rel="stylesheet" />
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
</head>
|
||||
|
||||
<body class="center-screen">
|
||||
<script>
|
||||
var q = 1,
|
||||
qMax = 0;
|
||||
|
||||
$(function() {
|
||||
qMax = $('#inputForm div.group').length;
|
||||
$('#inputForm div.group').hide();
|
||||
$('#inputForm div.group:nth-child(1)').show();
|
||||
$('#btnNext').on('click', function(event) {
|
||||
event.preventDefault();
|
||||
handleClick();
|
||||
});
|
||||
});
|
||||
|
||||
function handleClick() {
|
||||
if (q < qMax) {
|
||||
$('#inputForm div.group:nth-child(' + q + ')').hide();
|
||||
$('#inputForm div.group:nth-child(' + (q + 1) + ')').show();
|
||||
if (q == (qMax - 1)) {
|
||||
$('#btnNext').html('Eingabe bestätigen');
|
||||
}
|
||||
q++;
|
||||
} else {
|
||||
document.getElementById("inputForm").submit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="centered">
|
||||
<h1>Schlage für jede Kategorie eine/n Kandiadt/en vor:</h1>
|
||||
<form id="inputForm" action="#" th:action="@{/saveCandidates}" th:object="${form}" method="post">
|
||||
<div id="candidateAdding">
|
||||
<div class="group" th:each="category, itemStat : ${categories}">
|
||||
<div th:if="${itemStat.index > 30}">
|
||||
<h2 class="categoryCategory">Lehrer</h2>
|
||||
</div>
|
||||
<div th:unless="${itemStat.index > 30}">
|
||||
<h2 class="categoryCategory">Schüler</h2>
|
||||
</div>
|
||||
<h2 class="categoryHeader" th:text="${category.name}"></h2>
|
||||
<input th:field="*{possibleCandidates[__${itemStat.index}__].name}" />
|
||||
</div>
|
||||
</div>
|
||||
<button class="submitButton" id="btnNext" type="submit">Nächste Kategorie</button>
|
||||
<input id="voterName" type="hidden" name="name" th:value="${name}" />
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,113 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="https://www.thymeleaf.org/">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
<link th:href="@{/styles/authenticate.css}" rel="stylesheet" />
|
||||
</head>
|
||||
|
||||
<body class="center-screen">
|
||||
|
||||
<h1 th:text="|Dir wurde ein Code an ${name} gesendet!|"></h1>
|
||||
<h1>Nicht wundern das kann ein wenig dauern!</h1>
|
||||
<h1 id="time_remain" class="end" th:text="${codeTime}"></h1>
|
||||
<h2>Bitte gebe den Authentifizierungscode ein</h2>
|
||||
<form action="#" id="passForm" th:action="@{/vote}" method="post">
|
||||
<input id="voterName" type="hidden" name="name" th:value="${name}" />
|
||||
<input id="authCode" type="hidden" name="code" value="" />
|
||||
<input type="text" placeholder="•" class="passInput" name="pass[]" maxlength="1" autocomplete="off" required pattern="\d{1}" autofocus>
|
||||
<input type="text" placeholder="•" class="passInput" name="pass[]" maxlength="1" autocomplete="off" required pattern="\d{1}">
|
||||
<input type="text" placeholder="•" class="passInput" name="pass[]" maxlength="1" autocomplete="off" required pattern="\d{1}">
|
||||
<input type="text" placeholder="•" class="passInput" name="pass[]" maxlength="1" autocomplete="off" required pattern="\d{1}">
|
||||
<input type="text" placeholder="•" class="passInput" name="pass[]" maxlength="1" autocomplete="off" required pattern="\d{1}">
|
||||
<input type="text" placeholder="•" class="passInput" name="pass[]" maxlength="1" autocomplete="off" required pattern="\d{1}">
|
||||
</form>
|
||||
<button class="submitButton" id="signup_button" onclick="getCode()">Abstimmen</button>
|
||||
|
||||
|
||||
<form action="#" th:action="@{/newCode}" method="post">
|
||||
<input id="voterName" type="hidden" name="name" th:value="${name}" />
|
||||
<button class="newCode">Neuen Code anfordern</button>
|
||||
</form>
|
||||
|
||||
|
||||
<div th:if="${codeExpired}">
|
||||
<h2 class="errorCode">Der Code ist nicht mehr gültig!</h2>
|
||||
</div>
|
||||
|
||||
<div th:if="${codeFalse}">
|
||||
<h2 class="errorCode">Der eingegebene Code ist falsch</h2>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
const $inp = $(".passInput");
|
||||
|
||||
$inp.on({
|
||||
paste(ev) { // Handle Pasting
|
||||
const clip = ev.originalEvent.clipboardData.getData('text').trim();
|
||||
// Allow numbers only
|
||||
if (!/\d{6}/.test(clip)) return ev.preventDefault(); // Invalid. Exit here
|
||||
// Split string to Array or characters
|
||||
const s = [...clip];
|
||||
// Populate inputs. Focus last input.
|
||||
$inp.val(i => s[i]).eq(5).focus();
|
||||
},
|
||||
input(ev) { // Handle typing
|
||||
|
||||
const i = $inp.index(this);
|
||||
if (this.value) $inp.eq(i + 1).focus();
|
||||
},
|
||||
keydown(ev) { // Handle Deleting
|
||||
|
||||
const i = $inp.index(this);
|
||||
if (!this.value && ev.key === "Backspace" && i) $inp.eq(i - 1).focus();
|
||||
}
|
||||
});
|
||||
|
||||
function getCode() {
|
||||
groupInputs = document.querySelectorAll(".passInput");
|
||||
var code = "";
|
||||
groupInputs.forEach(input => {
|
||||
console.log("Input: " + input.value);
|
||||
code += input.value;
|
||||
});
|
||||
console.log("Code: " + code);
|
||||
output = document.getElementById("authCode");
|
||||
output.value = code;
|
||||
document.getElementById("passForm").submit();
|
||||
}
|
||||
|
||||
function updateCounter(time) {
|
||||
const zeroPad = (num, places) => String(num).padStart(places, '0')
|
||||
|
||||
// Show time remaining now.
|
||||
showTimeRemaining();
|
||||
|
||||
var dateFuture = time;
|
||||
console.log(dateFuture);
|
||||
|
||||
// Set a timer to update the displayed clock every 1000 milliseconds.
|
||||
var updateTimeLoop = setInterval(showTimeRemaining, 1000);
|
||||
|
||||
function showTimeRemaining() {
|
||||
var dateNow = Date.now();
|
||||
var days = zeroPad(Math.floor((dateFuture - dateNow) / (1000 * 60 * 60 * 24)), 2);
|
||||
var hours = zeroPad(Math.floor(((dateFuture - dateNow) - days * 1000 * 60 * 60 * 24) / (1000 * 60 * 60)), 2);
|
||||
var mins = zeroPad(Math.floor(((dateFuture - dateNow) - days * 1000 * 60 * 60 * 24 - hours * 1000 * 60 * 60) / (1000 * 60)), 2);
|
||||
var secs = zeroPad(Math.floor(((dateFuture - dateNow) - days * 1000 * 60 * 60 * 24 - hours * 1000 * 60 * 60 - mins * 1000 * 60) / 1000), 2);
|
||||
document.getElementById("time_remain").innerHTML = "Der Code gilt noch für " + mins + ":" + secs;
|
||||
if (hours + mins + secs == 0) {
|
||||
document.getElementById("time_remain").innerHTML = "Der Code ist abgelaufen";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updateCounter(document.getElementById("time_remain").innerHTML);
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,10 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de" xmlns:th="https://www.thymeleaf.org/">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<link th:href="@{/styles/allreadyVoted.css}" rel="stylesheet" />
|
||||
</head>
|
||||
|
||||
<body class="center-screen">
|
||||
<div class="centered">
|
||||
<h1>Oops irgendwas ist kaputt gegangen</h1>
|
||||
<h2 id="time_remain">Keine Sorge! <br> Probiers nochmal :D</h2>
|
||||
<button id="backButton" class="submitButton">Zurück zum Anfang</button>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.getElementById("backButton").onclick = function() {
|
||||
location.href = "/";
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,23 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de" xmlns:th="https://www.thymeleaf.org/">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<link th:href="@{/styles/allreadyVoted.css}" rel="stylesheet" />
|
||||
</head>
|
||||
|
||||
<body class="center-screen">
|
||||
<div class="centered">
|
||||
<h1>Du hast schon abgestimmt!</h1>
|
||||
<button id="backButton" class="submitButton">Zurück zum Anfang</button>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.getElementById("backButton").onclick = function() {
|
||||
location.href = "/";
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,14 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de" xmlns:th="https://www.thymeleaf.org/">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Abizeitung 2020/2021 Voting</title>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<h1 style="color: red;"> Der eingegebene Name entspricht nicht den Vorgaben </h1>
|
||||
<a href="/">Return to Login-Site</a>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de" xmlns:th="https://www.thymeleaf.org/">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<link th:href="@{/styles/allreadyVoted.css}" rel="stylesheet" />
|
||||
</head>
|
||||
|
||||
<body class="center-screen">
|
||||
<div class="centered">
|
||||
<h1>Du bist nicht zur Wahl zugelassen!</h1>
|
||||
<h2 id="time_remain">Falls du abstimmen können solltest <br> schreibe eine Mail an adolfinumvoting@gmail.com</h2>
|
||||
<button id="backButton" class="submitButton">Zurück zum Anfang</button>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.getElementById("backButton").onclick = function() {
|
||||
location.href = "/";
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de" xmlns:th="https://www.thymeleaf.org/">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<link th:href="@{/styles/allreadyVoted.css}" rel="stylesheet" />
|
||||
</head>
|
||||
|
||||
<body class="center-screen">
|
||||
<div class="centered">
|
||||
<h1>Du bist leider zu spät</h1>
|
||||
<h2>Momentan ist hier auf der Seite nichts los</h2>
|
||||
<button id="backButton" class="submitButton">Zur Adolfinum Seite</button>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
document.getElementById("backButton").onclick = function() {
|
||||
location.href = "https://adolfinum.de";
|
||||
};
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,65 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="https://www.thymeleaf.org/">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<link th:href="@{/styles/mottoVoting.css}" rel="stylesheet" />
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
</head>
|
||||
|
||||
|
||||
<body class="center-screen">
|
||||
|
||||
<div class="centered">
|
||||
<h1>Wähle das Abimotto:</h1>
|
||||
<div id="votingButtons">
|
||||
<div th:each="motto : ${mottos}" class="voteDiv">
|
||||
<button class="inputButton" th:id="|motto${motto.id}|" th:text="${motto.name}" th:onclick="|setColor(motto${motto.id})|"></button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<form action="#" th:action="@{/saveMotto}" method="post" id="mottoForm">
|
||||
<input id="voteValue" type="hidden" name="voteValue" value="" />
|
||||
<input id="voterName" type="hidden" name="name" th:value="${name}" />
|
||||
<button class="submitButton" id="btnNext" onclick=getVotes()>Auswahl bestätigen</button>
|
||||
</form>
|
||||
</div>
|
||||
<script>
|
||||
function setColor(button) {
|
||||
console.log(button);
|
||||
groupButtons = document.querySelectorAll('[id^=motto]');
|
||||
groupButtons.forEach(button => {
|
||||
button.style.background = 'transparent';
|
||||
button.style.fontWeight = 'normal';
|
||||
});
|
||||
button.style.background = "#bb1515";
|
||||
button.style.fontWeight = 'bold';
|
||||
}
|
||||
|
||||
function rgbToHex(rgb) {
|
||||
rgb = rgb.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
|
||||
var color = (rgb && rgb.length === 4) ? "#" +
|
||||
("0" + parseInt(rgb[1], 10).toString(16)).slice(-2) +
|
||||
("0" + parseInt(rgb[2], 10).toString(16)).slice(-2) +
|
||||
("0" + parseInt(rgb[3], 10).toString(16)).slice(-2) : '';
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
function getVotes() {
|
||||
groupButtons = document.querySelectorAll(".inputButton");
|
||||
var voteID;
|
||||
groupButtons.forEach(button => {
|
||||
if (button.style.fontWeight == 'bold') {
|
||||
voteID = 5;
|
||||
}
|
||||
});
|
||||
input = document.getElementById("voteValue");
|
||||
input.value = voteID;
|
||||
document.getElementById("mottoForm").submit();
|
||||
}
|
||||
</script>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,40 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de" xmlns:th="http://thymeleaf.org">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Abizeitung 2020/2021 Voting</title>
|
||||
<link th:href="@{/styles/start.css}" rel="stylesheet" />
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<script>
|
||||
window.addEventListener("load", function() {
|
||||
document.getElementById("signup_button").addEventListener("click", test);
|
||||
});
|
||||
|
||||
function test() {
|
||||
let input_field = document.getElementById("email_input");
|
||||
let input = input_field.value;
|
||||
if (!input.trim().match("[a-z]+\\.[a-z]+@adolfinum+\\.de$")) {
|
||||
input_field.value = "";
|
||||
alert("Die Email-Adresse \"" + input + "\" entspricht nicht den Vorgaben");
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="userLogin">
|
||||
<form action="#" th:action="@{/checkStatus}" method="post">
|
||||
<label for="email_input">
|
||||
<span class="label-text">Adolfinum E-Mail</span>
|
||||
</label>
|
||||
<input class="email_input" id="email_input" type="text" placeholder="name.nachname@adolfinum.de" name="name" required autofocus />
|
||||
<p></p>
|
||||
<button type="submit" id="signup_button">Abstimmen</button>
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,24 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="de" xmlns:th="http://thymeleaf.org">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<link th:href="@{/styles/voteSuccessful.css}" rel="stylesheet" />
|
||||
</head>
|
||||
|
||||
<body class="center-screen">
|
||||
<div class="centered">
|
||||
<h1>Deine Auswahl fließt nun in die Wahl ein!</h1>
|
||||
<h2>Danke fürs abstimmen!</h2>
|
||||
<button id="backButton" class="submitButton">Zurück zum Anfang</button>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
<script>
|
||||
document.getElementById("backButton").onclick = function() {
|
||||
location.href = "/";
|
||||
};
|
||||
</script>
|
||||
|
||||
</html>
|
||||
@@ -0,0 +1,92 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" xmlns:th="https://www.thymeleaf.org/">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<title>Title</title>
|
||||
<link th:href="@{/styles/voting.css}" rel="stylesheet" />
|
||||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
|
||||
</head>
|
||||
|
||||
|
||||
<body class="center-screen">
|
||||
<script>
|
||||
function setColor(button) {
|
||||
groupButtons = document.querySelectorAll('[id^=' + button.id.split("_")[0] + ']');
|
||||
groupButtons.forEach(button => {
|
||||
button.style.background = 'transparent';
|
||||
button.style.fontWeight = 'normal';
|
||||
});
|
||||
button.style.background = "#bb1515";
|
||||
button.style.fontWeight = 'bold';
|
||||
}
|
||||
|
||||
function rgbToHex(rgb) {
|
||||
rgb = rgb.match(/^rgba?[\s+]?\([\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?,[\s+]?(\d+)[\s+]?/i);
|
||||
var color = (rgb && rgb.length === 4) ? "#" +
|
||||
("0" + parseInt(rgb[1], 10).toString(16)).slice(-2) +
|
||||
("0" + parseInt(rgb[2], 10).toString(16)).slice(-2) +
|
||||
("0" + parseInt(rgb[3], 10).toString(16)).slice(-2) : '';
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
function getVotes() {
|
||||
groupButtons = document.querySelectorAll(".inputButton");
|
||||
var voteIds = [];
|
||||
groupButtons.forEach(button => {
|
||||
if (button.style.fontWeight == 'bold') {
|
||||
var str = button.id.split("_");
|
||||
voteIds.push(str[1].replace(/\D/g, ""));
|
||||
}
|
||||
});
|
||||
input = document.getElementById("voteValues");
|
||||
input.value = voteIds;
|
||||
}
|
||||
|
||||
var q = 1,
|
||||
qMax = 0;
|
||||
|
||||
$(function() {
|
||||
qMax = $('#votingButtons div.voteDiv').length;
|
||||
$('#votingButtons div.voteDiv').hide();
|
||||
$('#votingButtons div.voteDiv:nth-child(1)').show();
|
||||
$('#btnNext').on('click', function(event) {
|
||||
event.preventDefault();
|
||||
handleClick();
|
||||
});
|
||||
});
|
||||
|
||||
function handleClick() {
|
||||
if (q < qMax) {
|
||||
$('#votingButtons div.voteDiv:nth-child(' + q + ')').hide();
|
||||
$('#votingButtons div.voteDiv:nth-child(' + (q + 1) + ')').show();
|
||||
if (q == (qMax - 1)) {
|
||||
$('#btnNext').html('Auswahl bestätigen');
|
||||
}
|
||||
q++;
|
||||
} else {
|
||||
getVotes();
|
||||
document.getElementById("myForm").submit();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<div class="centered">
|
||||
<h1>Wähle deine Kandidaten:</h1>
|
||||
<div id="votingButtons">
|
||||
<div th:each="category,iter : ${categories}" class="voteDiv">
|
||||
<h2 class="categoryHeader" th:text="${category.name}"></h2>
|
||||
<div th:each="candidate : ${category.candidateList}">
|
||||
<button class="inputButton" th:id="|category${category.id}_candidate${candidate.id}|" th:text="${candidate.name}" th:onclick="|setColor(category${category.id}_candidate${candidate.id})|"></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<button class="submitButton" id="btnNext" type="submit">Nächste Kategorie</button>
|
||||
<form action="#" th:action="@{/processVote}" method="post" id="myForm">
|
||||
<input id="voteValues" type="hidden" name="voteValues" value="" />
|
||||
<input id="voterName" type="hidden" name="name" th:value="${name}" />
|
||||
</form>
|
||||
</div>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
package com.github.cato447.AbizeitungVotingSystem;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
@SpringBootTest
|
||||
class AbizeitungVotingSystemApplicationTests {
|
||||
|
||||
@Test
|
||||
void contextLoads() {
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user