docs: public String getJsIncludes() {
  
          StringBuffer result = new StringBuffer();
  
          result.append("<script type=\"text/javascript\" src=\"");
          result.append(CmsWorkplace.getSkinUri());
          result.append("commons/ajax.js\"></script>\n");
  
          result.append("<script type=\"text/javascript\">\n");
  
          // initialize global variables
          result.append("\tvar progressState = 0;\n");
          result.append("\tvar progressResult = '';\n");
  
          // function update progress bar
          result.append("\tfunction updateProgressBar(msg, state) {\n");
  
          // check state of progress
          result.append("\t\tif (progressState != 1) {\n");
          result.append("\t\t\tprogressState = 0;\n");
          result.append("\t\t\treturn;\n");
          result.append("\t\t}\n");
  
          result.append("\t\tif (state == 'ok') {\n");
  
          // get all elements to use
          result.append("\t\t\tvar bar = document.getElementById(\"progressbar_bar\");\n");
          result.append("\t\t\tvar percent = document.getElementById(\"progressbar_percent\");\n");
          result.append("\t\t\tvar wait = document.getElementById(\"progressbar_wait\");\n");
          result.append("\t\t\tvar desc = document.getElementById(\"progressbar_desc\");\n");
  
          result.append("\t\t\tif (msg != \"\") {\n");
  
          result.append("\t\t\t\tbar.parentNode.style.display = \"block\";\n");
          result.append("\t\t\t\tpercent.style.display = \"inline\";\n");
          result.append("\t\t\t\twait.style.display = \"none\";\n");
          result.append("\t\t\t\tdesc.style.display = \"block\";\n");
  
          // update progress
          result.append("\t\t\t\tif (msg.substring(0,3) == \"PRO\") {\n");
          result.append("\t\t\t\t\tvar splitted = msg.split(\"|\");\n");
          result.append("\t\t\t\t\tbar.style.width = splitted[0].substr(3);\n");
          result.append("\t\t\t\t\tpercent.innerHTML = splitted[0].substr(3);\n");
          result.append("\t\t\t\t\tdesc.innerHTML = splitted[1];\n");
          result.append("\t\t\t\t\tmakeRequest('");
          result.append(getJsp().link("/system/workplace/commons/report-progress.jsp"));
          result.append("', '");
          result.append(PARAMETER_KEY);
          result.append("=");
          result.append(getKey());
          result.append("&");
          result.append(PARAMETER_SHOWWAITTIME);
          result.append("=");
          result.append(getShowWaitTime());
          result.append("&");
          result.append(PARAMETER_REFRESHRATE);
          result.append("=");
          result.append(getRefreshRate());
          result.append("', 'updateProgressBar');\n");
  
          // set error message
          result.append("\t\t\t\t} else if (msg.substring(0,3) == \"ERR\") {\n");
          result.append("\t\t\t\t\tsetProgressBarError(msg.substr(3));\n");
  
          // set result
          result.append("\t\t\t\t} else {\n");
          result.append("\t\t\t\t\tprogressState = 0;\n");
          result.append("\t\t\t\t\tbar.style.width = \"100%\";\n");
          result.append("\t\t\t\t\tpercent.innerHTML = \"100%\";\n");
          result.append("\t\t\t\t\tprogressResult = msg;\n");
  
          result.append("\t\t\t\t\tbar.parentNode.style.display = \"none\";\n");
          result.append("\t\t\t\t\tpercent.style.display = \"none\";\n");
          result.append("\t\t\t\t\tdesc.style.display = \"none\";\n");
          result.append("\t\t\t\t\twait.style.display = \"block\";\n");
  
          result.append("\t\t\t\t\twindow.setTimeout(\"");
          result.append(getJsFinishMethod());
          result.append("()\",100);\n");
          result.append("\t\t\t\t}\n");
          result.append("\t\t\t} else {\n");
          result.append("\t\t\t\tbar.style.width = \"100%\";\n");
          result.append("\t\t\t}\n");
  
          // fatal error returned by ajax
          result.append("\t\t} else if (state == 'fatal') {\n");
          result.append("\t\t\tprogressState = 0;\n");
          result.append("\t\t\tsetProgressBarError(\"");
          result.append(
              org.opencms.workplace.Messages.get().getBundle(getJsp().getRequestContext().getLocale()).key(
                  org.opencms.workplace.Messages.GUI_AJAX_REPORT_GIVEUP_0));
          result.append("\");\n");
  
          // error returned by ajax
          result.append("\t\t} else if (state == 'error') {\n");
          result.append("\t\t\tprogressState = 0;\n");
          result.append("\t\t\tsetProgressBarError(\"");
          result.append(
              org.opencms.workplace.Messages.get().getBundle(getJsp().getRequestContext().getLocale()).key(
                  org.opencms.workplace.Messages.GUI_AJAX_REPORT_ERROR_0));
          result.append(" \" + msg);\n");
  
          // wait returned by ajax -> display wait symbol
          result.append("\t\t} else if (state == 'wait') {\n");
          result.append("\t\t\tbar.parentNode.style.display = \"none\";\n");
          result.append("\t\t\tpercent.style.display = \"none\";\n");
          result.append("\t\t\twait.style.display = \"block\";\n");
          result.append("\t\t}\n");
          result.append("\t}\n");
  
          // function set error
          result.append("\tfunction setProgressBarError(msg) {\n");
          result.append("\t\tvar error = document.getElementById(\"progressbar_error\");\n");
          result.append("\t\tvar bar = document.getElementById(\"progressbar_bar\");\n");
          result.append("\t\tvar percent = document.getElementById(\"progressbar_percent\");\n");
          result.append("\t\tvar desc = document.getElementById(\"progressbar_desc\");\n");
  
          result.append("\t\terror.innerHTML = msg;\n");
          result.append("\t\terror.style.display = \"block\";\n");
  
          result.append("\t\tbar.style.display = \"none\";\n");
          result.append("\t\tpercent.style.display = \"none\";\n");
          result.append("\t\tdesc.style.display = \"none\";\n");
  
          result.append("\t}\n");
  
          // function reset progress bar
          result.append("\tfunction resetProgressBar() {\n");
          result.append("\t\tvar bar = document.getElementById(\"progressbar_bar\");\n");
          result.append("\t\tbar.parentNode.style.display = \"inline\";\n");
          result.append("\t\tbar.style.width = \"0%\";\n");
          result.append("\t\tbar.style.display = \"block\";\n");
  
          result.append("\t\tvar percent = document.getElementById(\"progressbar_percent\");\n");
          result.append("\t\tpercent.innerHTML = \"0%\";\n");
          result.append("\t\tpercent.style.display = \"inline\";\n");
  
          result.append("\t\tvar error = document.getElementById(\"progressbar_error\");\n");
          result.append("\t\terror.innerHTML = \"\";\n");
          result.append("\t\terror.style.display = \"none\";\n");
  
          result.append("\t\tvar wait = document.getElementById(\"progressbar_wait\");\n");
          result.append("\t\twait.style.display = \"none\";\n");
  
          result.append("\t\tvar desc = document.getElementById(\"progressbar_desc\");\n");
          result.append("\t\tdesc.style.display = \"block\";\n");
          result.append("\t\tdesc.innerHTML = \"\";\n");
  
          result.append("\t\t\t\t\tprogressResult = \"\";\n");
  
          result.append("\t}\n");
  
          // function start progress bar
          result.append("\tfunction startProgressBar() {\n");
          result.append("\t\tif (progressState > 0) {\n");
          result.append("\t\t\tprogressState = 2;\n");
          result.append("\t\t\twindow.setTimeout(\"startProgressBar()\",");
          result.append(getRefreshRate());
          result.append(");\n");
          result.append("\t\t\treturn;\n");
          result.append("\t\t}\n");
          result.append("\t\tprogressState = 1;\n");
          result.append("\t\tmakeRequest('");
          result.append(getJsp().link("/system/workplace/commons/report-progress.jsp"));
          result.append("', '");
          result.append(PARAMETER_KEY);
          result.append("=");
          result.append(getKey());
          result.append("&");
          result.append(PARAMETER_SHOWWAITTIME);
          result.append("=");
          result.append(getShowWaitTime());
          result.append("&");
          result.append(PARAMETER_REFRESHRATE);
          result.append("=");
          result.append(getRefreshRate());
          result.append("', 'updateProgressBar');\n");
          result.append("\t}\n");
  
          result.append("</script>\n");
  
          return result.toString();
      }