com.sapportals.portal.prt.component
Class AbstractPortalComponent

java.lang.Object
  |
  +--com.sapportals.portal.prt.component.AbstractPortalComponent
All Implemented Interfaces:
IEventListenerComponent, IPortalComponent, IPortalComponentInit
Direct Known Subclasses:
StandardEditDialog

public abstract class AbstractPortalComponent
extends java.lang.Object
implements IPortalComponent, IPortalComponentInit, IEventListenerComponent

This class provides the base implementation of the IPortalComponent. this class should be subclassed by portalcomponents

See Also:
IPortalComponent

Constructor Summary
AbstractPortalComponent()
          Constructor for the AbstractPortalComponent object.
 
Method Summary
 void destroy()
          Called upon release of the component instance.
protected  void doAbout(IPortalComponentRequest aRequest, IPortalComponentResponse aResponse)
          Provides an "about" information on the Portal Component.
protected  void doAfterContent(IPortalComponentRequest request, IEvent event)
          Handles the AFTER_CONTENT event.
protected  void doBeforeContent(IPortalComponentRequest request, IEvent event)
          Handles the BEFORE_CONTENT event.
protected  void doComponentEvent(IPortalComponentRequest aRequest, IPortalComponentEvent event)
          Handles a server side component event.
protected abstract  void doContent(IPortalComponentRequest aRequest, IPortalComponentResponse aResponse)
          Generates the content of the component.
protected  void doEdit(IPortalComponentRequest aRequest, IPortalComponentResponse aResponse)
          Provides personalization dialog.
 void doHandleEditData(IPortalComponentRequest request, IPortalRequestEvent event)
          Default handler upon personalization according to the convention, which is that a personalization dialog presentation should use profile names as parameter names and it should contain a field "save" if the parameter set should be saved into the profile.
protected  void doHelp(IPortalComponentRequest aRequest, IPortalComponentResponse aResponse)
          Provides a help information on the Portal Component.
protected  void doOnNodeReady(IPortalComponentRequest request, IEvent event)
          Handles the POM_ON_NODE_READY event.
protected  void doOnNodeRemove(IPortalComponentRequest request, IEvent event)
          Handles the ON_NODE_REMOVE_EVENT event.
protected  void doOnPOMReady(IPortalComponentRequest request, IEvent event)
          Handles the ON_POM_READY_EVENT event.
protected  void doPreview(IPortalComponentRequest aRequest, IPortalComponentResponse aResponse)
          Provides preview on the typical output provided by the Portal Component.
protected  void doRefresh(IPortalComponentRequest aRequest, IPortalComponentResponse aResponse)
          Provides personalization dialog.
protected  void doRequestEvent(IPortalComponentRequest aRequest, IPortalRequestEvent event)
          Handles a client raised event that is not handled in a specific event handler.
 java.lang.String getCacheDiscriminant(IPortalComponentRequest request)
          Gets the cache discriminant.
 CachingLevel getCachingLevel(IPortalComponentRequest request)
          Method defined in ICachablePortalComponent.
 void handleEvent(IPortalComponentRequest request, IEvent event)
          Distributes known events to more convenient event handlers or force default handling.
 boolean hasExpired(IPortalComponentRequest request, long creationTime, long currentTime)
          method defined in ICachablePortalComponent. if the expiration flag is set to false, we check if the property called ValidityPeriod is set.
 void init()
          Deprecated.  
 void init(IPortalComponentConfig config)
           
 void init(IPortalComponentInitContext context)
          Invoked when this Portal Component is loaded for the first time in memory.
 void service(IPortalComponentRequest aRequest, IPortalComponentResponse aResponse)
          Called by the PortalSessionManager to allow the component to respond to a request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractPortalComponent

public AbstractPortalComponent()
Constructor for the AbstractPortalComponent object.
Method Detail

destroy

public void destroy()
Called upon release of the component instance.
Specified by:
destroy in interface IPortalComponent
Following copied from interface: com.sapportals.portal.prt.component.IPortalComponent
See Also:
IPortalComponent.init()

init

public void init()
Deprecated.  

Invoked when this Portal Component is loaded for the first time in memory. The container calls the init method each time this Portal Component is loaded in memory.
Specified by:
init in interface IPortalComponent

init

public void init(IPortalComponentInitContext context)
          throws PortalComponentException
Invoked when this Portal Component is loaded for the first time in memory. The container calls the init method each time this Portal Component is loaded in memory.
Specified by:
init in interface IPortalComponentInit
Parameters:
config - an instance of IPortalComponentInitContext providing initialization data

init

public void init(IPortalComponentConfig config)
          throws PortalComponentException

service

public void service(IPortalComponentRequest aRequest,
                    IPortalComponentResponse aResponse)
             throws PortalComponentException
Called by the PortalSessionManager to allow the component to respond to a request. It inspects the request type of the request, and dispatch the godd method.
Specified by:
service in interface IPortalComponent
Parameters:
aRequest - the PortalComponentRequest object that contains the client's request
aResponse - the PortalComponentResponse object that contains the server's response
Throws:
PortalComponentException -  

doContent

protected abstract void doContent(IPortalComponentRequest aRequest,
                                  IPortalComponentResponse aResponse)
Generates the content of the component.
Parameters:
aRequest - the PortalComponentRequest object that contains the client's request
aResponse - the PortalComponentResponse object that contains the server's response

doPreview

protected void doPreview(IPortalComponentRequest aRequest,
                         IPortalComponentResponse aResponse)
Provides preview on the typical output provided by the Portal Component. The default implementation simply defaults to a doContent call.
Parameters:
aRequest - the PortalComponentRequest object that contains the client's request
aResponse - the PortalComponentResponse object that contains the server's response

doAbout

protected void doAbout(IPortalComponentRequest aRequest,
                       IPortalComponentResponse aResponse)
Provides an "about" information on the Portal Component. The default implementation simply outputs some framework information.
Parameters:
aRequest - the PortalComponentRequest object that contains the client's request
aResponse - the PortalComponentResponse object that contains the server's response

doHelp

protected void doHelp(IPortalComponentRequest aRequest,
                      IPortalComponentResponse aResponse)
Provides a help information on the Portal Component. The default implementation simply outputs some framework information.
Parameters:
aRequest - the PortalComponentRequest object that contains the client's request
aResponse - the PortalComponentResponse object that contains the server's response

doEdit

protected void doEdit(IPortalComponentRequest aRequest,
                      IPortalComponentResponse aResponse)
Provides personalization dialog.

There are three different ways to provide personalization.

This default implementation will try to delegate, according to the second method.
Parameters:
aRequest - the PortalComponentRequest object that contains the client's request
aResponse - the PortalComponentResponse object that contains the server's response

doRefresh

protected void doRefresh(IPortalComponentRequest aRequest,
                         IPortalComponentResponse aResponse)
Provides personalization dialog.

There are three different ways to provide personalization.

This default implementation will try to delegate, according to the second method.
Parameters:
aRequest - the PortalComponentRequest object that contains the client's request
aResponse - the PortalComponentResponse object that contains the server's response

handleEvent

public void handleEvent(IPortalComponentRequest request,
                        IEvent event)
Distributes known events to more convenient event handlers or force default handling.
Specified by:
handleEvent in interface IEventListenerComponent
Parameters:
request - the Portal Component Request corresponding to this component
event - the event
Returns:
true if the event could be handled here or false otherwise.
If you want to override this methode, make sure to enable default handling by calling to super, i.e.
When a component event or client occurs, the cached content is by default invalidated. public void handleEvent(IPortalComponentRequest request, IEvent event) { // do your event handling here... .... // if you do not handle the event if () super.handleEvent(request,event); }

doOnNodeReady

protected void doOnNodeReady(IPortalComponentRequest request,
                             IEvent event)
Handles the POM_ON_NODE_READY event. This method should be overriden, in order to create your childnodes in the Portal Object Model.
Parameters:
request - the PortalComponentRequest object that contains the client's request
event - the event

doOnNodeRemove

protected void doOnNodeRemove(IPortalComponentRequest request,
                              IEvent event)
Handles the ON_NODE_REMOVE_EVENT event. This event is raised when a node will be removed from its parent.
Parameters:
request -  
event -  

doOnPOMReady

protected void doOnPOMReady(IPortalComponentRequest request,
                            IEvent event)
Handles the ON_POM_READY_EVENT event. This event is raised on a pre-order traversal of the POM when it has been constructed for the first time. For the receiver it is the last chance to modify the POM below it without breaking the event sequence.
Parameters:
request -  
event -  

doBeforeContent

protected void doBeforeContent(IPortalComponentRequest request,
                               IEvent event)
Handles the BEFORE_CONTENT event. This event is raised on all nodes of the current POM before the content phase on a post order traversal.
Parameters:
request -  
event -  

doAfterContent

protected void doAfterContent(IPortalComponentRequest request,
                              IEvent event)
Handles the AFTER_CONTENT event. This event is raised on all nodes of the current POM after the content phase on a pre order traversal.
Parameters:
request -  
event -  

doRequestEvent

protected void doRequestEvent(IPortalComponentRequest aRequest,
                              IPortalRequestEvent event)
Handles a client raised event that is not handled in a specific event handler. Given an event name xxx the default implementation of handleEvent will try to call a method doXxx(IPortalComponentRequest, IPortalRequestEvent) first. If that fails it will make a call to this method.
Parameters:
aRequest - the portal component request
event - the portal request event

doComponentEvent

protected void doComponentEvent(IPortalComponentRequest aRequest,
                                IPortalComponentEvent event)
Handles a server side component event.
Parameters:
aRequest -  
event -  

hasExpired

public boolean hasExpired(IPortalComponentRequest request,
                          long creationTime,
                          long currentTime)
method defined in ICachablePortalComponent. if the expiration flag is set to false, we check if the property called ValidityPeriod is set.
Parameters:
request -  
creationTime -  
currentTime -  

getCachingLevel

public CachingLevel getCachingLevel(IPortalComponentRequest request)
Method defined in ICachablePortalComponent. The caching level is read and parsed each time from the Portal Component Profile. This could be optimized later. returns by default SESSION
Parameters:
request -  

getCacheDiscriminant

public java.lang.String getCacheDiscriminant(IPortalComponentRequest request)
Gets the cache discriminant. This method returns null by default. A component must override this method to activate a multi-cache behavior. The cache discriminant is used as the key used by the caching to get back the previous content of the component.
Parameters:
request -  
Returns:
the cache discriminant

doHandleEditData

public void doHandleEditData(IPortalComponentRequest request,
                             IPortalRequestEvent event)
Default handler upon personalization according to the convention, which is that a personalization dialog presentation should use profile names as parameter names and it should contain a field "save" if the parameter set should be saved into the profile. The default event to be sent upon ending a personalization goes by the name "handleEditData".

This default handler will try to delegate personalization to a delegation component.

Parameters:
request -  
event -