Class BaseFriendlyURLMapper
- All Implemented Interfaces:
FriendlyURLMapper
- Direct Known Subclasses:
DefaultFriendlyURLMapper
FriendlyURLMapper.
Typically not subclassed directly. DefaultFriendlyURLMapper and a
friendly-url-routes.xml file will handle the needs of most
portlets.
- Author:
- Jorge Ferrer, Brian Wing Shun Chan, Connor McKay
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidAdds a namespaced parameter of any type to the parameter map.protected voidAdds a namespaced string parameter to the parameter map.protected voidAdds a namespaced string parameter to the parameter map.protected voidAdds a default namespaced parameter of any type to the parameter map.protected voidAdds a default namespaced string parameter to the parameter map.protected voidAdds a default namespaced string parameter to the parameter map.Returns the friendly URL mapping for this portlet.protected StringReturns the default namespace.Returns the ID of this portletReturns the router for this friendly URL mappervoidbooleanReturnstrueif the friendly URLs for this mapper should include the friendly URL separator.booleanReturnstrueif this portlet is instanceable.voidsetFriendlyURLRoutes(String friendlyURLRoutes) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.liferay.portal.kernel.portlet.FriendlyURLMapper
buildPath, populateParams
-
Field Details
-
router
-
-
Constructor Details
-
BaseFriendlyURLMapper
public BaseFriendlyURLMapper()
-
-
Method Details
-
getMapping
Description copied from interface:FriendlyURLMapperReturns the friendly URL mapping for this portlet.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- Specified by:
getMappingin interfaceFriendlyURLMapper- Returns:
- the friendly URL mapping for this portlet, not including any leading or trailing slashes
-
getPortletId
Description copied from interface:FriendlyURLMapperReturns the ID of this portlet- Specified by:
getPortletIdin interfaceFriendlyURLMapper- Returns:
- the ID of this portlet, not including the instance ID
-
getRouter
Description copied from interface:FriendlyURLMapperReturns the router for this friendly URL mapper- Specified by:
getRouterin interfaceFriendlyURLMapper- Returns:
- the router, or
nullif one has not been set
-
init
- Specified by:
initin interfaceFriendlyURLMapper
-
isCheckMappingWithPrefix
public boolean isCheckMappingWithPrefix()Description copied from interface:FriendlyURLMapperReturnstrueif 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
PortalImplwhen a friendly URL is processed.It is strongly recommended that this method always return
true.- Specified by:
isCheckMappingWithPrefixin interfaceFriendlyURLMapper- Returns:
trueif the "/-/" separator should be included in friendly URLs, orfalseif only a "/" should be used
-
isPortletInstanceable
public boolean isPortletInstanceable()Description copied from interface:FriendlyURLMapperReturnstrueif 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.
- Specified by:
isPortletInstanceablein interfaceFriendlyURLMapper- Returns:
trueif the portlet is instanceable;falseotherwise
-
setFriendlyURLRoutes
- Specified by:
setFriendlyURLRoutesin interfaceFriendlyURLMapper
-
addParameter
Adds a default namespaced parameter of any type to the parameter map.Do not use this method with an instanceable portlet, it will not properly namespace parameter names.
- Parameters:
parameterMap- the parameter mapname- the name of the parametervalue- the value of the parameter- See Also:
-
addParameter
Adds a default namespaced string parameter to the parameter map.Do not use this method with an instanceable portlet, it will not properly namespace parameter names.
- Parameters:
parameterMap- the parameter mapname- the name of the parametervalue- the value of the parameter- See Also:
-
addParameter
Adds a default namespaced string parameter to the parameter map.Do not use this method with an instanceable portlet, it will not properly namespace parameter names.
- Parameters:
parameterMap- the parameter mapname- the name of the parametervalues- the values of the parameter- See Also:
-
addParameter
protected void addParameter(String namespace, Map<String, String[]> parameterMap, String name, Object value) Adds a namespaced parameter of any type to the parameter map.- Parameters:
namespace- the namespace for portlet parameters. For instanceable portlets this must include the instance ID.parameterMap- the parameter mapname- space the namespace for portlet parameters. For instanceable portlets this must include the instance ID.value- the value of the parameter- See Also:
-
addParameter
protected void addParameter(String namespace, Map<String, String[]> parameterMap, String name, String value) Adds a namespaced string parameter to the parameter map.- Parameters:
namespace- the namespace for portlet parameters. For instanceable portlets this must include the instance ID.parameterMap- the parameter mapname- space the namespace for portlet parameters. For instanceable portlets this must include the instance ID.value- the value of the parameter- See Also:
-
addParameter
protected void addParameter(String namespace, Map<String, String[]> parameterMap, String name, String[] values) Adds a namespaced string parameter to the parameter map.- Parameters:
namespace- the namespace for portlet parameters. For instanceable portlets this must include the instance ID.parameterMap- the parameter mapname- space the namespace for portlet parameters. For instanceable portlets this must include the instance ID.values- the values of the parameter- See Also:
-
getNamespace
Returns the default namespace.Do not use this method with an instanceable portlet, it will not include the instance ID.
- Returns:
- the default namespace, not including the instance ID
- See Also:
-