Novell exteNd
Director 5.2 API

com.novell.afw.portlet.api
Interface EbiPortletSettings


public interface EbiPortletSettings

Represents a set of well known settings that can affect the way that the container deals with a portlet. The settings apply to a given portlet handle (and therefore instance). The settings can be composite, that is where one handle may be the parent of another, and settings are inherited from the parent, and its parents.

Since:
v5.0

Method Summary
 String getLocalizedTitle(Locale[] locales)
          Returns the localized title for the portlet.
 int getMaxTimeOut()
          Indicates that the maximum amount of time in milliseconds the portal should wait for this portlet to return its content.
 EbiPortletSettings getParent()
          Returns the parent of this settings object.
 String getTitle(Locale locale)
          Returns the localized title for the portlet.
 String getUserTitle(com.novell.afw.portlet.api.EbiContext context)
          Returns the localized title for the portlet.
 boolean isAuthenticationRequired()
          Indicates if the portlet requires authentication before it can be run.
 boolean isAuthenticationRequiredInherited()
          Indicates if the setting is defined at the current level or if it is only defined at a level in the parent hierarchy.
 boolean isHiddenFromUser()
          Indicates if the portlet should be hidden from the user, that is not shown in a list of portlets the user may choose from.
 boolean isHiddenFromUserInherited()
          Indicates if the setting is defined at the current level or if it is only defined at a level in the parent hierarchy.
 boolean isMaxTimeOutInherited()
          Indicates if the setting is defined at the current level or if it is only defined at a level in the parent hierarchy.
 boolean isOptionInherited(String option)
          Indicates if the setting is defined at the current level or if it is only defined at a level in the parent hierarchy.
 boolean isOptionSupported(String option)
          Indicates whether an option is supported by this portlet.
 boolean isTitlebarEnabled()
          Indicates if the portlet's titlebar should be shown.
 boolean isTitlebarEnabledInherited()
          Indicates if the setting is defined at the current level or if it is only defined at a level in the parent hierarchy.
 boolean isTitleInherited(Locale locale)
          Indicates if the setting is defined at the current level or if it is only defined at a level in the parent hierarchy.
 boolean isTitleReadOnly()
          Indicates if the title is read-only.
 void resetAuthenticationRequired()
          Resests the value to the original value (that is the one inherited from the parent settings).
 void resetHiddenFromUser()
          Resests the value to the original value (that is the one inherited from the parent settings).
 void resetMaxTimeOut()
          Resests the value to the original value (that is the one inherited from the parent settings).
 void resetOption(String option)
          Resests the suported status of the option to the original value (that is the one inherited from the parent settings).
 void resetTitle(Locale locale)
          Resets the value to the original value (that is the one inherited from the parent settings).
 void resetTitlebarEnabled()
          Resests the value to the original value (that is the one inherited from the parent settings).
 void setAuthenticationRequired(boolean authreq)
          Sets the flag to indicate if the portlet requires authentication before it can be run.
 void setHiddenFromUser(boolean enabled)
          Sets the flag to indicates that the portlet should be hidden from the user, that is not shown in a list of portlets the user may choose from.
 void setMaxTimeOut(long timeout)
          Indicates that the maximum amount of time in milliseconds the portal should wait for this portlet to return its content.
 void setOption(String option, boolean supported)
          Sets an option to be supported or unsupported for the portlet.
 void setTitle(Locale locale, String title)
          Sets the localized title for the portlet.
 void setTitlebarEnabled(boolean enabled)
          Sets the flag to indicates that the titlebar should be shwon.
 void setTitleReadOnly(boolean readOnly)
          Sets the readOnly status of the title.
 

Method Detail

getParent

public EbiPortletSettings getParent()
Returns the parent of this settings object. If there is a parent, this settings will inherit all the settings from it, unless overridden. If no parent exists, null will be returned.
Returns:
EbiPortletSettings object that is the parent of this object, or null if none.
Since:
v5.0

getMaxTimeOut

public int getMaxTimeOut()
Indicates that the maximum amount of time in milliseconds the portal should wait for this portlet to return its content. A -1 means that there is no timeout, or that a timeout has not been specified.
Returns:
number of milliseconds or -1 to mean no timeout.
Since:
v5.0

setMaxTimeOut

public void setMaxTimeOut(long timeout)
Indicates that the maximum amount of time in milliseconds the portal should wait for this portlet to return its content. A -1 means that there is no timeout, or that a timeout has not been specified.
Parameters:
timeout - long for the number of milliseconds or -1 to mean no timeout.
Since:
v5.0

resetMaxTimeOut

public void resetMaxTimeOut()
Resests the value to the original value (that is the one inherited from the parent settings). If there was no inherited value, the value is reset to the default.
Since:
v5.0

isMaxTimeOutInherited

public boolean isMaxTimeOutInherited()
Indicates if the setting is defined at the current level or if it is only defined at a level in the parent hierarchy.
Returns:
boolean true if the setting is inherited from another level, and not overridden at this level.
Since:
v5.0

getTitle

public String getTitle(Locale locale)
Returns the localized title for the portlet. With this method only variations of the locale passed in can be considered. If nothing matching the locale passed or one of its variants is found, then the default value is returned. To properly evaluate all locales that a user indicates that he can use, use the getLocalizedTitle(java.util.Locale[]) method and pass in an array of Locale objects (usually gotten from com.novell.afw.portlet.util.EboLocaleHelper). Alternatively, use the getUserTitle(com.sssw.fw.api.EbiContext) which will figure out the the best locale for the user based on the context and return the localized title.
Parameters:
locale - for which to return the title.
Returns:
String with the localized title or the default title if no localizations could be found to match the passed locale or its variants. If no localized title could be found and no default title exists, null may be returned.
Since:
v5.0
See Also:
EbiPortletSettings.getLocalizedTitle(java.util.Locale[]), #getUserTitle(com.sssw.fw.api.EbiContext)

getLocalizedTitle

public String getLocalizedTitle(Locale[] locales)
Returns the localized title for the portlet. With this method all locales in the array are considered. If nothing matching any of the locales passed is found, then the default value is returned. Use this method instead of getTitle(java.util.Locale) to consider a set of locales instead of just one. The array of locales is used as is (no variants of locales considered) and it is assumed that the list is populated with all variants of of locales to be considered in the order of specificity. As a convienience, you can also use the getUserTitle(com.sssw.fw.api.EbiContext) which will figure out the the best locale for the user based on the context and return the localized title.
Parameters:
locales - Array of Locale objects, usually gotten from com.novell.afw.portlet.util.EboLocaleHelper.
Returns:
String with the localized title or the default title if no localizations could be found to match one of the locales in the array or its variants. If no localized title could be found and no default title exists, null may be returned.
Since:
v5.2
See Also:
EbiPortletSettings.getTitle(java.util.Locale), #getUserTitle(com.sssw.fw.api.EbiContext)

getUserTitle

public String getUserTitle(com.novell.afw.portlet.api.EbiContext context)
Returns the localized title for the portlet. With this method the user's browser locales are considered and used to determine the most appropriate localized title to return. This is the best method to use when dealing with a user's request and the best locale should be determined automatically. All of the user's specified locales and all thier variants are will be tried in the order specified by the browser until a a match is found.
Parameters:
context - EbiContext containing information about the user's request.
Returns:
String with the localized title or the default title if no localizations could be found to match one of the locales in the enumeration or its variants. If no localized title could be found and no default title exists, null may be returned.
Since:
v5.2
See Also:
EbiPortletSettings.getTitle(java.util.Locale), EbiPortletSettings.getLocalizedTitle(java.util.Locale[])

setTitle

public void setTitle(Locale locale,
                     String title)
Sets the localized title for the portlet.
Parameters:
locale - for which to set the locale.
title - String with the title for the portlet.
Since:
v5.0

resetTitle

public void resetTitle(Locale locale)
Resets the value to the original value (that is the one inherited from the parent settings). If there was no inherited value, the value is reset to the default.
Parameters:
locale - The locale for which to reset the value
Since:
v5.0

isTitleInherited

public boolean isTitleInherited(Locale locale)
Indicates if the setting is defined at the current level or if it is only defined at a level in the parent hierarchy.
Returns:
boolean true if the setting is inherited from another level, and not overridden at this level.
Since:
v5.0

isTitleReadOnly

public boolean isTitleReadOnly()
Indicates if the title is read-only.
Returns:
boolean true if the title should not be modified by any levels above the current.
Since:
v5.0

setTitleReadOnly

public void setTitleReadOnly(boolean readOnly)
Sets the readOnly status of the title. Setting this to true means that no levels above the current can override the title.
Parameters:
readOnly - boolean true to mean the title is set read-only.
Since:
v5.0

isAuthenticationRequired

public boolean isAuthenticationRequired()
Indicates if the portlet requires authentication before it can be run.
Returns:
boolean true to mean that a user must be authenticated before the portlet can be run.
Since:
v5.0

setAuthenticationRequired

public void setAuthenticationRequired(boolean authreq)
Sets the flag to indicate if the portlet requires authentication before it can be run.
Parameters:
authreq - true to mean that a user must be authenticated before the portlet can be run.
Since:
v5.0

resetAuthenticationRequired

public void resetAuthenticationRequired()
Resests the value to the original value (that is the one inherited from the parent settings). If there was no inherited value, the value is reset to the default.
Since:
v5.0

isAuthenticationRequiredInherited

public boolean isAuthenticationRequiredInherited()
Indicates if the setting is defined at the current level or if it is only defined at a level in the parent hierarchy.
Returns:
boolean true if the setting is inherited from another level, and not overridden at this level.
Since:
v5.0

isTitlebarEnabled

public boolean isTitlebarEnabled()
Indicates if the portlet's titlebar should be shown.
Returns:
boolean true to mean that the titlebar will be shown.
Since:
v5.0

setTitlebarEnabled

public void setTitlebarEnabled(boolean enabled)
Sets the flag to indicates that the titlebar should be shwon.
Parameters:
enabled - true to mean that titlebar should be shown.
Since:
v5.0

resetTitlebarEnabled

public void resetTitlebarEnabled()
Resests the value to the original value (that is the one inherited from the parent settings). If there was no inherited value, the value is reset to the default.
Since:
v5.0

isTitlebarEnabledInherited

public boolean isTitlebarEnabledInherited()
Indicates if the setting is defined at the current level or if it is only defined at a level in the parent hierarchy.
Returns:
boolean true if the setting is inherited from another level, and not overridden at this level.
Since:
v5.0

isHiddenFromUser

public boolean isHiddenFromUser()
Indicates if the portlet should be hidden from the user, that is not shown in a list of portlets the user may choose from.
Returns:
boolean true to mean that the user cannot see the portlet in listings of portlets.
Since:
v5.0

setHiddenFromUser

public void setHiddenFromUser(boolean enabled)
Sets the flag to indicates that the portlet should be hidden from the user, that is not shown in a list of portlets the user may choose from.
Parameters:
enabled - boolean true to mean that the user cannot see the portlet in listings of portlets.
Since:
v5.0

resetHiddenFromUser

public void resetHiddenFromUser()
Resests the value to the original value (that is the one inherited from the parent settings). If there was no inherited value, the value is reset to the default.
Since:
v5.0

isHiddenFromUserInherited

public boolean isHiddenFromUserInherited()
Indicates if the setting is defined at the current level or if it is only defined at a level in the parent hierarchy.
Returns:
boolean true if the setting is inherited from another level, and not overridden at this level.
Since:
v5.0

setOption

public void setOption(String option,
                      boolean supported)
Sets an option to be supported or unsupported for the portlet. Options from lower level settings will be inherited, but these can be explicitly turned off by passing in the option name and indicating false.
Parameters:
option - String name of the option.
supported - boolean true to indicate that the portlet supports this option.
Since:
v5.0

resetOption

public void resetOption(String option)
Resests the suported status of the option to the original value (that is the one inherited from the parent settings). If there was no inherited value, the value is reset to the default.
Parameters:
option - String name of the option.
Since:
v5.0

isOptionSupported

public boolean isOptionSupported(String option)
Indicates whether an option is supported by this portlet.
Parameters:
option - String the option name.
Returns:
boolean true if the portlet is set to support the passed in option.
Since:
v5.0

isOptionInherited

public boolean isOptionInherited(String option)
Indicates if the setting is defined at the current level or if it is only defined at a level in the parent hierarchy. If an option was not defined at any level, it is considered to have been implicitly set to false i.e. "not supported", and so this method will return true.
Returns:
boolean true if the setting is inherited from another level or was not defined at any level, and not overridden at this level.
Since:
v5.0

Novell exteNd
Director 5.2 API