|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.pluto.internal.impl.BaseURLImpl
public class BaseURLImpl
Implementation of JSR-286 BaseURL, which includes a refactoring
of PortletURLImpl.
| Field Summary | |
|---|---|
protected PortletContainer |
container
|
protected PortalContext |
context
|
protected InternalPortletWindow |
internalPortletWindow
|
protected boolean |
isAction
|
protected boolean |
isResourceServing
|
protected PortletMode |
mode
|
protected java.util.Map |
parameters
|
protected java.util.Map<java.lang.String,java.lang.String[]> |
publicRenderParameters
|
protected boolean |
secure
|
protected javax.servlet.http.HttpServletRequest |
servletRequest
|
protected javax.servlet.http.HttpServletResponse |
servletResponse
|
protected WindowState |
state
|
| Constructor Summary | |
|---|---|
BaseURLImpl(PortletContainer container,
InternalPortletWindow internalPortletWindow,
javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse servletResponse,
boolean isAction,
boolean isResourceServing)
|
|
| Method Summary | |
|---|---|
void |
addProperty(java.lang.String key,
java.lang.String value)
Adds a String property to an existing key on the URL. |
java.lang.String |
getParameter(java.lang.String name)
|
java.util.Map |
getParameterMap()
Returns a Map of the parameters
currently set on this portlet URL via the
setParameter or setParameters
methods. |
java.lang.String[] |
getParameters(java.lang.String name)
|
PortletMode |
getPortletMode()
|
WindowState |
getWindowState()
|
protected boolean |
isPortletModeAllowed(PortletMode mode)
|
protected boolean |
isWindowStateAllowed(WindowState state)
|
void |
setParameter(java.lang.String name,
java.lang.String value)
Sets the given String parameter to this URL. |
void |
setParameter(java.lang.String name,
java.lang.String[] values)
Sets the given String array parameter to this URL. |
void |
setParameters(java.util.Map<java.lang.String,java.lang.String[]> parameters)
Sets a parameter map for this URL. |
void |
setProperty(java.lang.String key,
java.lang.String value)
Sets a String property on the URL. |
void |
setSecure(boolean secure)
Indicated the security setting for this URL. |
java.lang.String |
toString()
Returns the portlet URL string representation to be embedded in the markup. Note that the returned String may not be a valid URL, as it may be rewritten by the portal/portlet-container before returning the markup to the client. |
void |
write(java.io.Writer out)
Writes the portlet URL to the output stream using the provided writer. |
void |
write(java.io.Writer out,
boolean escapeXML)
Writes the portlet URL to the output stream using the provided writer. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected java.util.Map parameters
protected java.util.Map<java.lang.String,java.lang.String[]> publicRenderParameters
protected boolean secure
protected PortletContainer container
protected PortletMode mode
protected InternalPortletWindow internalPortletWindow
protected javax.servlet.http.HttpServletRequest servletRequest
protected javax.servlet.http.HttpServletResponse servletResponse
protected WindowState state
protected boolean isAction
protected boolean isResourceServing
protected PortalContext context
| Constructor Detail |
|---|
public BaseURLImpl(PortletContainer container,
InternalPortletWindow internalPortletWindow,
javax.servlet.http.HttpServletRequest servletRequest,
javax.servlet.http.HttpServletResponse servletResponse,
boolean isAction,
boolean isResourceServing)
| Method Detail |
|---|
public void setParameter(java.lang.String name,
java.lang.String value)
BaseURLThis method replaces all parameters with the given key.
The PortletURL implementation 'x-www-form-urlencoded' encodes
all parameter names and values. Developers should not encode them.
A portlet container may prefix the attribute names internally in order to preserve a unique namespace for the portlet.
A parameter value of null indicates that this
parameter should be removed.
setParameter in interface BaseURLname - the parameter namevalue - the parameter value
public void setParameter(java.lang.String name,
java.lang.String[] values)
BaseURLThis method replaces all parameters with the given key.
The PortletURL implementation 'x-www-form-urlencoded' encodes
all parameter names and values. Developers should not encode them.
A portlet container may prefix the attribute names internally in order to preserve a unique namespace for the portlet.
setParameter in interface BaseURLname - the parameter namevalues - the parameter valuespublic void setParameters(java.util.Map<java.lang.String,java.lang.String[]> parameters)
BaseURLAll previously set parameters are cleared.
The PortletURL implementation 'x-www-form-urlencoded' encodes
all parameter names and values. Developers should not encode them.
A portlet container may prefix the attribute names internally, in order to preserve a unique namespace for the portlet.
setParameters in interface BaseURLparameters - Map containing parameter names for
the render phase as
keys and parameter values as map
values. The keys in the parameter
map must be of type String. The values
in the parameter map must be of type
String array (String[]).
public void setSecure(boolean secure)
throws PortletSecurityException
BaseURL
Secure set to true indicates that the portlet requests
a secure connection between the client and the portlet window for
this URL. Secure set to false indicates that the portlet
does not need a secure connection for this URL. If the security is not
set for a URL, it should stay the same as the current request.
setSecure in interface BaseURLsecure - true, if portlet requests to have a secure connection
between its portlet window and the client; false, if
the portlet does not require a secure connection.
PortletSecurityException - if the run-time environment does
not support the indicated settingpublic java.lang.String toString()
BaseURLThe returned URL is not XML escaped.
For writing URLs to an output stream the BaseURL.write(java.io.Writer) or
BaseURL.write(java.io.Writer, boolean) method should be used as these are
more efficient.
toString in interface BaseURLtoString in class java.lang.Objectpublic java.lang.String getParameter(java.lang.String name)
public java.lang.String[] getParameters(java.lang.String name)
public java.util.Map getParameterMap()
BaseURLMap of the parameters
currently set on this portlet URL via the
setParameter or setParameters
methods.
The values in the returned Map are from type
String array (String[]).
If no parameters exist this method returns an empty Map.
getParameterMap in interface BaseURLMap containing parameter names as
keys and parameter values as map values, or an empty Map
if no parameters exist. The keys in the parameter
map are of type String. The values in the parameter map are of type
String array (String[]).public PortletMode getPortletMode()
public WindowState getWindowState()
protected boolean isPortletModeAllowed(PortletMode mode)
throws PortletModeException
PortletModeExceptionprotected boolean isWindowStateAllowed(WindowState state)
public void write(java.io.Writer out)
throws java.io.IOException
BaseURLNote that the URL written to the output stream may not be a valid URL, as it may be rewritten by the portal/portlet-container before returning the markup to the client.
The URL written to the output stream is always XML escaped. For writing
non-escaped URLs use BaseURL.write(java.io.Writer, boolean).
write in interface BaseURLout - the writer to write the portlet URL to
java.io.IOException - if an I/O error occured while writing the URL
public void write(java.io.Writer out,
boolean escapeXML)
throws java.io.IOException
BaseURLNote that the URL written to the output stream may not be a valid URL, as it may be rewritten by the portal/portlet-container before returning the markup to the client.
write in interface BaseURLout - the writer to write the portlet URL toescapeXML - denotes if the URL should be XML escaped before written to the output
stream or not
java.io.IOException - if an I/O error occurred while writing the URL
public void addProperty(java.lang.String key,
java.lang.String value)
BaseURLThis method allows URL properties to have multiple values.
Properties can be used by portlets to provide vendor specific information to the URL.
addProperty in interface BaseURLkey - the key of the propertyvalue - the value of the property
public void setProperty(java.lang.String key,
java.lang.String value)
BaseURLProperties can be used by portlets to provide vendor specific information to the URL.
This method resets all properties previously added with the same key.
setProperty in interface BaseURLkey - the key of the propertyvalue - the value of the property
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||