|
||||||||||
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)
BaseURL
This 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 BaseURL
name
- the parameter namevalue
- the parameter valuepublic void setParameter(java.lang.String name, java.lang.String[] values)
BaseURL
This 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 BaseURL
name
- the parameter namevalues
- the parameter valuespublic void setParameters(java.util.Map<java.lang.String,java.lang.String[]> parameters)
BaseURL
All 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 BaseURL
parameters
- 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 BaseURL
secure
- 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()
BaseURL
The 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 BaseURL
toString
in class java.lang.Object
public java.lang.String getParameter(java.lang.String name)
public java.lang.String[] getParameters(java.lang.String name)
public java.util.Map getParameterMap()
BaseURL
Map
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 BaseURL
Map
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
PortletModeException
protected boolean isWindowStateAllowed(WindowState state)
public void write(java.io.Writer out) throws java.io.IOException
BaseURL
Note 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 BaseURL
out
- the writer to write the portlet URL to
java.io.IOException
- if an I/O error occured while writing the URLpublic void write(java.io.Writer out, boolean escapeXML) throws java.io.IOException
BaseURL
Note 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 BaseURL
out
- 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 URLpublic void addProperty(java.lang.String key, java.lang.String value)
BaseURL
This 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 BaseURL
key
- the key of the propertyvalue
- the value of the propertypublic void setProperty(java.lang.String key, java.lang.String value)
BaseURL
Properties 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 BaseURL
key
- 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 |