org.apache.wsrp4j.consumer.app.driver
Class PageImpl

java.lang.Object
  extended byorg.apache.wsrp4j.util.StateChangedServiceImpl
      extended byorg.apache.wsrp4j.consumer.app.driver.PageImpl
All Implemented Interfaces:
Page, StateChangedService

public class PageImpl
extends StateChangedServiceImpl
implements Page

A simple page with portlets on it.

Version:
$Id: PageImpl.java,v 1.4 2005/08/10 14:45:38 cziegeler Exp $
Author:
Stephan Laertz

Field Summary
private  HandleGenerator handleGenerator
           
private  java.lang.String maximizedPortletInstanceKey
           
private  java.lang.String pageID
           
private  java.util.Hashtable portlets
           
private  java.lang.String title
           
 
Fields inherited from class org.apache.wsrp4j.util.StateChangedServiceImpl
 
Constructor Summary
PageImpl()
          Default constructor, for CASTOR persistence use only
PageImpl(java.lang.String pageID, java.util.Map portlets)
          This constructor should be use to create a new page.
 
Method Summary
 void addPortlet(PortletKey portletKey)
          Add an portlet to the page
 void addPortlet(PortletKey portletKey, java.lang.String instanceKey)
          Add an portlet to the page and set the ID of this portlet on the page to the given value.
 java.lang.String getMaximizedPortletInstanceKey()
          Get the instance key of the portlet on this page which is in maximized window state or null if no portlet is in that state.
 java.lang.String getPageID()
          Get the ID of this page
 java.util.Iterator getPortletInstanceKeys()
          Get the keys of all portlet instances on the page.
 PortletKey getPortletKey(java.lang.String portletInstanceKey)
          Get the portlet key to the given portlet instance key.
 java.util.Map getPortlets()
          Get map with portlet instance id's map to portlet keys with all portlet instances on this page.
 java.lang.String getTitle()
          Get the title of the page
 void removePortlet(java.lang.String portletInstanceKey)
          Remove an portlet instance from the page
 void setMaximizedPortletInstanceKey(java.lang.String portletInstanceKey)
          Set the portlet which is currently in maximized window state
 void setPageID(java.lang.String pageID)
          Set the page ID
 void setPortlets(java.util.Map map)
          Set the portlets which should appear on the page.
 void setTitle(java.lang.String title)
          Set the title of the page
 
Methods inherited from class org.apache.wsrp4j.util.StateChangedServiceImpl
addListener, stateChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

pageID

private java.lang.String pageID

title

private java.lang.String title

portlets

private java.util.Hashtable portlets

handleGenerator

private HandleGenerator handleGenerator

maximizedPortletInstanceKey

private java.lang.String maximizedPortletInstanceKey
Constructor Detail

PageImpl

public PageImpl()
Default constructor, for CASTOR persistence use only


PageImpl

public PageImpl(java.lang.String pageID,
                java.util.Map portlets)
This constructor should be use to create a new page.

Parameters:
pageID - The ID of the page
portlets - A map with portlet instance id's and portlet keys
Method Detail

getPortletInstanceKeys

public java.util.Iterator getPortletInstanceKeys()
Get the keys of all portlet instances on the page.

Specified by:
getPortletInstanceKeys in interface Page
Returns:
Iterator with the instance keys of all portlets on the page

addPortlet

public void addPortlet(PortletKey portletKey)
Add an portlet to the page

Specified by:
addPortlet in interface Page
Parameters:
portletKey - The portlet key

addPortlet

public void addPortlet(PortletKey portletKey,
                       java.lang.String instanceKey)
Add an portlet to the page and set the ID of this portlet on the page to the given value. If any other portlet exists on the page with the same ID the old portlet is removed.

Specified by:
addPortlet in interface Page
Parameters:
portletKey - The portlet key
instanceKey - ID of the portlet on the page

removePortlet

public void removePortlet(java.lang.String portletInstanceKey)
Remove an portlet instance from the page

Specified by:
removePortlet in interface Page
Parameters:
portletInstanceKey - The instance key of the portlet instance to be removed

getPortletKey

public PortletKey getPortletKey(java.lang.String portletInstanceKey)
Get the portlet key to the given portlet instance key.

Specified by:
getPortletKey in interface Page
Parameters:
portletInstanceKey - Key of a portlet instance on the page
Returns:
The portlet key

getPageID

public java.lang.String getPageID()
Get the ID of this page

Specified by:
getPageID in interface Page
Returns:
The page ID

setPageID

public void setPageID(java.lang.String pageID)
Set the page ID

Specified by:
setPageID in interface Page
Parameters:
pageID - ID of this page

getTitle

public java.lang.String getTitle()
Get the title of the page

Specified by:
getTitle in interface Page
Returns:
Title of this page

setTitle

public void setTitle(java.lang.String title)
Set the title of the page

Specified by:
setTitle in interface Page
Parameters:
title - Page title

getMaximizedPortletInstanceKey

public java.lang.String getMaximizedPortletInstanceKey()
Get the instance key of the portlet on this page which is in maximized window state or null if no portlet is in that state.

Specified by:
getMaximizedPortletInstanceKey in interface Page
Returns:
portlet instance key of the portlet or null if no portlet is in max window state

setMaximizedPortletInstanceKey

public void setMaximizedPortletInstanceKey(java.lang.String portletInstanceKey)
Set the portlet which is currently in maximized window state

Specified by:
setMaximizedPortletInstanceKey in interface Page
Parameters:
portletInstanceKey - instance ID

setPortlets

public void setPortlets(java.util.Map map)
Set the portlets which should appear on the page. The map must contain mappings of portlet instance id's to portlet keys.

Specified by:
setPortlets in interface Page

getPortlets

public java.util.Map getPortlets()
Get map with portlet instance id's map to portlet keys with all portlet instances on this page.

Specified by:
getPortlets in interface Page


--