Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Switch from JSP to Thymeleaf for view technology #299

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
deabaae
Move templates and static resources into src/main/resources
checketts Jul 26, 2023
09aaad5
Add Thymeleaf and remove JSP libs
checketts Jul 26, 2023
a7d781e
Migrate playlist view (and fix now playing/rating)
checketts Jul 27, 2023
02293c3
Migrate starred, playlists, and help to Thymeleaf
checketts Jul 27, 2023
d5044a8
Migrate bookmarks, music folders, and getting started to Thymeleaf
checketts Jul 28, 2023
9e9812b
Migrate status to Thymeleaf
checketts Jul 28, 2023
6900a8e
Migrate 'more' page to Thymeleaf
checketts Jul 28, 2023
5a46015
Migrate personalSettings to Thymeleaf
checketts Jul 28, 2023
913b0e9
Migrate podcast channels to Thymeleaf
checketts Jul 28, 2023
2b978e2
Migrate general settings to Thymeleaf
checketts Jul 29, 2023
75cc20d
igrate advanced settings to Thymeleaf
checketts Jul 29, 2023
859bf1b
Migrate credentialSettings to Thymeleaf
checketts Jul 31, 2023
6d583df
Migrate userSettings to Thymeleaf
checketts Jul 31, 2023
d4d2aa2
Migrate player settings to Thymeleaf
checketts Jul 31, 2023
999861e
Migrate share settings and externalPlayer over to Thymeleaf
checketts Aug 1, 2023
0ae0b64
Migrate dlna and sonos setting the Thymeleaf
checketts Aug 1, 2023
e529cd8
Migrate remaining settings to Thymeleaf
checketts Aug 1, 2023
aae52fe
Fix autohide and migrate importPlaylist to Thymeleaf
checketts Aug 1, 2023
d3ddcb7
Migrate editTags to Thymeleaf
checketts Aug 1, 2023
3714734
Migrate lyrics and search to Thymeleaf
checketts Aug 1, 2023
4974044
Remove un-used allMusic controller/view
checketts Aug 1, 2023
21e641f
Upload avatar migrated to Thymeleaf
checketts Aug 1, 2023
7b45cf3
Migrate podcastChannel to Thymeleaf and fix a few migration bugs
checketts Aug 1, 2023
0d87ab3
Migrate over podcast rss view to Thymeleaf
checketts Aug 1, 2023
d60c709
Migrate videoPlayer to Thymeleaf
checketts Aug 1, 2023
cb3260d
Begin migration error pages
checketts Aug 7, 2023
5933480
Migrate 'recover' page to Thymeleaf
checketts Aug 7, 2023
0714397
Address check style findings
checketts Sep 13, 2023
7bce689
Switch to JAR output and upgrade to latest Java 17
checketts Sep 13, 2023
2adb75b
Account for right column doesn't find a new version
checketts Sep 13, 2023
c7cbfab
Merge branch 'main' into checketts/switch-jar
kagemomiji Sep 14, 2023
5cc7754
Fix missing newVersionAvailable in help/about page
checketts Sep 15, 2023
f90c66f
Migrate upload template to Thymeleaf
checketts Sep 15, 2023
09d41ca
Fix degraded add credntials page
checketts Sep 15, 2023
9743dfb
Add ids to make add credential javascript work and fix upload html es…
checketts Sep 15, 2023
17ba048
Ignore unused dependency cxf-rt-databinding-jaxb
checketts Sep 15, 2023
9a75be9
Formate used/total memory in human readable bytes/mb etc
checketts Sep 15, 2023
ddf7173
Fix encoder not being populated whne selecting cred type
checketts Sep 15, 2023
f681f51
Fix local import on help controller and if statement for homePager
checketts Sep 15, 2023
47b3f7c
Fix podcast channel cover art
checketts Sep 15, 2023
05787be
Make 'ratings' correctly readOnly when appropriate
checketts Sep 15, 2023
251746a
Fix album artist cover art, allow share settings to display, and fix …
checketts Sep 16, 2023
7a72df3
Improve share setting expiration formatting
checketts Sep 16, 2023
97b2f81
Allow hyperlink in root warning
checketts Sep 17, 2023
b6a1277
Allow hyperlink in root warning, fix left sidebar index spacing, and …
checketts Sep 17, 2023
f3a1edc
Show bottom left index spacing correctly and show correct dropdowns f…
checketts Sep 17, 2023
a19e90f
Fix areas where spnish accented characters were being escaped incorre…
checketts Sep 18, 2023
25fff73
Merge branch 'main' into checketts/switch-jar
kagemomiji Sep 19, 2023
fed0f81
Fix migrate credentials buttons
checketts Sep 19, 2023
74512cf
Fix 'save' buttons using enclose check boxes
checketts Sep 19, 2023
bffe4f3
Fix checkstyle findings
checketts Sep 20, 2023
371ec23
Fix typo with resourceRootLocation property and provide default for d…
checketts Sep 20, 2023
45403a3
Include settings for playqueue when loading via index controller
checketts Sep 20, 2023
b3564f5
Merge branch 'main' into checketts/switch-jar
kagemomiji Oct 1, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -155,3 +155,5 @@ local.properties

# Code Recommenders
.recommenders/

tmp-home/
122 changes: 65 additions & 57 deletions airsonic-main/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@

<modelVersion>4.0.0</modelVersion>
<artifactId>airsonic-main</artifactId>
<packaging>war</packaging>
<name>Airsonic Main</name>

<parent>
Expand Down Expand Up @@ -56,16 +55,26 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-web</artifactId>
<exclusions>
<exclusion>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>jakarta.servlet.jsp</groupId>
<artifactId>jakarta.servlet.jsp-api</artifactId>
<version>2.3.6</version>
<scope>provided</scope>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-thymeleaf</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-validation</artifactId>
<exclusions>
<exclusion>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -86,6 +95,20 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
<exclusions>
<exclusion>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-processor</artifactId>
</exclusion>
<exclusion>
<groupId>cglib</groupId>
<artifactId>cglib-nodep</artifactId>
</exclusion>
<exclusion>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging-annotations</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>javax.cache</groupId>
Expand Down Expand Up @@ -149,20 +172,6 @@
</dependency>
<!-- END Spring -->

<!-- taglibs -->
<dependency>
<groupId>org.apache.taglibs</groupId>
<artifactId>taglibs-standard-impl</artifactId>
<version>1.2.5</version>
</dependency>
<dependency>
<groupId>taglibs</groupId>
<artifactId>string</artifactId>
<version>1.1.0</version>
<scope>runtime</scope>
</dependency>
<!-- END taglibs -->

<dependency>
<groupId>org.apache.lucene</groupId>
<artifactId>lucene-core</artifactId>
Expand Down Expand Up @@ -218,6 +227,7 @@
<version>1.24.0</version>
</dependency>
<dependency>
<!-- compression library-->
<groupId>org.tukaani</groupId>
<artifactId>xz</artifactId>
<version>1.9</version>
Expand Down Expand Up @@ -301,18 +311,14 @@
<version>1.2.6</version>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>net.sargue</groupId>
<artifactId>java-time-jsptags</artifactId>
<version>1.1.4</version>
</dependency>

<dependency>
<groupId>jakarta.mail</groupId>
<artifactId>jakarta.mail-api</artifactId>
</dependency>

<dependency>

<groupId>com.hoodcomputing</groupId>
<artifactId>natpmp</artifactId>
<version>0.1</version>
Expand Down Expand Up @@ -353,6 +359,12 @@
<!-- Cling removed the org.fourthline.cling.transport.impl.apache package in 2.1, which is needed to make Cling work with Tomcat. -->
<!-- Don't upgrade this unless you can test UPnP/DLNA support properly! -->
<version>2.0.1</version>
<exclusions>
<exclusion>
<groupId>javax.servlet</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand All @@ -367,6 +379,20 @@
<groupId>org.seamless</groupId>
<artifactId>seamless-util</artifactId>
<version>1.1.0</version>
<exclusions>
<exclusion>
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</exclusion>
<exclusion>
<groupId>commons-lang</groupId>
<artifactId>commons-lang</artifactId>
</exclusion>
<exclusion>
<groupId>javax.activation</groupId>
<artifactId>activation</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand Down Expand Up @@ -427,6 +453,10 @@
<groupId>commons-logging</groupId>
<artifactId>commons-logging</artifactId>
</exclusion>
<exclusion>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
</exclusion>
</exclusions>
</dependency>
<!-- Fixes liquibase not using slf4j -->
Expand All @@ -452,6 +482,12 @@
<groupId>org.liquibase</groupId>
<artifactId>liquibase-core</artifactId>
<version>${liquibase.version}</version>
<exclusions>
<exclusion>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</exclusion>
</exclusions>
</dependency>

<dependency>
Expand All @@ -461,6 +497,7 @@
</dependency>

<dependency>
<!-- playlist tooling-->
<groupId>com.github.muff1nman.chameleon</groupId>
<artifactId>core</artifactId>
<version>${chameleon.version}</version>
Expand Down Expand Up @@ -514,6 +551,10 @@
<groupId>commons-collections</groupId>
<artifactId>commons-collections</artifactId>
</exclusion>
<exclusion>
<groupId>com.sun.istack</groupId>
<artifactId>istack-commons-runtime</artifactId>
</exclusion>
</exclusions>
</dependency>

Expand All @@ -527,17 +568,6 @@
<artifactId>slf4j-api</artifactId>
</dependency>

<!-- Embedded tomcat -->
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
<scope>${tomcat.server.scope}</scope>
</dependency>
<dependency>
<groupId>org.apache.tomcat.embed</groupId>
<artifactId>tomcat-embed-jasper</artifactId>
<scope>${tomcat.server.scope}</scope>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-json</artifactId>
Expand Down Expand Up @@ -637,7 +667,6 @@
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<mainClass>org.airsonic.player.Application</mainClass>
<layout>WAR</layout>
</configuration>
</plugin>
<plugin>
Expand Down Expand Up @@ -720,27 +749,6 @@
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.eclipse.jetty</groupId>
<artifactId>jetty-jspc-maven-plugin</artifactId>
<version>9.4.41.v20210516</version>
<executions>
<execution>
<id>jspc</id>
<goals>
<goal>jspc</goal>
</goals>
<phase>compile</phase>
<configuration>
<!-- Since we are using spring boot - we do not have a web.xml so there is no sense
enabling merging. Furthermore, we output the webXmlFragment to the target/classes
directory such that it will be on the classpath for use during runtime -->
<mergeFragment>false</mergeFragment>
<webXmlFragment>${project.build.outputDirectory}/precompiled-jsp-web.xml</webXmlFragment>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
<reporting>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.WebApplicationType;
import org.springframework.boot.actuate.autoconfigure.endpoint.jmx.JmxEndpointAutoConfiguration;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jmx.JmxAutoConfiguration;
import org.springframework.boot.builder.SpringApplicationBuilder;
Expand All @@ -17,7 +18,8 @@
import java.lang.reflect.Method;

@SpringBootApplication(exclude = {
JmxAutoConfiguration.class
JmxAutoConfiguration.class,
JmxEndpointAutoConfiguration.class
})
@EnableTransactionManagement(mode = AdviceMode.ASPECTJ)
@ConfigurationPropertiesScan
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import org.airsonic.player.service.PersonalSettingsService;
import org.apache.commons.io.IOUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.core.io.Resource;
import org.springframework.core.io.ResourceLoader;
import org.springframework.stereotype.Controller;
Expand All @@ -43,6 +44,8 @@ public class AvatarController {

@Autowired
private ResourceLoader loader;
@Value("${resourceRootLocation:}")
private String resourceRootLocation = "";

@Autowired
private PersonalSettingsService personalSettingsService;
Expand Down Expand Up @@ -83,8 +86,11 @@ public void handleRequest(
response.setContentType(avatar.getMimeType());
Resource res = loader.getResource(avatar.getPath().toString());
if (!res.exists()) {
res = loader.getResource("file:" + avatar.getPath().toString());
res = loader.getResource("file:" + resourceRootLocation + avatar.getPath().toString());
}
// if (!res.exists()) {
// res = loader.getResource("file:" + avatar.getPath().toString());
// }
IOUtils.copy(res.getInputStream(), response.getOutputStream());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,26 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import java.util.HashMap;
import java.util.Map;

@Controller
@RequestMapping("/coverArtJsp")
public class CoverArtJspController {
@GetMapping
public ModelAndView get(HttpServletRequest request, HttpServletResponse response) {
return new ModelAndView("coverArt", request.getParameterMap());
Map<String, Object> model = new HashMap<>();
model.put("hideOverflow", "true".equalsIgnoreCase(request.getParameter("hideOverflow")));
model.put("showLink", "true".equalsIgnoreCase(request.getParameter("showLink")));
model.put("coverArtSize", Integer.parseInt(request.getParameter("coverArtSize")));
model.put("albumId", request.getParameter("albumId"));
model.put("playlistId", request.getParameter("playlistId"));
model.put("podcastChannelId", request.getParameter("podcastChannelId"));
model.put("caption1", request.getParameter("caption1"));
model.put("caption2", request.getParameter("caption2"));
model.put("caption3", request.getParameter("caption3"));
model.put("captionCount", request.getParameter("captionCount"));

return new ModelAndView("coverArt", model);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.mvc.support.RedirectAttributes;

Expand Down Expand Up @@ -136,7 +135,7 @@ protected String createNewCreds(Principal user,
return "redirect:credentialsSettings.view";
}

@PutMapping
@PostMapping("update")
protected String updateCreds(Principal user,
@ModelAttribute("command") @Validated(value = { Default.class, CredentialUpdateChecks.class }) CredentialsManagementCommand cmc,
BindingResult br, RedirectAttributes redirectAttributes) {
Expand All @@ -148,7 +147,7 @@ protected String updateCreds(Principal user,

redirectAttributes.addFlashAttribute("settings_toast", result);

return "redirect:credentialsSettings.view";
return "redirect:/credentialsSettings.view";
}

@PostMapping(path = "/admin")
Expand Down
Loading