docs: CmsResourceStatusRelationBean createRelationBean(
          CmsObject cms,
          String locale,
          CmsResource relationResource,
          CmsPermissionInfo permissionInfo)
      throws CmsException {
  
          CmsListInfoBean sourceBean = CmsVfsService.getPageInfo(cms, relationResource);
          sourceBean.setMarkChangedState(true);
          sourceBean.setResourceState(relationResource.getState());
  
          if (!CmsStringUtil.isEmptyOrWhitespaceOnly(locale)) {
              Locale realLocale = CmsLocaleManager.getLocale(locale);
              CmsGallerySearchResult result = CmsGallerySearch.searchById(
                  cms,
                  relationResource.getStructureId(),
                  realLocale);
              if (!CmsStringUtil.isEmptyOrWhitespaceOnly(result.getTitle())) {
                  sourceBean.setTitle(result.getTitle());
              }
          }
          String link = null;
          try {
              link = OpenCms.getLinkManager().substituteLink(cms, relationResource);
          } catch (Exception e) {
              LOG.warn(e.getLocalizedMessage(), e);
          }
          CmsResourceStatusRelationBean relationBean = new CmsResourceStatusRelationBean(
              sourceBean,
              link,
              relationResource.getStructureId(),
              permissionInfo);
          if (CmsResourceTypeXmlContent.isXmlContent(relationResource)) {
              relationBean.setIsXmlContent(true);
          }
          String sitePath = cms.getSitePath(relationResource);
          relationBean.setSitePath(sitePath);
          return relationBean;
      }