Liferay 6.1.2-ce-ga3

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(PortletRequest portletRequest, 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()
          Returns the portlet lifecycle of this URL's target portlet.
 String getNamespace()
           
 String getParameter(String name)
          Returns the first value of the URL parameter.
 Map<String,String[]> getParameterMap()
           
 Set<String> getParametersIncludedInPath()
          Returns the parameters that are included in the friendly URL path and do not need to appear in the query string.
 long getPlid()
           
 Portlet getPortlet()
           
 String getPortletFriendlyURLPath()
           
 String getPortletId()
          Returns the ID of this URL's target portlet.
 PortletMode getPortletMode()
           
 PortletRequest getPortletRequest()
           
protected  String getPublicRenderParameterName(String name)
           
 Set<String> getRemovedParameterNames()
           
 Map<String,String> getReservedParameterMap()
          Returns the map of reserved parameters for this URL.
 String getResourceID()
          Returns the ID of this URL's target resource.
 WindowState getWindowState()
           
 boolean isAnchor()
          Returns true if this URL is an anchor pointing to the specified portlet on the page.
protected  boolean isBlankValue(String[] value)
           
 boolean isCopyCurrentRenderParameters()
          Returns true if the render parameters in the current request should be copied to this URL.
 boolean isEncrypt()
          Returns true if this URL should be encrypted.
 boolean isEscapeXml()
          Returns true if this URL should be XML escaped.
 boolean isParameterIncludedInPath(String name)
          Returns true if the parameter is included in the friendly URL path.
 boolean isSecure()
          Returns true if this URL is secure (https).
protected  void mergeRenderParameters()
           
protected  String prependNamespace(String name)
           
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 setControlPanelCategory(String controlPanelCategory)
           
 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 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 setRefererGroupId(long refererGroupId)
           
 void setRefererPlid(long refererPlid)
          Sets the referer layout ID.
 void setRemovedParameterNames(Set<String> removedParameterNames)
           
 void setResourceID(String resourceID)
           
 void setSecure(boolean secure)
           
 void setWindowState(String windowState)
           
 void setWindowState(WindowState windowState)
           
 void setWindowStateRestoreCurrentView(boolean windowStateRestoreCurrentView)
           
protected  String shortenURL(String url, int count)
           
 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(PortletRequest portletRequest,
                      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

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
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:
LiferayPortletURL.setLifecycle(String)

getNamespace

public String getNamespace()

getParameter

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

Specified by:
getParameter in interface LiferayPortletURL
Parameters:
name - the name of the URL parameter
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()
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()

getPortlet

public Portlet getPortlet()

getPortletFriendlyURLPath

public String getPortletFriendlyURLPath()

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

getPortletMode

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

getPortletRequest

public PortletRequest getPortletRequest()

getRemovedParameterNames

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

getReservedParameterMap

public Map<String,String> getReservedParameterMap()
Description copied from interface: LiferayPortletURL
Returns 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
Returns the ID of this URL's target resource.

Specified by:
getResourceID in interface LiferayPortletURL
Returns:
the ID of this URL's target resource

getWindowState

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

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:
LiferayPortletURL.setAnchor(boolean)

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:
LiferayPortletURL.setCopyCurrentRenderParameters(boolean)

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:
LiferayPortletURL.setEncrypt(boolean)

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:
LiferayPortletURL.setEscapeXml(boolean)

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:
LiferayPortletURL.addParameterIncludedInPath(String)

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

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

setControlPanelCategory

public void setControlPanelCategory(String controlPanelCategory)
Specified by:
setControlPanelCategory in interface LiferayPortletURL

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)
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
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.

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

setRefererGroupId

public void setRefererGroupId(long refererGroupId)

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

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

setWindowStateRestoreCurrentView

public void setWindowStateRestoreCurrentView(boolean windowStateRestoreCurrentView)

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()

getPublicRenderParameterName

protected String getPublicRenderParameterName(String name)

isBlankValue

protected boolean isBlankValue(String[] value)

mergeRenderParameters

protected void mergeRenderParameters()

prependNamespace

protected String prependNamespace(String name)

processValue

protected String processValue(Key key,
                              int value)

processValue

protected String processValue(Key key,
                              long value)

processValue

protected String processValue(Key key,
                              String value)

shortenURL

protected String shortenURL(String url,
                            int count)

Liferay 6.1.2-ce-ga3