Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Info

Parent concept page describes how we should reorganize the widgetset to make it configurable and open for extension. This page highlights the concrete implementation choices (e.g. naming, packaging) that are made to fulfill the concept.

Table of Contents
maxLevel2

 

Configuration

magnolia.properties

New entries in magnolia-empty-webapp/src/main/webapp/WEB-INF/config/default/magnolia.properties:

Code Block
languagebash
titlemagnolia.properties
# Change to point at your custom Vaadin widgetset and theme
# Your widgetset should always inherit magnolia's default widgetset (info.magnolia.ui.vaadin.gwt.MagnoliaWidgetSet)
# Your theme should always include magnolia's default theme (admincentral)
magnolia.ui.vaadin.widgetset=info.magnolia.ui.vaadin.gwt.MagnoliaWidgetSet
magnolia.ui.vaadin.theme=admincentral

AdmincentralUIProvider

Package: info.magnolia.ui.admincentral

This is a custom Vaadin UIProvider. It gets the MagnoliaConfigurationProperties via injection, and checks for property values when queried for widgetset or theme. Vaadin's DefaultUIProvider can only resolve widgetsets and themes either from servlet parameters or via annotation.

Property keys are mostly defined as constants in the SystemProperty (info.magnolia.cms.core) deprecated class. In want of a better location for generic magnolia_ui properties (MagnoliaUiProperties?), the widgetset and theme properties keys are defined here.

Code Block
languagejava
titleAdmincentralUIProvider.java
public static final String MAGNOLIA_UI_VAADIN_WIDGETSET = "magnolia.ui.vaadin.widgetset";
public static final String MAGNOLIA_UI_VAADIN_THEME = "magnolia.ui.vaadin.theme";

It also holds fallback default values in case widgetset and theme cannot be determined:

Code Block
languagejava
titleAdmincentralUIProvider.java
public static final String DEFAULT_WIDGETSET_NAME = "info.magnolia.ui.vaadin.gwt.MagnoliaWidgetSet";
public static final String DEFAULT_THEME_NAME = "admincentral";