/** * Returns the online link for the given resource, with full server prefix.<p> * * Like <code>http://site.enterprise.com:8080/index.html</code>.<p> * * In case the resource name is a full root path, the site from the root path will be used. * Otherwise the resource is assumed to be in the current site set be the OpenCms user context.<p> * * Please note that this method will always return the link as it will appear in the "Online" * project, that is after the resource has been published. In case you need a method that * just returns the link with the full server prefix, use {@link #getServerLink(CmsObject, String)}.<p> * * @param cms the current OpenCms user context * @param resourceName the resource to generate the online link for * * @return the online link for the given resource, with full server prefix * * @see #getServerLink(CmsObject, String) */ public String getOnlineLink(CmsObject cms, String resourceName) { return getOnlineLink(cms, resourceName, false); }
/** * Returns the path under which the resource is accessible.<p> * * @return the path under which the resource is accessible */ public String getResourceUrl() { return OpenCms.getLinkManager().getOnlineLink(getCms(), getParamResource()); }
/** * Returns the path under which the resource is accessible.<p> * * @return the path under which the resource is accessible */ public String getResourceUrl() { return OpenCms.getLinkManager().getOnlineLink(getCms(), getParamResource()); }
"Sitemap: " + CmsXmlSitemapGenerator.replaceServerUri( OpenCms.getLinkManager().getOnlineLink(cms, cms.getSitePath(seoFile)), m_configuration.getServerUrl())); buffer.append("\n");
} else { String target = OpenCms.getLinkManager().getOnlineLink(cms, resourceName); if (!target.toLowerCase().startsWith(secureUrl.toLowerCase())) { Optional<String> targetWithReplacedHost = CmsStringUtil.replacePrefix(
/** * @see org.opencms.ui.actions.I_CmsWorkplaceAction#executeAction(org.opencms.ui.I_CmsDialogContext) */ public void executeAction(I_CmsDialogContext context) { if (context.getResources().size() == 1) { HttpServletRequest req = CmsVaadinUtils.getRequest(); CmsJspTagEnableAde.removeDirectEditFlagFromSession(req.getSession()); if (context.getCms().getRequestContext().getCurrentProject().isOnlineProject()) { String link = OpenCms.getLinkManager().getOnlineLink( context.getCms(), context.getCms().getSitePath(context.getResources().get(0))); A_CmsUI.get().openPageOrWarn(link, ONLINE_WINDOW_NAME); } else { String link = OpenCms.getLinkManager().substituteLink(context.getCms(), context.getResources().get(0)); A_CmsUI.get().getPage().setLocation(link); } } }
/** * Reads the data necessary for building the sitemap from the VFS and initializes the internal data structures.<p> * * @param baseSitePath the base site path * * @throws CmsException if something goes wrong */ private void initializeFileData(String baseSitePath) throws CmsException { m_resultMap.clear(); m_siteRootLink = OpenCms.getLinkManager().getOnlineLink(m_siteGuestCms, "/"); m_siteRootLink = CmsFileUtil.removeTrailingSeparator(m_siteRootLink); m_detailPageInfos = OpenCms.getADEManager().getAllDetailPages(m_guestCms); for (CmsDetailPageInfo detailPageInfo : m_detailPageInfos) { String type = detailPageInfo.getType(); String path = detailPageInfo.getUri(); path = CmsFileUtil.removeTrailingSeparator(path); m_detailTypesByPage.put(path, type); } List<CmsAlias> siteAliases = OpenCms.getAliasManager().getAliasesForSite( m_siteGuestCms, m_siteGuestCms.getRequestContext().getSiteRoot()); for (CmsAlias alias : siteAliases) { if (isAliasBelowBaseFolder(alias) && (alias.getMode() == CmsAliasMode.page)) { CmsUUID aliasId = alias.getStructureId(); m_pageAliasesBelowBaseFolderByStructureId.put(aliasId, alias); } } }
String sitePath = m_siteGuestCms.getSitePath(resource); List<CmsProperty> propertyList = m_siteGuestCms.readPropertyObjects(resource, true); String onlineLink = OpenCms.getLinkManager().getOnlineLink(m_siteGuestCms, sitePath); boolean isContainerPage = CmsResourceTypeXmlContainerPage.isContainerPage(resource); long dateModified = resource.getDateLastModified();
} else { String target = OpenCms.getLinkManager().getOnlineLink( cms, cms.getRequestContext().getUri());
/** * Gets the detail link for a given container page and detail content.<p> * * @param pageRes the container page * @param detailRes the detail content * @param locale the locale for which we want the link * * @return the detail page link */ protected String getDetailLink(CmsResource pageRes, CmsResource detailRes, Locale locale) { String pageSitePath = m_siteGuestCms.getSitePath(pageRes); String detailSitePath = m_siteGuestCms.getSitePath(detailRes); CmsRequestContext requestContext = m_siteGuestCms.getRequestContext(); String originalUri = requestContext.getUri(); Locale originalLocale = requestContext.getLocale(); try { requestContext.setUri(pageSitePath); requestContext.setLocale(locale); return OpenCms.getLinkManager().getOnlineLink(m_siteGuestCms, detailSitePath, true); } finally { requestContext.setUri(originalUri); requestContext.setLocale(originalLocale); } }
Set<String> cssResources = new LinkedHashSet<String>(); for (String cssSitePath : formatter.getCssHeadIncludes()) { cssResources.add(OpenCms.getLinkManager().getOnlineLink(m_cms, cssSitePath));
String url = m_linkManager.getOnlineLink(cms, uri); res.sendRedirect(url); return;
OpenCms.getSiteManager().getSiteForSiteRoot(cms.getRequestContext().getSiteRoot()).getUrl())) { if (detailResource != null) { onlineLink = OpenCms.getLinkManager().getOnlineLink( cms, cms.getSitePath(containerPage), false); } else { onlineLink = OpenCms.getLinkManager().getOnlineLink(cms, cms.getSitePath(containerPage));
initOptionGroup(m_secureField); initOptionGroup(m_exportField); m_linkField.setValue(OpenCms.getLinkManager().getOnlineLink(cms, cms.getSitePath(m_resource)));