org.apache.jetspeed.components.portletregistry
Interface PortletRegistry


public interface PortletRegistry

PortletRegistryComponentImpl

Version:
$ $
Author:
Scott T. Weaver

Method Summary
 void addRegistryListener(RegistryEventListener listener)
           
 PortletDefinition clonePortletDefinition(PortletDefinition source, java.lang.String newPortletName)
          Create a portlet instance
 java.util.Collection<PortletDefinition> getAllCloneDefinitions()
          Retrieve all clone definitions system wide
 java.util.Collection<PortletDefinition> getAllDefinitions()
          Retrieves all portlet definitions for this deployment including both clones and portlet definitions
 java.util.Collection<PortletDefinition> getAllPortletDefinitions()
          Retrieve all portlet definitions system wide The collection does not include clones
 PortletApplication getPortletApplication(java.lang.String name)
          Retrieves a PortletApplication by it's unique name.
 PortletApplication getPortletApplication(java.lang.String name, boolean fromCache)
          Retreives a PortletApplication by it's unique name.
 java.util.Collection<PortletApplication> getPortletApplications()
           
 PortletDefinition getPortletDefinitionByUniqueName(java.lang.String name)
          unique name is a string formed by the combination of a portlet's unique within it's parent application plus the parent application's unique name within the portlet container using ":" as a delimiter.
 PortletDefinition getPortletDefinitionByUniqueName(java.lang.String name, boolean fromCache)
          unique name is a string formed by the combination of a portlet's unique within it's parent application plus the parent application's unique name within the portlet container using ":" as a delimiter.
 boolean portletApplicationExists(java.lang.String name)
          Checks whether or not a portlet application with this name has all ready been registered to the container.
 boolean portletDefinitionExists(java.lang.String portletName, PortletApplication app)
          Checks whether or not a portlet with this identity has all ready been registered to the PortletApplication.
 void registerPortletApplication(PortletApplication newApp)
          Creates a new PortletApplicationDefinition within the Portal.
 void removeAllClones(PortletApplication pa)
          Remove all clones from a given portlet application
 void removeApplication(PortletApplication app)
           
 void removeClone(PortletDefinition clone)
          Remove a clone from a given portlet definition
 void removeRegistryEventListener(RegistryEventListener listener)
           
 int restoreClones(PortletApplication pa)
          Restores all orphaned clones to a re-registered portlet application
 void savePortletDefinition(PortletDefinition portlet)
           savePortletDefinition
 void updatePortletApplication(PortletApplication app)
          Makes any changes to the PortletApplicationDefinition persistent.
 

Method Detail

getAllDefinitions

java.util.Collection<PortletDefinition> getAllDefinitions()
Retrieves all portlet definitions for this deployment including both clones and portlet definitions

Returns:
a collection of portlet definitions from all portlet apps

getAllPortletDefinitions

java.util.Collection<PortletDefinition> getAllPortletDefinitions()
Retrieve all portlet definitions system wide The collection does not include clones

Returns:
a collection of portlet definitions from all portlet apps

getAllCloneDefinitions

java.util.Collection<PortletDefinition> getAllCloneDefinitions()
Retrieve all clone definitions system wide

Returns:
a collection of portlet definitions from all portlet apps

getPortletApplication

PortletApplication getPortletApplication(java.lang.String name)
Retrieves a PortletApplication by it's unique name. We use PortletApplication interface which extends the Pluto PortletApplicationDefinition and adds additional functionallity to it.
This method will always retrieve a fresh instance from the database, bypassing internal cache and therefore should be used when expecting to perform a write operation.

Parameters:
name -
Returns:
PortletApplication

getPortletApplication

PortletApplication getPortletApplication(java.lang.String name,
                                         boolean fromCache)
Retreives a PortletApplication by it's unique name. We use PortletApplication interface which extends the Pluto PortletApplicationDefinition and adds additional functionallity to it.
This method will optionally try to retrieve a shared instance from an internal cache first. If not found it will retrieve a fresh instance from the database (which will also store the instance in the cache for future access).
Because the returned instance might be shared it should only be used for readonly purposes.

Parameters:
name -
fromCache - when true first try to retrieve a shared instance from cache
Returns:
PortletApplication

getPortletApplications

java.util.Collection<PortletApplication> getPortletApplications()

getPortletDefinitionByUniqueName

PortletDefinition getPortletDefinitionByUniqueName(java.lang.String name)
unique name is a string formed by the combination of a portlet's unique within it's parent application plus the parent application's unique name within the portlet container using ":" as a delimiter.
FORMAT: application name::portlet name
EXAMPLE: com.myapp.portletApp1::weather-portlet
This method will always retrieve a fresh instance from the database, bypassing internal cache and therefore should be used when expecting to perform a write operation.

Parameters:
name - portlets unique name.
Returns:
Portlet that matches the unique name

getPortletDefinitionByUniqueName

PortletDefinition getPortletDefinitionByUniqueName(java.lang.String name,
                                                   boolean fromCache)
unique name is a string formed by the combination of a portlet's unique within it's parent application plus the parent application's unique name within the portlet container using ":" as a delimiter.
FORMAT: application name::portlet name
EXAMPLE: com.myapp.portletApp1::weather-portlet
This method will optionally try to retrieve a shared instance from an internal cache first. If not found it will retrieve a fresh instance from the database (which will also store the instance in the cache for future access).
Because the returned instance might be shared it should only be used for readonly purposes.

Parameters:
name - portlets unique name.
fromCache - when true first try to retrieve a shared instance from cache
Returns:
Portlet that matches the unique name

portletApplicationExists

boolean portletApplicationExists(java.lang.String name)
Checks whether or not a portlet application with this name has all ready been registered to the container.

Parameters:
name - portlet application name to check for.
Returns:
boolean true if a portlet application with this name is alreay registered, false if it has not.

portletDefinitionExists

boolean portletDefinitionExists(java.lang.String portletName,
                                PortletApplication app)
Checks whether or not a portlet with this identity has all ready been registered to the PortletApplication.

Parameters:
portletIndentity - portlet indetity to check for.
app - PortletApplication to check .
Returns:
boolean true if a portlet with this identity is alreay registered, false if it has not.

registerPortletApplication

void registerPortletApplication(PortletApplication newApp)
                                throws RegistryException
Creates a new PortletApplicationDefinition within the Portal.

Parameters:
newApp -
Throws:
RegistryException

removeApplication

void removeApplication(PortletApplication app)
                       throws RegistryException
Throws:
RegistryException

updatePortletApplication

void updatePortletApplication(PortletApplication app)
                              throws RegistryException
Makes any changes to the PortletApplicationDefinition persistent.

Parameters:
app -
Throws:
RegistryException

savePortletDefinition

void savePortletDefinition(PortletDefinition portlet)
                           throws FailedToStorePortletDefinitionException

savePortletDefinition

Parameters:
portlet -
Throws:
FailedToStorePortletDefinitionException

addRegistryListener

void addRegistryListener(RegistryEventListener listener)

removeRegistryEventListener

void removeRegistryEventListener(RegistryEventListener listener)

clonePortletDefinition

PortletDefinition clonePortletDefinition(PortletDefinition source,
                                         java.lang.String newPortletName)
                                         throws FailedToStorePortletDefinitionException
Create a portlet instance

Parameters:
source - create an instance from this given portlet definition
newPortletName - a unique portlet name
Throws:
FailedToStorePortletDefinitionException

restoreClones

int restoreClones(PortletApplication pa)
                  throws RegistryException
Restores all orphaned clones to a re-registered portlet application

Parameters:
pa -
Returns:
Throws:
RegistryException

removeClone

void removeClone(PortletDefinition clone)
                 throws RegistryException
Remove a clone from a given portlet definition

Parameters:
clone - the portlet definition
Throws:
RegistryException

removeAllClones

void removeAllClones(PortletApplication pa)
                     throws RegistryException
Remove all clones from a given portlet application

Parameters:
pa - the portlet application
Throws:
RegistryException


Copyright © 1999-2011 The Apache Software Foundation. All Rights Reserved.