Gets the path which is used when the sitemap entry is selected.<p>

@param sitemapEntry the sitemap entry

@return the path to use when the entry is selected
497919
public String getSelectPath(CmsSitemapEntryBean sitemapEntry) {

        String normalizedSiteRoot = CmsStringUtil.joinPaths(CmsCoreProvider.get().getSiteRoot(), "/");
        String rootPath = sitemapEntry.getRootPath();
        if (rootPath.startsWith(normalizedSiteRoot)) {
            return rootPath.substring(normalizedSiteRoot.length() - 1);
        }
        return sitemapEntry.getRootPath();
    }
587301
public static String getVaadinWorkplaceLink(CmsObject cms, String resourceRootFolder) {

        CmsSite site = OpenCms.getSiteManager().getSiteForRootPath(resourceRootFolder);
        String siteRoot = site != null
        ? site.getSiteRoot()
        : OpenCms.getSiteManager().startsWithShared(resourceRootFolder)
        ? OpenCms.getSiteManager().getSharedFolder()
        : "";
        String sitePath = resourceRootFolder.substring(siteRoot.length());
        String link = getFileExplorerLink(cms, siteRoot) + sitePath;
        return link;
    }
424814
public String getSiteSelector(String htmlAttributes) {

        List<String> options = new ArrayList<String>();
        List<String> values = new ArrayList<String>();
        int selectedIndex = 0;
        String preSelection = getSettings().getTreeSite(getTreeType());
        if (preSelection == null) {
            if ("".equals(getCms().getRequestContext().getSiteRoot())) {
                // we are in the root site, getCurrentSite(CmsObject) includes NOT the root site
                preSelection = "";
            } else {
                // get the site root of the current site
                preSelection = OpenCms.getSiteManager().getCurrentSite(getCms()).getSiteRoot();
            }
            // set the tree site to avoid discrepancies between selector and tree
            getSettings().setTreeSite(getTreeType(), preSelection);
        }

        boolean includeRootSite = true;
        boolean showSiteUrls = false;
        if (TYPE_PAGELINK.equals(getTreeType())) {
            // in wysiwyg editor link dialog, don't show root site, but show site URLs
            includeRootSite = false;
            showSiteUrls = true;
        }
        List<CmsSite> sites = OpenCms.getSiteManager().getAvailableSites(
            getCms(),
            includeRootSite,
            true,
            getCms().getRequestContext().getOuFqn());

        Iterator<CmsSite> i = sites.iterator();
        int pos = 0;
        while (i.hasNext()) {
            CmsSite site = i.next();
            values.add(site.getSiteRoot());
            String curOption = substituteSiteTitle(site.getTitle());
            if (showSiteUrls && (site.getSiteMatcher() != null)) {
                // show the site URL in editor link dialog tree
                curOption = site.getUrl() + " (" + curOption + ")";
                if (getCms().getRequestContext().getSiteRoot().equals(site.getSiteRoot())) {
                    // mark the current workplace site in selector
                    curOption = "*" + curOption;
                }
            }

            if (site.getSiteRoot().equals(preSelection)) {
                // this is the user's currently selected site
                selectedIndex = pos;
            }
            options.add(curOption);
            pos++;
        }

        return buildSelect(htmlAttributes, options, values, selectedIndex);
    }
959200
public String getBaseToolPath(CmsWorkplace wp) {

        CmsToolUserData userData = getUserData(wp);
        String path = TOOLPATH_SEPARATOR;
        if (userData != null) {
            path = userData.getBaseTool(getCurrentRoot(wp).getKey());
        }
        return path;
    }
489862
public void openSiteMap(String sitePath, boolean siteChange) {

        String uri = CmsCoreProvider.get().link(
            CmsCoreProvider.get().getUri()) + "?" + CmsCoreData.PARAM_PATH + "=" + sitePath;
        if (!siteChange) {
            uri += "&" + CmsCoreData.PARAM_RETURNCODE + "=" + getData().getReturnCode();
        }
        Window.Location.replace(uri);
    }
1335902
public String getFileLink() {

        if (m_resource != null) {
            return A_CmsJspValueWrapper.substituteLink(m_cms, m_cms.getSitePath(m_resource));
        } else {
            return "";
        }
    }
425948
public List<String> getAllSelectedSitePath() {

        List<String> result = new ArrayList<String>();
        for (String cat : m_selectedCategories) {
            result.add(((CmsDataValue)m_categories.get(cat).getMainWidget()).getParameter(2));
        }
        return result;
    }
35964
private static String getContextRootPath(CmsObject cms, String creationSitemap) {

        String path = null;
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(creationSitemap)) {
            try {
                path = cms.readFolder(creationSitemap).getRootPath();
            } catch (CmsException e) {
                LOG.warn("The provided creation sitemap " + creationSitemap + " is not a VFS folder.", e);
            }
        }
        if (path == null) {
            path = cms.addSiteRoot(cms.getRequestContext().getFolderUri());
        }

        return path;
    }
328680
public String getDestinationPath() {

        if (m_destinationPath == null) {
            m_destinationPath = OpenCms.getSystemInfo().getAbsoluteRfsPathRelativeToWebApplication(
                m_configuredDestination);
        }
        return m_destinationPath;
    }
1314848
static CmsListInfoBean getInfoBean(CmsClientSitemapEntry entry, boolean navMode) {

        CmsListInfoBean infoBean = new CmsListInfoBean();
        infoBean.setTitle(entry.getTitle());
        infoBean.setSubTitle(entry.getSitePath());
        // showing the resource type icon of the default file in navigation mode
        infoBean.setResourceType(
            CmsStringUtil.isNotEmptyOrWhitespaceOnly(entry.getDefaultFileType())
            ? entry.getDefaultFileType()
            : entry.getResourceTypeName());
        infoBean.setResourceState(entry.getResourceState());
        CmsMessages msg = Messages.get();
        List<CmsAdditionalInfoBean> infos = new ArrayList<CmsAdditionalInfoBean>();
        addInfo(infos, msg.key(Messages.GUI_NAME_0), entry.getName());

        boolean isTitleSet = false;
        if (navMode) {
            // in nav mode, display the title of the page rather than that of the folder, if available
            Map<String, CmsClientProperty> defaultFileProps = entry.getDefaultFileProperties();
            CmsClientProperty titleProperty = defaultFileProps == null
            ? null
            : defaultFileProps.get(CmsClientProperty.PROPERTY_TITLE);
            if ((titleProperty != null) && !titleProperty.isEmpty()) {
                addInfo(infos, msg.key(Messages.GUI_TITLE_PROPERTY_0), titleProperty.getEffectiveValue());
                isTitleSet = true;
            }
        }
        if (!isTitleSet) {
            CmsClientProperty titleProperty = entry.getOwnProperties().get(CmsClientProperty.PROPERTY_TITLE);
            if ((titleProperty != null) && !titleProperty.isEmpty()) {
                addInfo(infos, msg.key(Messages.GUI_TITLE_PROPERTY_0), titleProperty.getEffectiveValue());
                isTitleSet = true;
            }
        }

        String shownPath = entry.getVfsPath();
        if (CmsStringUtil.isEmptyOrWhitespaceOnly(shownPath)) {
            shownPath = "-";
        }
        addInfo(infos, msg.key(Messages.GUI_VFS_PATH_0), shownPath);
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(entry.getDateReleased())) {
            addInfo(infos, msg.key(Messages.GUI_LABEL_DATE_RELEASED_0), entry.getDateReleased());

        }
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(entry.getDateExpired())) {
            addInfo(infos, msg.key(Messages.GUI_LABEL_DATE_EXPIRED_0), entry.getDateExpired());

        }
        if (entry.getEntryType() == EntryType.redirect) {
            addInfo(infos, msg.key(Messages.GUI_LABEL_TARGET_0), entry.getRedirectTarget());

        }
        if (entry.getAliases() != null) {
            int counter = 1;
            for (String aliasPath : entry.getAliases()) {
                addInfo(infos, msg.key(Messages.GUI_LABEL_ALIAS_1, counter + ""), aliasPath);
                counter += 1;
            }
        }
        infoBean.setAdditionalInfo(infos);
        return infoBean;
    }
521610
public String getSiteRoot() {

        if (m_internal && (m_siteRoot == null)) {
            m_siteRoot = OpenCms.getSiteManager().getSiteRoot(m_target);
            if (m_siteRoot == null) {
                m_siteRoot = "";
            }
        }
        return m_siteRoot;
    }
640638
protected String getCommonSite(Collection<CmsResource> resourceSet) {

        String commonPath = getCommonAncestorPath(resourceSet);
        String result = null;
        CmsSiteManagerImpl siteManager = OpenCms.getSiteManager();
        if (siteManager.startsWithShared(commonPath)) {
            result = siteManager.getSharedFolder();
        } else {
            String siteRoot = siteManager.getSiteRoot(CmsStringUtil.joinPaths(commonPath, "/"));
            if (siteRoot == null) {
                result = "/";
            } else {
                result = siteRoot;
            }
        }
        return result;

    }
1185516
@NonNull
    protected Map<String, String> getPathVariable(@NonNull String httpPath) {
        List<Path.Segment> httpSegments = Path.pathToList(httpPath);
        List<Path.Rule> ruleList = mMapping.getPath().getRuleList();
        for (Path.Rule rule : ruleList) {
            List<Path.Segment> segments = rule.getSegments();
            if (httpSegments.size() != httpSegments.size()) continue;

            String path = Path.listToPath(segments);
            if (path.equals(httpPath)) return Collections.emptyMap();

            boolean matches = true;
            boolean isBlurred = false;
            for (int i = 0; i < segments.size(); i++) {
                Path.Segment segment = segments.get(i);
                boolean blurred = segment.isBlurred();
                isBlurred = isBlurred || blurred;
                if (!segment.equals(httpSegments.get(i)) && !blurred) {
                    matches = false;
                    break;
                }
            }

            if (matches) {
                if (isBlurred) {
                    Map<String, String> map = new HashMap<>();
                    for (int i = 0; i < segments.size(); i++) {
                        Path.Segment segment = segments.get(i);
                        Path.Segment httpSegment = httpSegments.get(i);

                        String key = segment.getValue();
                        key = key.substring(1, key.length() - 1);
                        map.put(key, httpSegment.getValue());
                    }
                    return map;
                }

                return Collections.emptyMap();
            }
        }

        return Collections.emptyMap();
    }
97024
public List<String> getPath() {

        List<String> result = new ArrayList<String>();
        CmsChoiceMenuEntryBean entry = this;
        while (entry != null) {
            String pathComponent = entry.getPathComponent();
            if (pathComponent != null) {
                // pathComponent may be null for a dummy root entry
                result.add(entry.getPathComponent());
            }
            entry = entry.m_parent;
        }
        Collections.reverse(result);
        return result;
    }
1213763
public static String getBasePath(String siteConfigFile) {

        if (siteConfigFile.endsWith(CmsADEManager.CONFIG_SUFFIX)) {
            return CmsResource.getParentFolder(CmsResource.getParentFolder(siteConfigFile));
        }
        return null;
    }
503781
private boolean isValidEntryAndPath(CmsClientSitemapEntry entry, String toPath) {

        return ((toPath != null)
            && (CmsResource.getParentFolder(toPath) != null)
            && (entry != null)
            && (getEntry(CmsResource.getParentFolder(toPath)) != null)
            && (getEntry(entry.getSitePath()) != null));
    }
135490
public String getPath() {

        StringBuffer path = new StringBuffer("/");
        CmsTreeItem current = this;
        while (current != null) {
            path.insert(0, current.getId()).insert(0, "/");
            current = current.getParentItem();
        }
        String result = path.toString();
        if (result.startsWith("//")) {
            // This happens if the root item has an empty id.
            // In that case, we cut off the first slash.
            result = result.substring(1);
        }
        return result;
    }