com.liferay.faces.bridge.context.url.internal
Class BridgeURLBase

java.lang.Object
  extended by com.liferay.faces.bridge.context.url.internal.BridgeURLBase
All Implemented Interfaces:
BridgeURL
Direct Known Subclasses:
BridgeActionURLImpl, BridgeBookmarkableURLImpl, BridgePartialActionURLImpl, BridgeRedirectURLImpl, BridgeResourceURLCompatImpl

public abstract class BridgeURLBase
extends Object
implements BridgeURL

This is a utility class used only by ExternalContextImpl that represents a URL with attributes that the Bridge Spec is concerned with. The getter methods in this class make heavy use of lazy-initialization for performance reasons, because it is unlikely that every method will be called.

Author:
Neil Griffin

Field Summary
protected  BridgeContext bridgeContext
           
protected  BridgeURI bridgeURI
           
protected static String RELATIVE_PATH_PREFIX
           
protected  String viewId
           
 
Constructor Summary
BridgeURLBase(BridgeContext bridgeContext, BridgeURI bridgeURI, String viewId)
           
 
Method Summary
protected  String _toString(boolean modeChanged)
           
protected  String _toString(boolean modeChanged, Set<String> excludedParameterNames)
           
protected  void copyParameters(String fromURL, javax.portlet.BaseURL toURL)
          Copies any query paramters present in the specified "from" URL to the specified "to" URL.
protected  javax.portlet.PortletURL createActionURL(String fromURL)
           
protected  javax.portlet.ResourceURL createPartialActionURL(String fromURL)
           
protected  javax.portlet.PortletURL createRenderURL(String fromURL)
           
protected  javax.portlet.ResourceURL createResourceURL(String fromURL)
           
 String getParameter(String name)
           
 Map<String,String[]> getParameterMap()
           
protected  String getViewIdParameterName()
           
 boolean isFacesViewTarget()
           
 boolean isSecure()
           
 boolean isSelfReferencing()
           
protected  boolean matchPathAndExtension(String file1, String file2)
          Determines whether or not the specified files have the same path (prefix) and extension (suffix).
protected  List<RequestParameter> parseRequestParameters(String url)
          Parses the specified URL and returns a list of query parameters that are found.
protected  String removeParameter(String name)
           
 void setParameter(String name, String value)
           
 void setParameter(String name, String[] value)
           
protected  void setPortletModeParameter(String portletMode, javax.portlet.PortletURL portletURL)
           
protected  void setRenderParameters(javax.portlet.BaseURL baseURL)
           
 void setSecure(boolean secure)
           
protected  void setSecureParameter(String secure, javax.portlet.BaseURL baseURL)
           
 void setSelfReferencing(boolean selfReferencing)
           
protected  void setWindowStateParameter(String windowState, javax.portlet.PortletURL portletURL)
           
protected abstract  javax.portlet.BaseURL toBaseURL()
          Returns a BaseURL representation of the bridge URL.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

RELATIVE_PATH_PREFIX

protected static final String RELATIVE_PATH_PREFIX
See Also:
Constant Field Values

bridgeURI

protected BridgeURI bridgeURI

viewId

protected String viewId

bridgeContext

protected BridgeContext bridgeContext
Constructor Detail

BridgeURLBase

public BridgeURLBase(BridgeContext bridgeContext,
                     BridgeURI bridgeURI,
                     String viewId)
Method Detail

toString

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

toBaseURL

protected abstract javax.portlet.BaseURL toBaseURL()
                                            throws MalformedURLException
Returns a BaseURL representation of the bridge URL.

Throws:
MalformedURLException

_toString

protected String _toString(boolean modeChanged)

_toString

protected String _toString(boolean modeChanged,
                           Set<String> excludedParameterNames)

copyParameters

protected void copyParameters(String fromURL,
                              javax.portlet.BaseURL toURL)
                       throws MalformedURLException
Copies any query paramters present in the specified "from" URL to the specified "to" URL.

Throws:
MalformedURLException

createActionURL

protected javax.portlet.PortletURL createActionURL(String fromURL)
                                            throws MalformedURLException
Throws:
MalformedURLException

createPartialActionURL

protected javax.portlet.ResourceURL createPartialActionURL(String fromURL)
                                                    throws MalformedURLException
Throws:
MalformedURLException

createRenderURL

protected javax.portlet.PortletURL createRenderURL(String fromURL)
                                            throws MalformedURLException
Throws:
MalformedURLException

createResourceURL

protected javax.portlet.ResourceURL createResourceURL(String fromURL)
                                               throws MalformedURLException
Throws:
MalformedURLException

matchPathAndExtension

protected boolean matchPathAndExtension(String file1,
                                        String file2)
Determines whether or not the specified files have the same path (prefix) and extension (suffix).

Parameters:
file1 - The first file to compare.
file2 - The second file to compare.
Returns:
true if the specified files have the same path (prefix) and extension (suffix), otherwise false.

parseRequestParameters

protected List<RequestParameter> parseRequestParameters(String url)
                                                 throws MalformedURLException
Parses the specified URL and returns a list of query parameters that are found.

Parameters:
url - The URL to parse.
Returns:
The list of query parameters found.
Throws:
MalformedURLException

removeParameter

protected String removeParameter(String name)

isSecure

public boolean isSecure()
Specified by:
isSecure in interface BridgeURL

isSelfReferencing

public boolean isSelfReferencing()
Specified by:
isSelfReferencing in interface BridgeURL

getParameter

public String getParameter(String name)
Specified by:
getParameter in interface BridgeURL

setParameter

public void setParameter(String name,
                         String[] value)
Specified by:
setParameter in interface BridgeURL

setParameter

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

getParameterMap

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

setPortletModeParameter

protected void setPortletModeParameter(String portletMode,
                                       javax.portlet.PortletURL portletURL)

setRenderParameters

protected void setRenderParameters(javax.portlet.BaseURL baseURL)

setSecure

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

setSecureParameter

protected void setSecureParameter(String secure,
                                  javax.portlet.BaseURL baseURL)

setSelfReferencing

public void setSelfReferencing(boolean selfReferencing)
Specified by:
setSelfReferencing in interface BridgeURL

isFacesViewTarget

public boolean isFacesViewTarget()
Specified by:
isFacesViewTarget in interface BridgeURL

getViewIdParameterName

protected String getViewIdParameterName()

setWindowStateParameter

protected void setWindowStateParameter(String windowState,
                                       javax.portlet.PortletURL portletURL)


Copyright © 2015 Liferay, Inc.. All rights reserved.