Overview  Package   Class  Tree  Serialized  Deprecated  Index  Help 

com.ibm.wps.pb.property
Interface Action


public interface Action

For use by portlets written to the IBM portlet API only.

Action encapsulates the information used by the Property Broker to deliver property values provided by source portlets to target portlets. The target portlet may implement the action either as a portlet action (via the ActionListener interface), or as a Struts action. Action objects will be implicitly created and registered with the Property Broker if defined in a WSDL file. Otherwise, they may be explicitly created and registered programmatically. May be programmatically created using PropertyFactory, followed by invoking the setters.

This interface is for use by portlets using the IBM portlet API.

Since:
5.0
See Also:
org.apache.jetspeed.portlet.event.ActionListener, PropertyFactory, PropertyBrokerService

Field Summary
static int DEFAULT_PORTLET_ACTION
          Specifies delivery using DefaultPortletAction.
static int SIMPLE_PORTLET_ACTION
          Specifies delivery using a simple action string
static int STRUTS_ACTION
          Specifies delivery using Struts
 

Method Summary
 boolean getActiveOnStartup()
          Deprecated.  
 java.util.Map getConstantParameters()
          Returns a Map containing name, value entries.
 java.lang.String getDescription()
          Deprecated.  
 java.lang.String java.util.Locale)">getDescription(java.util.Locale locale)
          Returns a string containing a description of the action which can be used as a visual aid.
 boolean getInvokeOnMultipleMatch()
          Deprecated.  
 java.lang.String getName()
          Returns the name of the action.
 java.lang.Object getOwnerId()
          Returns an id representing the portlet which registered this action.
 Parameter[] getParameters()
          Returns the parameters associated with the action.
 java.lang.String getTitle()
          Deprecated.  
 java.lang.String java.util.Locale)">getTitle(java.util.Locale locale)
          Returns a short string about the action suitable for displaying in a menu.
 int getType()
          Returns the type of the action.
 boolean isActiveOnStartup()
          Returns true if this action is active on portlet startup.
 boolean isImplementedBy(org.apache.jetspeed.portlet.PortletSettings caller)
          Returns true if the action was registered by the calling portlet.
 boolean isInvocableOnMultipleMatch()
          Returns a boolean indicating whether the action should be processed if it is simultaneously triggered with other actions on the same portlet (due to multiple wires being activated, or multiple actions being triggered through a Click-to-Action menu, for example).
 void setActiveOnStartup(boolean activeOnStartup)
          Sets the activeOnStartup parameter for this action.
 void java.util.Map)">setConstantParameters(java.util.Map params)
          Sets constant parameters associated with the Action, by way of name, value entries in a Map.
 void setDescription(java.lang.String descriptionKey)
          Deprecated.  
 void setDescriptionKey(java.lang.String descriptionKey)
          Sets the key for the description.
 void setInvocableOnMultipleMatch(boolean invokeOnMultipleMatch)
          Sets the parameter used to specify whether the action can be invoked in the event multiple matching actions are available for invocation on the portlet.
 void setInvokeOnMultipleMatch(boolean invokeOnMultipleMatch)
          Deprecated.  
 void java.util.Locale[])">setLocalizationInfo(java.lang.String nlsFileName, org.apache.jetspeed.portlet.PortletContext context, java.util.Locale[] locales)
          This data is used to retrieve internationalized versions of the title and description.
 void setName(java.lang.String name)
          Sets the name of the action.
 void setParameters(Parameter[] params)
          Sets the action parameters.
 void setTitle(java.lang.String titleKey)
          Deprecated.  
 void setTitleKey(java.lang.String titleKey)
          Sets the key for the title.
 void setType(int type)
          Sets the type of this action.
 

Field Detail

DEFAULT_PORTLET_ACTION

public static final int DEFAULT_PORTLET_ACTION
Specifies delivery using DefaultPortletAction. The use of this value is deprecated and is retained for backwards compatibility

See Also:
Constant Field Values

SIMPLE_PORTLET_ACTION

public static final int SIMPLE_PORTLET_ACTION
Specifies delivery using a simple action string

See Also:
Constant Field Values

STRUTS_ACTION

public static final int STRUTS_ACTION
Specifies delivery using Struts

See Also:
Constant Field Values

Method Detail

getName

public java.lang.String getName()
Returns the name of the action. Must be unique for a given portlet.

Returns:
a String containing the action name

getConstantParameters

public java.util.Map getConstantParameters()
Returns a Map containing name, value entries. These entries will be passed to the action when it is invoked through the property broker. How the entries are passed to the action is dependent on the action type. For actions implemented by portlets, the values are passed as request parameters. The values for the entries are restricted to String.

Returns:
an unmodifiable Map of constant objects associated with this action. If no constant parameters were set, an empty Map is returned.
Since:
5.1

getParameters

public Parameter[] getParameters()
Returns the parameters associated with the action.

Returns:
an array of Parameter objects containing the parameter information for this action
See Also:
Parameter

getTitle

public java.lang.String getTitle()
Deprecated.  

This method is deprecated. Use the locale-specific version.

Returns:
a String containing the title
See Also:
java.util.Locale)">getTitle(Locale)

getDescription

public java.lang.String getDescription()
Deprecated.  

This method is deprecated. Use the locale-specific version.

Returns:
a String containing the description
See Also:
java.util.Locale)">getTitle(Locale)

java.util.Locale)">

getTitle

public java.lang.String getTitle(java.util.Locale locale)
Returns a short string about the action suitable for displaying in a menu. This will return the title for the specified locale. Displayed in Click-to-Action menus, tools, or as help text as an aid to the user.

Parameters:
locale - the client locale
Returns:
the internationalized version of the title string

java.util.Locale)">

getDescription

public java.lang.String getDescription(java.util.Locale locale)
Returns a string containing a description of the action which can be used as a visual aid. Displayed in tools or as help text as an aid to the user. This will return the description for the specified locale.

Parameters:
locale - the client locale
Returns:
the internationalized version of the description string

isInvocableOnMultipleMatch

public boolean isInvocableOnMultipleMatch()
Returns a boolean indicating whether the action should be processed if it is simultaneously triggered with other actions on the same portlet (due to multiple wires being activated, or multiple actions being triggered through a Click-to-Action menu, for example). If return value is true, then this action will be invoked even if other actions on the portlet are simultaneously triggered. This is a safety mechanism used to prevent multiple actions from being invoked on the portlet even if simultaneously triggered, unless explictly overridden through this setting. The default value is false.

Returns:
a boolean value

getInvokeOnMultipleMatch

public boolean getInvokeOnMultipleMatch()
Deprecated.  

This method is deprecated. Use isInvocableOnMultipleMatch instead.

See Also:
isInvocableOnMultipleMatch()

getType

public int getType()
Returns the type of the action.

Returns:
the type of the action, ie DEFAULT_PORTLET_ACTION et. al. See the constants in this interface for allowed values.

getOwnerId

public java.lang.Object getOwnerId()
Returns an id representing the portlet which registered this action.

Returns:
an Object representing the id of the portlet which registered this action. May be used in comparisons.

isImplementedBy

public boolean isImplementedBy(org.apache.jetspeed.portlet.PortletSettings caller)
Returns true if the action was registered by the calling portlet.

Parameters:
caller - the PortletSettings object identifying the calling portlet
Returns:
true iff this action was registered by by the portlet identified by the PortletSettings object passed in.

isActiveOnStartup

public boolean isActiveOnStartup()
Returns true if this action is active on portlet startup.

Returns:
true iff this action is active on portlet startup. If false, the portlet must make a call to activateActions in the PropertyBrokerService interface.
See Also:
PropertyBrokerService

getActiveOnStartup

public boolean getActiveOnStartup()
Deprecated.  

This method is deprecated. Use isActiveOnStartup instead.

See Also:
isActiveOnStartup()

setName

public void setName(java.lang.String name)
Sets the name of the action.

Parameters:
name - the name
See Also:
getName()

java.util.Map)">

setConstantParameters

public void setConstantParameters(java.util.Map params)
Sets constant parameters associated with the Action, by way of name, value entries in a Map. The values are restricted to String. If this method is called multiple times, the values in the Map passed to the last call override previous values. If null or an empty Map is passed, any constant parameters set earlier are cleared.

Parameters:
params - a Map of constant String values.
Throws:
java.lang.ClassCastException - if the name or value is not String.
java.lang.IllegalArgumentException - if the parameters do not satisfy required constraints.
Since:
5.1
See Also:
getConstantParameters()

setParameters

public void setParameters(Parameter[] params)
                   throws InvalidPropertyException
Sets the action parameters.

Parameters:
params - an array of Parameter objects.
Throws:
InvalidPropertyException - is thrown if the parameters do not satisfy required constraints.
See Also:
Parameter, InvalidPropertyException, getParameters()

setTitle

public void setTitle(java.lang.String titleKey)
Deprecated.  

This method is deprecated. Use setTitleKey instead.

Parameters:
titleKey - the key for the title
See Also:
setTitleKey(String)

setTitleKey

public void setTitleKey(java.lang.String titleKey)
Sets the key for the title. The key is used in conjunction with the localization info set in the setLocalizationInfo method to retrieve the translated title for supported locales.

Parameters:
titleKey - the key for the title

setDescription

public void setDescription(java.lang.String descriptionKey)
Deprecated.  

This method is deprecated. Use setDescriptionKey instead.

Parameters:
descriptionKey - the key for the description
See Also:
setDescriptionKey(String)

setDescriptionKey

public void setDescriptionKey(java.lang.String descriptionKey)
Sets the key for the description. The key is used in conjunction with the localization info set in the setLocalizationInfo method to retrieve the translated description for supported locales.

Parameters:
descriptionKey - the key for the description

java.util.Locale[])">

setLocalizationInfo

public void setLocalizationInfo(java.lang.String nlsFileName,
                                org.apache.jetspeed.portlet.PortletContext context,
                                java.util.Locale[] locales)
This data is used to retrieve internationalized versions of the title and description.

Parameters:
nlsFileName - the base name of the nls resource file(s) containing translated strings
context - the PortletContext for the calling portlet
locales - the locales supported by this portlet

setInvocableOnMultipleMatch

public void setInvocableOnMultipleMatch(boolean invokeOnMultipleMatch)
Sets the parameter used to specify whether the action can be invoked in the event multiple matching actions are available for invocation on the portlet. See the isInvocableOnMultipleMatch method description for a description of the semantics of this parameter.

Parameters:
invokeOnMultipleMatch - true or false
See Also:
isInvocableOnMultipleMatch()

setInvokeOnMultipleMatch

public void setInvokeOnMultipleMatch(boolean invokeOnMultipleMatch)
Deprecated.  

This method is deprecated. Use setInvocableOnMultipleMatch instead.

See Also:
setInvocableOnMultipleMatch(boolean)

setType

public void setType(int type)
             throws InvalidPropertyException
Sets the type of this action. Must be one of the type values defined in this class. DEFAULT_PORTLET_ACTION is the default if not set.

Parameters:
type - the type of the action
Throws:
InvalidPropertyException - is thrown if the type does not satisfy the required constraint.

setActiveOnStartup

public void setActiveOnStartup(boolean activeOnStartup)
Sets the activeOnStartup parameter for this action. See the getActiveOnStartup method description for a description of this parameter.

Parameters:
activeOnStartup - true or false
See Also:
isActiveOnStartup()

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.