@ParametersAreNonnullByDefault public class DefaultWebInterfaceContext extends Object implements WebInterfaceContext
CONTEXT_KEY_ATTACHMENT, CONTEXT_KEY_COMMENT, CONTEXT_KEY_CONTENT_DRAFT, CONTEXT_KEY_DRAFT, CONTEXT_KEY_EDIT_PAGE_RESTRICTED, CONTEXT_KEY_LABEL, CONTEXT_KEY_PAGE, CONTEXT_KEY_PARENT_PAGE, CONTEXT_KEY_PERSONAL_INFORMATION, CONTEXT_KEY_SPACE, CONTEXT_KEY_SPACE_KEY, CONTEXT_KEY_TARGET_USER, CONTEXT_KEY_USER| Constructor and Description |
|---|
DefaultWebInterfaceContext() |
DefaultWebInterfaceContext(Map<String,Object> context)
Deprecated.
since 5.8 Use
createFrom(java.util.Map) or copyOf(WebInterfaceContext) |
DefaultWebInterfaceContext(WebInterfaceContext webInterfaceContext)
Deprecated.
since 5.8 use
copyOf(WebInterfaceContext) |
| Modifier and Type | Method and Description |
|---|---|
static DefaultWebInterfaceContext |
copyOf(WebInterfaceContext webInterfaceContext)
Creates a new
DefaultWebInterfaceContext with a copy of the data from another context. |
static DefaultWebInterfaceContext |
createFrom(Map<String,?> contextMap)
Creates a new
DefaultWebInterfaceContext with the datas from the given Map. |
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.
|
ContentEntityObject |
getContentDraft()
Deprecated.
|
ConfluenceUser |
getCurrentUser() |
Draft |
getDraft()
Deprecated.
|
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.
|
com.atlassian.user.User |
getUser()
Deprecated.
|
boolean |
hasParameter(String key)
Returns true if the parameter has been set (even if it is set to null).
|
boolean |
isEditPageRestricted()
Deprecated.
since 5.9. Use proper permissions checks on the content
|
DefaultWebInterfaceContext |
putAllMissing(WebInterfaceContext source)
Put all missing parameters from source into current web interface context
|
void |
setAttachment(Attachment attachment) |
void |
setComment(Comment comment) |
void |
setCurrentUser(ConfluenceUser user)
Set the current user on the context
|
void |
setIsEditPageRestricted(boolean restricted)
Deprecated.
since 5.9. Use proper permissions checks on the content
|
void |
setLabel(DisplayableLabel label) |
void |
setLazyParameter(String key,
com.google.common.base.Supplier<Object> supplier) |
void |
setPage(AbstractPage page) |
void |
setParameter(String key,
Object value) |
void |
setParameters(Map<String,Object> parameters) |
void |
setPersonalInformation(PersonalInformation personalInformation) |
void |
setSpace(Space space) |
void |
setTargetedUser(ConfluenceUser user) |
void |
setTargetUser(com.atlassian.user.User user)
Deprecated.
since 5.2
|
void |
setUser(com.atlassian.user.User user)
Deprecated.
since 5.2. See
setCurrentUser(ConfluenceUser). |
Map<String,Object> |
toMap()
Converts the contents of this object as a Map.
|
public DefaultWebInterfaceContext()
@Deprecated public DefaultWebInterfaceContext(@Nullable Map<String,Object> context)
createFrom(java.util.Map) or copyOf(WebInterfaceContext)toMap().context - the context parameters in a map@Deprecated public DefaultWebInterfaceContext(WebInterfaceContext webInterfaceContext)
copyOf(WebInterfaceContext)webInterfaceContext - the other context to copy the parameters frompublic static DefaultWebInterfaceContext copyOf(WebInterfaceContext webInterfaceContext)
DefaultWebInterfaceContext with a copy of the data from another context.
If the other context is also an implementation of DefaultWebInterfaceContext, then any lazy
properties will be copied intact, and will not be evaluated.public static DefaultWebInterfaceContext createFrom(Map<String,?> contextMap)
DefaultWebInterfaceContext with the datas from the given Map. The map will be
copied.@Deprecated public com.atlassian.user.User getUser()
WebInterfaceContextgetUser in interface WebInterfaceContextpublic ConfluenceUser getCurrentUser()
getCurrentUser in interface WebInterfaceContext@Deprecated public void setUser(com.atlassian.user.User user)
setCurrentUser(ConfluenceUser).public void setCurrentUser(ConfluenceUser user)
user - the current userpublic AbstractPage getPage()
WebInterfaceContextgetPage in interface WebInterfaceContext@Deprecated public Draft getDraft()
WebInterfaceContextgetDraft in interface WebInterfaceContext@Deprecated public ContentEntityObject getContentDraft()
WebInterfaceContextgetContentDraft in interface WebInterfaceContextpublic void setPage(AbstractPage page)
public Space getSpace()
WebInterfaceContextgetSpace in interface WebInterfaceContextpublic String getSpaceKey()
WebInterfaceContextgetSpaceKey in interface WebInterfaceContextpublic void setSpace(Space space)
public Comment getComment()
WebInterfaceContextgetComment in interface WebInterfaceContextpublic void setComment(Comment comment)
public DisplayableLabel getLabel()
WebInterfaceContextgetLabel in interface WebInterfaceContextpublic void setLabel(DisplayableLabel label)
public Attachment getAttachment()
WebInterfaceContextgetAttachment in interface WebInterfaceContextpublic void setAttachment(Attachment attachment)
public PersonalInformation getPersonalInformation()
WebInterfaceContextgetPersonalInformation in interface WebInterfaceContextpublic void setPersonalInformation(PersonalInformation personalInformation)
public Object getParameter(String key)
WebInterfaceContextgetParameter in interface WebInterfaceContextpublic boolean hasParameter(String key)
WebInterfaceContexthasParameter in interface WebInterfaceContextpublic void setLazyParameter(String key, com.google.common.base.Supplier<Object> supplier)
public Map<String,Object> toMap()
toMap in interface WebInterfaceContext@Deprecated public com.atlassian.user.User getTargetUser()
WebInterfaceContextgetTargetUser in interface WebInterfaceContextpublic ConfluenceUser getTargetedUser()
getTargetedUser in interface WebInterfaceContext@Deprecated public void setTargetUser(com.atlassian.user.User user)
public void setTargetedUser(ConfluenceUser user)
user - the user targeted by the current action.@Deprecated public void setIsEditPageRestricted(boolean restricted)
@Deprecated public boolean isEditPageRestricted()
WebInterfaceContextisEditPageRestricted in interface WebInterfaceContextpublic AbstractPage getParentPage()
WebInterfaceContextgetParentPage in interface WebInterfaceContextpublic DefaultWebInterfaceContext putAllMissing(WebInterfaceContext source)
source - which contains parameters to be copied in.Copyright © 2003–2019 Atlassian. All rights reserved.