org.apache.jetspeed.portal
Class BasePortletConfig

java.lang.Object
  extended byjava.util.Dictionary
      extended byjava.util.Hashtable
          extended byorg.apache.jetspeed.util.BaseConfig
              extended byorg.apache.jetspeed.portal.BasePortletConfig
All Implemented Interfaces:
java.lang.Cloneable, Config, java.util.Map, PortletConfig, java.io.Serializable

public class BasePortletConfig
extends BaseConfig
implements PortletConfig

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

Version:
$Id: BasePortletConfig.java,v 1.12 2004/05/18 22:30:15 jford Exp $
Author:
Kevin A. Burton
See Also:
Serialized Form

Constructor Summary
BasePortletConfig()
           
 
Method Summary
 CapabilityMap getCapabilityMap()
           
 PortletSet.Constraints getConstraints()
          Retrieves the constraints associated with this portlet
 java.util.Map getLayout()
          Deprecated. use getConstraints instead
 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)
          Deprecated. use setConstraints instead
 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 class org.apache.jetspeed.util.BaseConfig
addInitParameters, getInitParameter, getInitParameter, getInitParameterNames, getInitParameters, getName, setInitParameter, setInitParameters, setName
 
Methods inherited from class java.util.Hashtable
clear, clone, contains, containsKey, containsValue, elements, entrySet, equals, get, hashCode, isEmpty, keys, keySet, put, putAll, rehash, remove, size, toString, values
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.apache.jetspeed.util.Config
addInitParameters, getInitParameter, getInitParameter, getInitParameterNames, getInitParameters, getName, setInitParameter, setInitParameters, setName
 

Constructor Detail

BasePortletConfig

public BasePortletConfig()
Method Detail

init

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

Specified by:
init in interface PortletConfig

getPortletSet

public PortletSet getPortletSet()
Returns the portlet current PortletSet

Specified by:
getPortletSet in interface PortletConfig

setPortletSet

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

Specified by:
setPortletSet in interface PortletConfig

getLayout

public java.util.Map getLayout()
Deprecated. use getConstraints instead

Returns the portlet current PortletSet

Specified by:
getLayout in interface PortletConfig

setLayout

public void setLayout(java.util.Map constraints)
Deprecated. use setConstraints instead

Set the context (PortletSet) for this portlet

Specified by:
setLayout in interface PortletConfig

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.

Specified by:
getSkin in interface PortletConfig
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

Specified by:
setSkin in interface PortletConfig

getPosition

public int getPosition()
Returns the portlet current PortletSet

Specified by:
getPosition in interface PortletConfig

setPosition

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

Specified by:
setPosition in interface PortletConfig

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.

Specified by:
getMetainfo in interface PortletConfig

setMetainfo

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

Specified by:
setMetainfo in interface PortletConfig

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.

Specified by:
getURL in interface PortletConfig

setURL

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

Specified by:
setURL in interface PortletConfig

isCachedOnURL

public boolean isCachedOnURL()
Description copied from interface: PortletConfig
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.

Specified by:
isCachedOnURL in interface PortletConfig
Returns:
true if the URL is to be part of the cache key.

setCachedOnURL

public void setCachedOnURL(boolean cached)
Description copied from interface: PortletConfig
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.

Specified by:
setCachedOnURL in interface PortletConfig
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

Specified by:
getLayout in interface PortletConfig

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

Specified by:
getSkin in interface PortletConfig

setSkin

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

Specified by:
setSkin in interface PortletConfig

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.

Specified by:
getPortletSkin in interface PortletConfig
Returns:
the Skin object that should be used.

setPortletSkin

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

Specified by:
setPortletSkin in interface PortletConfig
Parameters:
skin - the new skin to use

getConstraints

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

Specified by:
getConstraints in interface PortletConfig
Returns:
the Constraints object

setConstraints

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

Specified by:
setConstraints in interface PortletConfig
Parameters:
constraints - the constrints object associated with this portlet in the current set

getCapabilityMap

public CapabilityMap getCapabilityMap()
Specified by:
getCapabilityMap in interface PortletConfig

setCapabilityMap

public void setCapabilityMap(CapabilityMap cm)
Specified by:
setCapabilityMap in interface PortletConfig

setPageId

public void setPageId(java.lang.String pageId)
Specified by:
setPageId in interface PortletConfig

getPageId

public java.lang.String getPageId()
Specified by:
getPageId in interface PortletConfig

setPortletId

public void setPortletId(java.lang.String portletId)
Specified by:
setPortletId in interface PortletConfig

getPortletId

public java.lang.String getPortletId()
Specified by:
getPortletId in interface PortletConfig

getSecurityRef

public SecurityReference getSecurityRef()
Getter for property securityRef.

Specified by:
getSecurityRef in interface PortletConfig
Returns:
Value of property securityRef.

setSecurityRef

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

Specified by:
setSecurityRef in interface PortletConfig
Parameters:
securityRef - New value of property securityRef.


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