com.atlassian.confluence.plugin.descriptor.web
Interface WebInterfaceContext

All Known Implementing Classes:
DefaultWebInterfaceContext

public interface WebInterfaceContext

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).

Since:
2.8
See Also:
BaseConfluenceCondition, ConfluenceWebInterfaceManager

Field Summary
static String CONTEXT_KEY_ATTACHMENT
           
static String CONTEXT_KEY_COMMENT
           
static String CONTEXT_KEY_DRAFT
           
static String CONTEXT_KEY_EDIT_PAGE_RESTRICTED
           
static String CONTEXT_KEY_LABEL
           
static String CONTEXT_KEY_PAGE
           
static String CONTEXT_KEY_PARENT_PAGE
           
static String CONTEXT_KEY_PERSONAL_INFORMATION
           
static String CONTEXT_KEY_SPACE
           
static String CONTEXT_KEY_SPACE_KEY
           
static String CONTEXT_KEY_TARGET_USER
           
static String CONTEXT_KEY_USER
           
 
Method Summary
 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.
 ConfluenceUser getCurrentUser()
           
 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.
 AbstractPage getParentPage()
          Returns the parent page related to the web interface state, or null if there is no parent page.
 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.
 String getSpaceKey()
          Returns the space-key related to the web interface state, or null if there is no space-key.
 ConfluenceUser getTargetedUser()
           
 com.atlassian.user.User getTargetUser()
          Deprecated. since 5.2. See getTargetedUser().
 com.atlassian.user.User getUser()
          Deprecated. since 5.2. See getCurrentUser() instead.
 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<String,Object> toMap()
          Converts the parameters into a map using the "context keys" defined as constants in this class.
 

Field Detail

CONTEXT_KEY_USER

static final String CONTEXT_KEY_USER
See Also:
Constant Field Values

CONTEXT_KEY_TARGET_USER

static final String CONTEXT_KEY_TARGET_USER
See Also:
Constant Field Values

CONTEXT_KEY_PAGE

static final String CONTEXT_KEY_PAGE
See Also:
Constant Field Values

CONTEXT_KEY_DRAFT

static final String CONTEXT_KEY_DRAFT
See Also:
Constant Field Values

CONTEXT_KEY_SPACE

static final String CONTEXT_KEY_SPACE
See Also:
Constant Field Values

CONTEXT_KEY_SPACE_KEY

static final String CONTEXT_KEY_SPACE_KEY
See Also:
Constant Field Values

CONTEXT_KEY_COMMENT

static final String CONTEXT_KEY_COMMENT
See Also:
Constant Field Values

CONTEXT_KEY_LABEL

static final String CONTEXT_KEY_LABEL
See Also:
Constant Field Values

CONTEXT_KEY_ATTACHMENT

static final String CONTEXT_KEY_ATTACHMENT
See Also:
Constant Field Values

CONTEXT_KEY_PERSONAL_INFORMATION

static final String CONTEXT_KEY_PERSONAL_INFORMATION
See Also:
Constant Field Values

CONTEXT_KEY_EDIT_PAGE_RESTRICTED

static final String CONTEXT_KEY_EDIT_PAGE_RESTRICTED
See Also:
Constant Field Values

CONTEXT_KEY_PARENT_PAGE

static final String CONTEXT_KEY_PARENT_PAGE
See Also:
Constant Field Values
Method Detail

getUser

@Deprecated
com.atlassian.user.User getUser()
Deprecated. since 5.2. See getCurrentUser() instead.

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


getCurrentUser

ConfluenceUser getCurrentUser()
Returns:
the current user or null if there is no user logged in.
Since:
5.2

getTargetUser

@Deprecated
com.atlassian.user.User getTargetUser()
Deprecated. since 5.2. See getTargetedUser().

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.


getTargetedUser

ConfluenceUser getTargetedUser()
Returns:
the user targeted by the action, or null if there is none. The targeted user is the user the action is performing against, not necessarily the logged in user.
Since:
5.2

getPage

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


getDraft

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


getSpace

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


getSpaceKey

String getSpaceKey()
Returns the space-key related to the web interface state, or null if there is no space-key.


getComment

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


getLabel

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


getAttachment

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


getPersonalInformation

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.


getParameter

Object getParameter(String key)
Returns a custom parameter, or null if the parameter has not been set.


hasParameter

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.


toMap

Map<String,Object> 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.


isEditPageRestricted

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


getParentPage

AbstractPage getParentPage()
Returns the parent page related to the web interface state, or null if there is no parent page.



Copyright © 2003–2015 Atlassian. All rights reserved.