org.apache.jetspeed.components.portletregistry
Class PersistenceBrokerPortletRegistry

java.lang.Object
  extended by org.springframework.dao.support.DaoSupport
      extended by org.springframework.orm.ojb.support.PersistenceBrokerDaoSupport
          extended by org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport
              extended by org.apache.jetspeed.components.portletregistry.PersistenceBrokerPortletRegistry
All Implemented Interfaces:
JetspeedCacheEventListener, PortletRegistry, org.springframework.beans.factory.InitializingBean

public class PersistenceBrokerPortletRegistry
extends InitablePersistenceBrokerDaoSupport
implements PortletRegistry, JetspeedCacheEventListener

OjbPortletRegistry

Version:
$Id: PersistenceBrokerPortletRegistry.java 516448 2007-03-09 16:25:47Z ate $
Author:
Scott T. Weaver

Field Summary
 
Fields inherited from class org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport
repositoryPath
 
Fields inherited from class org.springframework.dao.support.DaoSupport
logger
 
Constructor Summary
PersistenceBrokerPortletRegistry(java.lang.String repositoryPath)
           
PersistenceBrokerPortletRegistry(java.lang.String repositoryPath, PortletFactory portletFactory, JetspeedCache applicationOidCache, JetspeedCache portletOidCache, JetspeedCache applicationNameCache, JetspeedCache portletNameCache)
           
 
Method Summary
 void addRegistryListener(RegistryEventListener listener)
           
 org.apache.pluto.om.common.Language createLanguage(java.util.Locale locale, java.lang.String title, java.lang.String shortTitle, java.lang.String description, java.util.Collection keywords)
           
 java.util.Collection getAllPortletDefinitions()
           
 MutablePortletApplication getPortletApplication(org.apache.pluto.om.common.ObjectID id)
          Retreives a PortletApplication by it's unique ObjectID.
 MutablePortletApplication getPortletApplication(java.lang.String name)
          Retreives a PortletApplication by it's unique name.
 MutablePortletApplication getPortletApplicationByIdentifier(java.lang.String identifier)
          Locates a portlet application using it's unique identifier field.
 java.util.Collection getPortletApplications()
           
 PortletDefinitionComposite getPortletDefinition(org.apache.pluto.om.common.ObjectID id)
          Locates the portlet defintion by its unique ObjectID.
 PortletDefinitionComposite getPortletDefinitionByIdentifier(java.lang.String identifier)
          Locates a portlet using it's unique identifier field.
 PortletDefinitionComposite 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.
 boolean namedPortletApplicationExists(java.lang.String appName)
           namedPortletApplicationExists
 void notifyElementAdded(JetspeedCache cache, boolean local, java.lang.Object key, java.lang.Object element)
          ADDED notification for cache listeners
 void notifyElementChanged(JetspeedCache cache, boolean local, java.lang.Object key, java.lang.Object element)
          CHANGE notification for cache listeners
 void notifyElementEvicted(JetspeedCache cache, boolean local, java.lang.Object key, java.lang.Object element)
          EVICTED notification for cache listeners
 void notifyElementExpired(JetspeedCache cache, boolean local, java.lang.Object key, java.lang.Object element)
          EXPIRED notification for cache listeners
 void notifyElementRemoved(JetspeedCache cache, boolean local, java.lang.Object key, java.lang.Object element)
          REMOVE notification for cache listeners
 boolean portletApplicationExists(java.lang.String appIdentity)
          Checks whether or not a portlet application with this identity has all ready been registered to the container.
 boolean portletDefinitionExists(java.lang.String portletIdentity)
          Checks whether or not a portlet with this identity has all ready been registered to the container.
 boolean portletDefinitionExists(java.lang.String portletName, MutablePortletApplication app)
          Checks whether or not a portlet with this identity has all ready been registered to the PortletApplication.
 void registerPortletApplication(org.apache.pluto.om.portlet.PortletApplicationDefinition newApp)
          Creates a new PortletApplicationDefinition within the Portal.
 void removeApplication(org.apache.pluto.om.portlet.PortletApplicationDefinition app)
           
 void removeRegistryEventListner(RegistryEventListener listener)
           
 void savePortletDefinition(org.apache.pluto.om.portlet.PortletDefinition portlet)
           savePortletDefinition
 void updatePortletApplication(org.apache.pluto.om.portlet.PortletApplicationDefinition app)
          Makes any changes to the PortletApplicationDefinition persistent.
 
Methods inherited from class org.apache.jetspeed.components.dao.InitablePersistenceBrokerDaoSupport
init
 
Methods inherited from class org.springframework.orm.ojb.support.PersistenceBrokerDaoSupport
checkDaoConfig, closePersistenceBrokerIfNecessary, convertOjbAccessException, createPersistenceBrokerTemplate, getJcdAlias, getPersistenceBroker, getPersistenceBrokerTemplate, releasePersistenceBroker, setJcdAlias, setPersistenceBrokerTemplate
 
Methods inherited from class org.springframework.dao.support.DaoSupport
afterPropertiesSet, initDao
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PersistenceBrokerPortletRegistry

public PersistenceBrokerPortletRegistry(java.lang.String repositoryPath)

PersistenceBrokerPortletRegistry

public PersistenceBrokerPortletRegistry(java.lang.String repositoryPath,
                                        PortletFactory portletFactory,
                                        JetspeedCache applicationOidCache,
                                        JetspeedCache portletOidCache,
                                        JetspeedCache applicationNameCache,
                                        JetspeedCache portletNameCache)
Method Detail

createLanguage

public org.apache.pluto.om.common.Language createLanguage(java.util.Locale locale,
                                                          java.lang.String title,
                                                          java.lang.String shortTitle,
                                                          java.lang.String description,
                                                          java.util.Collection keywords)
                                                   throws RegistryException
Specified by:
createLanguage in interface PortletRegistry
Throws:
RegistryException

getAllPortletDefinitions

public java.util.Collection getAllPortletDefinitions()
Specified by:
getAllPortletDefinitions in interface PortletRegistry

getPortletApplication

public MutablePortletApplication getPortletApplication(org.apache.pluto.om.common.ObjectID id)
Description copied from interface: PortletRegistry
Retreives a PortletApplication by it's unique ObjectID. The unqiue ObjectID is generally a function of the native storage mechanism of the container whether it be auto-generated by an RDBMS, O/R tool or some other mechanism. This is different than the portlet applaiction's unique indentfier which is specified within the portlet.xml

Specified by:
getPortletApplication in interface PortletRegistry
Returns:

getPortletApplication

public MutablePortletApplication getPortletApplication(java.lang.String name)
Description copied from interface: PortletRegistry
Retreives a PortletApplication by it's unique name. We use PortletApplicationComposite interface which extends the PortletApplication and adds additional functionallity to it.

Specified by:
getPortletApplication in interface PortletRegistry
Returns:
PortletApplicationComposite

getPortletApplicationByIdentifier

public MutablePortletApplication getPortletApplicationByIdentifier(java.lang.String identifier)
Description copied from interface: PortletRegistry
Locates a portlet application using it's unique identifier field.

Specified by:
getPortletApplicationByIdentifier in interface PortletRegistry
Parameters:
identifier - Unique id for this portlet application
Returns:
portlet application matching this unique id.

getPortletApplications

public java.util.Collection getPortletApplications()
Specified by:
getPortletApplications in interface PortletRegistry

getPortletDefinitionByIdentifier

public PortletDefinitionComposite getPortletDefinitionByIdentifier(java.lang.String identifier)
Description copied from interface: PortletRegistry
Locates a portlet using it's unique identifier field.
This method automatically calls getStoreableInstance(PortletDefinitionComposite portlet) on the returned PortletEntityInstance

Specified by:
getPortletDefinitionByIdentifier in interface PortletRegistry
Parameters:
identifier - Unique id for this portlet
Returns:
Portlet matching this unique id.

getPortletDefinitionByUniqueName

public PortletDefinitionComposite getPortletDefinitionByUniqueName(java.lang.String name)
Description copied from interface: PortletRegistry
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 methos automatically calls getStoreableInstance(PortletDefinitionComposite portlet) on the returned PortletEntityInstance

Specified by:
getPortletDefinitionByUniqueName in interface PortletRegistry
Parameters:
name - portlets unique name.
Returns:
Portlet that matches the unique name

portletApplicationExists

public boolean portletApplicationExists(java.lang.String appIdentity)
Description copied from interface: PortletRegistry
Checks whether or not a portlet application with this identity has all ready been registered to the container.

Specified by:
portletApplicationExists in interface PortletRegistry
Returns:
boolean true if a portlet application with this identity is alreay registered, false if it has not.

namedPortletApplicationExists

public boolean namedPortletApplicationExists(java.lang.String appName)
Description copied from interface: PortletRegistry

namedPortletApplicationExists

Specified by:
namedPortletApplicationExists in interface PortletRegistry
Returns:

portletDefinitionExists

public boolean portletDefinitionExists(java.lang.String portletName,
                                       MutablePortletApplication app)
Description copied from interface: PortletRegistry
Checks whether or not a portlet with this identity has all ready been registered to the PortletApplication.

Specified by:
portletDefinitionExists in interface PortletRegistry
app - PortletApplication to check .
Returns:
boolean true if a portlet with this identity is alreay registered, false if it has not.

portletDefinitionExists

public boolean portletDefinitionExists(java.lang.String portletIdentity)
Description copied from interface: PortletRegistry
Checks whether or not a portlet with this identity has all ready been registered to the container.

Specified by:
portletDefinitionExists in interface PortletRegistry
Parameters:
portletIdentity - portlet indetity to check for.
Returns:
boolean true if a portlet with this identity is alreay registered, false if it has not.

registerPortletApplication

public void registerPortletApplication(org.apache.pluto.om.portlet.PortletApplicationDefinition newApp)
                                throws RegistryException
Description copied from interface: PortletRegistry
Creates a new PortletApplicationDefinition within the Portal.

Specified by:
registerPortletApplication in interface PortletRegistry
Throws:
RegistryException

removeApplication

public void removeApplication(org.apache.pluto.om.portlet.PortletApplicationDefinition app)
                       throws RegistryException
Specified by:
removeApplication in interface PortletRegistry
Throws:
RegistryException

updatePortletApplication

public void updatePortletApplication(org.apache.pluto.om.portlet.PortletApplicationDefinition app)
                              throws RegistryException
Description copied from interface: PortletRegistry
Makes any changes to the PortletApplicationDefinition persistent.

Specified by:
updatePortletApplication in interface PortletRegistry
Throws:
RegistryException

savePortletDefinition

public void savePortletDefinition(org.apache.pluto.om.portlet.PortletDefinition portlet)
                           throws FailedToStorePortletDefinitionException
Description copied from interface: PortletRegistry

savePortletDefinition

Specified by:
savePortletDefinition in interface PortletRegistry
Throws:
FailedToStorePortletDefinitionException

getPortletDefinition

public PortletDefinitionComposite getPortletDefinition(org.apache.pluto.om.common.ObjectID id)
Description copied from interface: PortletRegistry
Locates the portlet defintion by its unique ObjectID. The ObjectID is generated internally by the portal when the portlet definition is first registered and has no connection to the information stored within the portlet.xml.

Specified by:
getPortletDefinition in interface PortletRegistry
Returns:
PortletDefinitionComposite

notifyElementAdded

public void notifyElementAdded(JetspeedCache cache,
                               boolean local,
                               java.lang.Object key,
                               java.lang.Object element)
Description copied from interface: JetspeedCacheEventListener
ADDED notification for cache listeners

Specified by:
notifyElementAdded in interface JetspeedCacheEventListener
Parameters:
cache - the Cache repoorting the change
local - true if action was local, false if initiated by remote cache
key - key of object
element - content of object

notifyElementChanged

public void notifyElementChanged(JetspeedCache cache,
                                 boolean local,
                                 java.lang.Object key,
                                 java.lang.Object element)
Description copied from interface: JetspeedCacheEventListener
CHANGE notification for cache listeners

Specified by:
notifyElementChanged in interface JetspeedCacheEventListener
Parameters:
cache - the Cache repoorting the change
local - true if action was local, false if initiated by remote cache
key - key of object
element - content of object

notifyElementEvicted

public void notifyElementEvicted(JetspeedCache cache,
                                 boolean local,
                                 java.lang.Object key,
                                 java.lang.Object element)
Description copied from interface: JetspeedCacheEventListener
EVICTED notification for cache listeners

Specified by:
notifyElementEvicted in interface JetspeedCacheEventListener
Parameters:
cache - the Cache repoorting the change
local - true if action was local, false if initiated by remote cache
key - key of object
element - content of object

notifyElementExpired

public void notifyElementExpired(JetspeedCache cache,
                                 boolean local,
                                 java.lang.Object key,
                                 java.lang.Object element)
Description copied from interface: JetspeedCacheEventListener
EXPIRED notification for cache listeners

Specified by:
notifyElementExpired in interface JetspeedCacheEventListener
Parameters:
cache - the Cache repoorting the change
local - true if action was local, false if initiated by remote cache
key - key of object
element - content of object

notifyElementRemoved

public void notifyElementRemoved(JetspeedCache cache,
                                 boolean local,
                                 java.lang.Object key,
                                 java.lang.Object element)
Description copied from interface: JetspeedCacheEventListener
REMOVE notification for cache listeners

Specified by:
notifyElementRemoved in interface JetspeedCacheEventListener
Parameters:
cache - the Cache repoorting the change
local - true if action was local, false if initiated by remote cache
key - key of object
element - content of object

addRegistryListener

public void addRegistryListener(RegistryEventListener listener)
Specified by:
addRegistryListener in interface PortletRegistry

removeRegistryEventListner

public void removeRegistryEventListner(RegistryEventListener listener)
Specified by:
removeRegistryEventListner in interface PortletRegistry


Copyright © 1999-2009 Apache Software Foundation. All Rights Reserved.