public class WAIFriendlyURLMapper extends java.lang.Object implements FriendlyURLMapper
| Constructor and Description |
|---|
WAIFriendlyURLMapper() |
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
buildPath(LiferayPortletURL liferayPortletURL)
Generates a friendly URL path from the portlet URL object.
|
java.lang.String |
getMapping()
Returns the friendly URL mapping for this portlet.
|
java.lang.String |
getPortletId()
Returns the ID of this portlet
|
Router |
getRouter()
Returns the router for this friendly URL mapper
|
protected boolean |
hasBinaryExtension(java.lang.String friendlyURLPath) |
boolean |
isCheckMappingWithPrefix()
Returns
true if the friendly URLs for this mapper should
include the friendly URL separator. |
boolean |
isPortletInstanceable()
Returns
true if this portlet is instanceable. |
void |
populateParams(java.lang.String friendlyURLPath,
java.util.Map<java.lang.String,java.lang.String[]> parameterMap,
java.util.Map<java.lang.String,java.lang.Object> requestContext)
Populates the parameter map with values parsed from the friendly URL
path.
|
void |
setMapping(java.lang.String mapping)
Sets the friendly URL mapping for this portlet.
|
void |
setPortletId(java.lang.String portletId)
Sets the ID of this portlet.
|
void |
setPortletInstanceable(boolean portletInstanceable)
Sets whether this portlet is instanceable.
|
void |
setRouter(Router router)
Sets the router for this friendly URL mapper.
|
protected Router router
public java.lang.String buildPath(LiferayPortletURL liferayPortletURL)
FriendlyURLMapperbuildPath in interface FriendlyURLMapperliferayPortletURL - the portlet URL object to generate a friendly
URL fornull if one cannot be
built. Returning null will cause a normal portlet
URL to be generated.public java.lang.String getMapping()
FriendlyURLMapper
The friendly URL mapping is used by Liferay to identify the portlet a
friendly URL refers to. It generally appears directly after the
/-/ in the URL.
For instance, the blogs portlet mapping is "blogs". This
produces friendly URLs similar to
http://www.liferay.com/web/guest/blog/-/blogs/example-post
getMapping in interface FriendlyURLMapperpublic java.lang.String getPortletId()
FriendlyURLMappergetPortletId in interface FriendlyURLMapperpublic Router getRouter()
FriendlyURLMappergetRouter in interface FriendlyURLMappernull if one has not been setpublic boolean isCheckMappingWithPrefix()
FriendlyURLMappertrue if the friendly URLs for this mapper should
include the friendly URL separator.
Typically, friendly URLs will include the separator "/-/"
before the friendly URL mapping. If this method returns
false, a single slash will be used instead.
This method is called by PortalImpl when
a friendly URL is processed.
It is strongly recommended that this method always return
true.
isCheckMappingWithPrefix in interface FriendlyURLMappertrue if the "/-/" separator should be
included in friendly URLs, or false if only a
"/" should be usedpublic boolean isPortletInstanceable()
FriendlyURLMappertrue if this portlet is instanceable.
The value returned from this method has no effect on whether a portlet is instanceable, it is a helper method used to determine if the instance ID should be included in the URL.
isPortletInstanceable in interface FriendlyURLMappertrue if the portlet is instanceable;
false otherwisepublic void populateParams(java.lang.String friendlyURLPath,
java.util.Map<java.lang.String,java.lang.String[]> parameterMap,
java.util.Map<java.lang.String,java.lang.Object> requestContext)
FriendlyURLMapper
This method is called by PortalImpl when
a friendly URL is processed.
populateParams in interface FriendlyURLMapperfriendlyURLPath - the friendly URL path, including a leading slash
and the friendly URL mapping. For example:
/blogs/example-postparameterMap - the parameter map. Entries added to this map must be
namespaced.requestContext - the request contextBaseFriendlyURLMapper.addParameter(Map, String, String),
BaseFriendlyURLMapper.addParameter(String, Map, String, String)public void setMapping(java.lang.String mapping)
FriendlyURLMapper
This method is automatically called by PortletBagFactory with the friendly URL mapping
defined in liferay-portlet.xml.
setMapping in interface FriendlyURLMappermapping - the friendly URL mapping for this portletpublic void setPortletId(java.lang.String portletId)
FriendlyURLMapper
This method is automatically called by PortletBagFactory with the portlet ID defined in
liferay-portlet.xml.
setPortletId in interface FriendlyURLMapperportletId - the ID of this portlet.public void setPortletInstanceable(boolean portletInstanceable)
FriendlyURLMappersetPortletInstanceable in interface FriendlyURLMapperportletInstanceable - whether this portlet is instanceablepublic void setRouter(Router router)
FriendlyURLMapper
This method is automatically called by PortletBagFactory with a router populated with the
routes defined in this portlet's friendly-url-routes.xml file. The location of this file is defined
in this portlet's liferay-portlet.xml file.
setRouter in interface FriendlyURLMapperrouter - the router for this friendly URL mapperprotected boolean hasBinaryExtension(java.lang.String friendlyURLPath)