code: public String getSiteTitle(CmsObject cms, CmsResource resource) throws CmsException {
  
          String title = cms.readPropertyObject(resource, CmsPropertyDefinition.PROPERTY_TITLE, false).getValue();
          if (title == null) {
              title = resource.getRootPath();
          }
          if (resource.getRootPath().equals(getSharedFolder())) {
              title = SHARED_FOLDER_TITLE;
          }
          return title;
      }
docs: Returns the site title.<p>
  
  @param cms the cms context
  @param resource the site root resource
  
  @return the title
  
  @throws CmsException in case reading the title property fails