Liferay 6.0.5

com.liferay.portlet
Class PortletURLImpl

java.lang.Object
  extended by com.liferay.portlet.PortletURLImpl
All Implemented Interfaces:
LiferayPortletURL, Serializable, BaseURL, PortletURL, ResourceURL
Direct Known Subclasses:
PortletURLImplWrapper

public class PortletURLImpl
extends Object
implements LiferayPortletURL, PortletURL, ResourceURL, Serializable

See Also:
Serialized Form

Field Summary
 
Fields inherited from interface javax.portlet.ResourceURL
FULL, PAGE, PORTLET, SHARED
 
Constructor Summary
PortletURLImpl(javax.servlet.http.HttpServletRequest request, String portletId, long plid, String lifecycle)
           
PortletURLImpl(PortletRequestImpl portletRequestImpl, String portletId, long plid, String lifecycle)
           
 
Method Summary
 void addParameterIncludedInPath(String name)
          Adds a parameter that is included in the friendly URL path and does not need to appear in the query string.
protected  void addPortalAuthToken(StringBundler sb, Key key)
           
protected  void addPortletAuthToken(StringBundler sb, Key key)
           
 void addProperty(String key, String value)
           
protected  void clearCache()
           
protected  String generateToString()
           
protected  String generateWSRPToString()
           
 String getCacheability()
           
 javax.servlet.http.HttpServletRequest getHttpServletRequest()
           
 Layout getLayout()
           
 String getLayoutFriendlyURL()
           
 String getLifecycle()
          Gets the lifecycle of the portlet this URL points to.
 String getNamespace()
           
 String getParameter(String name)
          Gets the first value of the URL parameter.
 Map<String,String[]> getParameterMap()
           
 Set<String> getParametersIncludedInPath()
           
 long getPlid()
           
 Portlet getPortlet()
           
 String getPortletFriendlyURLPath()
           
 String getPortletId()
          Gets the id of the portlet this URL points to.
 PortletMode getPortletMode()
           
 PortletRequest getPortletRequest()
           
 Map<String,String> getReservedParameterMap()
          Gets the map of reserved parameters for this URL.
 String getResourceID()
          Gets the id of the resource this URL points to.
 WindowState getWindowState()
           
 boolean isAnchor()
          Determines whether this URL is an anchor pointing to the specified portlet on the page.
protected  boolean isBlankValue(String[] value)
           
 boolean isCopyCurrentPublicRenderParameters()
           
 boolean isCopyCurrentRenderParameters()
          Determines whether the render parameters in the current request should be copied to this URL.
 boolean isEncrypt()
          Determines whether this URL should be encrypted.
 boolean isEscapeXml()
          Determines whether this URL should be XML escaped.
 boolean isParameterIncludedInPath(String name)
          Determines whether the parameter is included in the friendly URL path.
 boolean isSecure()
          Determines whether this URL is secure (https).
protected  String processValue(Key key, int value)
           
protected  String processValue(Key key, long value)
           
protected  String processValue(Key key, String value)
           
 void removePublicRenderParameter(String name)
           
 void setAnchor(boolean anchor)
          Sets whether this URL is an anchor pointing to the specified portlet on the page.
 void setCacheability(String cacheability)
           
 void setCopyCurrentPublicRenderParameters(boolean copyCurrentPublicRenderParameters)
           
 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)
           
 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 lifecycle of the portlet this URL points to.
 void setParameter(String name, String value)
           
 void setParameter(String name, String[] values)
           
 void setParameter(String name, String[] values, boolean append)
          Sets the URL parameter the values.
 void setParameter(String name, String value, boolean append)
          Sets the URL parameter to the value.
 void setParameters(Map<String,String[]> params)
           
 void setPlid(long plid)
          Sets the portlet layout id.
 void setPortletId(String portletId)
          Sets the id of the target portlet.
 void setPortletMode(PortletMode portletMode)
           
 void setPortletMode(String portletMode)
           
 void setProperty(String key, String value)
           
 void setRefererPlid(long refererPlid)
           
 void setResourceID(String resourceID)
           
 void setSecure(boolean secure)
           
 void setWindowState(String windowState)
           
 void setWindowState(WindowState windowState)
           
 String toString()
           
 void write(Writer writer)
           
 void write(Writer writer, boolean escapeXml)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PortletURLImpl

public PortletURLImpl(javax.servlet.http.HttpServletRequest request,
                      String portletId,
                      long plid,
                      String lifecycle)

PortletURLImpl

public PortletURLImpl(PortletRequestImpl portletRequestImpl,
                      String portletId,
                      long plid,
                      String lifecycle)
Method Detail

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 that is included in the path

addProperty

public void addProperty(String key,
                        String value)
Specified by:
addProperty in interface BaseURL

getCacheability

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

getHttpServletRequest

public javax.servlet.http.HttpServletRequest getHttpServletRequest()

getLayout

public Layout getLayout()

getLayoutFriendlyURL

public String getLayoutFriendlyURL()

getLifecycle

public String getLifecycle()
Description copied from interface: LiferayPortletURL
Gets the lifecycle of the portlet this URL points to.

Specified by:
getLifecycle in interface LiferayPortletURL
Returns:
the portlet lifecycle
See Also:
LiferayPortletURL.setLifecycle(String)

getNamespace

public String getNamespace()

getParameter

public String getParameter(String name)
Description copied from interface: LiferayPortletURL
Gets the first value of the URL parameter.

Specified by:
getParameter in interface LiferayPortletURL
Parameters:
name - the name of the URL parameter to get the value of
Returns:
the first value of the URL parameter

getParameterMap

public Map<String,String[]> getParameterMap()
Specified by:
getParameterMap in interface BaseURL

getParametersIncludedInPath

public Set<String> getParametersIncludedInPath()
Specified by:
getParametersIncludedInPath in interface LiferayPortletURL

getPlid

public long getPlid()

getPortlet

public Portlet getPortlet()

getPortletFriendlyURLPath

public String getPortletFriendlyURLPath()

getPortletId

public String getPortletId()
Description copied from interface: LiferayPortletURL
Gets the id of the portlet this URL points to.

Specified by:
getPortletId in interface LiferayPortletURL
Returns:
the id of the portlet this URL points to

getPortletMode

public PortletMode getPortletMode()
Specified by:
getPortletMode in interface PortletURL

getPortletRequest

public PortletRequest getPortletRequest()

getReservedParameterMap

public Map<String,String> getReservedParameterMap()
Description copied from interface: LiferayPortletURL
Gets the map of reserved parameters for this URL.

This method is only used internally. Reserved parameters contain special, Liferay specific information, such as p_p_id and p_p_lifecycle.

Specified by:
getReservedParameterMap in interface LiferayPortletURL
Returns:
the reserved parameter names and values in a read-only map

getResourceID

public String getResourceID()
Description copied from interface: LiferayPortletURL
Gets the id of the resource this URL points to.

Specified by:
getResourceID in interface LiferayPortletURL
Returns:
the id of the resource this URL points to

getWindowState

public WindowState getWindowState()
Specified by:
getWindowState in interface PortletURL

isAnchor

public boolean isAnchor()
Description copied from interface: LiferayPortletURL
Determines whether 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:
LiferayPortletURL.setAnchor(boolean)

isCopyCurrentPublicRenderParameters

public boolean isCopyCurrentPublicRenderParameters()

isCopyCurrentRenderParameters

public boolean isCopyCurrentRenderParameters()
Description copied from interface: LiferayPortletURL
Determines whether 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:
LiferayPortletURL.setCopyCurrentRenderParameters(boolean)

isEncrypt

public boolean isEncrypt()
Description copied from interface: LiferayPortletURL
Determines whether this URL should be encrypted.

Specified by:
isEncrypt in interface LiferayPortletURL
Returns:
true if this URL should be encrypted; false otherwise
See Also:
LiferayPortletURL.setEncrypt(boolean)

isEscapeXml

public boolean isEscapeXml()
Description copied from interface: LiferayPortletURL
Determines whether 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:
LiferayPortletURL.setEscapeXml(boolean)

isParameterIncludedInPath

public boolean isParameterIncludedInPath(String name)
Description copied from interface: LiferayPortletURL
Determines whether 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:
LiferayPortletURL.addParameterIncludedInPath(String)

isSecure

public boolean isSecure()
Description copied from interface: LiferayPortletURL
Determines whether this URL is secure (https).

Specified by:
isSecure in interface LiferayPortletURL
Returns:
true if this URL is secure; false otherwise

removePublicRenderParameter

public void removePublicRenderParameter(String name)
Specified by:
removePublicRenderParameter in interface PortletURL

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

setCopyCurrentPublicRenderParameters

public void setCopyCurrentPublicRenderParameters(boolean copyCurrentPublicRenderParameters)

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)

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)
Specified by:
setDoAsUserLanguageId in interface LiferayPortletURL

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 lifecycle of the portlet this URL points to.

Valid lifecycles are:

Specified by:
setLifecycle in interface LiferayPortletURL
Parameters:
lifecycle - the lifecycle of the portlet this URL points to

setParameter

public void setParameter(String name,
                         String value)
Specified by:
setParameter in interface BaseURL

setParameter

public void setParameter(String name,
                         String value,
                         boolean append)
Description copied from interface: LiferayPortletURL
Sets the URL parameter to the value.

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)
Specified by:
setParameter in interface BaseURL

setParameter

public void setParameter(String name,
                         String[] values,
                         boolean append)
Description copied from interface: LiferayPortletURL
Sets the URL parameter the values.

Specified by:
setParameter in interface LiferayPortletURL
Parameters:
name - the name 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.

setParameters

public void setParameters(Map<String,String[]> params)
Specified by:
setParameters in interface BaseURL

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

setPortletMode

public void setPortletMode(PortletMode portletMode)
                    throws PortletModeException
Specified by:
setPortletMode in interface PortletURL
Throws:
PortletModeException

setPortletMode

public void setPortletMode(String portletMode)
                    throws PortletModeException
Throws:
PortletModeException

setProperty

public void setProperty(String key,
                        String value)
Specified by:
setProperty in interface BaseURL

setRefererPlid

public void setRefererPlid(long refererPlid)

setResourceID

public void setResourceID(String resourceID)
Specified by:
setResourceID in interface ResourceURL

setSecure

public void setSecure(boolean secure)
Specified by:
setSecure in interface BaseURL

setWindowState

public void setWindowState(String windowState)
                    throws WindowStateException
Throws:
WindowStateException

setWindowState

public void setWindowState(WindowState windowState)
                    throws WindowStateException
Specified by:
setWindowState in interface PortletURL
Throws:
WindowStateException

toString

public String toString()
Specified by:
toString in interface BaseURL
Overrides:
toString in class Object

write

public void write(Writer writer)
           throws IOException
Specified by:
write in interface BaseURL
Throws:
IOException

write

public void write(Writer writer,
                  boolean escapeXml)
           throws IOException
Specified by:
write in interface BaseURL
Throws:
IOException

addPortalAuthToken

protected void addPortalAuthToken(StringBundler sb,
                                  Key key)

addPortletAuthToken

protected void addPortletAuthToken(StringBundler sb,
                                   Key key)

clearCache

protected void clearCache()

generateToString

protected String generateToString()

generateWSRPToString

protected String generateWSRPToString()

isBlankValue

protected boolean isBlankValue(String[] value)

processValue

protected String processValue(Key key,
                              int value)

processValue

protected String processValue(Key key,
                              long value)

processValue

protected String processValue(Key key,
                              String value)

Liferay 6.0.5