Class LiferayPortletURLWrapper
- All Implemented Interfaces:
LiferayPortletURL
,Serializable
,BaseURL
,Mutable
,MutableRenderState
,PortletURL
,RenderState
,ResourceURL
- Author:
- Neil Griffin
- See Also:
-
Field Summary
Fields inherited from class javax.portlet.filter.RenderStateWrapper
wrapped
Fields inherited from interface javax.portlet.ResourceURL
FULL, PAGE, PORTLET, SHARED
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a parameter that is included in the friendly URL path and does not need to appear in the query string.Returns the portlet lifecycle of this URL's target portlet.getParameter
(String name) Returns the parameters that are included in the friendly URL path and do not need to appear in the query string.long
getPlid()
Returns the ID of this URL's target portlet.Returns the ID of this URL's target resource.boolean
isAnchor()
Returnstrue
if this URL is an anchor pointing to the specified portlet on the page.boolean
Returnstrue
if the render parameters in the current request should be copied to this URL.boolean
Returnstrue
if this URL should be encrypted.boolean
Returnstrue
if this URL should be XML escaped.boolean
Returnstrue
if the parameter is included in the friendly URL path.boolean
isSecure()
Returnstrue
if this URL is secure (https).void
setAnchor
(boolean anchor) Sets whether this URL is an anchor pointing to the specified portlet on the page.void
setCacheability
(String cacheability) void
setCopyCurrentRenderParameters
(boolean copyCurrentRenderParameters) Sets whether the render parameters in the current request should be copied to this URL.void
setDoAsGroupId
(long doAsGroupId) void
setDoAsUserId
(long doAsUserId) Sets the ID of the user to impersonate.void
setDoAsUserLanguageId
(String doAsUserLanguageId) Sets the language ID of the user to impersonate.void
setEncrypt
(boolean encrypt) Sets whether this URL should be encrypted.void
setEscapeXml
(boolean escapeXml) Sets whether this URL should be XML escaped.void
setLifecycle
(String lifecycle) Sets the portlet lifecycle of this URL's target portlet.void
setParameter
(String name, String[] values, boolean append) void
setParameter
(String name, String value, boolean append) void
setPlid
(long plid) Sets the portlet layout ID.void
setPortletId
(String portletId) Sets the ID of the target portlet.void
setRefererGroupId
(long refererGroupId) void
setRefererPlid
(long refererPlid) Sets the referer layout ID.void
setRemovedParameterNames
(Set<String> removedParamNames) void
setResourceID
(String resourceID) void
setWindowStateRestoreCurrentView
(boolean windowStateRestoreCurrentView) Sets whether this portlet restores to the current view when toggling between maximized and normal states.void
visitReservedParameters
(BiConsumer<String, String> biConsumer) Methods inherited from class javax.portlet.filter.PortletURLWrapper
getRenderParameters, removePublicRenderParameter, setBeanParameter, setPortletMode, setWindowState, setWrapped
Methods inherited from class javax.portlet.filter.BaseURLWrapper
addProperty, append, append, getParameterMap, setParameter, setParameter, setParameters, setProperty, setSecure, setWrapped, toString, write, write
Methods inherited from class javax.portlet.filter.RenderStateWrapper
getPortletMode, getWindowState, setWrapped
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface javax.portlet.BaseURL
addProperty, append, append, getParameterMap, setParameter, setParameter, setParameters, setProperty, setSecure, toString, write, write
Methods inherited from interface javax.portlet.MutableRenderState
getRenderParameters, setPortletMode, setWindowState
Methods inherited from interface javax.portlet.PortletURL
removePublicRenderParameter, setBeanParameter
Methods inherited from interface javax.portlet.RenderState
getPortletMode, getWindowState
-
Constructor Details
-
LiferayPortletURLWrapper
-
-
Method Details
-
addParameterIncludedInPath
Description copied from interface:LiferayPortletURL
Adds a parameter that is included in the friendly URL path and does not need to appear in the query string.- Specified by:
addParameterIncludedInPath
in interfaceLiferayPortletURL
- Parameters:
name
- the name of the parameter
-
getCacheability
- Specified by:
getCacheability
in interfaceResourceURL
-
getLifecycle
Description copied from interface:LiferayPortletURL
Returns the portlet lifecycle of this URL's target portlet.- Specified by:
getLifecycle
in interfaceLiferayPortletURL
- Returns:
- the portlet lifecycle of this URL's target portlet
- See Also:
-
getParameter
- Specified by:
getParameter
in interfaceLiferayPortletURL
- Parameters:
name
- the name of the URL parameter- Returns:
- the first value of the URL parameter
-
getParametersIncludedInPath
Description copied from interface:LiferayPortletURL
Returns the parameters that are included in the friendly URL path and do not need to appear in the query string.- Specified by:
getParametersIncludedInPath
in interfaceLiferayPortletURL
- Returns:
- the names of the parameters that are included in the friendly URL path and do not need to appear in the query string
-
getPlid
public long getPlid()- Specified by:
getPlid
in interfaceLiferayPortletURL
-
getPortletId
Description copied from interface:LiferayPortletURL
Returns the ID of this URL's target portlet.- Specified by:
getPortletId
in interfaceLiferayPortletURL
- Returns:
- the ID of this URL's target portlet
-
getRemovedParameterNames
- Specified by:
getRemovedParameterNames
in interfaceLiferayPortletURL
-
getResourceID
Description copied from interface:LiferayPortletURL
Returns the ID of this URL's target resource.- Specified by:
getResourceID
in interfaceLiferayPortletURL
- Specified by:
getResourceID
in interfaceResourceURL
- Returns:
- the ID of this URL's target resource
-
getResourceParameters
- Specified by:
getResourceParameters
in interfaceResourceURL
-
getWrapped
- Overrides:
getWrapped
in classPortletURLWrapper
-
isAnchor
public boolean isAnchor()Description copied from interface:LiferayPortletURL
Returnstrue
if this URL is an anchor pointing to the specified portlet on the page.- Specified by:
isAnchor
in interfaceLiferayPortletURL
- Returns:
- whether this URL is an anchor pointing to the specified portlet on the page
- See Also:
-
isCopyCurrentRenderParameters
public boolean isCopyCurrentRenderParameters()Description copied from interface:LiferayPortletURL
Returnstrue
if the render parameters in the current request should be copied to this URL.- Specified by:
isCopyCurrentRenderParameters
in interfaceLiferayPortletURL
- Returns:
- whether the render parameters in the current request should be copied to this URL
- See Also:
-
isEncrypt
public boolean isEncrypt()Description copied from interface:LiferayPortletURL
Returnstrue
if this URL should be encrypted.- Specified by:
isEncrypt
in interfaceLiferayPortletURL
- Returns:
true
if this URL should be encrypted;false
otherwise- See Also:
-
isEscapeXml
public boolean isEscapeXml()Description copied from interface:LiferayPortletURL
Returnstrue
if this URL should be XML escaped.- Specified by:
isEscapeXml
in interfaceLiferayPortletURL
- Returns:
true
if this URL should be XML escaped;false
otherwise- See Also:
-
isParameterIncludedInPath
Description copied from interface:LiferayPortletURL
Returnstrue
if the parameter is included in the friendly URL path.- Specified by:
isParameterIncludedInPath
in interfaceLiferayPortletURL
- Parameters:
name
- the name of the parameter to check for inclusion in the path- Returns:
- whether the parameter is included in the friendly URL path
- See Also:
-
isSecure
public boolean isSecure()Description copied from interface:LiferayPortletURL
Returnstrue
if this URL is secure (https).- Specified by:
isSecure
in interfaceLiferayPortletURL
- Returns:
true
if this URL is secure;false
otherwise
-
setAnchor
public void setAnchor(boolean anchor) Description copied from interface:LiferayPortletURL
Sets whether this URL is an anchor pointing to the specified portlet on the page.An anchor URL will cause the user's browser to automatically jump down to the specified portlet after the page loads, avoiding the need to scroll.
- Specified by:
setAnchor
in interfaceLiferayPortletURL
- Parameters:
anchor
- whether this URL is an anchor pointing to the specified portlet on the page
-
setCacheability
- Specified by:
setCacheability
in interfaceResourceURL
-
setCopyCurrentRenderParameters
public void setCopyCurrentRenderParameters(boolean copyCurrentRenderParameters) Description copied from interface:LiferayPortletURL
Sets whether the render parameters in the current request should be copied to this URL.New parameters set on this URL will appear before the copied render parameters.
- Specified by:
setCopyCurrentRenderParameters
in interfaceLiferayPortletURL
- Parameters:
copyCurrentRenderParameters
- whether the render parameters in the current request should be copied to this URL
-
setDoAsGroupId
public void setDoAsGroupId(long doAsGroupId) - Specified by:
setDoAsGroupId
in interfaceLiferayPortletURL
-
setDoAsUserId
public void setDoAsUserId(long doAsUserId) Description copied from interface:LiferayPortletURL
Sets the ID of the user to impersonate.When a page is accessed while impersonating a user, it will appear exactly as it would to that user.
- Specified by:
setDoAsUserId
in interfaceLiferayPortletURL
- Parameters:
doAsUserId
- the ID of the user to impersonate in the portlet this URL points to
-
setDoAsUserLanguageId
Description copied from interface:LiferayPortletURL
Sets the language ID of the user to impersonate. This will only have an effect when a user is being impersonated viaLiferayPortletURL.setDoAsUserId(long)
.The language set here will override the impersonated user's default language.
- Specified by:
setDoAsUserLanguageId
in interfaceLiferayPortletURL
- Parameters:
doAsUserLanguageId
- the language ID of the user to impersonate
-
setEncrypt
public void setEncrypt(boolean encrypt) Description copied from interface:LiferayPortletURL
Sets whether this URL should be encrypted.In an encrypted URL, the value of every parameter will be encrypted using the company's key. This allows sensitive information to be placed in the URL without being vulnerable to snooping.
Note that this is not the same as making a URL
secure
.- Specified by:
setEncrypt
in interfaceLiferayPortletURL
-
setEscapeXml
public void setEscapeXml(boolean escapeXml) Description copied from interface:LiferayPortletURL
Sets whether this URL should be XML escaped.If a URL is XML escaped, it will automatically have special characters escaped when it is converted to a string or written to a
Writer
.- Specified by:
setEscapeXml
in interfaceLiferayPortletURL
- Parameters:
escapeXml
- whether this URL should be XML escaped
-
setLifecycle
Description copied from interface:LiferayPortletURL
Sets the portlet lifecycle of this URL's target portlet.Valid lifecycles are:
- Specified by:
setLifecycle
in interfaceLiferayPortletURL
- Parameters:
lifecycle
- the portlet lifecycle
-
setParameter
- Specified by:
setParameter
in interfaceLiferayPortletURL
- Parameters:
name
- the name of the URL parametervalue
- the value of the URL parameterappend
- whether the new value should be appended to any existing values for the parameter. Ifappend
isfalse
any existing values will be overwritten with the new value.
-
setParameter
- Specified by:
setParameter
in interfaceLiferayPortletURL
- Parameters:
name
- the name of the URL parametervalues
- the values of the URL parameterappend
- whether the new values should be appended to any existing values for the parameter. Ifappend
isfalse
any existing values will be overwritten with the new values.
-
setPlid
public void setPlid(long plid) Description copied from interface:LiferayPortletURL
Sets the portlet layout ID.- Specified by:
setPlid
in interfaceLiferayPortletURL
- Parameters:
plid
- the portlet layout ID
-
setPortletId
Description copied from interface:LiferayPortletURL
Sets the ID of the target portlet.- Specified by:
setPortletId
in interfaceLiferayPortletURL
-
setRefererGroupId
public void setRefererGroupId(long refererGroupId) - Specified by:
setRefererGroupId
in interfaceLiferayPortletURL
-
setRefererPlid
public void setRefererPlid(long refererPlid) Description copied from interface:LiferayPortletURL
Sets the referer layout ID.- Specified by:
setRefererPlid
in interfaceLiferayPortletURL
- Parameters:
refererPlid
- the referer layout ID
-
setRemovedParameterNames
- Specified by:
setRemovedParameterNames
in interfaceLiferayPortletURL
-
setResourceID
- Specified by:
setResourceID
in interfaceResourceURL
-
setWindowStateRestoreCurrentView
public void setWindowStateRestoreCurrentView(boolean windowStateRestoreCurrentView) Description copied from interface:LiferayPortletURL
Sets whether this portlet restores to the current view when toggling between maximized and normal states.- Specified by:
setWindowStateRestoreCurrentView
in interfaceLiferayPortletURL
- Parameters:
windowStateRestoreCurrentView
- whether this portlet restores to the current view when toggling between maximized and normal states
-
visitReservedParameters
- Specified by:
visitReservedParameters
in interfaceLiferayPortletURL
-