Clearspace API (1.10.16) Core Javadocs

com.jivesoftware.community.widget
Class WidgetContext

java.lang.Object
  extended by com.jivesoftware.community.widget.WidgetContext

public class WidgetContext
extends java.lang.Object

The widget context is passed to all Widgets when the render method is invoked. The context contains key information about the container of the widget, providing widget authors access the the inforamtion required to render the widget appropriately.


Constructor Summary
WidgetContext(JiveContext jiveContext, User user, AuthToken authToken, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
          Creates a WidgetContext with all the necessary information for a widget author to render their widget.
WidgetContext(JiveContext jiveContext, User user, AuthToken authToken, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Community community)
          Creates a WidgetContext with all the necessary information for a widget author to render their widget, as well as the parent community of the widget.
WidgetContext(JiveContext jiveContext, User user, AuthToken authToken, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response, Community community, boolean isEdit)
          Creates a WidgetContext with all the necessary information for a widget author to render their widget, as well as the parent community of the widget.
 
Method Summary
 AuthToken getAuthToken()
          Gets the current page user's auth token
 Community getCommunity()
          Gets the community object for this widget context, or null if the widget is being rendered outside of a community.
 JiveContext getJiveContext()
          Gets the jive context for the current page user
 javax.servlet.http.HttpServletRequest getRequest()
          Gets the http servlet request object
 javax.servlet.http.HttpServletResponse getResponse()
          Gets the http servlet response object
 User getUser()
          Gets the current page user, or null if annonymous
 boolean isEdit()
          Returns true if the parent container is currently in edit mode and false if it is not.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WidgetContext

public WidgetContext(JiveContext jiveContext,
                     User user,
                     AuthToken authToken,
                     javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response)
Creates a WidgetContext with all the necessary information for a widget author to render their widget.

Parameters:
jiveContext - the jiveContext for the page user
user - the page user
authToken - the auth token of the page user
request - the http servlet request object
response - the http servlet response object

WidgetContext

public WidgetContext(JiveContext jiveContext,
                     User user,
                     AuthToken authToken,
                     javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response,
                     Community community)
Creates a WidgetContext with all the necessary information for a widget author to render their widget, as well as the parent community of the widget.

Parameters:
jiveContext - the jiveContext for the page user
user - the page user
authToken - the auth token of the page user
request - the http servlet request object
response - the http servlet response object
community - the parent community object

WidgetContext

public WidgetContext(JiveContext jiveContext,
                     User user,
                     AuthToken authToken,
                     javax.servlet.http.HttpServletRequest request,
                     javax.servlet.http.HttpServletResponse response,
                     Community community,
                     boolean isEdit)
Creates a WidgetContext with all the necessary information for a widget author to render their widget, as well as the parent community of the widget.

Parameters:
jiveContext - the jiveContext for the page user
user - the page user
authToken - the auth token of the page user
request - the http servlet request object
response - the http servlet response object
community - the parent community object
isEdit - specifies wether the parent container is currently in edit mode.
Method Detail

getJiveContext

public JiveContext getJiveContext()
Gets the jive context for the current page user

Returns:
the jive context for the current page user

getUser

public User getUser()
Gets the current page user, or null if annonymous

Returns:
the current page user, or null if annonymous

getAuthToken

public AuthToken getAuthToken()
Gets the current page user's auth token

Returns:
the current page user's auth token

getRequest

public javax.servlet.http.HttpServletRequest getRequest()
Gets the http servlet request object

Returns:
the http servlet request object

getResponse

public javax.servlet.http.HttpServletResponse getResponse()
Gets the http servlet response object

Returns:
the http servlet response object

getCommunity

public Community getCommunity()
Gets the community object for this widget context, or null if the widget is being rendered outside of a community.

Returns:
the community object for this widget context, or null if a community object doesn't exist.

isEdit

public boolean isEdit()
Returns true if the parent container is currently in edit mode and false if it is not.

Returns:
true if the parent container is currently in edit mode and false if it is not.

Clearspace Project Page

Copyright © 1999-2007 Jive Software.