Class LiferayPortletURLWrapper

All Implemented Interfaces:
LiferayPortletURL, Serializable, BaseURL, Mutable, MutableRenderState, PortletURL, RenderState, ResourceURL

public class LiferayPortletURLWrapper extends PortletURLWrapper implements LiferayPortletURL
Author:
Neil Griffin
See Also:
  • Constructor Details

    • LiferayPortletURLWrapper

      public LiferayPortletURLWrapper(LiferayPortletURL liferayPortletURL)
  • Method Details

    • addParameterIncludedInPath

      public void addParameterIncludedInPath(String name)
      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 interface LiferayPortletURL
      Parameters:
      name - the name of the parameter
    • getCacheability

      public String getCacheability()
      Specified by:
      getCacheability in interface ResourceURL
    • getLifecycle

      public String getLifecycle()
      Description copied from interface: LiferayPortletURL
      Returns the portlet lifecycle of this URL's target portlet.
      Specified by:
      getLifecycle in interface LiferayPortletURL
      Returns:
      the portlet lifecycle of this URL's target portlet
      See Also:
    • getParameter

      public String getParameter(String name)
      Specified by:
      getParameter in interface LiferayPortletURL
      Parameters:
      name - the name of the URL parameter
      Returns:
      the first value of the URL parameter
    • getParametersIncludedInPath

      public Set<String> 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 interface LiferayPortletURL
      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 interface LiferayPortletURL
    • getPortletId

      public String getPortletId()
      Description copied from interface: LiferayPortletURL
      Returns the ID of this URL's target portlet.
      Specified by:
      getPortletId in interface LiferayPortletURL
      Returns:
      the ID of this URL's target portlet
    • getRemovedParameterNames

      public Set<String> getRemovedParameterNames()
      Specified by:
      getRemovedParameterNames in interface LiferayPortletURL
    • getResourceID

      public String getResourceID()
      Description copied from interface: LiferayPortletURL
      Returns the ID of this URL's target resource.
      Specified by:
      getResourceID in interface LiferayPortletURL
      Specified by:
      getResourceID in interface ResourceURL
      Returns:
      the ID of this URL's target resource
    • getResourceParameters

      public MutableResourceParameters getResourceParameters()
      Specified by:
      getResourceParameters in interface ResourceURL
    • getWrapped

      public LiferayPortletURL getWrapped()
      Overrides:
      getWrapped in class PortletURLWrapper
    • isAnchor

      public boolean isAnchor()
      Description copied from interface: LiferayPortletURL
      Returns true if this URL is an anchor pointing to the specified portlet on the page.
      Specified by:
      isAnchor in interface LiferayPortletURL
      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
      Returns true if the render parameters in the current request should be copied to this URL.
      Specified by:
      isCopyCurrentRenderParameters in interface LiferayPortletURL
      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
      Returns true if this URL should be encrypted.
      Specified by:
      isEncrypt in interface LiferayPortletURL
      Returns:
      true if this URL should be encrypted; false otherwise
      See Also:
    • isEscapeXml

      public boolean isEscapeXml()
      Description copied from interface: LiferayPortletURL
      Returns true if this URL should be XML escaped.
      Specified by:
      isEscapeXml in interface LiferayPortletURL
      Returns:
      true if this URL should be XML escaped; false otherwise
      See Also:
    • isParameterIncludedInPath

      public boolean isParameterIncludedInPath(String name)
      Description copied from interface: LiferayPortletURL
      Returns true if the parameter is included in the friendly URL path.
      Specified by:
      isParameterIncludedInPath in interface LiferayPortletURL
      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
      Returns true if this URL is secure (https).
      Specified by:
      isSecure in interface LiferayPortletURL
      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 interface LiferayPortletURL
      Parameters:
      anchor - whether this URL is an anchor pointing to the specified portlet on the page
    • setCacheability

      public void setCacheability(String cacheability)
      Specified by:
      setCacheability in interface ResourceURL
    • 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 interface LiferayPortletURL
      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 interface LiferayPortletURL
    • 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 interface LiferayPortletURL
      Parameters:
      doAsUserId - the ID of the user to impersonate in the portlet this URL points to
    • setDoAsUserLanguageId

      public void setDoAsUserLanguageId(String doAsUserLanguageId)
      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 via LiferayPortletURL.setDoAsUserId(long).

      The language set here will override the impersonated user's default language.

      Specified by:
      setDoAsUserLanguageId in interface LiferayPortletURL
      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 interface LiferayPortletURL
    • 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 interface LiferayPortletURL
      Parameters:
      escapeXml - whether this URL should be XML escaped
    • setLifecycle

      public void setLifecycle(String lifecycle)
      Description copied from interface: LiferayPortletURL
      Sets the portlet lifecycle of this URL's target portlet.

      Valid lifecycles are:

      Specified by:
      setLifecycle in interface LiferayPortletURL
      Parameters:
      lifecycle - the portlet lifecycle
    • setParameter

      public void setParameter(String name, String value, boolean append)
      Specified by:
      setParameter in interface LiferayPortletURL
      Parameters:
      name - the name of the URL parameter
      value - the value of the URL parameter
      append - whether the new value should be appended to any existing values for the parameter. If append is false any existing values will be overwritten with the new value.
    • setParameter

      public void setParameter(String name, String[] values, boolean append)
      Specified by:
      setParameter in interface LiferayPortletURL
      Parameters:
      name - the name of the URL parameter
      values - the values of the URL parameter
      append - whether the new values should be appended to any existing values for the parameter. If append is false 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 interface LiferayPortletURL
      Parameters:
      plid - the portlet layout ID
    • setPortletId

      public void setPortletId(String portletId)
      Description copied from interface: LiferayPortletURL
      Sets the ID of the target portlet.
      Specified by:
      setPortletId in interface LiferayPortletURL
    • setRefererGroupId

      public void setRefererGroupId(long refererGroupId)
      Specified by:
      setRefererGroupId in interface LiferayPortletURL
    • setRefererPlid

      public void setRefererPlid(long refererPlid)
      Description copied from interface: LiferayPortletURL
      Sets the referer layout ID.
      Specified by:
      setRefererPlid in interface LiferayPortletURL
      Parameters:
      refererPlid - the referer layout ID
    • setRemovedParameterNames

      public void setRemovedParameterNames(Set<String> removedParamNames)
      Specified by:
      setRemovedParameterNames in interface LiferayPortletURL
    • setResourceID

      public void setResourceID(String resourceID)
      Specified by:
      setResourceID in interface ResourceURL
    • 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 interface LiferayPortletURL
      Parameters:
      windowStateRestoreCurrentView - whether this portlet restores to the current view when toggling between maximized and normal states
    • visitReservedParameters

      public void visitReservedParameters(BiConsumer<String,String> biConsumer)
      Specified by:
      visitReservedParameters in interface LiferayPortletURL