You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 20 Next »

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.

 

Configuration

magnolia.properties

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

magnolia.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

Technical insight: 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. For these new properties, we keep their keys where we use them, i.e. in the AdmincentralUIProvider.

AdmincentralUIProvider.java
public static final String WIDGETSET_PROPERTY_KEY = "magnolia.ui.vaadin.widgetset";
public static final String THEME_PROPERTY_KEY = "magnolia.ui.vaadin.theme";

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

AdmincentralUIProvider.java
public static final String DEFAULT_WIDGETSET = "info.magnolia.ui.vaadin.gwt.MagnoliaWidgetSet";
public static final String DEFAULT_THEME = "admincentral";

 

 

 

  • No labels