|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.wicket.protocol.http.request.WebRequestCodingStrategy
public class WebRequestCodingStrategy
Request parameters factory implementation that uses http request parameters and path info to construct the request parameters object.
Nested Class Summary | |
---|---|
static class |
WebRequestCodingStrategy.Settings
Various settings used to configure this strategy |
Field Summary | |
---|---|
static java.lang.String |
BEHAVIOR_ID_PARAMETER_NAME
AJAX query parameter name |
static java.lang.String |
BOOKMARKABLE_PAGE_PARAMETER_NAME
Parameter name used all over the place |
static java.lang.String |
DEFAULT_PAGEMAP_NAME
Url name of the default pagemap When we encode the default pagemap name in a url we cannot always use null or "" because it breaks urls which are encoded with /param1/value1/ eg /product/14/wicket:pageMapName/ split on / will split into {product,14,wicket:pageMapName} |
static java.lang.String |
IGNORE_IF_NOT_ACTIVE_PARAMETER_NAME
Parameter name that tells decode to ignore this request if the page+version encoded in the url is not on top of the stack. |
static java.lang.String |
INTERFACE_PARAMETER_NAME
Name of interface target query parameter |
static java.lang.String |
NAME_SPACE
Name of interface target query parameter |
static java.lang.String |
PAGEMAP
Pagemap parameter constant |
static java.lang.String |
RESOURCES_PATH_PREFIX
The URL path prefix expected for (so called) resources (not html pages). |
Constructor Summary | |
---|---|
WebRequestCodingStrategy()
Construct. |
|
WebRequestCodingStrategy(WebRequestCodingStrategy.Settings settings)
Construct. |
Method Summary | |
---|---|
protected void |
addBookmarkablePageParameters(Request request,
RequestParameters parameters)
Adds bookmarkable page related parameters (page alias and optionally page parameters). |
protected void |
addInterfaceParameters(Request request,
RequestParameters parameters)
Adds page related parameters (path and pagemap and optionally version and interface). |
static void |
addInterfaceParameters(java.lang.String interfaceParameter,
RequestParameters parameters)
Analyzes the passed in interfaceParameter for the relevant parts and puts the parts as parameters in the provided request parameters object. |
protected void |
addResourceParameters(Request request,
RequestParameters parameters)
Adds (shared) resource related parameters (resource key). |
RequestParameters |
decode(Request request)
Analyze the request and create a corresponding request parameters object for it. |
static java.lang.String |
decodePageMapName(java.lang.String pageMapName)
Undoes the effect of encodePageMapName(String) |
protected java.lang.String |
doEncode(RequestCycle requestCycle,
IRequestTarget requestTarget)
In case you are using custom targets that are not part of the default target hierarchy, you need to override this method, which will be called after the defaults have been tried. |
java.lang.CharSequence |
encode(java.lang.CharSequence url)
Returns the given url encoded. |
protected java.lang.CharSequence |
encode(RequestCycle requestCycle,
IBookmarkablePageRequestTarget requestTarget)
Encode a page class target. |
protected java.lang.CharSequence |
encode(RequestCycle requestCycle,
IListenerInterfaceRequestTarget requestTarget)
Encode a listener interface target. |
protected java.lang.CharSequence |
encode(RequestCycle requestCycle,
IPageRequestTarget requestTarget)
Encode a page target. |
java.lang.CharSequence |
encode(RequestCycle requestCycle,
IRequestTarget requestTarget)
Encode the given request target. |
protected java.lang.CharSequence |
encode(RequestCycle requestCycle,
ISharedResourceRequestTarget requestTarget)
Encode a shared resource target. |
static java.lang.String |
encodePageMapName(java.lang.String pageMapName)
Makes page map name url safe. |
protected IRequestTargetUrlCodingStrategy |
getMountEncoder(IRequestTarget requestTarget)
Gets the mount encoder for the given request target if any. |
protected java.lang.String |
getRequestPath(Request request)
Gets the request info path. |
IRequestTargetUrlCodingStrategy[] |
listMounts()
List the mounts that are known to the implementing mounter. |
void |
mount(IRequestTargetUrlCodingStrategy encoder)
Mounts a request target with the given path. |
java.lang.CharSequence |
pathForTarget(IRequestTarget requestTarget)
Gets the url that the provided request target conforms to. |
IRequestTarget |
targetForRequest(RequestParameters requestParameters)
Gets the request target that conforms to the given request parameters. |
void |
unmount(java.lang.String path)
Unmounts a request target. |
IRequestTargetUrlCodingStrategy |
urlCodingStrategyForPath(java.lang.String path)
Gets the encoder that was mounted on the provided path if any. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String NAME_SPACE
public static final java.lang.String INTERFACE_PARAMETER_NAME
public static final java.lang.String BEHAVIOR_ID_PARAMETER_NAME
public static final java.lang.String BOOKMARKABLE_PAGE_PARAMETER_NAME
public static final java.lang.String PAGEMAP
public static final java.lang.String DEFAULT_PAGEMAP_NAME
public static final java.lang.String RESOURCES_PATH_PREFIX
public static final java.lang.String IGNORE_IF_NOT_ACTIVE_PARAMETER_NAME
Constructor Detail |
---|
public WebRequestCodingStrategy()
public WebRequestCodingStrategy(WebRequestCodingStrategy.Settings settings)
settings
- Method Detail |
---|
public final RequestParameters decode(Request request)
IRequestCodingStrategy
decode
in interface IRequestCodingStrategy
request
- the incoming request
IRequestCodingStrategy.decode(org.apache.wicket.Request)
public final java.lang.CharSequence encode(RequestCycle requestCycle, IRequestTarget requestTarget)
doEncode(RequestCycle, IRequestTarget)
, which will be called after the defaults have
been tried. When that doesn't provide a url either, an exception will be thrown saying that
encoding could not be done.
encode
in interface IRequestCodingStrategy
requestCycle
- the current request cycle (for efficient access)requestTarget
- the request target
IRequestCodingStrategy.encode(org.apache.wicket.RequestCycle,
org.apache.wicket.IRequestTarget)
public java.lang.CharSequence encode(java.lang.CharSequence url)
url
- The URL to encode
public IRequestTargetUrlCodingStrategy[] listMounts()
IRequestTargetMountsInfo
listMounts
in interface IRequestTargetMountsInfo
IRequestTargetMountsInfo.listMounts()
public IRequestTargetUrlCodingStrategy urlCodingStrategyForPath(java.lang.String path)
IRequestTargetMounter
urlCodingStrategyForPath
in interface IRequestTargetMounter
path
- the path
IRequestTargetMounter.urlCodingStrategyForPath(java.lang.String)
public final void mount(IRequestTargetUrlCodingStrategy encoder)
IRequestTargetMounter
mount
in interface IRequestTargetMounter
encoder
- The strategy to use for encoding and decoding urlsIRequestTargetMounter.mount(org.apache.wicket.request.target.coding.IRequestTargetUrlCodingStrategy)
public final java.lang.CharSequence pathForTarget(IRequestTarget requestTarget)
IRequestTargetMounter
pathForTarget
in interface IRequestTargetMounter
requestTarget
- the request target
IRequestTargetMounter.pathForTarget(org.apache.wicket.IRequestTarget)
public final IRequestTarget targetForRequest(RequestParameters requestParameters)
IRequestTargetMounter
targetForRequest
in interface IRequestTargetMounter
requestParameters
- the request parameters
IRequestTargetMounter.targetForRequest(org.apache.wicket.request.RequestParameters)
public final void unmount(java.lang.String path)
IRequestTargetMounter
unmount
in interface IRequestTargetMounter
path
- the path to unmountIRequestTargetMounter.unmount(java.lang.String)
protected void addBookmarkablePageParameters(Request request, RequestParameters parameters)
encode(RequestCycle, IBookmarkablePageRequestTarget)
should also be overridden to be
in sync with that behavior.
request
- the incoming requestparameters
- the parameters object to set the found values onprotected void addInterfaceParameters(Request request, RequestParameters parameters)
encode(RequestCycle, IListenerInterfaceRequestTarget)
should be overridden to be in
sync with that behavior.
request
- the incoming requestparameters
- the parameters object to set the found values onpublic static void addInterfaceParameters(java.lang.String interfaceParameter, RequestParameters parameters)
interfaceParameter
- The format of the interfaceParameter is:
page-map-name:path:version:interface:behaviourId:urlDepth
parameters
- parameters object to set the found parts inprotected void addResourceParameters(Request request, RequestParameters parameters)
encode(RequestCycle, ISharedResourceRequestTarget)
should be overridden to be in
sync with that behavior.
request
- the incoming requestparameters
- the parameters object to set the found values onprotected java.lang.String doEncode(RequestCycle requestCycle, IRequestTarget requestTarget)
requestCycle
- the current request cycle (for efficient access)requestTarget
- the request target
protected java.lang.CharSequence encode(RequestCycle requestCycle, IBookmarkablePageRequestTarget requestTarget)
addBookmarkablePageParameters(Request, RequestParameters)
should be overridden to be
in sync with that behavior.
requestCycle
- the current request cyclerequestTarget
- the target to encode
protected java.lang.CharSequence encode(RequestCycle requestCycle, ISharedResourceRequestTarget requestTarget)
addResourceParameters(Request, RequestParameters)
should be overridden to be in sync
with that behavior.
requestCycle
- the current request cyclerequestTarget
- the target to encode
protected java.lang.CharSequence encode(RequestCycle requestCycle, IListenerInterfaceRequestTarget requestTarget)
addInterfaceParameters(Request, RequestParameters)
should be overridden to be in
sync with that behavior.
requestCycle
- the current request cyclerequestTarget
- the target to encode
protected java.lang.CharSequence encode(RequestCycle requestCycle, IPageRequestTarget requestTarget)
requestCycle
- the current request cyclerequestTarget
- the target to encode
protected IRequestTargetUrlCodingStrategy getMountEncoder(IRequestTarget requestTarget)
requestTarget
- the request target to match
protected java.lang.String getRequestPath(Request request)
Request.getPath()
.
request
- the request
public static final java.lang.String encodePageMapName(java.lang.String pageMapName)
pageMapName
passed in
is not null it is returned without modification.
pageMapName
- page map name
public static java.lang.String decodePageMapName(java.lang.String pageMapName)
encodePageMapName(String)
pageMapName
- page map name
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |