/** * 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)); }
/** * Matches the given request against all configures sites and returns * the matching site, or the default site if no sites matches.<p> * * @param req the request to match * * @return the matching site, or the default site if no sites matches */ public CmsSite matchRequest(HttpServletRequest req) { CmsSiteMatcher matcher = getRequestMatcher(req); if (matcher.getTimeOffset() != 0) { HttpSession session = req.getSession(); if (session != null) { session.setAttribute(CmsContextInfo.ATTRIBUTE_REQUEST_TIME, new Long(System.currentTimeMillis() + matcher.getTimeOffset())); } } CmsSite site = matchSite(matcher); if (LOG.isDebugEnabled()) { String requestServer = req.getScheme() + "://" + req.getServerName() + ":" + req.getServerPort(); LOG.debug(Messages.get().getBundle().key( Messages.LOG_MATCHING_REQUEST_TO_SITE_2, requestServer, site.toString())); } return site; }
/** * Matches the given request against all configures sites and returns * the matching site, or the default site if no sites matches.<p> * * @param req the request to match * * @return the matching site, or the default site if no sites matches */ public CmsSite matchRequest(HttpServletRequest req) { CmsSiteMatcher matcher = getRequestMatcher(req); if (matcher.getTimeOffset() != 0) { HttpSession session = req.getSession(); if (session != null) { session.setAttribute( CmsContextInfo.ATTRIBUTE_REQUEST_TIME, new Long(System.currentTimeMillis() + matcher.getTimeOffset())); } } CmsSite site = matchSite(matcher); if (LOG.isDebugEnabled()) { String requestServer = req.getScheme() + "://" + req.getServerName() + ":" + req.getServerPort(); LOG.debug( Messages.get().getBundle().key( Messages.LOG_MATCHING_REQUEST_TO_SITE_2, requestServer, site.toString())); } return site; }
/** * Returns true if this request goes to a secure site.<p> * * @param req the request to check * * @return true if the request goes to a secure site */ public boolean usesSecureSite(HttpServletRequest req) { CmsSite site = matchRequest(req); if (site == null) { return false; } CmsSiteMatcher secureMatcher = site.getSecureServerMatcher(); boolean result = false; if (secureMatcher != null) { result = secureMatcher.equals(getRequestMatcher(req)); } return result; }