com.novell.afw.portlet.api
Interface EbiNovellPortletModel
- All Superinterfaces:
- EbiPortletModel
- public interface EbiNovellPortletModel
- extends EbiPortletModel
This interface represents a portlet model that provides JSR168 portlet
information in addition to the Novell extension information. This class
represents and is populated from the //portlet section of the portlet's
deployment descriptor.
- Since:
- v5.0
Field Summary |
static int |
EXPIRATION_CACHE_UNSPECIFIED
int value meaning that the expiration cache value was not specified in the deployment
descriptor. |
Methods implemented from interface com.novell.afw.portlet.api.EbiPortletModel |
getDescription,
getDisplayName,
getPortletAppContextName,
getPortletClassName,
getPortletContainerType,
getPortletName,
getPreviewImage,
getProducerID,
getStyles,
getSupportedMimeTypes,
getSupportedOptions,
getTitle,
isTitleBarEnabled |
EXPIRATION_CACHE_UNSPECIFIED
public static final int EXPIRATION_CACHE_UNSPECIFIED
- int value meaning that the expiration cache value was not specified in the deployment
descriptor. This value can be returned from the getExpirationCache() method.
- See Also:
EbiNovellPortletModel.getExpirationCache()
- Since:
- v5.0
getApplicationModel
public EbiPortletAppModel getApplicationModel()
- Returns a reference to the model that this portlet model belongs to.
- Returns:
- EbiPortletAppModel that prodcued this EbiPortletModel.
- Since:
- v5.0
getPreferences
public EbiPortletPreferencesDefaultType getPreferences()
- Returns the preferences for this portlet. These are
preferences defined in the descriptor and resource bundles only, and does
not include any defined at higher levels for various
portlet instances.
Corresponds to //portlet/portlet-preferences section of the portlet descriptor.
- Returns:
- EbiPortletPreferencesDefaultType with preferences in in the deployment descriptor.
- Since:
- v5.0
getInitParams
public Map getInitParams()
- Returns an unmodifiable Map of EbiPortletInitParam objects keyed by the init-param's name. These are parameters that are used
for initialization of the portlet, and available to the portlet at runtime. See section
PLT.5.2.2 of the portlet spec for more details on portlet initialization.
Corresponds to //portlet/init-param section of the portlet descriptor.
- Returns:
- Map of initializaiton parameters, where the name of the init-param is the key, and the value is
the EbiPortletInitParam object. If there are no init-params for the portlet, an empty Map is returned.
- Since:
- v5.0
- See Also:
EbiPortletInitParam
getExpirationCache
public int getExpirationCache()
- Returns the expiration cache. This is the amount of
time in seconds that portlet content should be cached
before the portal fetches fresh content from the portlet.
A value of 0 means the caching is disabled, a value of -1
means that the cache never expires. If no value was specified,
then the constant value EXPIRATION_CACHE_UNSPECIFIED will be returned.
Corresponds to //portlet/expiration-cache section of the portlet descriptor.
- Returns:
- int representing the number of seconds the content of the portlet should be cached.
- Since:
- v5.0
- See Also:
EbiNovellPortletModel.EXPIRATION_CACHE_UNSPECIFIED
getSuportedLocales
public Collection getSuportedLocales()
- Returns a Collection of Locale objects, one for each locale that the portlet
declares that it supports. This generally indicates which locales the portlet
developer has provided resource bundles for, and that one can expect the
portlet to have values localized for each locale indicated.
Corresponds to //portlet/supported-locale section of the portlet descriptor.
- Returns:
- Collection of Locale objects, or null if only the default locale is supported.
- Since:
- v5.0
isLocaleSupported
public boolean isLocaleSupported(Locale locale)
- Tests whether a given locale is supported. Returns true if it is. Only exact locales
are matched, so for example, if "en" is declared as being supported, a Locale with "en_US"
passed in would return false.
Corresponds to //portlet/supported-locale section of the portlet descriptor.
- Parameters:
locale
- Locale object to test for support of.- Returns:
- boolean true if the locale is supported, false otherwise.
- Since:
- v5.0
getShortTitle
public String getShortTitle(Locale locale)
- Returns a short title for the given locale, or the default
locale value if a value for the specified locale could not be found.
This value can come from either a resource bundle or the //portlet/portlet-info/short-title
section of the descriptor. An attempt to match the most specific locale in a resource
bundle will be made, and the portlet descriptor value will be the fall back if specified
there. If no value at all is specified, a return value of "" can be expected.
- Parameters:
locale
- Locale for which to get the short title, or null for the default.- Returns:
- String localized short title.
- Since:
- v5.0
getKeywords
public String[] getKeywords(Locale locale)
- Returns a String array of keywords.
Keywords are used to help locate portlets that users may be interested in.
This value can come from either a resource bundle or the //portlet/portlet-info/keywords
section of the descriptor. An attempt to match the most specific locale in a resource
bundle will be made, and the portlet descriptor value will be the fall back if specified
there. If no value at all is specified, an empty String[] can be expected.
- Parameters:
locale
- The locale for which the keywords should be retrieved, or null for the default.- Returns:
- String[] of localized Strings for the keywords, or and empty String[]
if none appropriate for the locale were found.
- Since:
- v5.0
getSecurityRoles
public Collection getSecurityRoles()
- Returns a Collection of EbiPortletSecurityRoleRef objects. These
reference security roles correspond to the //portlet/security-role-ref
section of the descriptor. See section PLT.2.0 or the portlet spec for more details on this.
- Returns:
- Collection of EbiPortletSecurityRoleRef objects, or empty Collection if none specified.
- Since:
- v5.0
- See Also:
EbiPortletSecurityRoleRef
getSupportedModes
public String[] getSupportedModes(String mimeType)
- Returns an Collection of supported portlet modes. This corresponds to the
//portlet/supports/portlet-mode section of the descriptor. See section PLT.8
of the portlet spec for more information.
TODO: this should return an empty String[] and not null - NP.
- Parameters:
mimeType
- The mimeType for which the modes should be retrieved (e.g. "text/html").- Returns:
- String array with all the supported modes, null if none defined for the mimetype.
- Since:
- v5.0
isModeSupported
public boolean isModeSupported(String mimeType,
String portletMode)
- Returns a boolean indicating whether the passed mode is supported for the passed in mimeType.
The mode comparison is case insensitive. This corresponds to the
//portlet/supports/portlet-mode section of the descriptor. See section PLT.8
of the portlet spec for more information.
- Parameters:
mimeType
- String mimeType for which the mode check should be done (e.g. "text/html").portletMode
- String name of the portlet mode to check.- Returns:
- boolean true if the mode is supported.
- Since:
- v5.0
isSynchronous
public boolean isSynchronous()
- Indicates whether or not the portlet is to be run synchronously. When this
is true, it indicates to the portal aggregation engine that the portlet should not
be rendered on it's own thread and that the application server's thread (depending on
portal settings) should be used to run every portlet in the request sequentially using the
same thread. It should be noted that when run asynchronously, the portlet's thread will
not have a copy of the app server's ThreadLocal variables, and being such, certain operations
such as jndi lookups may not work.
Corresponds to //portlet/synchonous section of the descriptor.
- Returns:
- boolean true if the portlet should run synchronously.
- Since:
- v5.0
- See Also:
com.novell.afw.portal.aggregation.EboPortalAggregationHelper#splitPortletsByThreadingModel(HashMap,ArrayList,ArrayList)
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 0 means that there is no timeout, or that a timeout has
not been specified. It should be noted that even if the value is specified here, that the
portal at its option may ignore or override this value for some or all portlets.
Corresponds to //portlet/max-timeout section of descriptor.
- Returns:
- number of milliseconds or 0 to mean no timeout.
- 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.
Corresponds to //portlet/hidden-from-user section of descriptor.
- Since:
- v5.0
isOptionSupported
public boolean isOptionSupported(String option)
- Indicates if the portlet should support the given option. If the option
name passed in is not listed in the novell-portlet.xml OR the option is listed
but has the enabled attribute set to false, this method will return false.
Corresponds to the //portlet/supported-option section of the descriptor.
- Parameters:
option
- String name of the option.- Returns:
- boolean true to mean that the option is supported by this portlet.
- Since:
- v5.0
isAuthenticationRequired
public boolean isAuthenticationRequired()
- Indicates whether or not the portlet requires the
use executing it to be authenticated before it can run.
If this is false, then the portlet can be run anonymously.
Corresponds to the //portlet/required-authentication section of the descriptor.
- Returns:
- boolean true if the portlet requires the user to be authenticated before it can run.
This will be false if not specified.
- Since:
- v5.0
getAutoRegistration
public EbiPortletModelAutoRegistration getAutoRegistration()
- Returns the registration information for this portlet.
If this is null, then no auto registration information was provided.
Corresponds to the //portlet/auto-register section of the descriptor.
- Returns:
- EbiPortletModelAutoRegistration object with the auto-registration
information for the portlet, or null if none was specified.
- Since:
- v5.0
isAutoRegistered
public boolean isAutoRegistered()
- Indicates whether or not the portlet should be be auto registered.
If this is true, then the portlet is registered automatically if
no registration for the portlet is found at boot time. If this is true,
then getAutoRegistration will return a non null object from which
further details about the registration can be obtained.
Corresponds to the //portlet/auto-register/@enabled section of the descriptor.
- Returns:
- boolean true if the portlet is allowed to be auto registered.
- Since:
- v5.0
isMimeTypeSupported
public boolean isMimeTypeSupported(String mimeTyppe)
- Indicates whether or not the mime type passed in is supported.
See section PLT.8.6 of the portlet spec for more information on supports.
Corresponds to the //portlet/supports/mime-type section of the descriptor.
- Parameters:
mimeTyppe
- String name of the mimeType to check to see if supported (i.e. "text/html").- Returns:
- boolean true if the portlet supports the mimetype.
- Since:
- v5.0
getResourceBundle
public ResourceBundle getResourceBundle(Locale locale)
- Returns the resource bundle associated with this portlet. This is the
bundle which has its base bundle name defined in the //portlet/resource-bundle
section of the descriptor and accesible by calling getResourceBundleName(). If the
bundle could not be found, a bundle is generated based on the //portlet/portlet-info
contents, and if this is not present, the returned bundle will be empty.
- Parameters:
locale
- The locale for which to return the bundle.- Returns:
- A resource bundle, or null if not found.
- Since:
- v5.0
getResourceBundleName
public String getResourceBundleName()
- Returns the name of the resource bundle declared in the
descriptor. This will return null if none was specified.
Note that just beacuse this returns null, does not
mean that getResourceBundle() will return null. That
method will generate a bundle when needed, and so
will never return null.
Corresponds to the //portlet/resource-bundle section of the descriptor.
- Returns:
- String name of the declared resource bundle.
- Since:
- v5.0
getPortletContext
public javax.portlet.PortletContext getPortletContext()
- Returns the portlet context that is bound to this portlet model.
- Returns:
- PortletContext, never null.
- Since:
- v5.0