/** * Returns <code>true</code> if the given site matcher matches any configured site, * which includes the workplace site.<p> * * @param matcher the site matcher to match the site with * * @return <code>true</code> if the matcher matches a site */ public boolean isMatching(CmsSiteMatcher matcher) { boolean result = m_siteMatcherSites.get(matcher) != null; if (!result) { // try to match the workplace site result = isWorkplaceRequest(matcher); } return result; }
/** * Returns <code>true</code> if the given request is against the configured OpenCms workplace.<p> * * @param req the request to match * * @return <code>true</code> if the given request is against the configured OpenCms workplace */ public boolean isWorkplaceRequest(HttpServletRequest req) { if (req == null) { // this may be true inside a static export test case scenario return false; } return isWorkplaceRequest(getRequestMatcher(req)); }
/** * Returns <code>true</code> if the given request is against the configured OpenCms workplace.<p> * * @param req the request to match * * @return <code>true</code> if the given request is against the configured OpenCms workplace */ public boolean isWorkplaceRequest(HttpServletRequest req) { if (req == null) { // this may be true inside a static export test case scenario return false; } return isWorkplaceRequest(getRequestMatcher(req)); }
if ((OpenCms.getSiteManager().getSites().size() > 1) && !OpenCms.getSiteManager().isWorkplaceRequest(request)) {
/** * Checks whether the workplace is accessed through the workplace server, and sends an error message otherwise.<p> * * @param request the request to check * @param cms the CmsObject to use */ public void checkWorkplaceRequest(HttpServletRequest request, CmsObject cms) { try { if ((OpenCms.getSiteManager().getSites().size() > 1) && !OpenCms.getSiteManager().isWorkplaceRequest(request)) { // this is a multi site-configuration, but not a request to the configured Workplace site CmsUser user = cms.getRequestContext().getCurrentUser(); // to limit the number of times broadcast is called for a user, we use an expiring cache // with the user name as key if (null == m_workplaceServerUserChecks.getIfPresent(user.getName())) { m_workplaceServerUserChecks.put(user.getName(), ""); OpenCms.getSessionManager().sendBroadcast( null, Messages.get().getBundle(getWorkplaceLocale(cms)).key( Messages.ERR_WORKPLACE_SERVER_CHECK_FAILED_0), user); } } } catch (Exception e) { LOG.error(e.getLocalizedMessage(), e); } }
} else if (getSiteManager().isWorkplaceRequest(req)) {
if (OpenCms.getSiteManager().isWorkplaceRequest(req)) {
if (OpenCms.getSiteManager().isWorkplaceRequest(req)) {
path = path.substring(OpenCms.getSystemInfo().getOpenCmsContext().length()); if (OpenCms.getSiteManager().isWorkplaceRequest(matcher)) {
if ((OpenCms.getSiteManager().getSites().size() > 1) && !OpenCms.getSiteManager().isWorkplaceRequest(request)) {
path = path.substring(OpenCms.getSystemInfo().getOpenCmsContext().length()); if (OpenCms.getSiteManager().isWorkplaceRequest(matcher)) {
&& !OpenCms.getSiteManager().isWorkplaceRequest(getRequest())) {
boolean isWorkplaceServer = OpenCms.getSiteManager().isWorkplaceRequest(targetMatcher) || targetMatcher.equals(cms.getRequestContext().getRequestMatcher()); if (isWorkplaceServer) {
&& !OpenCms.getSiteManager().isWorkplaceRequest(getRequest())) {