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

java.lang.Object
  extended byorg.apache.wsrp4j.consumer.app.driver.AggregationImpl
All Implemented Interfaces:
Aggregation

public class AggregationImpl
extends java.lang.Object
implements Aggregation

Implementation of an aggregation for the swing consumer. The aggregation is used to display the markup of remote portlets aggregated on a page. It also adds the markup for the portlets decoration.

Version:
$Id: AggregationImpl.java,v 1.7 2005/08/10 14:45:38 cziegeler Exp $
Author:
Stephan Laertz, Peter Fischer

Field Summary
private  SwingConsumer consumer
           
private  ConsumerEnvironment consumerEnv
           
private  Logger logger
           
private  java.lang.String maxPortletInstanceKey
           
 
Constructor Summary
AggregationImpl(ConsumerEnvironment consumerEnv, SwingConsumer consumer)
          Construct a new AggregationImpl object by providing a reference to the consumer environment object, whcih is used to access all consumer side registries and handlers.
 
Method Summary
private  java.lang.String addPortletFrame(java.lang.String content, WSRPPortlet portlet, SimplePortletWindowSession windowSession, java.lang.String title)
           
private  java.lang.String getCloneLink(java.lang.String portletInstanceKey)
          Get a html link to clone an portlet
private  java.lang.String getEdit(WSRPPortlet portlet, SimplePortletWindowSession session)
           
private  java.lang.String getHelp(WSRPPortlet portlet, SimplePortletWindowSession session)
           
private  java.lang.String getMarkup(WSRPPortlet portlet, SimplePortletWindowSession windowSession, Request request)
          Retrieve the markup generated by the portlet
private  java.lang.String getMaximize(WSRPPortlet portlet, SimplePortletWindowSession session)
           
private  java.lang.String getMinimize(WSRPPortlet portlet, SimplePortletWindowSession session)
           
private  java.lang.String getModeLink(java.lang.String name, java.lang.String md, WSRPPortlet portlet, SimplePortletWindowSession windowSession)
          Get a html link to switch the portlet in the portlet mode (md)
private  java.lang.String getNormalize(WSRPPortlet portlet, SimplePortletWindowSession session)
           
private  java.lang.String getPortletTitle(WSRPPortlet portlet, SimplePortletWindowSession windowSession)
          Get the title of an portlet instance depending on the window state from the portlet description.
private  java.lang.String getPreview(WSRPPortlet portlet, SimplePortletWindowSession session)
           
private  java.lang.String getSolo(WSRPPortlet portlet, SimplePortletWindowSession session)
           
private  java.lang.String getStateLink(java.lang.String name, java.lang.String st, WSRPPortlet portlet, SimplePortletWindowSession windowSession)
          Get a html link to switch the portlet in the window state (st)
private  java.lang.String getView(WSRPPortlet portlet, SimplePortletWindowSession session)
           
private  java.lang.String getViewPropertyLink(java.lang.String portletInstanceKey)
          Get a html link to activate the property window
 java.lang.String renderPage(Page page, Request request)
          Render a page and return the generated markup.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

consumerEnv

private ConsumerEnvironment consumerEnv

consumer

private SwingConsumer consumer

maxPortletInstanceKey

private java.lang.String maxPortletInstanceKey

logger

private Logger logger
Constructor Detail

AggregationImpl

public AggregationImpl(ConsumerEnvironment consumerEnv,
                       SwingConsumer consumer)
Construct a new AggregationImpl object by providing a reference to the consumer environment object, whcih is used to access all consumer side registries and handlers.

Method Detail

renderPage

public java.lang.String renderPage(Page page,
                                   Request request)
Render a page and return the generated markup.

Specified by:
renderPage in interface Aggregation
Parameters:
page - The page object which should be rendered
request - Request object
Returns:
The markup of the page.

addPortletFrame

private java.lang.String addPortletFrame(java.lang.String content,
                                         WSRPPortlet portlet,
                                         SimplePortletWindowSession windowSession,
                                         java.lang.String title)

getPortletTitle

private java.lang.String getPortletTitle(WSRPPortlet portlet,
                                         SimplePortletWindowSession windowSession)
Get the title of an portlet instance depending on the window state from the portlet description.


getCloneLink

private java.lang.String getCloneLink(java.lang.String portletInstanceKey)
Get a html link to clone an portlet


getViewPropertyLink

private java.lang.String getViewPropertyLink(java.lang.String portletInstanceKey)
Get a html link to activate the property window


getModeLink

private java.lang.String getModeLink(java.lang.String name,
                                     java.lang.String md,
                                     WSRPPortlet portlet,
                                     SimplePortletWindowSession windowSession)
Get a html link to switch the portlet in the portlet mode (md)

Parameters:
name - A descriptive name of the portlet mode. This name is displayed in the link
md - The new portlet mode
portlet - The portlet
windowSession - The session of the portlet
Returns:
A html link which should switch the portlet in a new portlet mode on activation.

getView

private java.lang.String getView(WSRPPortlet portlet,
                                 SimplePortletWindowSession session)

getEdit

private java.lang.String getEdit(WSRPPortlet portlet,
                                 SimplePortletWindowSession session)

getHelp

private java.lang.String getHelp(WSRPPortlet portlet,
                                 SimplePortletWindowSession session)

getPreview

private java.lang.String getPreview(WSRPPortlet portlet,
                                    SimplePortletWindowSession session)

getStateLink

private java.lang.String getStateLink(java.lang.String name,
                                      java.lang.String st,
                                      WSRPPortlet portlet,
                                      SimplePortletWindowSession windowSession)
Get a html link to switch the portlet in the window state (st)

Parameters:
name - A descriptive name of the window state. This name is displayed in the link
st - The new window state
portlet - The portlet
windowSession - The session of the portlet
Returns:
A html link which should switch the portlet in a new window state on activation.

getSolo

private java.lang.String getSolo(WSRPPortlet portlet,
                                 SimplePortletWindowSession session)

getMinimize

private java.lang.String getMinimize(WSRPPortlet portlet,
                                     SimplePortletWindowSession session)

getNormalize

private java.lang.String getNormalize(WSRPPortlet portlet,
                                      SimplePortletWindowSession session)

getMaximize

private java.lang.String getMaximize(WSRPPortlet portlet,
                                     SimplePortletWindowSession session)

getMarkup

private java.lang.String getMarkup(WSRPPortlet portlet,
                                   SimplePortletWindowSession windowSession,
                                   Request request)
Retrieve the markup generated by the portlet



--