Class CmsContextInfo

java.lang.Object
org.opencms.main.CmsContextInfo
All Implemented Interfaces:
Serializable

public class CmsContextInfo extends Object implements Serializable
Contains user information for automated creation of a CmsRequestContext during system runtime.

Since:
6.0.0
See Also:
  • Field Details

  • Constructor Details

    • CmsContextInfo

      public CmsContextInfo()
      Creates a new instance, initializing the variables with some reasonable default values.

      The default values are:

      User name
      (configured default guest user)
      Project name
      Online
      Requested URI
      /
      Site root
      /
      Locale name
      (configured default locale name)
      Encoding
      (configured default system encoding)
      Remote address
      127.0.0.1
      Organizational unit
      /

    • CmsContextInfo

      public CmsContextInfo(CmsRequestContext requestContext)
      Creates a new instance with all context variables initialized from the given request context.

      Parameters:
      requestContext - the request context to initialize this context info with
    • CmsContextInfo

      public CmsContextInfo(CmsUser user, CmsProject project, String requestedUri, CmsSiteMatcher requestMatcher, String siteRoot, boolean isSecureRequest, Locale locale, String encoding, String remoteAddr, long requestTime, String ouFqn, boolean isForceAbsoluteLinks)
      Creates a new instance with all context variables initialized.

      Parameters:
      user - the user to create the context with
      project - the project to create the context with
      requestedUri - the request URI to create the context with
      requestMatcher - the matcher for the current request, that is the host part of the URI from the original http request
      siteRoot - the site root to create the context with
      isSecureRequest - if this a secure request
      locale - the locale to create the context with
      encoding - the encoding to create the context with
      remoteAddr - the remote ip address to create the context with
      requestTime - the time of the request (used for resource publication / expiration date)
      ouFqn - the fully qualified name of the organizational unit to create the context with
      isForceAbsoluteLinks - a flag indicating whether links to the current site should be generated with a server prefix
    • CmsContextInfo

      public CmsContextInfo(String userName)
      Creates a new instance, initializing the user name as provided and all other vaiables with the same default values as in CmsContextInfo().

      Parameters:
      userName - the user name to create the context with
      See Also:
  • Method Details