org.apache.jetspeed.portlet
Interface PortletConfig


public interface PortletConfig

The PortletConfig interface provides the portlet with its configuration. The configuration holds information about the portlet that is valid for all users, and is maintained by the administrator. The portlet can therefore only read the configuration. Only when the portlet is in CONFIGURE mode, it has write access to the configuartion data (the rest of the configuration is managed by the portlet container directly).

Author:
Thomas F. Boehme
See Also:
Portlet

Method Summary
 java.lang.String getAttribute(java.lang.String name)
          Returns the value of the attribute with the given name, or null if no such attribute exists.
 java.util.Enumeration getAttributeNames()
          Returns an enumeration of all available attributes names.
 PortletContext getContext()
          Returns the portlet context.
 java.lang.String getName()
          Returns the name of the portlet.
 java.lang.String getTitle(java.util.Locale locale, Client client)
          Returns the title of this window.
 void removeAttribute(java.lang.String name)
          Removes the attribute with the given name.
 void setAttribute(java.lang.String name, java.lang.String value)
          Sets the attribute with the given name and value.
 boolean supports(java.util.Locale locale)
          Returns whether the portlet supports the given locale.
 boolean supports(Portlet.Mode mode, Client client)
          Returns whether the portlet supports the given mode for the given client.
 boolean supports(PortletWindow.State state)
          Returns whether the portlet window supports the given state
 

Method Detail

getName

public java.lang.String getName()
Returns the name of the portlet. The portlet container needs the portlet name for internal and administration purposes.

Returns:
the portlet name

setAttribute

public void setAttribute(java.lang.String name,
                         java.lang.String value)
                  throws AccessDeniedException
Sets the attribute with the given name and value.

Parameters:
name - the attribute name
value - the attribute value
Throws:
AccessDeniedException - if the caller isn't authorized to access this data object

getAttribute

public java.lang.String getAttribute(java.lang.String name)
                              throws AccessDeniedException
Returns the value of the attribute with the given name, or null if no such attribute exists.

Parameters:
name - the attribute name
Returns:
the attribute value
Throws:
AccessDeniedException - if the caller isn't authorized to access this data object

getAttributeNames

public java.util.Enumeration getAttributeNames()
                                        throws AccessDeniedException
Returns an enumeration of all available attributes names.

Returns:
an enumeration of attribute names
Throws:
AccessDeniedException - if the caller isn't authorized to access this data object
See Also:
getAttribute(String)

removeAttribute

public void removeAttribute(java.lang.String name)
                     throws AccessDeniedException
Removes the attribute with the given name. If no such attribute exists, this method does nothing.

Parameters:
name - the attribute name
Throws:
AccessDeniedException - if the caller isn't authorized to access this data object

getTitle

public java.lang.String getTitle(java.util.Locale locale,
                                 Client client)
Returns the title of this window. This method returns only a static title from the portlet configuration.

Parameters:
locale - the locale
client - the client
Returns:
the text of the portlet title

supports

public boolean supports(PortletWindow.State state)
Returns whether the portlet window supports the given state

Parameters:
state - the portlet window state to be supported
Returns:
true if the portlet window provides support,
false otherwise
See Also:
PortletWindow.State

supports

public boolean supports(java.util.Locale locale)
Returns whether the portlet supports the given locale.

Parameters:
locale - the locale to be supported
Returns:
true if the portlet provides support,
false otherwise

supports

public boolean supports(Portlet.Mode mode,
                        Client client)
Returns whether the portlet supports the given mode for the given client.

Parameters:
mode - the portlet mode to be supported
client - the client to be supported
Returns:
true if the portlet provides support,
false otherwise
See Also:
Portlet.Mode

getContext

public PortletContext getContext()
Returns the portlet context.

Returns:
the portlet context


Copyright © 2002 Apache Software Foundation. All Rights Reserved.