public class RequestParamUserStateBuilder extends Object
HttpServletRequest
.Modifier and Type | Field and Description |
---|---|
protected String |
mDateParam |
protected String |
mUserAgentParam |
protected String |
mUserSegmentParam |
protected String |
mWorkspaceIdParam |
protected static String |
PROFILE_GROUP_PREFIX
Attribute key expected by MDEX to disambiguate ATG profile groups from Endeca user segments.
|
Constructor and Description |
---|
RequestParamUserStateBuilder() |
Modifier and Type | Method and Description |
---|---|
UserState |
createUserState(javax.servlet.http.HttpServletRequest request)
Deprecated.
as of 11.2, replaced by
parseUserState
Returns a UserState object by parsing the information present in the
HttpServletRequest . |
protected String |
parseDate(javax.servlet.http.HttpServletRequest request)
Returns the date parameter value, using the parameter name set by
setDateParam(String) . |
protected String |
parseUserAgent(javax.servlet.http.HttpServletRequest request)
Returns the user agent parameter value, using the parameter name set by
setUserAgentParam(String) . |
protected String |
parseUserSegments(javax.servlet.http.HttpServletRequest request)
Returns the user segment parameter value, using the parameter name set by
setUserSegmentsParam(String) . |
UserState |
parseUserState(javax.servlet.http.HttpServletRequest request)
Returns a
UserState object by parsing the information present in the
HttpServletRequest . |
protected String |
parseWorkspaceId(javax.servlet.http.HttpServletRequest request)
Returns the workspace id parameter value, using the parameter name set by
setWorkspaceIdParam(String) . |
void |
setDateParam(String param)
Sets the name of the parameter used for obtaining the date information
from the
HttpServletRequest . |
void |
setUserAgentParam(String param)
Sets the name of the parameter used for obtaining the user agent information
from the
HttpServletRequest . |
void |
setUserSegmentsParam(String param)
Sets the name of the parameter used for obtaining the user segment information
from the
HttpServletRequest . |
void |
setWorkspaceIdParam(String param)
Sets the name of the parameter used for obtaining the workspace id information from
the
HttpServletRequest . |
protected String mUserSegmentParam
protected String mDateParam
protected String mUserAgentParam
protected String mWorkspaceIdParam
protected static final String PROFILE_GROUP_PREFIX
public void setUserSegmentsParam(String param)
HttpServletRequest
. Note that the format of the user segments value
must be String
user segment names separated by pipe characters ('|'). For example,
"preferred|standard".
Note that if this class is being used in a production environment, it is highly
recommended that the user segment parameter be removed from the navigation URL by adding
the user segment parameter name to com.endeca.infront.navigation.url.UrlNavigationStateBuilder#setRemoveAlways
.param
- a String
specifying the name of the user segment parameter.
If null, no user segment information will be read from the HttpServletRequest
.parseUserSegments(javax.servlet.http.HttpServletRequest)
public void setDateParam(String param)
HttpServletRequest
. Note that the format of the date value
must be recognizable by UserState.setDateAsString(String)
.
Note that if this class is being used in a production environment, it is highly
recommended that the user segment parameter be removed from the navigation URL by adding
the user segment parameter name to com.endeca.infront.navigation.url.UrlNavigationStateBuilder#setRemoveAlways
.param
- a String
specifying the name of the date parameter.
If null, no date information will be read from the HttpServletRequest
.parseDate(javax.servlet.http.HttpServletRequest)
,
UserState.setDateAsString(String)
public void setUserAgentParam(String param)
HttpServletRequest
. Note that user agent must be properly encoded.
Note that if this class is being used in a production environment, it is highly
recommended that the user agent parameter be removed from the navigation URL by adding
the user agent parameter name to com.endeca.infront.navigation.url.UrlNavigationStateBuilder#setRemoveAlways
.param
- a String
specifying the name of the user agent parameter.
If null, no user agent information will be read from the HttpServletRequest
.parseUserAgent(HttpServletRequest)
public void setWorkspaceIdParam(String param)
HttpServletRequest
. Note that workspaceId must be properly encoded.
Note that if this class is being used in a production/live environment, it is highly recommended that the
workspaceId parameter be removed from the navigation url by adding the workspaceId parameter name
to com.endeca.infront.navigation.url.UrlNavigationStateBuilder#setRemoveAlways
param
- a String
specifying the name of the workspace id parameter.
If null, no workspace id information will be read from the HttpServletRequest
.parseWorkspaceId(HttpServletRequest)
public UserState parseUserState(javax.servlet.http.HttpServletRequest request) throws ContentException
UserState
object by parsing the information present in the
HttpServletRequest
.ContentException
- if the date cannot be parsed into a Date
.public UserState createUserState(javax.servlet.http.HttpServletRequest request) throws ContentException
parseUserState
Returns a UserState
object by parsing the information present in the
HttpServletRequest
.ContentException
- if the date cannot be parsed into a Date
.protected String parseUserSegments(javax.servlet.http.HttpServletRequest request)
setUserSegmentsParam(String)
.protected String parseDate(javax.servlet.http.HttpServletRequest request)
setDateParam(String)
.protected String parseUserAgent(javax.servlet.http.HttpServletRequest request)
setUserAgentParam(String)
.protected String parseWorkspaceId(javax.servlet.http.HttpServletRequest request)
setWorkspaceIdParam(String)
.request
- Copyright © 2015, Oracle and/or its affiliates. All rights reserved.