org.apache.jetspeed.om.registry.base
Class BasePortletEntry

java.lang.Object
  extended byorg.apache.jetspeed.om.registry.base.BaseRegistryEntry
      extended byorg.apache.jetspeed.om.registry.base.BasePortletInfoEntry
          extended byorg.apache.jetspeed.om.registry.base.BasePortletEntry
All Implemented Interfaces:
PortletEntry, PortletInfoEntry, RegistryEntry, java.io.Serializable

public class BasePortletEntry
extends BasePortletInfoEntry
implements PortletEntry, java.io.Serializable

Default bean like implementation of the PortletEntry interface suitable for serialization with Castor

Version:
$Id: BasePortletEntry.java,v 1.8 2005/03/21 18:21:37 sgala Exp $
Author:
Raphaël Luta
See Also:
Serialized Form

Field Summary
protected  java.util.Vector categories
           
 
Fields inherited from class org.apache.jetspeed.om.registry.base.BasePortletInfoEntry
classname, medias, mediasIdx, nameIdx, parameter, tools, toolsIdx
 
Fields inherited from class org.apache.jetspeed.om.registry.base.BaseRegistryEntry
_hidden, hidden, metaInfo, name, security, securityRef
 
Fields inherited from interface org.apache.jetspeed.om.registry.PortletEntry
DEFAULT_CATEGORY_ABSTRACT, DEFAULT_CATEGORY_REF, DEFAULT_GROUP, TYPE_ABSTRACT, TYPE_INSTANCE, TYPE_REF
 
Constructor Summary
BasePortletEntry()
           
BasePortletEntry(long id)
           
 
Method Summary
 void addCategory(java.lang.String name)
          Add a new category to this portlet entry in the default group.
 void addCategory(java.lang.String name, java.lang.String group)
          Add a new category to this portlet entry.
 boolean equals(java.lang.Object object)
          Implements the equals operation so that 2 elements are equal if all their member values are equal.
 boolean getApplication()
          This method is used by the Castor persistence system to retrieve the application status
 CachedParameter getCachedParameter(java.lang.String name)
          helper to get an instance of a cached parameter.
 java.util.Vector getCategories()
           
 java.lang.String getClassname()
           
 BaseContentURL getContentURL()
           
 java.lang.String getDescription()
           
 MetaInfo getMetaInfo()
           
 Parameter getParameter(java.lang.String name)
          Search for a named parameter and return the associated parameter object.
 java.util.Map getParameterMap()
          Returns a map of parameter values keyed on the parameter names
 java.util.Iterator getParameterNames()
           
 java.lang.String getParent()
           
 PortletEntry getParentEntry()
          Looks up in the Registry the parent entry for this real entry
 java.lang.String getTitle()
           
 java.lang.String getType()
           
 java.lang.String getURL()
           
 ContentURL getURLEntry()
          Gets the URL entry record for this portlet entry
 boolean hasCategory(java.lang.String name)
          Test if a given category exists for this entry
 boolean hasCategory(java.lang.String name, java.lang.String group)
          Test if a given category exists for this entry, in the specified group of categories.
 boolean hasMediaType(java.lang.String name)
          Test if a given media type is supported by this entry.
 boolean isAdmin()
           
 boolean isApplication()
           
 boolean isCachedOnURL()
          Determines whether to use the URL as part of the unique id to the portlet cache.
 java.util.Iterator listCategories()
          Returns a list of the supported media type names
 java.util.Iterator listMediaTypes()
          Returns a list of the supported media type names
 void removeCategory(java.lang.String name)
          Remove a category from this portlet entry in the default group.
 void removeCategory(java.lang.String name, java.lang.String group)
          Remove a category from this portlet entry in the specified group.
 void setApplication(boolean application)
          Sets the application status of this portlet entry.
 void setCachedOnURL(boolean cache)
          Determines whether to use the URL as part of the unique id to the portlet cache.
 void setCategories(java.util.Vector v)
           
 void setContentURL(BaseContentURL url)
          Sets the URL for this PortletEntry
 void setParent(java.lang.String parent)
          Sets the ancestor for this PortletEntry.
 void setType(java.lang.String type)
          Sets the type of this entry.
 void setURL(java.lang.String url)
          Sets the URL for this PortletEntry
 
Methods inherited from class org.apache.jetspeed.om.registry.base.BasePortletInfoEntry
addMediaType, addParameter, addParameter, addTool, buildNameIndex, getMediaTypes, getParameters, getTool, getToolMap, getToolNames, getTools, removeMediaType, removeParameter, removeTool, setClassname, setMediaTypes, setParameters, setTools
 
Methods inherited from class org.apache.jetspeed.om.registry.base.BaseRegistryEntry
getBaseMetaInfo, getBaseSecurity, getHidden, getId, getName, getSecurity, getSecurityRef, isHidden, setBaseMetaInfo, setBaseSecurity, setDescription, setHidden, setMetaInfo, setName, setSecurity, setSecurityRef, setTitle
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.jetspeed.om.registry.PortletInfoEntry
addMediaType, addParameter, addParameter, addTool, getTool, getToolMap, getToolNames, removeMediaType, removeParameter, removeTool, setClassname
 
Methods inherited from interface org.apache.jetspeed.om.registry.RegistryEntry
getId, getName, getSecurity, getSecurityRef, isHidden, setDescription, setHidden, setMetaInfo, setName, setSecurity, setSecurityRef, setTitle
 

Field Detail

categories

protected java.util.Vector categories
Constructor Detail

BasePortletEntry

public BasePortletEntry()

BasePortletEntry

public BasePortletEntry(long id)
Method Detail

equals

public boolean equals(java.lang.Object object)
Implements the equals operation so that 2 elements are equal if all their member values are equal.

Overrides:
equals in class BasePortletInfoEntry

getURL

public java.lang.String getURL()
Specified by:
getURL in interface PortletEntry
Returns:
the URL associated with this portlet or null

setURL

public void setURL(java.lang.String url)
Sets the URL for this PortletEntry

Specified by:
setURL in interface PortletEntry
Parameters:
url - the new PortletEntry URL

isCachedOnURL

public boolean isCachedOnURL()
Description copied from interface: PortletEntry
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 PortletEntry
Returns:
true if the URL is to be part of the cache key.

setCachedOnURL

public void setCachedOnURL(boolean cache)
Description copied from interface: PortletEntry
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 PortletEntry
Returns:
cached set to true if want this portlet to be cached based on the url

getURLEntry

public ContentURL getURLEntry()
Description copied from interface: PortletEntry
Gets the URL entry record for this portlet entry

Specified by:
getURLEntry in interface PortletEntry
Returns:
ContentURL the URL entry object

getParent

public java.lang.String getParent()
Specified by:
getParent in interface PortletEntry
Returns:
the entry name from which this one is derived

getClassname

public java.lang.String getClassname()
Specified by:
getClassname in interface PortletInfoEntry
Overrides:
getClassname in class BasePortletInfoEntry
Returns:
the classname associated to this entry

setParent

public void setParent(java.lang.String parent)
Sets the ancestor for this PortletEntry.

Specified by:
setParent in interface PortletEntry
Parameters:
parent - the new ancestor entry name. This name should be defined in the system registry

isAdmin

public boolean isAdmin()
Specified by:
isAdmin in interface PortletEntry
Returns:
true is this entry is only accessible by the portal administrators.

isApplication

public boolean isApplication()
Specified by:
isApplication in interface PortletEntry
Returns:
true is the PortletEntry is marked as an application

setApplication

public void setApplication(boolean application)
Sets the application status of this portlet entry. If an entry is maked as application, the associated portlet will only be displayed in Maximized mode and can be retrieved specifically

Specified by:
setApplication in interface PortletEntry
Parameters:
application - the new application status

getType

public java.lang.String getType()
Specified by:
getType in interface PortletEntry
Returns:
the type of this entry

setType

public void setType(java.lang.String type)
Sets the type of this entry. The type specifies whether it is abstract, instance or ref

Specified by:
setType in interface PortletEntry
Parameters:
type - the new type for the PortletEntry

getApplication

public boolean getApplication()
This method is used by the Castor persistence system to retrieve the application status

Returns:
the application status of this entry
See Also:
PortletEntry.isApplication()

getTitle

public java.lang.String getTitle()
Specified by:
getTitle in interface RegistryEntry
Overrides:
getTitle in class BaseRegistryEntry
See Also:
RegistryEntry.getTitle()

getDescription

public java.lang.String getDescription()
Specified by:
getDescription in interface RegistryEntry
Overrides:
getDescription in class BaseRegistryEntry
See Also:
RegistryEntry.getDescription()

getParentEntry

public PortletEntry getParentEntry()
Looks up in the Registry the parent entry for this real entry


getMetaInfo

public MetaInfo getMetaInfo()
Specified by:
getMetaInfo in interface RegistryEntry
Overrides:
getMetaInfo in class BaseRegistryEntry

getParameterNames

public java.util.Iterator getParameterNames()
Specified by:
getParameterNames in interface PortletInfoEntry
Overrides:
getParameterNames in class BasePortletInfoEntry
Returns:
an enumeration of this entry parameter names

getParameter

public Parameter getParameter(java.lang.String name)
Search for a named parameter and return the associated parameter object. The search is case sensitive.

Specified by:
getParameter in interface PortletInfoEntry
Overrides:
getParameter in class BasePortletInfoEntry
Parameters:
name - the parameter name to look for
Returns:
the parameter object for a given parameter name

getCachedParameter

public CachedParameter getCachedParameter(java.lang.String name)
Description copied from interface: PortletEntry
helper to get an instance of a cached parameter.

Specified by:
getCachedParameter in interface PortletEntry
Parameters:
name - The parameter name.
Returns:
The cached parameter entry.

getParameterMap

public java.util.Map getParameterMap()
Returns a map of parameter values keyed on the parameter names

Specified by:
getParameterMap in interface PortletInfoEntry
Overrides:
getParameterMap in class BasePortletInfoEntry
Returns:
the parameter values map

listMediaTypes

public java.util.Iterator listMediaTypes()
Returns a list of the supported media type names

Specified by:
listMediaTypes in interface PortletInfoEntry
Overrides:
listMediaTypes in class BasePortletInfoEntry
Returns:
an iterator on the supported media type names

hasMediaType

public boolean hasMediaType(java.lang.String name)
Test if a given media type is supported by this entry. The test is done by a case sensitive name comparison

Specified by:
hasMediaType in interface PortletInfoEntry
Overrides:
hasMediaType in class BasePortletInfoEntry
Parameters:
name - the media type name to test for.
Returns:
true is the media type is supported false otherwise

getContentURL

public BaseContentURL getContentURL()
Returns:
the URL associated with this portlet or null

setContentURL

public void setContentURL(BaseContentURL url)
Sets the URL for this PortletEntry

Parameters:
url - the new PortletEntry URL

getCategories

public java.util.Vector getCategories()

setCategories

public void setCategories(java.util.Vector v)

listCategories

public java.util.Iterator listCategories()
Returns a list of the supported media type names

Specified by:
listCategories in interface PortletEntry
Returns:
an iterator on the supported media type names

hasCategory

public boolean hasCategory(java.lang.String name)
Test if a given category exists for this entry

Specified by:
hasCategory in interface PortletEntry
Parameters:
name - the category name
Returns:
true is the category exists in the default group

hasCategory

public boolean hasCategory(java.lang.String name,
                           java.lang.String group)
Test if a given category exists for this entry, in the specified group of categories.

Specified by:
hasCategory in interface PortletEntry
Parameters:
name - the category name
group - the category group
Returns:
true is the category exists in the specified group

addCategory

public void addCategory(java.lang.String name)
Add a new category to this portlet entry in the default group.

Specified by:
addCategory in interface PortletEntry
Parameters:
name - the category name

addCategory

public void addCategory(java.lang.String name,
                        java.lang.String group)
Add a new category to this portlet entry.

Specified by:
addCategory in interface PortletEntry
Parameters:
name - the category name
group - the category group name

removeCategory

public void removeCategory(java.lang.String name)
Remove a category from this portlet entry in the default group.

Specified by:
removeCategory in interface PortletEntry
Parameters:
name - the category name

removeCategory

public void removeCategory(java.lang.String name,
                           java.lang.String group)
Remove a category from this portlet entry in the specified group.

Specified by:
removeCategory in interface PortletEntry
Parameters:
name - the media type name to remove.
group - the category group name


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