docs: public CmsResourceStatusBean getResourceStatus(
          HttpServletRequest request,
          CmsObject cms,
          CmsUUID structureId,
          String contentLocale,
          boolean includeTargets,
          CmsUUID detailContentId,
          List<CmsUUID> additionalStructureIds,
          Map<String, String> context)
      throws CmsException {
  
          Locale locale = OpenCms.getWorkplaceManager().getWorkplaceLocale(cms);
          cms.getRequestContext().setLocale(locale);
          CmsResource resource = cms.readResource(structureId, CmsResourceFilter.ALL);
          String localizedTitle = null;
          Locale realLocale = null;
          if (!CmsStringUtil.isEmptyOrWhitespaceOnly(contentLocale)) {
              realLocale = CmsLocaleManager.getLocale(contentLocale);
              CmsGallerySearchResult result = CmsGallerySearch.searchById(cms, structureId, realLocale);
              if (!CmsStringUtil.isEmptyOrWhitespaceOnly(result.getTitle())) {
                  localizedTitle = result.getTitle();
              }
          }
          CmsResourceUtil resourceUtil = new CmsResourceUtil(cms, resource);
          List<CmsProperty> properties = cms.readPropertyObjects(resource, false);
          CmsResourceStatusBean result = new CmsResourceStatusBean();
          result.setDateCreated(CmsVfsService.formatDateTime(cms, resource.getDateCreated()));
          long dateExpired = resource.getDateExpired();
          if (dateExpired != CmsResource.DATE_EXPIRED_DEFAULT) {
              result.setDateExpired(CmsVfsService.formatDateTime(cms, dateExpired));
          }
          result.setDateLastModified(CmsVfsService.formatDateTime(cms, resource.getDateLastModified()));
          long dateReleased = resource.getDateReleased();
          if (dateReleased != CmsResource.DATE_RELEASED_DEFAULT) {
              result.setDateReleased(CmsVfsService.formatDateTime(cms, dateReleased));
          }
          String lastProject = resourceUtil.getLockedInProjectName();
          if ("".equals(lastProject)) {
              lastProject = null;
          }
          result.setLastProject(lastProject);
  
          result.setListInfo(CmsVfsService.getPageInfo(cms, resource));
          Map<String, String> contextualAddInfos = createContextInfos(cms, request, resource, context);
          for (Map.Entry<String, String> entry : contextualAddInfos.entrySet()) {
              result.getListInfo().addAdditionalInfo(entry.getKey(), entry.getValue());
          }
  
          CmsLock lock = cms.getLock(resource);
          CmsUser lockOwner = null;
          if (!lock.isUnlocked()) {
              lockOwner = cms.readUser(lock.getUserId());
              result.setLockState(
                  org.opencms.workplace.list.Messages.get().getBundle(locale).key(
                      org.opencms.workplace.list.Messages.GUI_EXPLORER_LIST_ACTION_LOCK_NAME_2,
                      lockOwner.getName(),
                      lastProject));
          } else {
              result.setLockState(
                  org.opencms.workplace.list.Messages.get().getBundle(locale).key(
                      org.opencms.workplace.list.Messages.GUI_EXPLORER_LIST_ACTION_UNLOCK_NAME_0));
          }
  
          CmsProperty navText = CmsProperty.get(CmsPropertyDefinition.PROPERTY_NAVTEXT, properties);
          if (navText != null) {
              result.setNavText(navText.getValue());
          }
          result.setPermissions(resourceUtil.getPermissionString());
          result.setSize(resource.getLength());
          result.setStateBean(resource.getState());
          CmsProperty title = CmsProperty.get(CmsPropertyDefinition.PROPERTY_TITLE, properties);
          if (localizedTitle != null) {
              result.setTitle(localizedTitle);
              result.getListInfo().setTitle(localizedTitle);
          } else if (title != null) {
              result.setTitle(title.getValue());
          }
          result.setUserCreated(resourceUtil.getUserCreated());
          result.setUserLastModified(resourceUtil.getUserLastModified());
  
          I_CmsResourceType resType = OpenCms.getResourceManager().getResourceType(resource);
          result.setResourceType(resType.getTypeName());
  
          result.setStructureId(resource.getStructureId());
          if (resType instanceof CmsResourceTypeXmlContent) {
              CmsFile file = cms.readFile(resource);
              CmsXmlContent content = CmsXmlContentFactory.unmarshal(cms, file);
              List<Locale> locales = content.getLocales();
              List<String> localeStrings = new ArrayList<String>();
              for (Locale l : locales) {
                  localeStrings.add(l.toString());
              }
              result.setLocales(localeStrings);
          }
          Map<String, String> additionalAttributes = new LinkedHashMap<String, String>();
          additionalAttributes.put(
              Messages.get().getBundle(locale).key(Messages.GUI_STATUS_PERMALINK_0),
              OpenCms.getLinkManager().getPermalink(cms, cms.getSitePath(resource), detailContentId));
  
          if (OpenCms.getRoleManager().hasRole(cms, CmsRole.ADMINISTRATOR)) {
              additionalAttributes.put(
                  Messages.get().getBundle(locale).key(Messages.GUI_STATUS_STRUCTURE_ID_0),
                  resource.getStructureId().toString());
              additionalAttributes.put(
                  Messages.get().getBundle(locale).key(Messages.GUI_STATUS_RESOURCE_ID_0),
                  resource.getResourceId().toString());
          }
  
          result.setAdditionalAttributes(additionalAttributes);
  
          List<CmsRelation> relations = cms.readRelations(
              CmsRelationFilter.relationsToStructureId(resource.getStructureId()));
          Map<CmsUUID, CmsResource> relationSources = new HashMap<CmsUUID, CmsResource>();
  
          if (CmsResourceTypeXmlContainerPage.isContainerPage(resource)) {
              // People may link to the folder of a container page instead of the page itself
              try {
                  CmsResource parent = cms.readParentFolder(resource.getStructureId());
                  List<CmsRelation> parentRelations = cms.readRelations(
                      CmsRelationFilter.relationsToStructureId(parent.getStructureId()));
                  relations.addAll(parentRelations);
              } catch (CmsException e) {
                  LOG.error(e.getLocalizedMessage(), e);
              }
          }
  
          // find all distinct relation sources
          for (CmsRelation relation : relations) {
              try {
                  CmsResource currentSource = relation.getSource(cms, CmsResourceFilter.ALL);
                  relationSources.put(currentSource.getStructureId(), currentSource);
              } catch (CmsException e) {
                  LOG.error(e.getLocalizedMessage(), e);
              }
          }
  
          for (CmsResource relationResource : relationSources.values()) {
              try {
                  CmsPermissionInfo permissionInfo = OpenCms.getADEManager().getPermissionInfo(
                      cms,
                      relationResource,
                      resource.getRootPath());
                  if (permissionInfo.hasViewPermission()) {
                      CmsResourceStatusRelationBean relationBean = createRelationBean(
                          cms,
                          contentLocale,
                          relationResource,
                          permissionInfo);
                      CmsSite site = OpenCms.getSiteManager().getSiteForRootPath(relationResource.getRootPath());
                      if ((site != null)
                          && !CmsStringUtil.isPrefixPath(
                              cms.getRequestContext().getSiteRoot(),
                              relationResource.getRootPath())) {
                          String siteTitle = site.getTitle();
                          if (siteTitle == null) {
                              siteTitle = site.getUrl();
                          } else {
                              siteTitle = CmsWorkplace.substituteSiteTitleStatic(
                                  siteTitle,
                                  OpenCms.getWorkplaceManager().getWorkplaceLocale(cms));
                          }
                          relationBean.setSiteRoot(site.getSiteRoot());
                          result.getOtherSiteRelationSources().add(relationBean);
                          relationBean.getInfoBean().setTitle(
                              "[" + siteTitle + "] " + relationBean.getInfoBean().getTitle());
                      } else {
                          result.getRelationSources().add(relationBean);
                      }
  
                  }
              } catch (CmsVfsResourceNotFoundException notfound) {
                  LOG.error(notfound.getLocalizedMessage(), notfound);
                  continue;
              }
          }
          sortRelations(cms, result);
          if (includeTargets) {
              result.getRelationTargets().addAll(getTargets(cms, contentLocale, resource, additionalStructureIds));
              if ((detailContentId != null) && (realLocale != null)) {
                  // try to add detail only contents
                  try {
                      CmsResource detailContent = cms.readResource(detailContentId, CmsResourceFilter.ALL);
                      Optional<CmsResource> detailOnlyPage = CmsDetailOnlyContainerUtil.getDetailOnlyResource(
                          cms,
                          realLocale.toString(),
                          detailContent,
                          resource);
                      if (detailOnlyPage.isPresent()) {
                          result.getRelationTargets().addAll(
                              getTargets(
                                  cms,
                                  contentLocale,
                                  detailOnlyPage.get(),
                                  Arrays.asList(detailOnlyPage.get().getStructureId())));
                      }
  
                  } catch (CmsException e) {
                      LOG.error(e.getLocalizedMessage(), e);
                  }
              }
              Iterator<CmsResourceStatusRelationBean> iter = result.getRelationTargets().iterator();
              // Remove duplicates
              Set<CmsUUID> visitedIds = Sets.newHashSet();
              while (iter.hasNext()) {
                  CmsResourceStatusRelationBean bean = iter.next();
                  if (visitedIds.contains(bean.getStructureId())) {
                      iter.remove();
                  }
                  visitedIds.add(bean.getStructureId());
              }
          }
          result.getSiblings().addAll(getSiblings(cms, contentLocale, resource));
          LinkedHashMap<CmsResourceStatusTabId, String> tabMap = new LinkedHashMap<CmsResourceStatusTabId, String>();
          Map<CmsResourceStatusTabId, CmsMessageContainer> tabs;
          CmsResourceStatusTabId startTab = CmsResourceStatusTabId.tabRelationsFrom;
          if (CmsResourceTypeXmlContainerPage.isContainerPage(resource)) {
              tabs = CmsResourceStatusConstants.STATUS_TABS_CONTAINER_PAGE;
          } else if (OpenCms.getResourceManager().getResourceType(resource) instanceof I_CmsLinkParseable) {
              tabs = CmsResourceStatusConstants.STATUS_TABS_CONTENT;
          } else {
              tabs = CmsResourceStatusConstants.STATUS_TABS_OTHER;
              startTab = CmsResourceStatusTabId.tabStatus;
          }
          for (Map.Entry<CmsResourceStatusTabId, CmsMessageContainer> entry : tabs.entrySet()) {
              tabMap.put(entry.getKey(), entry.getValue().key(locale));
          }
  
          result.setTabs(tabMap);
          result.setStartTab(startTab);
          return result;
      }