Class ThemeUpdateService
java.lang.Object
io.meeds.layout.service.ThemeUpdateService
Updates one part of the theme the way the Branding page's Apply button
does: the whole branding is loaded, the part's options and resets are
merged into it, and the whole is submitted, so that every field the caller
did not name keeps its stored value although the branding service replaces
the whole. An untouched theme variable stored at its configured default is
submitted absent, so that it keeps following that default. A page field's
value is validated here against the Page drawer's vocabulary; a theme
variable's value by the branding service before its first write, whose
message code is answered as the option it names, or as the options
refused when it names none; any other failure of the write is answered as
the theme not saved, the service's own text staying in the server log.
-
Field Details
-
ADMINISTRATORS_ONLY
- See Also:
-
OPTIONS_NOT_ACCEPTED
- See Also:
-
RESET_NOT_ACCEPTED
- See Also:
-
THEME_NOT_SAVED
- See Also:
-
-
Constructor Details
-
ThemeUpdateService
public ThemeUpdateService()
-
-
Method Details
-
updateTheme
public Map<String,String> updateTheme(ThemePart part, Map<String, String> options, List<String> reset, String username) throws IllegalAccessException- Parameters:
part- the part of the themeoptions- the options to set, by name; a null value is ignoredreset- the options returned to their defaultusername- the acting user- Returns:
- the part's options as stored after the update
- Throws:
IllegalAccessException- when the user is not an administratorIllegalArgumentException- when an option is not one of the part, when a value is blank, a page value outside the Page drawer's vocabulary or a background image other than none or one gradient, when an option is both set and reset, when nothing is asked, or when the branding service refuses a valueIllegalStateException- when the branding service fails to save the theme
-
describe
-
acceptedOptions
-