code: private String getSitePrefix(String prefix, String storedSiteRoot) {
  
          if (OpenCms.getSiteManager().isSharedFolder(prefix)) {
              return prefix;
          }
          if (TYPE_PAGELINK.equals(getTreeType())) {
              // in editor link dialog, create a special prefix for internal links
              if (!storedSiteRoot.equals(prefix)) {
                  // stored site is not selected site, create complete URL as prefix
                  CmsSite site = OpenCms.getSiteManager().getSiteForSiteRoot(prefix);
                  prefix = getCms().getRequestContext().removeSiteRoot(prefix);
                  prefix = site.getUrl() + OpenCms.getSystemInfo().getOpenCmsContext() + prefix;
              } else {
                  // stored site is selected site, don't show prefix at all
                  prefix = "";
              }
  
          } else if (TYPE_COPY.equals(getTreeType())
              || TYPE_SIBLING.equals(getTreeType())
              || TYPE_VFSWIDGET.equals(getTreeType())) {
              // in vfs copy|move|link or vfs widget mode, don't add the prefix for the current workplace site
              if (storedSiteRoot.equals(prefix)) {
                  prefix = "";
              }
          } else if (TYPE_PREFERENCES.equals(getTreeType())) {
              prefix = "";
          }
  
          return prefix;
      }
docs: Calculates the prefix that has to be added when selecting a resource in a popup tree window.<p>
  
  This is needed for the link dialog in editors
  as well as the copy, move and link popup dialogs for resources in the VFS.<p>
  
  @param prefix the current prefix of the resource
  @param storedSiteRoot the site root in which the workplace (not the tree!) is
  @return the prefix which is added to the resource name