docs: public static String displayVaadinLoginDialog(HttpServletRequest request, HttpServletResponse response)
      throws IOException, CmsException {
  
          CmsFlexController controller = CmsFlexController.getController(request);
          if (controller == null) {
              // controller not found - this request was not initialized properly
              throw new CmsRuntimeException(
                  org.opencms.jsp.Messages.get().container(
                      org.opencms.jsp.Messages.ERR_MISSING_CMS_CONTROLLER_1,
                      CmsLoginUI.class.getName()));
          }
          CmsObject cms = controller.getCmsObject();
          if ((OpenCms.getSiteManager().getSites().size() > 1) && !OpenCms.getSiteManager().isWorkplaceRequest(request)) {
              // do not send any redirects to the workplace site for security reasons
              response.sendError(HttpServletResponse.SC_NOT_FOUND);
              return null;
          }
          String logout = request.getParameter(CmsLoginHelper.PARAM_ACTION_LOGOUT);
          if (Boolean.valueOf(logout).booleanValue()) {
              CmsLoginController.logout(cms, request, response);
              return null;
          }
  
          if (!cms.getRequestContext().getCurrentUser().isGuestUser()) {
              String target = request.getParameter(CmsGwtConstants.PARAM_LOGIN_REDIRECT);
              if (CmsStringUtil.isEmptyOrWhitespaceOnly(target)) {
                  target = CmsLoginController.getLoginTarget(cms, getWorkplaceSettings(cms, request.getSession()), null);
              }
              response.sendRedirect(target);
              return null;
          }
  
          CmsLoginHelper.LoginParameters params = CmsLoginHelper.getLoginParameters(cms, request, false);
          request.getSession().setAttribute(CmsLoginUI.INIT_DATA_SESSION_ATTR, params);
          try {
              byte[] pageBytes = CmsFileUtil.readFully(
                  Thread.currentThread().getContextClassLoader().getResourceAsStream(
                      "org/opencms/ui/login/login-page.html"));
              String page = new String(pageBytes, "UTF-8");
              CmsMacroResolver resolver = new CmsMacroResolver();
              String context = OpenCms.getSystemInfo().getContextPath();
              String vaadinDir = CmsStringUtil.joinPaths(context, "VAADIN/");
              String vaadinVersion = Version.getFullVersion();
              String vaadinServlet = CmsStringUtil.joinPaths(context, "workplace/dialogs/");
              String vaadinBootstrap = CmsStringUtil.joinPaths(
                  context,
                  "VAADIN/vaadinBootstrap.js?v=" + OpenCms.getSystemInfo().getVersionNumber());
              String autocomplete = params.isPrivatePc() ? "on" : "off";
              StringBuffer workplaceCssBuffer = null;
              if (!OpenCms.getWorkplaceAppManager().getWorkplaceCssUris().isEmpty()) {
                  workplaceCssBuffer = new StringBuffer();
                  workplaceCssBuffer.append("\n<style type=\"text/css\">\n");
                  for (String cssURI : OpenCms.getWorkplaceAppManager().getWorkplaceCssUris()) {
                      workplaceCssBuffer.append("@import url(\"").append(CmsWorkplace.getResourceUri(cssURI)).append(
                          "\");\n");
                  }
                  workplaceCssBuffer.append("</style>\n");
              }
              String cmsLogo = OpenCms.getSystemInfo().getContextPath()
                  + CmsWorkplace.RFS_PATH_RESOURCES
                  + "commons/login_logo.png";
              resolver.addMacro("workplaceCss", workplaceCssBuffer != null ? workplaceCssBuffer.toString() : "");
              resolver.addMacro("loadingHtml", CmsVaadinConstants.LOADING_INDICATOR_HTML);
              resolver.addMacro("vaadinDir", vaadinDir);
              resolver.addMacro("vaadinVersion", vaadinVersion);
              resolver.addMacro("vaadinServlet", vaadinServlet);
              resolver.addMacro("vaadinBootstrap", vaadinBootstrap);
              resolver.addMacro("cmsLogo", cmsLogo);
              resolver.addMacro("autocomplete", autocomplete);
              resolver.addMacro("title", CmsLoginHelper.getTitle(params.getLocale()));
              if (params.isPrivatePc()) {
                  resolver.addMacro(
                      "hiddenPasswordField",
                      "      <input type=\"password\" id=\"hidden-password\" name=\"ocPword\" autocomplete=\"%(autocomplete)\" >");
              }
              if (params.getUsername() != null) {
                  resolver.addMacro("predefUser", "value=\"" + CmsEncoder.escapeXml(params.getUsername()) + "\"");
              }
              page = resolver.resolveMacros(page);
              return page;
          } catch (Exception e) {
              LOG.error("Failed to display login dialog.", e);
              return "<!--Error-->";
          }
      }