public interface

WebInterfaceContext

com.atlassian.confluence.plugin.descriptor.web.WebInterfaceContext
Known Indirect Subclasses

Class Overview

When rendering web fragments, this context is used for retrieval of Confluence content information. It can be converted to and from a Map to fit with the Condition and WebInterfaceManager interfaces. The map returned by toMap() is also used as a Velocity context for rendering URLs.

Parameters that are only used in a couple of places can be retrieved without type-safe accessors via getParameter(String) or hasParameter(String).

Summary

Constants
String CONTEXT_KEY_ATTACHMENT
String CONTEXT_KEY_COMMENT
String CONTEXT_KEY_DRAFT
String CONTEXT_KEY_EDIT_PAGE_RESTRICTED
String CONTEXT_KEY_LABEL
String CONTEXT_KEY_PAGE
String CONTEXT_KEY_PERSONAL_INFORMATION
String CONTEXT_KEY_SPACE
String CONTEXT_KEY_TARGET_USER
String CONTEXT_KEY_USER
Public Methods
Attachment getAttachment()
Returns the attachment related to the web interface state, or null if there is no attachment.
Comment getComment()
Returns the comment related to the web interface state, or null if there is no comment.
Draft getDraft()
Returns a draft related to the web interface state, or null if there is no draft.
DisplayableLabel getLabel()
Returns the label related to the web interface state, or null if there is no label.
AbstractPage getPage()
Returns the page related to the web interface state, or null if there is no page.
Object getParameter(String key)
Returns a custom parameter, or null if the parameter has not been set.
PersonalInformation getPersonalInformation()
Returns the personal information (i.e.
Space getSpace()
Returns the space related to the web interface state, or null if there is no space.
User getTargetUser()
Returns the target user of the action, or null if there is no target user.
User getUser()
Returns the current user, or null if there is no user logged in.
boolean hasParameter(String key)
Returns true if the parameter has been set (even if it is set to null).
boolean isEditPageRestricted()
Indicates if the current edit page is restricted (i.e.
Map<StringObject> toMap()
Converts the parameters into a map using the "context keys" defined as constants in this class.

Constants

public static final String CONTEXT_KEY_ATTACHMENT

Constant Value: "attachment"

public static final String CONTEXT_KEY_COMMENT

Constant Value: "comment"

public static final String CONTEXT_KEY_DRAFT

Constant Value: "draft"

public static final String CONTEXT_KEY_EDIT_PAGE_RESTRICTED

Constant Value: "editPageRestricted"

public static final String CONTEXT_KEY_LABEL

Constant Value: "label"

public static final String CONTEXT_KEY_PAGE

Constant Value: "page"

public static final String CONTEXT_KEY_PERSONAL_INFORMATION

Constant Value: "userinfo"

public static final String CONTEXT_KEY_SPACE

Constant Value: "space"

public static final String CONTEXT_KEY_TARGET_USER

Constant Value: "targetUser"

public static final String CONTEXT_KEY_USER

Constant Value: "user"

Public Methods

public Attachment getAttachment ()

Returns the attachment related to the web interface state, or null if there is no attachment.

public Comment getComment ()

Returns the comment related to the web interface state, or null if there is no comment.

public Draft getDraft ()

Returns a draft related to the web interface state, or null if there is no draft.

public DisplayableLabel getLabel ()

Returns the label related to the web interface state, or null if there is no label.

public AbstractPage getPage ()

Returns the page related to the web interface state, or null if there is no page.

public Object getParameter (String key)

Returns a custom parameter, or null if the parameter has not been set.

public PersonalInformation getPersonalInformation ()

Returns the personal information (i.e. user profile) that is related to the web interface state, or null if there is no personal information.

public Space getSpace ()

Returns the space related to the web interface state, or null if there is no space.

public User getTargetUser ()

Returns the target user of the action, or null if there is no target user. The target user is the user the action is performing against, not necessarily the logged in user.

public User getUser ()

Returns the current user, or null if there is no user logged in.

public boolean hasParameter (String key)

Returns true if the parameter has been set (even if it is set to null). Useful for checking boolean custom parameters.

public boolean isEditPageRestricted ()

Indicates if the current edit page is restricted (i.e. has some kind of permissions in place).

public Map<StringObject> toMap ()

Converts the parameters into a map using the "context keys" defined as constants in this class. Parameters which have not been set may be omitted from the resulting map.