|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.liferay.faces.bridge.container.liferay.LiferayURLGeneratorBaseImpl
public abstract class LiferayURLGeneratorBaseImpl
This abstract class implements the LiferayURLGenerator contract for generating URLs that are compatible
with Liferay Portal. The main reason why this is necessary is because the Liferay Portal PortletURLImpl#toString() method returns different values depending on the portlet lifecycle phase during which it
is called. Additionally, it sometimes includes the public render parameters in the URL (which are not required for
JSF portlets). Another issue is related to ICEfaces, which uses a server-side DOM-diff algorithm within it's RenderKit. When DOM-diff strategies are used, it is critical that URLs always be the same regardless of which
portlet lifecycle phase is executing. For example, a URL generated during the PortletRequest.RENDER_PHASE of
the portlet lifecycle must be identical to the one generated during the PortletRequest.RESOURCE_PHASE, or
else a DOM-diff will be detected.
The constructors of this class receive a String-based parameter named "baseURL" which is expected to be the result
of calling the toString() method of a Liferay URL. The baseURL is then parsed and the URL parameters are cached so
that the generateURL(Map) method can quickly generate a consistent URL.
| Constructor Summary | |
|---|---|
LiferayURLGeneratorBaseImpl(String baseURL,
javax.portlet.PortletMode portletMode,
String responseNamespace,
javax.portlet.WindowState windowState)
Constructs a new instance. |
|
LiferayURLGeneratorBaseImpl(String baseURL,
String responseNamespace)
Constructs a new instance. |
|
| Method Summary | |
|---|---|
protected void |
appendParameterToURL(boolean firstParameter,
boolean namespaced,
String parameterName,
String parameterValue,
StringBuilder url)
|
protected void |
appendParameterToURL(boolean firstParameter,
String parameterName,
String parameterValue,
StringBuilder url)
|
protected void |
appendParameterToURL(String parameterName,
String parameterValue,
StringBuilder url)
|
protected String |
encode(String value)
|
String |
generateURL(Map<String,String[]> additionalParameterMap)
Generates a Liferay-compatible URL with the specified additional URL parameters. |
String |
generateURL(Map<String,String[]> additionalParameterMap,
javax.portlet.PortletMode portletMode,
String resourceId,
javax.portlet.WindowState windowState)
|
String |
generateURL(Map<String,String[]> additionalParameterMap,
javax.portlet.PortletMode portletMode,
javax.portlet.WindowState windowState)
Generates a Liferay-compatible URL with the specified additional URL parameters, portlet mode, and window state. |
String |
generateURL(Map<String,String[]> additionalParameterMap,
String resourceId)
Generates a Liferay-compatible URL with the specified additional URL parameters and resource ID. |
protected void |
parse()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface com.liferay.faces.bridge.container.liferay.LiferayURLGenerator |
|---|
getPortletLifecycleId |
| Constructor Detail |
|---|
public LiferayURLGeneratorBaseImpl(String baseURL,
String responseNamespace)
baseURL - The String-based URL generated by Liferay Portal's PortletURLImpl#toString() method.responseNamespace - The response namespace.
public LiferayURLGeneratorBaseImpl(String baseURL,
javax.portlet.PortletMode portletMode,
String responseNamespace,
javax.portlet.WindowState windowState)
baseURL - The String-based URL generated by Liferay Portal's PortletURLImpl#toString()
method.portletMode - The portlet mode specified by Liferay Portal's PortletURLImpl#getPortletMode()
method.responseNamespace - The response namespace.windowState - The window state specified by Liferay Portal's PortletURLImpl#getWindowState()
method.| Method Detail |
|---|
public String generateURL(Map<String,String[]> additionalParameterMap)
LiferayURLGenerator
generateURL in interface LiferayURLGeneratoradditionalParameterMap - Additional URL parameters.
public String generateURL(Map<String,String[]> additionalParameterMap,
String resourceId)
LiferayURLGenerator
generateURL in interface LiferayURLGeneratoradditionalParameterMap - Additional URL parameters.resourceId - The resource ID.
public String generateURL(Map<String,String[]> additionalParameterMap,
javax.portlet.PortletMode portletMode,
javax.portlet.WindowState windowState)
LiferayURLGenerator
generateURL in interface LiferayURLGeneratoradditionalParameterMap - Additional URL parameters.portletMode - The portlet mode.windowState - The window state.
public String generateURL(Map<String,String[]> additionalParameterMap,
javax.portlet.PortletMode portletMode,
String resourceId,
javax.portlet.WindowState windowState)
protected void appendParameterToURL(String parameterName,
String parameterValue,
StringBuilder url)
protected void appendParameterToURL(boolean firstParameter,
String parameterName,
String parameterValue,
StringBuilder url)
protected void appendParameterToURL(boolean firstParameter,
boolean namespaced,
String parameterName,
String parameterValue,
StringBuilder url)
protected String encode(String value)
protected void parse()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||