commit ff40fbae35ce95c25c58b2e98cfba9fe2c0c868f
Author: Andreas Kohlbecker <a.kohlbecker@bgbm.org>
Date:   Fri Nov 12 14:24:31 2021 +0100

    ref #9859 Password Recovery UI and view implemented

diff --git a/src/main/java/eu/etaxonomy/cdm/addon/config/CdmVaadinConfiguration.java b/src/main/java/eu/etaxonomy/cdm/addon/config/CdmVaadinConfiguration.java
index fd0e617a..0f3573b1 100644
--- a/src/main/java/eu/etaxonomy/cdm/addon/config/CdmVaadinConfiguration.java
+++ b/src/main/java/eu/etaxonomy/cdm/addon/config/CdmVaadinConfiguration.java
@@ -61,6 +61,7 @@ import eu.etaxonomy.cdm.vaadin.permission.annotation.EnableAnnotationBasedAccess
 import eu.etaxonomy.cdm.vaadin.ui.CdmBaseUI;
 import eu.etaxonomy.cdm.vaadin.ui.ConceptRelationshipUI;
 import eu.etaxonomy.cdm.vaadin.ui.DistributionStatusUI;
+import eu.etaxonomy.cdm.vaadin.ui.PasswordResetUI;
 import eu.etaxonomy.cdm.vaadin.ui.RegistrationUI;
 import eu.etaxonomy.cdm.vaadin.ui.StatusEditorUI;
 import eu.etaxonomy.vaadin.ui.annotation.EnableVaadinSpringNavigation;
@@ -202,6 +203,16 @@ public class CdmVaadinConfiguration implements ApplicationContextAware  {
         return null;
     }
 
+    @Bean
+    @UIScope
+    public PasswordResetUI passwordResetUI() {
+        if(isUIEnabled(PasswordResetUI.class)){
+            registerRegistrationUiHibernateEventListeners();
+            return new PasswordResetUI();
+        }
+        return null;
+    }
+
     /**
      * this is only a quick implementation for testing,
      * TODO see also the NOTE on CdmListenerIntegrator class declaration for a prospective better solution
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/ui/AbstractUI.java b/src/main/java/eu/etaxonomy/cdm/vaadin/ui/AbstractUI.java
index 273a219e..81543240 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/ui/AbstractUI.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/ui/AbstractUI.java
@@ -78,16 +78,18 @@ public abstract class AbstractUI extends UI {
     @Override
     protected void init(VaadinRequest request) {
 
-        logger.debug("init()");
+        logger.debug(this.getClass().getSimpleName() + ".init()");
         registerErrorHandlers();
 
         configureAccessDeniedView();
 
-        setContent((Component) getViewDisplay());
-        initContent();
+        assert getInitialViewName() != null;
+        assert getViewDisplay() != null;
+
+        logger.debug(this.getClass().getSimpleName() + ".init() ViewDisplay: " + getViewDisplay().getClass().getSimpleName() + ", initialViewName: " + getInitialViewName());
+        initAdditionalContent();
 
         getNavigationManagerBean().setViewDisplay(getViewDisplay());
-        assert getInitialViewName() != null;
         getNavigationManagerBean().setDefaultViewName(getInitialViewName());
 
         Responsive.makeResponsive(this);
@@ -115,13 +117,11 @@ public abstract class AbstractUI extends UI {
             Page.getCurrent().getStyles().add(registryCssFile);
         }
 
-
         uiEventBus.publish(this, new UIInitializedEvent());
-
     }
 
     /**
-     * @return The name of the initial view to
+     * @return The name of the initial view to show
      */
     abstract protected String getInitialViewName();
 
@@ -144,7 +144,7 @@ public abstract class AbstractUI extends UI {
      * will for example be interesting when using the {@link ValoTheme.UI_WITH_MENU}
      * style.
      */
-    abstract protected void initContent();
+    abstract protected void initAdditionalContent();
 
     protected void registerErrorHandlers() {
         DelegatingErrorHandler delegatingErrorHander = new DelegatingErrorHandler();
@@ -161,7 +161,6 @@ public abstract class AbstractUI extends UI {
         viewProvider.setAccessDeniedViewClass(RedirectToLoginView.class);
     }
 
-
     private String pageFragmentAsState() {
         Page page = Page.getCurrent();
         String fragment = page.getUriFragment();
@@ -172,7 +171,4 @@ public abstract class AbstractUI extends UI {
         return state;
     }
 
-
-
-
 }
\ No newline at end of file
diff --git a/src/main/java/eu/etaxonomy/cdm/vaadin/ui/RegistrationUI.java b/src/main/java/eu/etaxonomy/cdm/vaadin/ui/RegistrationUI.java
index 9d2b37b5..6e580d10 100644
--- a/src/main/java/eu/etaxonomy/cdm/vaadin/ui/RegistrationUI.java
+++ b/src/main/java/eu/etaxonomy/cdm/vaadin/ui/RegistrationUI.java
@@ -11,7 +11,6 @@ package eu.etaxonomy.cdm.vaadin.ui;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Qualifier;
 
-import com.flowingcode.vaadin.addons.errorwindow.WindowErrorHandler;
 import com.vaadin.annotations.Theme;
 import com.vaadin.annotations.Title;
 import com.vaadin.annotations.Viewport;
@@ -19,16 +18,12 @@ import com.vaadin.annotations.Widgetset;
 import com.vaadin.navigator.ViewDisplay;
 import com.vaadin.server.FontAwesome;
 import com.vaadin.server.VaadinRequest;
-import com.vaadin.server.VaadinSession;
 import com.vaadin.spring.annotation.SpringUI;
+import com.vaadin.ui.Component;
 import com.vaadin.ui.Label;
 import com.vaadin.ui.themes.ValoTheme;
 
-import eu.etaxonomy.cdm.database.PermissionDeniedException;
 import eu.etaxonomy.cdm.vaadin.debug.EntityCacheDebugger;
-import eu.etaxonomy.cdm.vaadin.event.error.DelegatingErrorHandler;
-import eu.etaxonomy.cdm.vaadin.event.error.ErrorTypeErrorHandlerWrapper;
-import eu.etaxonomy.cdm.vaadin.event.error.PermissionDeniedErrorHandler;
 import eu.etaxonomy.cdm.vaadin.toolbar.Toolbar;
 import eu.etaxonomy.cdm.vaadin.view.name.TaxonNamePopupEditor;
 import eu.etaxonomy.cdm.vaadin.view.registration.DashBoardView;
@@ -77,18 +72,13 @@ public class RegistrationUI extends AbstractUI implements PopupEditorDefaultStat
 
     public static final String INITIAL_VIEW =  DashBoardView.NAME;
 
-    protected static final String UI_STYLE_NAME = ValoTheme.UI_WITH_MENU;
-
     public RegistrationUI() {
         super();
     }
 
     @Override
     protected void init(VaadinRequest request) {
-
         super.init(request);
-
-        addStyleName(UI_STYLE_NAME);
         if(entityCacheDebugger != null){
             addShortcutListener(entityCacheDebugger.getShortcutListener());
         }
@@ -100,7 +90,8 @@ public class RegistrationUI extends AbstractUI implements PopupEditorDefaultStat
     }
 
     @Override
-    protected void initContent() {
+    protected void initAdditionalContent() {
+        setContent((Component) getViewDisplay());
         Label phycoBankLogo = new Label("PhycoBank");
         phycoBankLogo.addStyleName("phycobank-green");
         phycoBankLogo.addStyleName(ValoTheme.LABEL_HUGE);
@@ -116,18 +107,6 @@ public class RegistrationUI extends AbstractUI implements PopupEditorDefaultStat
         }
     }
 
-    @Override
-    protected void registerErrorHandlers() {
-        DelegatingErrorHandler delegatingErrorHander = new DelegatingErrorHandler();
-        WindowErrorHandler errorHandler = new WindowErrorHandler(this, RegistrationUIDefaults.ERROR_CONTACT_MESSAGE_LINE + "</br></br>"
-                + "<i>To help analyzing the problem please describe your actions that lead to this error and provide the error details from below in your email. "
-                + "You also might want to add a sreenshot of the browser page in error.</i>");
-        delegatingErrorHander.registerHandler(new ErrorTypeErrorHandlerWrapper<PermissionDeniedException>(PermissionDeniedException.class, new PermissionDeniedErrorHandler(this)));
-        delegatingErrorHander.registerHandler(new ErrorTypeErrorHandlerWrapper<Exception>(Exception.class, errorHandler));
-        setErrorHandler(delegatingErrorHander);
-        VaadinSession.getCurrent().setErrorHandler(delegatingErrorHander);
-    }
-
     @Override
     public <T extends AbstractPopupEditor> String defaultStatusMarkup(Class<T> popupEditorClass){
         if(popupEditorClass.equals(TaxonNamePopupEditor.class)){
