code: private String getSite(CmsObject cms, CmsFavoriteEntry entry) {
  
          CmsSite site = OpenCms.getSiteManager().getSiteForRootPath(entry.getSiteRoot());
          Item item = m_sitesContainer.getItem(entry.getSiteRoot());
          if (item != null) {
              return (String)(item.getItemProperty("caption").getValue());
          }
          String result = entry.getSiteRoot();
          if (site != null) {
              if (!CmsStringUtil.isEmpty(site.getTitle())) {
                  result = site.getTitle();
              }
          }
          return result;
      }
docs: Gets the site label for the entry.
  
  @param cms the current CMS context
  @param entry the entry
  @return the site label for the entry