org.apache.jetspeed.aggregator
Interface PortletContent


public interface PortletContent

PortletContent

Version:
$Id: PortletContent.java 889695 2009-12-11 16:53:45Z woonsan $
Author:
Scott T. Weaver, David S. Taylor

Method Summary
 void addHeadElement(HeadElement element, java.lang.String keyHint)
          Adds an header element to be contributed to the page.
 void complete()
          Notify that this content is completed.
 ContentCacheKey getCacheKey()
          Get the cache key used to cache this content
 java.lang.String getContent()
          Retrieve the actual content of a portlet as a string
 java.lang.String getContentType()
          Gets the content type of this portlet content.
 int getExpiration()
          Get the expiration setting for this content if it is cached.
 java.util.List<KeyValue<java.lang.String,HeadElement>> getHeadElements()
          Retrieves header element key value pairs to be contributed to the page.
 javax.portlet.PortletMode getPortletMode()
          Gets the portlet mode of this portlet content.
 java.lang.String getTitle()
          Get the title of the portlet, used during caching
 javax.portlet.WindowState getWindowState()
          Gets the window state of this portlet content.
 java.io.PrintWriter getWriter()
          Get a writer to the content to stream content into this object
 boolean isComplete()
          Has the renderer completed rendering the content?
 void release()
          Release the buffers used by the portlet content cache.
 void reset()
           
 void resetBuffer()
           
 void setContentType(java.lang.String contentType)
          Sets the content type of this portlet content.
 void setExpiration(int expiration)
          Sets the expiration setting for this content.
 void setTitle(java.lang.String title)
          Set the title of this portlet, used during caching
 

Method Detail

getContent

java.lang.String getContent()
Retrieve the actual content of a portlet as a string

Returns:

isComplete

boolean isComplete()
Has the renderer completed rendering the content?

Returns:

complete

void complete()
Notify that this content is completed.


getWriter

java.io.PrintWriter getWriter()
Get a writer to the content to stream content into this object

Returns:

getExpiration

int getExpiration()
Get the expiration setting for this content if it is cached.

Returns:

setExpiration

void setExpiration(int expiration)
Sets the expiration setting for this content.

Parameters:
expiration -

getCacheKey

ContentCacheKey getCacheKey()
Get the cache key used to cache this content

Returns:
Since:
2.1.2

getTitle

java.lang.String getTitle()
Get the title of the portlet, used during caching

Returns:

setTitle

void setTitle(java.lang.String title)
Set the title of this portlet, used during caching

Parameters:
title -

getContentType

java.lang.String getContentType()
Gets the content type of this portlet content.

Returns:

setContentType

void setContentType(java.lang.String contentType)
Sets the content type of this portlet content.

Parameters:
contentType -

getPortletMode

javax.portlet.PortletMode getPortletMode()
Gets the portlet mode of this portlet content.

Returns:

getWindowState

javax.portlet.WindowState getWindowState()
Gets the window state of this portlet content.

Returns:

addHeadElement

void addHeadElement(HeadElement element,
                    java.lang.String keyHint)
Adds an header element to be contributed to the page. If keyHint argument is provided and if a header element with the provided key hint already exists, then the element will be overwritten to the item. If the element is null and keyHint is not null, the element with the keyHint is removed from the response. If the element is not null and keyHint is null, then the keyHint will be automatically generated by the element content. Meanwhile, the element should implement java.io.Serializable. Otherwise it will throw a java.io.NotSerializableException.

Parameters:
element -
keyHint -

getHeadElements

java.util.List<KeyValue<java.lang.String,HeadElement>> getHeadElements()
Retrieves header element key value pairs to be contributed to the page. Because the insertion order might be important for web development, it should be list instead of map.

Returns:

reset

void reset()

resetBuffer

void resetBuffer()

release

void release()
Release the buffers used by the portlet content cache. Note the actual release may not occur until garbage collection.



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