moderization
This commit is contained in:
1 parent
ccd6c78397
commit
58c1fe2fff
24 files changed
+204
-103
No files matched your search
+1
-6
@@ -20,11 +20,6 @@
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-25/"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jst.j2ee.internal.web.container"/>
|
||||
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer">
|
||||
<attributes>
|
||||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
||||
</attributes>
|
||||
</classpathentry>
|
||||
<classpathentry kind="con" path="org.eclipse.buildship.core.gradleclasspathcontainer"/>
|
||||
<classpathentry kind="output" path="bin/default"/>
|
||||
</classpath>
|
||||
@@ -11,7 +11,7 @@
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.wst.common.project.facet.core.builder</name>
|
||||
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
@@ -20,11 +20,6 @@
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.eclipse.buildship.core.gradleprojectbuilder</name>
|
||||
<arguments>
|
||||
</arguments>
|
||||
</buildCommand>
|
||||
<buildCommand>
|
||||
<name>org.springframework.ide.eclipse.boot.validation.springbootbuilder</name>
|
||||
<arguments>
|
||||
@@ -33,9 +28,6 @@
|
||||
</buildSpec>
|
||||
<natures>
|
||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
||||
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
|
||||
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
|
||||
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
|
||||
<nature>org.eclipse.buildship.core.gradleprojectnature</nature>
|
||||
</natures>
|
||||
</projectDescription>
|
||||
@@ -0,0 +1,37 @@
|
||||
# Variablen
|
||||
JAR_SOURCE=build/libs/CampOrganizer2.jar
|
||||
DEPLOY_DIR=debian-deploy
|
||||
PACKAGE_NAME=camporganizer.deb
|
||||
|
||||
.PHONY: all deb clean
|
||||
|
||||
all: deb
|
||||
|
||||
deb:
|
||||
@echo "get version..."
|
||||
$(eval VERSION := $(shell ./gradlew properties -q | grep '^version:' | awk '{print $$2}'))
|
||||
@echo "found version ${VERSION}"
|
||||
|
||||
@echo "Starting Gradle-Build..."
|
||||
./gradlew clean bootJar
|
||||
|
||||
@echo "prepare package structure..."
|
||||
mkdir -p $(DEPLOY_DIR)/opt/camporganizer
|
||||
cp $(JAR_SOURCE) $(DEPLOY_DIR)/opt/camporganizer/CampOrganizer2.jar
|
||||
chmod 755 $(DEPLOY_DIR)/DEBIAN/postinst
|
||||
chmod 755 $(DEPLOY_DIR)/DEBIAN/postrm
|
||||
|
||||
@echo "Generiere finale DEBIAN/control Datei mit Version $(VERSION)..."
|
||||
sed "s/__VERSION__/$(VERSION)/g" $(DEPLOY_DIR)/DEBIAN/control.template > $(DEPLOY_DIR)/DEBIAN/control
|
||||
|
||||
@echo "Building Debian package..."
|
||||
dpkg-deb --root-owner-group --build $(DEPLOY_DIR) $(PACKAGE_NAME)
|
||||
|
||||
@echo "Done! Package created: $(PACKAGE_NAME)"
|
||||
|
||||
clean:
|
||||
@echo "Cleaning up..."
|
||||
rm -rf $(DEPLOY_DIR)/opt/
|
||||
rm -f $(DEPLOY_DIR)/DEBIAN/control
|
||||
rm -f $(PACKAGE_NAME)
|
||||
./gradlew clean
|
||||
+27
-29
@@ -1,16 +1,13 @@
|
||||
plugins {
|
||||
id 'org.springframework.boot' version '3.5.0'
|
||||
id 'org.springframework.boot' version '4.1.1'
|
||||
id "io.spring.dependency-management" version "1.1.7"
|
||||
id 'java'
|
||||
id 'war'
|
||||
id 'eclipse'
|
||||
id 'application'
|
||||
}
|
||||
|
||||
group = 'de.jottyfan.camporganizer'
|
||||
version = '1.0.6'
|
||||
|
||||
description = """CampOrganizer2"""
|
||||
group = project.group
|
||||
version = project.version
|
||||
description = project.description
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
@@ -26,8 +23,9 @@ tasks.withType(JavaCompile).configureEach {
|
||||
options.compilerArgs.add("-parameters")
|
||||
}
|
||||
|
||||
application {
|
||||
springBoot {
|
||||
mainClass = 'de.jottyfan.camporganizer.Main'
|
||||
buildInfo()
|
||||
}
|
||||
|
||||
java {
|
||||
@@ -36,26 +34,22 @@ java {
|
||||
}
|
||||
}
|
||||
|
||||
war {
|
||||
doFirst {
|
||||
manifest {
|
||||
attributes("Implementation-Title": project.name,
|
||||
"Implementation-Version": version,
|
||||
"Implementation-Timestamp": new Date())
|
||||
}
|
||||
bootJar {
|
||||
manifest {
|
||||
attributes(
|
||||
'Implementation-Title': project.name,
|
||||
'Implementation-Version': project.version,
|
||||
'Implementation-Timestamp': new Date().toString()
|
||||
)
|
||||
}
|
||||
version = version
|
||||
archiveFileName = 'CampOrganizer2.war'
|
||||
archiveVersion = project.version
|
||||
archiveFileName = "CampOrganizer2.jar"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation 'org.jooq:jooq:3.20.8'
|
||||
implementation 'org.jooq:jooq'
|
||||
implementation 'de.jottyfan:COJooq:2026.10.12'
|
||||
|
||||
implementation 'org.apache.logging.log4j:log4j-api:2.25.2'
|
||||
implementation 'org.apache.logging.log4j:log4j-core:2.25.2'
|
||||
implementation 'org.apache.logging.log4j:log4j-to-slf4j:2.25.2'
|
||||
|
||||
implementation 'org.webjars:bootstrap:5.3.8'
|
||||
implementation 'org.webjars:font-awesome:7.0.1'
|
||||
implementation 'org.webjars:jquery:3.7.1'
|
||||
@@ -64,6 +58,8 @@ dependencies {
|
||||
implementation 'org.webjars:select2:4.0.13'
|
||||
implementation 'org.webjars.npm:fancyapps__fancybox:3.5.7'
|
||||
|
||||
implementation 'org.springframework.boot:spring-boot-starter-log4j2'
|
||||
|
||||
implementation 'net.sf.biweekly:biweekly:0.6.8'
|
||||
|
||||
// for using the keycloak rest interface
|
||||
@@ -81,28 +77,30 @@ dependencies {
|
||||
implementation 'commons-validator:commons-validator:1.10.0'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-mail'
|
||||
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-jooq'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-security'
|
||||
implementation "org.springframework.boot:spring-boot-starter-oauth2-client"
|
||||
implementation 'org.springframework.security:spring-security-oauth2-authorization-server:1.5.3'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-web'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-validation'
|
||||
implementation 'org.thymeleaf.extras:thymeleaf-extras-springsecurity6'
|
||||
implementation 'nz.net.ultraq.thymeleaf:thymeleaf-layout-dialect:3.4.0'
|
||||
|
||||
implementation 'commons-io:commons-io:2.20.0'
|
||||
|
||||
runtimeOnly 'org.springframework.boot:spring-boot-starter-tomcat'
|
||||
implementation 'org.springframework.boot:spring-boot-starter-tomcat'
|
||||
|
||||
testImplementation 'org.springframework.boot:spring-boot-starter-test'
|
||||
testImplementation 'org.springframework.security:spring-security-test'
|
||||
|
||||
modules {
|
||||
module("org.springframework.boot:spring-boot-starter-logging") {
|
||||
replacedBy("org.springframework.boot:spring-boot-starter-log4j2", "use log4j2 for logback")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
}
|
||||
|
||||
// add version to manifest
|
||||
springBoot {
|
||||
buildInfo()
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
Package: camporganizer
|
||||
Version: __VERSION__
|
||||
Section: web
|
||||
Priority: optional
|
||||
Architecture: all
|
||||
Maintainer: Joerg Henke <jottyfan@mail.de>
|
||||
Depends: default-jre-headless
|
||||
Description: CampOrganizer Web Application with embedded Tomcat
|
||||
Executable
+23
@@ -0,0 +1,23 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if ! id "camporganizer" >/dev/null 2>&1; then
|
||||
useradd --system --user-group --no-create-home \
|
||||
--shell /bin/false camporganizer
|
||||
fi
|
||||
|
||||
touch /etc/camporganizer.properties
|
||||
chgrp camporganizer /etc/camporganizer.properties
|
||||
chmod 640 /etc/camporganizer.properties
|
||||
|
||||
mkdir -p /opt/camporganizer
|
||||
chown -R camporganizer:camporganizer /opt/camporganizer
|
||||
|
||||
systemctl daemon-reload
|
||||
systemctl enable camporganizer.service
|
||||
|
||||
if systemctl is-active --quiet camporganizer.service; then
|
||||
systemctl restart camporganizer.service
|
||||
fi
|
||||
|
||||
exit 0
|
||||
Executable
+20
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
set -e
|
||||
|
||||
if [ "$1" = "purge" ]; then
|
||||
echo "remove system user and group 'camporganizer'..."
|
||||
|
||||
if id "camporganizer" >/dev/null 2>&1; then
|
||||
userdel camporganizer || echo "could not remove system user 'camporganizer'."
|
||||
fi
|
||||
|
||||
if getent group "camporganizer" >/dev/null 2>&1; then
|
||||
groupdel camporganizer || echo "could not remove group 'camporganizer'."
|
||||
fi
|
||||
|
||||
if [ -d "/opt/camporganizer" ]; then
|
||||
rm -rf /opt/camporganizer
|
||||
fi
|
||||
fi
|
||||
|
||||
exit 0
|
||||
@@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=CampOrganizer Service
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
User=camporganizer
|
||||
Group=camporganizer
|
||||
Type=simple
|
||||
WorkingDirectory=/opt/camporganizer
|
||||
ExecStart=/usr/bin/java -jar /opt/camporganizer/CampOrganizer2.jar
|
||||
Restart=always
|
||||
RestartSec=10
|
||||
StandardOutput=journal
|
||||
StandardError=journal
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -0,0 +1,3 @@
|
||||
group = de.jottyfan.camporganizer
|
||||
version = 1.0.7
|
||||
description = CampOrganizer2
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.1.0-bin.zip
|
||||
distributionUrl=https\://services.gradle.org/distributions/gradle-9.8.1-bin.zip
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
zipStorePath=wrapper/dists
|
||||
@@ -8,6 +8,8 @@ import org.springframework.security.config.annotation.web.builders.HttpSecurity;
|
||||
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
|
||||
import org.springframework.security.oauth2.client.oidc.web.logout.OidcClientInitiatedLogoutSuccessHandler;
|
||||
import org.springframework.security.oauth2.client.registration.InMemoryClientRegistrationRepository;
|
||||
import org.springframework.security.oauth2.jwt.JwtDecoder;
|
||||
import org.springframework.security.oauth2.jwt.NimbusJwtDecoder;
|
||||
import org.springframework.security.web.SecurityFilterChain;
|
||||
import org.springframework.security.web.authentication.session.NullAuthenticatedSessionStrategy;
|
||||
import org.springframework.security.web.authentication.session.SessionAuthenticationStrategy;
|
||||
@@ -27,6 +29,13 @@ public class SecurityConfiguration {
|
||||
return new NullAuthenticatedSessionStrategy();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public JwtDecoder jwtDecoder(InMemoryClientRegistrationRepository clientRegistrationRepository) {
|
||||
var clientRegistration = clientRegistrationRepository.iterator().next();
|
||||
String jwkSetUri = clientRegistration.getProviderDetails().getJwkSetUri();
|
||||
return NimbusJwtDecoder.withJwkSetUri(jwkSetUri).build();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public SecurityFilterChain securityFilterChain(HttpSecurity sec, InMemoryClientRegistrationRepository crr)
|
||||
throws Exception {
|
||||
|
||||
@@ -47,7 +47,7 @@ public class AdminController extends CommonController {
|
||||
mailBean.setFrom(from);
|
||||
mailBean.getTo().add(getCurrentEmail(principal));
|
||||
model.addAttribute("bean", mailBean);
|
||||
return "/admin/mail";
|
||||
return "admin/mail";
|
||||
}
|
||||
|
||||
@PostMapping("/admin/mail/send")
|
||||
@@ -56,7 +56,7 @@ public class AdminController extends CommonController {
|
||||
if (bindingResult.hasErrors()) {
|
||||
for (ObjectError error : bindingResult.getAllErrors())
|
||||
LOGGER.error("error {}: {}", error.getCode(), error.getDefaultMessage());
|
||||
return "/admin/mail";
|
||||
return "admin/mail";
|
||||
}
|
||||
service.sendMail(bean);
|
||||
return "redirect:/admin/mail";
|
||||
@@ -65,19 +65,19 @@ public class AdminController extends CommonController {
|
||||
@GetMapping("/admin/document")
|
||||
public String getDocuments(Model model, HttpServletRequest request) {
|
||||
model.addAttribute("documents", service.getAllDocuments());
|
||||
return "/admin/document";
|
||||
return "admin/document";
|
||||
}
|
||||
|
||||
@GetMapping("/admin/document/add")
|
||||
public String prepareAddDocument(Model model, HttpServletRequest request) {
|
||||
model.addAttribute("bean", new DocumentBean());
|
||||
return "/admin/document_edit";
|
||||
return "admin/document_edit";
|
||||
}
|
||||
|
||||
@GetMapping("/admin/document/edit/{id}")
|
||||
public String prepareAddDocument(@PathVariable("id") Integer id, Model model, HttpServletRequest request) {
|
||||
model.addAttribute("bean", service.getDocument(id));
|
||||
return "/admin/document_edit";
|
||||
return "admin/document_edit";
|
||||
}
|
||||
|
||||
@PostMapping("/admin/document/update")
|
||||
@@ -86,7 +86,7 @@ public class AdminController extends CommonController {
|
||||
if (bindingResult.hasErrors()) {
|
||||
for (ObjectError error : bindingResult.getAllErrors())
|
||||
LOGGER.error("error {}: {}", error.getCode(), error.getDefaultMessage());
|
||||
return "/admin/document_edit";
|
||||
return "admin/document_edit";
|
||||
}
|
||||
service.updateDocument(bean);
|
||||
return "redirect:/admin/document";
|
||||
@@ -101,21 +101,21 @@ public class AdminController extends CommonController {
|
||||
@GetMapping("/admin/location")
|
||||
public String getLocations(Model model, HttpServletRequest request) {
|
||||
model.addAttribute("locations", service.getLocations());
|
||||
return "/admin/location";
|
||||
return "admin/location";
|
||||
}
|
||||
|
||||
@GetMapping("/admin/location/add")
|
||||
public String prepareAddLocation(Model model, HttpServletRequest request) {
|
||||
model.addAttribute("bean", new LocationBean());
|
||||
model.addAttribute("documents", service.getLocationDocuments());
|
||||
return "/admin/location_edit";
|
||||
return "admin/location_edit";
|
||||
}
|
||||
|
||||
@GetMapping("/admin/location/edit/{id}")
|
||||
public String prepareAddLocation(@PathVariable("id") Integer id, Model model, HttpServletRequest request) {
|
||||
model.addAttribute("bean", service.getLocation(id));
|
||||
model.addAttribute("documents", service.getLocationDocuments());
|
||||
return "/admin/location_edit";
|
||||
return "admin/location_edit";
|
||||
}
|
||||
|
||||
@PostMapping("/admin/location/update")
|
||||
@@ -126,7 +126,7 @@ public class AdminController extends CommonController {
|
||||
LOGGER.error("error {}: {}", error.getCode(), error.getDefaultMessage());
|
||||
}
|
||||
model.addAttribute("documents", service.getLocationDocuments());
|
||||
return "/admin/location_edit";
|
||||
return "admin/location_edit";
|
||||
}
|
||||
service.upsertLocation(bean);
|
||||
return "redirect:/admin/location";
|
||||
@@ -142,7 +142,7 @@ public class AdminController extends CommonController {
|
||||
public String getCamplist(Model model, HttpServletRequest request) {
|
||||
model.addAttribute("camps", service.getAllCamps());
|
||||
model.addAttribute("locations", service.getLocations());
|
||||
return "/admin/camp";
|
||||
return "admin/camp";
|
||||
}
|
||||
|
||||
@GetMapping("/admin/camp/add")
|
||||
@@ -152,7 +152,7 @@ public class AdminController extends CommonController {
|
||||
model.addAttribute("locations", service.getLocations());
|
||||
model.addAttribute("profiles", service.getProfiles());
|
||||
model.addAttribute("campdescriptions", service.getCampdescriptions());
|
||||
return "/admin/camp_edit";
|
||||
return "admin/camp_edit";
|
||||
}
|
||||
|
||||
@GetMapping("/admin/camp/edit/{id}")
|
||||
@@ -166,7 +166,7 @@ public class AdminController extends CommonController {
|
||||
if (error != null) {
|
||||
model.addAttribute("error", error);
|
||||
}
|
||||
return "/admin/camp_edit";
|
||||
return "admin/camp_edit";
|
||||
}
|
||||
|
||||
@PostMapping("/admin/camp/update")
|
||||
@@ -180,7 +180,7 @@ public class AdminController extends CommonController {
|
||||
model.addAttribute("locations", service.getLocations());
|
||||
model.addAttribute("profiles", service.getProfiles());
|
||||
model.addAttribute("campdescriptions", service.getCampdescriptions());
|
||||
return "/admin/camp_edit";
|
||||
return "admin/camp_edit";
|
||||
}
|
||||
String error = service.upsertCamp(bean);
|
||||
redirect.addAttribute("error", error);
|
||||
@@ -205,7 +205,7 @@ public class AdminController extends CommonController {
|
||||
model.addAttribute("documents", service.getDocumentsForCamps());
|
||||
model.addAttribute("campdocuments", service.getAllCampDocuments());
|
||||
model.addAttribute("campdocument", new CampDocumentBean());
|
||||
return "/admin/campdocument";
|
||||
return "admin/campdocument";
|
||||
}
|
||||
|
||||
@PostMapping("/admin/campdocument/add")
|
||||
@@ -220,7 +220,7 @@ public class AdminController extends CommonController {
|
||||
model.addAttribute("camps", service.getAllCamps());
|
||||
model.addAttribute("documents", service.getDocumentsForCamps());
|
||||
model.addAttribute("campdocuments", service.getAllCampDocuments());
|
||||
return "/admin/campdocument";
|
||||
return "admin/campdocument";
|
||||
}
|
||||
service.upsertCampDocument(bean);
|
||||
return "redirect:/admin/campdocument";
|
||||
|
||||
@@ -34,19 +34,19 @@ public class AdminPrivilegesController extends CommonController {
|
||||
@GetMapping("/admin/privileges/userbased")
|
||||
public String getUserbased(Model model) {
|
||||
model.addAttribute("list", service.getProfiles());
|
||||
return "/admin/privileges/userbased";
|
||||
return "admin/privileges/userbased";
|
||||
}
|
||||
|
||||
@GetMapping("/admin/privileges/rolebased")
|
||||
public String getRolebased(Model model) {
|
||||
model.addAttribute("list", service.getAllModules());
|
||||
return "/admin/privileges/rolebased";
|
||||
return "admin/privileges/rolebased";
|
||||
}
|
||||
|
||||
@GetMapping("/admin/privileges/campbased")
|
||||
public String getCampbased(Model model) {
|
||||
model.addAttribute("list", service.getAllCamps());
|
||||
return "/admin/privileges/campbased";
|
||||
return "admin/privileges/campbased";
|
||||
}
|
||||
|
||||
@GetMapping("/admin/privileges/rolebased/{role}")
|
||||
@@ -56,7 +56,7 @@ public class AdminPrivilegesController extends CommonController {
|
||||
model.addAttribute("container", service.getPersonCampMappingByModule(EnumModule.valueOf(role)));
|
||||
model.addAttribute("pagedest", "_admin_privileges_rolebased_" + role);
|
||||
model.addAttribute("module", role);
|
||||
return "/admin/privileges/rolebased";
|
||||
return "admin/privileges/rolebased";
|
||||
}
|
||||
|
||||
@GetMapping("/admin/privileges/campbased/{campid}")
|
||||
@@ -73,7 +73,7 @@ public class AdminPrivilegesController extends CommonController {
|
||||
model.addAttribute("container", service.getPersonModuleMappingByCamp(campid));
|
||||
model.addAttribute("pagedest", "_admin_privileges_campbased_" + campid);
|
||||
model.addAttribute("fkCamp", campid);
|
||||
return "/admin/privileges/campbased";
|
||||
return "admin/privileges/campbased";
|
||||
}
|
||||
|
||||
@GetMapping("/admin/privileges/userbased/{userid}")
|
||||
@@ -90,7 +90,7 @@ public class AdminPrivilegesController extends CommonController {
|
||||
model.addAttribute("container", service.getModuleCampMappingByPerson(userid));
|
||||
model.addAttribute("pagedest", "_admin_privileges_userbased_" + userid);
|
||||
model.addAttribute("fkProfile", userid);
|
||||
return "/admin/privileges/userbased";
|
||||
return "admin/privileges/userbased";
|
||||
}
|
||||
|
||||
@GetMapping("/admin/privileges/delete/{id}/{pagedest}")
|
||||
@@ -109,7 +109,7 @@ public class AdminPrivilegesController extends CommonController {
|
||||
model.addAttribute("profiles", service.getProfiles());
|
||||
model.addAttribute("camps", service.getAllCamps());
|
||||
model.addAttribute("modules", service.getAllModules());
|
||||
return "/admin/privileges/add";
|
||||
return "admin/privileges/add";
|
||||
}
|
||||
|
||||
@PostMapping("/admin/privileges/insert/{pagedest}")
|
||||
@@ -119,7 +119,7 @@ public class AdminPrivilegesController extends CommonController {
|
||||
model.addAttribute("profiles", service.getProfiles());
|
||||
model.addAttribute("camps", service.getAllCamps());
|
||||
model.addAttribute("modules", service.getAllModules());
|
||||
return "/admin/privileges/add";
|
||||
return "admin/privileges/add";
|
||||
}
|
||||
service.insertIntoCampProfile(bean);
|
||||
return "redirect:" + pagedest.replace("_", "/");
|
||||
|
||||
+1
-2
@@ -5,7 +5,6 @@ import java.time.LocalDate;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.ui.Model;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
@@ -33,7 +32,7 @@ public class BookingsController extends CommonController {
|
||||
|
||||
@GetMapping("/business/bookings/{year}")
|
||||
@RolesAllowed({"business_booking"})
|
||||
public String getBookings(Model model, @Nullable @PathVariable("year") Integer year, @RequestParam(name = "search", defaultValue = "") String search) {
|
||||
public String getBookings(Model model, @PathVariable(name = "year", required = false) Integer year, @RequestParam(name = "search", defaultValue = "") String search) {
|
||||
model.addAttribute("bookers", bookingsService.getBookers(getCurrentUser(), year));
|
||||
model.addAttribute("addBean", new AddPaymentBean());
|
||||
model.addAttribute("year", year == null ? LocalDate.now().getYear() : year);
|
||||
|
||||
+5
-5
@@ -37,28 +37,28 @@ public class OutlayController extends CommonController {
|
||||
public String getOutlayDashboard(Model model, Principal principal) {
|
||||
model.addAttribute("list", service.getListOf(super.getCurrentUser(principal), null));
|
||||
model.addAttribute("camps", service.getAllCamps());
|
||||
return "/business/outlay/list";
|
||||
return "business/outlay/list";
|
||||
}
|
||||
|
||||
@GetMapping("/business/outlay/add")
|
||||
public String loadAddMask(Model model, Principal principal) {
|
||||
model.addAttribute("bean", new OutlayBean().withUser(super.getCurrentUser(principal)));
|
||||
model.addAttribute("camps", service.getAllCamps());
|
||||
return "/business/outlay/editor";
|
||||
return "business/outlay/editor";
|
||||
}
|
||||
|
||||
@GetMapping("/business/outlay/edit/{id}")
|
||||
public String loadAddMask(@PathVariable("id") Integer id, Model model, Principal principal) {
|
||||
model.addAttribute("bean", service.getBeanIfAllowedFor(super.getCurrentUser(principal), id));
|
||||
model.addAttribute("camps", service.getAllCamps());
|
||||
return "/business/outlay/editor";
|
||||
return "business/outlay/editor";
|
||||
}
|
||||
|
||||
@PostMapping("/business/outlay/save")
|
||||
public String save(@Valid @ModelAttribute("bean") OutlayBean bean, BindingResult bindingResult, Model model) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
model.addAttribute("camps", service.getAllCamps());
|
||||
return "/business/outlay/editor";
|
||||
return "business/outlay/editor";
|
||||
}
|
||||
service.save(bean);
|
||||
return "redirect:/business/outlay";
|
||||
@@ -74,7 +74,7 @@ public class OutlayController extends CommonController {
|
||||
public String getSummaryOfCamp(@PathVariable("campid") Integer campId, Model model, Principal principal) {
|
||||
model.addAttribute("campid", campId);
|
||||
model.addAttribute("list", service.getListOf(null, campId));
|
||||
return "/business/outlay/summary";
|
||||
return "business/outlay/summary";
|
||||
}
|
||||
|
||||
@GetMapping("/business/outlay/download/{campid}")
|
||||
|
||||
@@ -30,7 +30,7 @@ public class CamplistController extends CommonController {
|
||||
@GetMapping("/camplist")
|
||||
public String index(Model model, Principal principal) {
|
||||
model.addAttribute("camps", service.getAllCamps(true));
|
||||
return super.isLoggedIn(principal) ? dashboard(model) : "/camplist";
|
||||
return super.isLoggedIn(principal) ? dashboard(model) : "camplist";
|
||||
}
|
||||
|
||||
@GetMapping("/dashboard")
|
||||
@@ -38,7 +38,7 @@ public class CamplistController extends CommonController {
|
||||
model.addAttribute("mybookings", service.getBookingsOf(super.getCurrentUser()));
|
||||
model.addAttribute("bookingBean", new BookingBean());
|
||||
model.addAttribute("camps", service.getAllCamps(true));
|
||||
return "/dashboard";
|
||||
return "dashboard";
|
||||
}
|
||||
|
||||
@PostMapping("/dashboard/update")
|
||||
|
||||
@@ -21,18 +21,18 @@ public class CampsideController extends CommonController {
|
||||
@GetMapping("/campside")
|
||||
public String getCampside(final Model model) {
|
||||
model.addAttribute("myCampBookings", service.getCampBookingsOf(super.getCurrentUser()));
|
||||
return "/campside/list";
|
||||
return "campside/list";
|
||||
}
|
||||
|
||||
@GetMapping("/campside/{id}")
|
||||
public String getCampDetails(@PathVariable("id") Integer fkCamp, final Model model) {
|
||||
// TODO: load content for the camp with fkCamp
|
||||
return "/campside/camp";
|
||||
return "campside/camp";
|
||||
}
|
||||
|
||||
@GetMapping("/campside/{id}/plan")
|
||||
public String getCampPlan(@PathVariable("id") Integer fkCamp, final Model model) {
|
||||
// TODO: load camp plan from database
|
||||
return "/campside/plan";
|
||||
return "campside/plan";
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -28,7 +28,7 @@ public class ConfirmationBoardController extends CommonController {
|
||||
@GetMapping("/confirmation/board")
|
||||
public String getBoard(Model model, Principal principal) {
|
||||
model.addAttribute("camps", service.loadCampList(super.getCurrentUser(principal)));
|
||||
return "/confirmation/board";
|
||||
return "confirmation/board";
|
||||
}
|
||||
|
||||
@GetMapping("/confirmation/board/camp/{id}")
|
||||
@@ -36,7 +36,7 @@ public class ConfirmationBoardController extends CommonController {
|
||||
model.addAttribute("campId", id);
|
||||
model.addAttribute("campStartDate", service.getCampStartDate(super.getCurrentUser(principal), id));
|
||||
model.addAttribute("persons", service.loadPersonList(super.getCurrentUser(principal), id));
|
||||
return "/confirmation/camplist";
|
||||
return "confirmation/camplist";
|
||||
}
|
||||
|
||||
@GetMapping("/confirmation/board/download/{id}")
|
||||
|
||||
@@ -32,19 +32,19 @@ public class MigrationController extends CommonController {
|
||||
@GetMapping("/migration/login")
|
||||
public String getLogin(Model model) {
|
||||
model.addAttribute("bean", new MigrationBean());
|
||||
return "/migration/login";
|
||||
return "migration/login";
|
||||
}
|
||||
|
||||
@PostMapping("/migration/loginold")
|
||||
public String loginOld(@Valid @ModelAttribute("bean") MigrationBean bean, final BindingResult bindingResult, Model model) {
|
||||
if (bindingResult.hasErrors()) {
|
||||
return "/migration/login";
|
||||
return "migration/login";
|
||||
} else if (service.checkLogin(bean)) {
|
||||
service.migrate(bean);
|
||||
return "redirect:/dashboard";
|
||||
} else {
|
||||
bindingResult.addError(new FieldError("password", "password", "Dein Passwort scheint falsch zu sein, oder den Benutzer gibt es nicht."));
|
||||
return "/migration/login";
|
||||
return "migration/login";
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-6
@@ -42,9 +42,9 @@ public class RegistrationController extends CommonController {
|
||||
model.addAttribute("sexes", EnumConverter.getSexes());
|
||||
model.addAttribute("roles", EnumConverter.getRoles());
|
||||
model.addAttribute("wellknown", service.getWellKnownRegistrations(getCurrentUser()));
|
||||
return "/registration/registration";
|
||||
return "registration/registration";
|
||||
} else {
|
||||
return "/registration/isover";
|
||||
return "registration/isover";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public class RegistrationController extends CommonController {
|
||||
if (currentUser != null) {
|
||||
model.addAttribute("wellknown", service.getWellKnownRegistrations(currentUser));
|
||||
}
|
||||
return "/registration/registration";
|
||||
return "registration/registration";
|
||||
}
|
||||
Integer result = service.register(bean, getCurrentUser());
|
||||
if (result < 1) {
|
||||
@@ -88,15 +88,15 @@ public class RegistrationController extends CommonController {
|
||||
if (currentUser != null) {
|
||||
model.addAttribute("wellknown", service.getWellKnownRegistrations(currentUser));
|
||||
}
|
||||
return "/registration/registration";
|
||||
return "registration/registration";
|
||||
}
|
||||
return "/registration/success";
|
||||
return "registration/success";
|
||||
}
|
||||
|
||||
@GetMapping("/registration/cancel/{id}")
|
||||
public String cancellation(@PathVariable("id") Integer id, final Model model) {
|
||||
model.addAttribute("bean", service.getBooking(id));
|
||||
return "/registration/cancellation";
|
||||
return "registration/cancellation";
|
||||
}
|
||||
|
||||
@GetMapping("/registration/revoke/{id}")
|
||||
|
||||
+8
-8
@@ -36,7 +36,7 @@ public class StaticPagesController extends CommonController {
|
||||
*/
|
||||
@GetMapping("/reports/{subpage}")
|
||||
public String getSubpage(@PathVariable("subpage") String subpage) {
|
||||
return "/reports/" + subpage;
|
||||
return "reports/" + subpage;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -46,7 +46,7 @@ public class StaticPagesController extends CommonController {
|
||||
*/
|
||||
@GetMapping("/verein")
|
||||
public String getVerein() {
|
||||
return "/verein";
|
||||
return "verein";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -56,7 +56,7 @@ public class StaticPagesController extends CommonController {
|
||||
*/
|
||||
@GetMapping("/vereinsmitglieder")
|
||||
public String getVereinsmitglieder() {
|
||||
return "/vereinsmitglieder";
|
||||
return "vereinsmitglieder";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -66,7 +66,7 @@ public class StaticPagesController extends CommonController {
|
||||
*/
|
||||
@GetMapping("/kontakt")
|
||||
public String getKontakt() {
|
||||
return "/kontakt";
|
||||
return "kontakt";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -77,7 +77,7 @@ public class StaticPagesController extends CommonController {
|
||||
@GetMapping("/allgemeines")
|
||||
public String getAllgemeines(final Model model) {
|
||||
model.addAttribute("title", service.getStockDescription());
|
||||
return "/allgemeines";
|
||||
return "allgemeines";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -87,7 +87,7 @@ public class StaticPagesController extends CommonController {
|
||||
*/
|
||||
@GetMapping("/nachruf")
|
||||
public String getNachruf() {
|
||||
return "/nachruf";
|
||||
return "nachruf";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -97,7 +97,7 @@ public class StaticPagesController extends CommonController {
|
||||
*/
|
||||
@GetMapping("/datenschutz")
|
||||
public String getDatenschutz() {
|
||||
return "/datenschutz";
|
||||
return "datenschutz";
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -107,7 +107,7 @@ public class StaticPagesController extends CommonController {
|
||||
*/
|
||||
@GetMapping("/impressum")
|
||||
public String getImpressum() {
|
||||
return "/impressum";
|
||||
return "impressum";
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
# database credentials from defined config file
|
||||
spring.config.import = /etc/camporganizer.properties
|
||||
spring.config.import = optional:file:/etc/camporganizer.properties
|
||||
|
||||
# define overwriteable arguments
|
||||
spring.datasource.driver-class-name = ${spring.datasource.driver-class-name:org.postgresql.Driver}
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
<body>
|
||||
<th:block layout:fragment="content">
|
||||
<div class="mainpage">
|
||||
<div th:replace="~{/fragments/camplist.html::camplist(camps=${camps})}"></div>
|
||||
<div th:replace="~{fragments/camplist::camplist(camps=${camps})}"></div>
|
||||
<br />
|
||||
<div class="text-center">
|
||||
<a class="btn btn-outline-secondary titlefont d-inline-block" th:href="@{/campside}">Zu meinen Freizeiten</a>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
</div>
|
||||
<br />
|
||||
<div class="row">
|
||||
<div th:replace="~{/fragments/camplist.html::camplist(camps=${camps})}"></div>
|
||||
<div th:replace="~{fragments/camplist::camplist(camps=${camps})}"></div>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
|
||||
Reference in new issue
Block a user