docs: public static String initTree(CmsObject cms, String encoding, String skinUri) {
  
          StringBuffer retValue = new StringBuffer(512);
          String servletUrl = OpenCms.getSystemInfo().getOpenCmsContext();
  
          // get the localized workplace messages
          // TODO: Why a new message object, can it not be obtained from session?
          Locale locale = cms.getRequestContext().getLocale();
          CmsMessages messages = OpenCms.getWorkplaceManager().getMessages(locale);
  
          retValue.append("function initTreeResources() {\n");
          retValue.append("\tinitResources(\"");
          retValue.append(encoding);
          retValue.append("\", \"");
          retValue.append(PATH_WORKPLACE);
          retValue.append("\", \"");
          retValue.append(skinUri);
          retValue.append("\", \"");
          retValue.append(servletUrl);
          retValue.append("\");\n");
  
          // get all available resource types
          List<I_CmsResourceType> allResTypes = OpenCms.getResourceManager().getResourceTypes();
          for (int i = 0; i < allResTypes.size(); i++) {
              // loop through all types
              I_CmsResourceType type = allResTypes.get(i);
              int curTypeId = type.getTypeId();
              String curTypeName = type.getTypeName();
              // get the settings for the resource type
              CmsExplorerTypeSettings settings = OpenCms.getWorkplaceManager().getExplorerTypeSetting(curTypeName);
              if (settings == null) {
                  if (LOG.isWarnEnabled()) {
                      LOG.warn(Messages.get().getBundle().key(Messages.LOG_MISSING_SETTINGS_ENTRY_1, curTypeName));
                  }
                  settings = OpenCms.getWorkplaceManager().getExplorerTypeSetting(
                      CmsResourceTypePlain.getStaticTypeName());
              }
              retValue.append("\taddResourceType(");
              retValue.append(curTypeId);
              retValue.append(", \"");
              retValue.append(curTypeName);
              retValue.append("\",\t\"");
              retValue.append(messages.key(settings.getKey()));
              retValue.append("\",\t\"" + CmsWorkplace.RES_PATH_FILETYPES);
              retValue.append(settings.getIcon());
              retValue.append("\");\n");
          }
  
          retValue.append("}\n\n");
          retValue.append("initTreeResources();\n");
          String sharedFolder = OpenCms.getSiteManager().getSharedFolder();
          if (sharedFolder != null) {
              retValue.append("sharedFolderName = '" + sharedFolder + "';");
          }
          return retValue.toString();
      }