code: private String getDetailRootPath(CmsObject cms, String result) {
  
          if (result == null) {
              return null;
          }
          try {
              URI uri = new URI(result);
              String path = uri.getPath();
              if (CmsStringUtil.isEmptyOrWhitespaceOnly(path) || !OpenCms.getADEManager().isInitialized()) {
                  return null;
              }
              String name = CmsFileUtil.removeTrailingSeparator(CmsResource.getName(path));
              CmsUUID detailId = OpenCms.getADEManager().getDetailIdCache(
                  cms.getRequestContext().getCurrentProject().isOnlineProject()).getDetailId(name);
              if (detailId == null) {
                  return null;
              }
              String origSiteRoot = cms.getRequestContext().getSiteRoot();
              try {
                  cms.getRequestContext().setSiteRoot("");
                  // real root paths have priority over detail contents
                  if (cms.existsResource(path)) {
                      return null;
                  }
              } finally {
                  cms.getRequestContext().setSiteRoot(origSiteRoot);
              }
              CmsResource detailResource = cms.readResource(detailId, CmsResourceFilter.ALL);
              return detailResource.getRootPath() + getSuffix(uri);
          } catch (Exception e) {
              LOG.error(e.getLocalizedMessage(), e);
              return null;
          }
      }
docs: Tries to interpret the given URI as a detail page URI and returns the detail content's root path if possible.<p>
  
  If the given URI is not a detail URI, null will be returned.<p>
  
  @param cms the CMS context to use
  @param result the detail root path, or null if the given uri is not a detail page URI
  
  @return the detail content root path