* Update to Wildfly 24.0.1
* Fixed problem with Themes when not default site is availablepull/10/head
parent
d14e2433da
commit
16f8a69131
|
|
@ -25,6 +25,8 @@ package org.libreccm.core;
|
||||||
*/
|
*/
|
||||||
public final class CoreConstants {
|
public final class CoreConstants {
|
||||||
|
|
||||||
|
public static final String BUILDIN_DEFAULT_THEME = "ccm-freemarker";
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* XML namespace used for XML created by and from classes in the ccm-core
|
* XML namespace used for XML created by and from classes in the ccm-core
|
||||||
* module.
|
* module.
|
||||||
|
|
|
||||||
|
|
@ -18,6 +18,7 @@
|
||||||
*/
|
*/
|
||||||
package org.libreccm.theming.mvc;
|
package org.libreccm.theming.mvc;
|
||||||
|
|
||||||
|
import org.libreccm.core.CoreConstants;
|
||||||
import org.libreccm.sites.Site;
|
import org.libreccm.sites.Site;
|
||||||
import org.libreccm.sites.SiteRepository;
|
import org.libreccm.sites.SiteRepository;
|
||||||
import org.libreccm.theming.ThemeInfo;
|
import org.libreccm.theming.ThemeInfo;
|
||||||
|
|
@ -34,6 +35,7 @@ import javax.enterprise.context.RequestScoped;
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.mvc.Models;
|
import javax.mvc.Models;
|
||||||
import javax.servlet.ServletContext;
|
import javax.servlet.ServletContext;
|
||||||
|
import javax.ws.rs.InternalServerErrorException;
|
||||||
import javax.ws.rs.NotFoundException;
|
import javax.ws.rs.NotFoundException;
|
||||||
import javax.ws.rs.WebApplicationException;
|
import javax.ws.rs.WebApplicationException;
|
||||||
import javax.ws.rs.core.Response;
|
import javax.ws.rs.core.Response;
|
||||||
|
|
@ -74,14 +76,28 @@ public class ThemesMvc {
|
||||||
final String application,
|
final String application,
|
||||||
final String view
|
final String view
|
||||||
) {
|
) {
|
||||||
final Site site = getSite(uriInfo);
|
final ThemeInfo themeInfo;
|
||||||
|
final ThemeVersion themeVersion;
|
||||||
|
if (siteRepo.findAll().isEmpty()) {
|
||||||
|
themeVersion = ThemeVersion.LIVE;
|
||||||
|
themeInfo = themes
|
||||||
|
.getTheme(CoreConstants.BUILDIN_DEFAULT_THEME, themeVersion)
|
||||||
|
.orElseThrow(
|
||||||
|
() -> new InternalServerErrorException(
|
||||||
|
"Build-in default theme not available."
|
||||||
|
)
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
final Site site = getSite(uriInfo);
|
||||||
final String theme = parseThemeParam(uriInfo);
|
final String theme = parseThemeParam(uriInfo);
|
||||||
final ThemeVersion themeVersion = parsePreviewParam(uriInfo);
|
themeVersion = parsePreviewParam(uriInfo);
|
||||||
final ThemeInfo themeInfo = getTheme(
|
themeInfo = getTheme(
|
||||||
site,
|
site,
|
||||||
theme,
|
theme,
|
||||||
themeVersion
|
themeVersion
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
final ThemeManifest manifest = themeInfo.getManifest();
|
final ThemeManifest manifest = themeInfo.getManifest();
|
||||||
final Map<String, String> views = manifest.getViewsOfApplication(
|
final Map<String, String> views = manifest.getViewsOfApplication(
|
||||||
application
|
application
|
||||||
|
|
@ -163,8 +179,11 @@ public class ThemesMvc {
|
||||||
} else {
|
} else {
|
||||||
site = siteRepo
|
site = siteRepo
|
||||||
.findDefaultSite()
|
.findDefaultSite()
|
||||||
.orElseThrow(() -> new NotFoundException(
|
.orElseThrow(
|
||||||
"No matching Site and no default Site."));
|
() -> new NotFoundException(
|
||||||
|
"No matching Site and no default Site."
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
return site;
|
return site;
|
||||||
|
|
|
||||||
4
pom.xml
4
pom.xml
|
|
@ -340,7 +340,7 @@
|
||||||
<version>2.1.0.Beta1</version>
|
<version>2.1.0.Beta1</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<skip>true</skip>
|
<skip>true</skip>
|
||||||
<version>24.0.0.Final</version>
|
<version>24.0.1.Final</version>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
|
|
@ -976,4 +976,4 @@
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue