code: public static String getBestUrlName(CmsObject cms, CmsUUID id) throws CmsException {
  
          // this is currently only used for static export
          Locale locale = cms.getRequestContext().getLocale();
          List<Locale> defaultLocales = OpenCms.getLocaleManager().getDefaultLocales();
          String urlName = cms.readBestUrlName(id, locale, defaultLocales);
          if (urlName != null) {
              return urlName;
          }
          return id.toString();
      }
docs: Returns either the newest URL name for a structure id, or  the structure id as a string if there is no URL name.<p>
  
  @param cms the current CMS context
  @param id the structure id of a resource
  
  @return the best URL name for the structure id
  
  @throws CmsException if something goes wrong