com.ibm.portal.portletmodel
Interface Portlet

All Superinterfaces:
Identifiable, Localized, MarkupCapable, MetaDataProvider, PortletPreferencesProvider
All Known Subinterfaces:
ModifiablePortlet

public interface Portlet
extends Identifiable, MarkupCapable, PortletPreferencesProvider, Localized

Interface that represents the deployed code unit for a portlet, as specified in the deployment descriptor. Properties of the portlet are defined by the portlet programmer and deployer, typically in the deployment descriptor, and cannot be altered after deployment.

All methods that take or return supported markups as strings will also accept or return mimetype strings. For example, for a portlet supporting the html markup, both supportsMarkup("html") and supportsMarkup("text/html") will return true. The supported mimetypes must not contain a character set definition and must not contain wildcards.

Since:
6.0.1

Method Summary
 MetaData<java.lang.String,? extends java.util.Map.Entry<java.lang.String,java.lang.String>> getInitParameters()
          Returns the init parameters of the portlet as specified in the deployment descriptor
 MetaData<java.lang.String,? extends java.util.Map.Entry<java.lang.String,java.lang.String>> getMetaData()
          Returns the same preferences as getPortletPreferencesLayer()
 ListModel getPortletModes()
          Returns a ListModel object of PortletMode objects that are contained in the portlet's list of supported portlet modes.
 ListModel getPortletModes(java.lang.String markup)
          Returns a ListModel object of PortletMode objects that are contained in the portlet's list of supported portlet modes for a specific markup
 java.lang.String getPortletName()
          Returns the portlet name as specified in the deployment descriptor
 PortletPreferences getPortletPreferencesLayer()
          Returns the preferences that are defined in the deployment descriptor for this portlet
 boolean supportsPortletMode(javax.portlet.PortletMode mode)
          Checks if a given portlet mode is in the list of supported portlet modes.
 boolean supportsPortletMode(javax.portlet.PortletMode mode, java.lang.String markup)
          Checks if a given portlet mode is in the list of supported portlet modes for the given markup.
 boolean supportsWindowState(javax.portlet.WindowState state)
          Checks if a given window state is in the list of supported window states.
 boolean supportsWindowState(javax.portlet.WindowState state, java.lang.String markup)
          Checks if a given window state is in the list of supported window states for the given markup.
 
Methods inherited from interface com.ibm.portal.Identifiable
getObjectID
 
Methods inherited from interface com.ibm.portal.admin.MarkupCapable
getMarkups, supportsMarkup, supportsMarkup
 
Methods inherited from interface com.ibm.portal.Localized
getDescription, getLocales, getTitle
 

Method Detail

getPortletName

java.lang.String getPortletName()
Returns the portlet name as specified in the deployment descriptor

Returns:
the portlet name

getInitParameters

MetaData<java.lang.String,? extends java.util.Map.Entry<java.lang.String,java.lang.String>> getInitParameters()
Returns the init parameters of the portlet as specified in the deployment descriptor

Returns:
the init parameters

getPortletPreferencesLayer

PortletPreferences getPortletPreferencesLayer()
Returns the preferences that are defined in the deployment descriptor for this portlet

Specified by:
getPortletPreferencesLayer in interface PortletPreferencesProvider
Returns:
a portlet preferences layer; never returns null.
Since:
6.1

getMetaData

MetaData<java.lang.String,? extends java.util.Map.Entry<java.lang.String,java.lang.String>> getMetaData()
Returns the same preferences as getPortletPreferencesLayer()

Specified by:
getMetaData in interface MetaDataProvider
Specified by:
getMetaData in interface PortletPreferencesProvider
Returns:
an implementation of MetaData
See Also:
MetaDataProvider

getPortletModes

ListModel getPortletModes()
                          throws ModelException
Returns a ListModel object of PortletMode objects that are contained in the portlet's list of supported portlet modes.

Returns:
a list model of PortletMode objects, never null
Throws:
ModelException - in case the portlet modes cannot be obtained

getPortletModes

ListModel getPortletModes(java.lang.String markup)
                          throws ModelException
Returns a ListModel object of PortletMode objects that are contained in the portlet's list of supported portlet modes for a specific markup

Parameters:
markup - The markup for which the supported modes are requested.
Returns:
a list model of PortletMode objects, never null
Throws:
ModelException - in case the portlet modes cannot be obtained

supportsPortletMode

boolean supportsPortletMode(javax.portlet.PortletMode mode)
                            throws ModelException
Checks if a given portlet mode is in the list of supported portlet modes.
This method checks if the portlet may be invoked in the given mode in any of its supported markups.

Parameters:
mode - The portlet mode that is to be checked.
Returns:
true if the mode is in the list of supported modes for any supported markup, false if not.
Throws:
ModelException - in case the portlet modes cannot be obtained

supportsPortletMode

boolean supportsPortletMode(javax.portlet.PortletMode mode,
                            java.lang.String markup)
                            throws ModelException
Checks if a given portlet mode is in the list of supported portlet modes for the given markup.
This method checks if the portlet may be invoked in the given mode in the given markup, which must be in the list of supported markups for the portlet

Parameters:
mode - The portlet mode that is to be checked.
markup - The markup for which the mode is to be checked.
Returns:
true if the markup is in the list of supported markups and the mode is in the list of supported modes for that markup, false if not.
Throws:
ModelException - in case the portlet modes cannot be obtained

supportsWindowState

boolean supportsWindowState(javax.portlet.WindowState state)
                            throws ModelException
Checks if a given window state is in the list of supported window states.
This method checks if the portlet may be invoked in the given window state in any of its supported markups.

Parameters:
state - The window state that is to be checked.
Returns:
true if the mode is in the list of supported window states for any supported markup, false if not.
Throws:
ModelException - in case the window states cannot be obtained

supportsWindowState

boolean supportsWindowState(javax.portlet.WindowState state,
                            java.lang.String markup)
                            throws ModelException
Checks if a given window state is in the list of supported window states for the given markup.
This method checks if the portlet may be invoked in the given window states in the given markup, which must be in the list of supported markups for the portlet

Parameters:
mode - The window state that is to be checked.
markup - The markup for which the mode is to be checked.
Returns:
true if the markup is in the list of supported markups and the window state is in the list of supported window states for that markup, false if not.
Throws:
ModelException - in case the windwo states cannot be obtained