code: protected static String substituteLink(CmsObject cms, String target) {
  
          if (cms != null) {
              return OpenCms.getLinkManager().substituteLinkForUnknownTarget(
                  cms,
                  CmsLinkManager.getAbsoluteUri(String.valueOf(target), cms.getRequestContext().getUri()));
          } else {
              return "";
          }
      }
docs: Returns the substituted link to the given target.<p>
  
  @param cms the cms context
  @param target the link target
  
  @return the substituted link