Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ see wiki for more information: [wiki](https://github.com/thmarx/cms/wiki)
* **BUGFIX** TemplateEngine should use cache only if activated [456](https://github.com/CondationCMS/cms-server/issues/456)
* **MAINTENANCE** multiple dependencies updated
* **MAINTENANCE** maven wrapper added to project
* **MAINTENANCE** Dynamic themes, add some comments to make decisions clear [458](https://github.com/CondationCMS/cms-server/issues/458)
* **MAINTENANCE** Deprecate/replace PathUtil.toURI with PathUtil.toURL [462](https://github.com/CondationCMS/cms-server/issues/462)
* **FEATURE** Developer Experience [PR-440](https://github.com/CondationCMS/cms-server/pull/440)
* **FEATURE** Aliases for content [442](https://github.com/CondationCMS/cms-server/issues/442)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@ public Theme theme () {
return theme;
}

/**
* This method is used for the ThemeFeature in the ModuleContext, because that feature is created once and not per request
*
* @param theme
*/
public void updateTheme (Theme theme) {
this.theme = theme;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,30 @@ public ConfigManagement configurationManagement(SiteCronJobScheduler scheduler,

return cm;
}

/**
* must not be singleton because some site properties (theme...) are allowed to be changed
*
* @param serverProperties
* @return
* @throws IOException
*/
@Provides
public SiteProperties siteProperties(ServerProperties serverProperties) throws IOException {
return new ExtendedSiteProperties(ConfigurationFactory.siteConfiguration(
serverProperties.env(),
hostBase));
}

/**
* This method must not be Singleton because it loads the configured theme for every request
*
* @param siteProperties
* @param serverProperties
* @param messageSource
* @param cacheManager
* @return
* @throws IOException
*/
@Provides
public Theme loadTheme(
SiteProperties siteProperties,
Expand Down