org.apache.jetspeed.portal
Interface PortletConfig

All Superinterfaces:
Config
All Known Implementing Classes:
BasePortletConfig

public interface PortletConfig
extends Config

Defines a configuration for Portlets. A PortletConfig provides information about the running environment of a given Portlet.

Version:
$Id: PortletConfig.java,v 1.50 2004/02/23 04:05:35 jford Exp $
Author:
Kevin A. Burton

Method Summary
 CapabilityMap getCapabilityMap()
           
 PortletSet.Constraints getConstraints()
          Retrieves the constraints associated with this portlet
 java.util.Map getLayout()
          Returns the portlet current PortletSet
 java.lang.String getLayout(java.lang.String name, java.lang.String defaultValue)
          Returns a parameter (or defaultValue) that was given to a Portlet.
 MetaData getMetainfo()
          Returns this Portlet's Metainfo or null it none exists.
 java.lang.String getPageId()
           
 java.lang.String getPortletId()
           
 PortletSet getPortletSet()
          Returns the portlet current PortletSet
 PortletSkin getPortletSkin()
          Retrieves the Skin object that should be used for this portlet.
 int getPosition()
          Returns the portlet current PortletSet
 SecurityReference getSecurityRef()
          Getter for property securityRef.
 java.util.Map getSkin()
          Returns the current skin mapping.
 java.lang.String getSkin(java.lang.String name, java.lang.String defaultValue)
          Returns a parameter (or defaultValue) that was given to a Portlet.
 java.lang.String getURL()
          Portlets can have external configuration information other than just parameters.
 void init(java.lang.String url, java.util.Map init_params)
          Init this PortletConfig providing the basic info.
 boolean isCachedOnURL()
          Determines whether to use the URL as part of the unique id to the portlet cache.
 void setCachedOnURL(boolean cached)
          Determines whether to use the URL as part of the unique id to the portlet cache.
 void setCapabilityMap(CapabilityMap cm)
           
 void setConstraints(PortletSet.Constraints constraints)
          Sets the layout constraints in the current portlet set
 void setLayout(java.util.Map constraints)
          Set the context (PortletSet) for this portlet
 void setMetainfo(MetaData metainfo)
          Set the metainfo for the Portlet
 void setPageId(java.lang.String pageId)
           
 void setPortletId(java.lang.String portletId)
           
 void setPortletSet(PortletSet set)
          Set the context (PortletSet) for this portlet
 void setPortletSkin(PortletSkin skin)
          Sets the PortletSkin to use for this Portlet
 void setPosition(int position)
          Set the context (PortletSet) for this portlet
 void setSecurityRef(SecurityReference securityRef)
          Setter for property securityRef.
 void setSkin(java.util.Map skin)
          Deprecated. use setPortletSkin instead
 void setSkin(java.lang.String name, java.lang.String value)
          Sets a skin parameter value in the local config
 void setURL(java.lang.String url)
          Used to define a Portlet's URL.
 
Methods inherited from interface org.apache.jetspeed.util.Config
addInitParameters, getInitParameter, getInitParameter, getInitParameterNames, getInitParameters, getName, setInitParameter, setInitParameters, setName
 

Method Detail

init

public void init(java.lang.String url,
                 java.util.Map init_params)
Init this PortletConfig providing the basic info.


getPortletSet

public PortletSet getPortletSet()
Returns the portlet current PortletSet


setPortletSet

public void setPortletSet(PortletSet set)
Set the context (PortletSet) for this portlet


getLayout

public java.util.Map getLayout()
Returns the portlet current PortletSet


setLayout

public void setLayout(java.util.Map constraints)
Set the context (PortletSet) for this portlet


getSkin

public java.util.Map getSkin()
Returns the current skin mapping. This method is used for configuration. Use getPortletSkin() to find skin use by the Layout engine.

Returns:
Current skin mapping or null if no skin is defined in PSML.

setSkin

public void setSkin(java.util.Map skin)
Deprecated. use setPortletSkin instead

Set the context (PortletSet) for this portlet


getPosition

public int getPosition()
Returns the portlet current PortletSet


setPosition

public void setPosition(int position)
Set the context (PortletSet) for this portlet


getMetainfo

public MetaData getMetainfo()
Returns this Portlet's Metainfo or null it none exists. The Metainfo can be used to determine an optional title or description for this Portlet.


setMetainfo

public void setMetainfo(MetaData metainfo)
Set the metainfo for the Portlet


getURL

public java.lang.String getURL()
Portlets can have external configuration information other than just parameters. A URL can define an external configuration file or HTML file that this Portlet can parse out. The main reason for using setURL/getURL is because the remote URL is cached within Jetspeed so future requests won't have any latency.


setURL

public void setURL(java.lang.String url)
Used to define a Portlet's URL.


isCachedOnURL

public boolean isCachedOnURL()
Determines whether to use the URL as part of the unique id to the portlet cache. This can be used to control the lifetime of the portlet. The URL is used in combination with the parameter names and values for this portlet to uniquely identify to portlet. Parameters may also be optionally included in the cache key. This value can be set in the portlet registry.

Returns:
true if the URL is to be part of the cache key.

setCachedOnURL

public void setCachedOnURL(boolean cached)
Determines whether to use the URL as part of the unique id to the portlet cache. This can be used to control the lifetime of the portlet. The URL is used in combination with the parameter names and values for this portlet to uniquely identify to portlet. Parameters may also be optionally included in the cache key. This value can be set in the portlet registry.

Returns:
cached set to true if want this portlet to be cached based on the url

getLayout

public java.lang.String getLayout(java.lang.String name,
                                  java.lang.String defaultValue)
Returns a parameter (or defaultValue) that was given to a Portlet. This can be by a Portlet to obtain further information of itself. The parameter is returned even if it is defined in the context and not directly in the portlet config


getSkin

public java.lang.String getSkin(java.lang.String name,
                                java.lang.String defaultValue)
Returns a parameter (or defaultValue) that was given to a Portlet. This can be by a Portlet to obtain further information of itself. The parameter is returned even if it is defined in the context and not directly in the portlet config


setSkin

public void setSkin(java.lang.String name,
                    java.lang.String value)
Sets a skin parameter value in the local config


getPortletSkin

public PortletSkin getPortletSkin()
Retrieves the Skin object that should be used for this portlet. If the current portlet does not have a skin, then skin is retrieve from the parent portlet set of the system default is now skins are defined in the portlet set. getSkin() can be used for configuration.

Returns:
the Skin object that should be used.

setPortletSkin

public void setPortletSkin(PortletSkin skin)
Sets the PortletSkin to use for this Portlet

Parameters:
skin - the new skin to use

getConstraints

public PortletSet.Constraints getConstraints()
Retrieves the constraints associated with this portlet

Returns:
the Constraints object

setConstraints

public void setConstraints(PortletSet.Constraints constraints)
Sets the layout constraints in the current portlet set

Parameters:
constraints - the constrints object associated with this portlet in the current set

getCapabilityMap

public CapabilityMap getCapabilityMap()

setCapabilityMap

public void setCapabilityMap(CapabilityMap cm)

setPortletId

public void setPortletId(java.lang.String portletId)

getPortletId

public java.lang.String getPortletId()

setPageId

public void setPageId(java.lang.String pageId)

getPageId

public java.lang.String getPageId()

getSecurityRef

public SecurityReference getSecurityRef()
Getter for property securityRef.

Returns:
Value of property securityRef.

setSecurityRef

public void setSecurityRef(SecurityReference securityRef)
Setter for property securityRef.

Parameters:
securityRef - New value of property securityRef.


Copyright © 2000-2005 Apache Software Foundation. All Rights Reserved.