|
Liferay 6.0-ee | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface FriendlyURLMapper
Provides friendly URL mapping for a portlet by converting portlet URL parameters to friendly URL paths and back.
Never implement this interface directly, subclass BaseFriendlyURLMapper
to ensure forward compatibility.
BaseFriendlyURLMapper
,
DefaultFriendlyURLMapper
,
PortletURLImpl
Method Summary | |
---|---|
String |
buildPath(LiferayPortletURL liferayPortletURL)
Generates a friendly URL path from the portlet URL object. |
String |
getMapping()
Gets the friendly URL mapping for this portlet. |
String |
getPortletId()
Gets the id of this portlet |
Router |
getRouter()
Gets the router for this friendly URL mapper |
boolean |
isCheckMappingWithPrefix()
Determines if the friendly URLs for this mapper should include the friendly URL separator. |
boolean |
isPortletInstanceable()
Determines if this portlet is instanceable. |
void |
populateParams(String friendlyURLPath,
Map<String,String[]> parameterMap,
Map<String,Object> requestContext)
Populates the parameter map with values parsed from the friendly URL path. |
void |
setMapping(String mapping)
Sets the friendly URL mapping for this portlet. |
void |
setPortletId(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. |
Method Detail |
---|
String buildPath(LiferayPortletURL liferayPortletURL)
liferayPortletURL
- the portlet URL object to generate a friendly
URL for
null
if one cannot be
built. Returning null
will cause a normal portlet
URL to be generated.String getMapping()
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
String getPortletId()
Router getRouter()
null
if one has not been setboolean isCheckMappingWithPrefix()
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
.
true
if the "/-/" separator should be
included in friendly URLs, or false
if only a
"/" should be usedboolean isPortletInstanceable()
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.
true
if the portlet is instanceable;
false
otherwisevoid populateParams(String friendlyURLPath, Map<String,String[]> parameterMap, Map<String,Object> requestContext)
This method is called by PortalImpl
when
a friendly URL is processed.
friendlyURLPath
- the friendly URL path to parse, including a
leading slash and the friendly URL mapping. For example:
/blogs/example-post
parameterMap
- the parameter map to populate. Entries added to this
map must be namespaced.requestContext
- the request contextBaseFriendlyURLMapper.addParameter(Map, String, String)
,
BaseFriendlyURLMapper.addParameter(String, Map, String, String)
void setMapping(String mapping)
This method is automatically called by PortletBagFactory
with the friendly URL mapping
defined in liferay-portlet.xml
.
mapping
- the friendly URL mapping for this portletvoid setPortletId(String portletId)
This method is automatically called by PortletBagFactory
with the portlet id defined in
liferay-portlet.xml
.
portletId
- the id of this portlet.void setPortletInstanceable(boolean portletInstanceable)
portletInstanceable
- whether this portlet is instanceablevoid setRouter(Router router)
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.
router
- the router for this friendly URL mapper
|
Liferay 6.0-ee | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |