Overview  Package   Class  Tree  Serialized  Deprecated  Index  Help 

org.apache.jetspeed.portlet
Interface PortletURI


public interface PortletURI

A PortletURI represents a URI to a specific portlet function. A URI is created through the PortletResponse for a specific portlet mode. Then additional parameter can be added to the URI. The complete URI can be converted to a string which is ready for embedding into markup.

On top of the parameters, it is possible to add actions to a portlet URI. Actions are portlet-specific activities that need to be performed as result of the incoming request, but before the service() method of the portlet is called. For example, the PERSONALIZE mode of the portlet is likely to have a "Save" button at the end of its dialog. The "Save" button has to bring the user back to the DEFAULT mode of the portlet, but to save the personalized portlet data, the portlet needs to be able to process the posted data bfore the next markup is generated. This can be achieved by adding a "Save" action to the URI that represents the "Save" button. The respective listener is attached the respective action listener to the portlet response. This listener will be called when the next request comes and one of the portlet URIs where the reason for the request. If more than one URI were part of the response, the listener need to the check the action content. This depends on the definition of the actual action which is the responsibility of the portlet developer.

Since:
4.1

Method Summary
 void addAction(PortletAction action)
          Deprecated. Use addAction(String simpleAction) instead
 void addAction(java.lang.String simpleAction)
          Adds the given simple action String to this URI.
 void addParameter(java.lang.String name, java.lang.String value)
          Adds the given parameter to this URI.
 java.lang.String toString()
          Returns the complete URI as a string.
 

Method Detail

addParameter

public void addParameter(java.lang.String name,
                         java.lang.String value)
Adds the given parameter to this URI. The attribute name will be prefixed by the portal to preserve a unique namespace for the portlet. This method will overwrite an exsting value for the specified parameter name. Multiple values for a parameter name aare not supported. The arguments may be arbitrary strings; the portal is responsible for URL encoding the parameter name and value.
No parameters may be added if this portlet URL will be used as the action URL in a HTML for with method GET. The form input passing mechanism for the GET method does not allow action URLs that already contain parameters.

Parameters:
name - the parameter name
value - the parameter value

addAction

public void addAction(PortletAction action)
Deprecated. Use addAction(String simpleAction) instead

Adds the given action to this URI. The action is a portlet-defined implementation of the portlet action interface. It can carry any information that is not tied to the current request. Note that only one addAction(*) method can be used in a PortletURI at the same time. Not complying with this restriction will result in a java.lang.IllegalStateException

For performance reasons, portlet programmers should use simple portlet actions (simple strings) instead where possible.

Unless the ActionListener interface is implemented at the portlet this action will not be delivered.

Parameters:
action - the portlet action

addAction

public void addAction(java.lang.String simpleAction)
Adds the given simple action String to this URI. Note that only one addAction(*) method can be used in a PortletURI at the same time. Not complying with this restriction will result in a java.lang.IllegalStateException

Unless the ActionListener interface is implemented at the portlet this actionString will not be delivered.


toString

public java.lang.String toString()
Returns the complete URI as a string. The string is ready to be embedded in markup.

Once the string has been created, adding more parameters or other listeners will not modify the string. You have to call this method again, to create an updated string.

Returns:
the encoded URI as a string

Overview  Package   Class  Tree  Serialized  Deprecated  Index  Help 

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.