Class ViewPageAction
java.lang.Object
org.apache.struts2.ActionSupport
com.opensymphony.xwork2.ActionSupport
com.atlassian.confluence.core.AbstractI18nActionSupport
com.atlassian.confluence.core.ConfluenceActionSupport
com.atlassian.confluence.pages.actions.AbstractPageAwareAction
com.atlassian.confluence.pages.actions.AbstractPageAction
com.atlassian.confluence.pages.actions.ViewPageAction
- All Implemented Interfaces:
Evented<ConfluenceEvent>
,CommentAware
,PageAware
,TinyUrlAware
,WebInterface
,MessageHolderAware
,com.opensymphony.xwork2.Action
,com.opensymphony.xwork2.interceptor.ValidationAware
,com.opensymphony.xwork2.LocaleProvider
,com.opensymphony.xwork2.TextProvider
,com.opensymphony.xwork2.Validateable
,Serializable
,org.apache.struts2.action.Action
,org.apache.struts2.interceptor.ValidationAware
,org.apache.struts2.Validateable
- Direct Known Subclasses:
PageInfoAction
public class ViewPageAction
extends AbstractPageAction
implements CommentAware, Evented<ConfluenceEvent>
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.opensymphony.xwork2.interceptor.ValidationAware
com.opensymphony.xwork2.interceptor.ValidationAware.LegacyAdapter
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected CommentManager
protected static final String
protected static final String
protected Renderer
protected NotificationManager
static final String
Fields inherited from class com.atlassian.confluence.pages.actions.AbstractPageAction
incomingLinks, linkManager, pageManager, PREVIEW, RICHTEXT, viewRenderer, wysiwygConverter
Fields inherited from class com.atlassian.confluence.pages.actions.AbstractPageAwareAction
contentPermissionManager, spaceManager
Fields inherited from class com.atlassian.confluence.core.ConfluenceActionSupport
accessModeService, CANCEL, confluenceAccessManager, contentUiSupport, eventPublisher, formatSettingsManager, globalSettingsManager, i18NBeanFactory, labelManager, languageManager, LICENSE_EXPIRED, LICENSE_USERS_EXCEEDED, localeManager, loginManager, messageHolder, permissionManager, pluginAccessor, request, response, spacePermissionManager, strutsHelper, systemInformationService, userAccessor, webInterfaceManager
Fields inherited from class org.apache.struts2.ActionSupport
container
Fields inherited from interface org.apache.struts2.action.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute()
Deprecated, for removal: This API element is subject to removal in a future version.since 8.8.0.long
getDateString
(Date date) getEventToPublish
(String result) Gets the event to publish.long
long
Deprecated, for removal: This API element is subject to removal in a future version.since 8.8.0.int
long
Returns a context which can be passed to web items when rendering them.getWebInterfaceContext
(Comment comment) boolean
checks if the page has any direct contentpermissions or inherited onesboolean
hasNextVersion
(AbstractPage page) boolean
boolean
Used to hide the page children if we are using the left sidebar.boolean
boolean
If the action can only work on the most recent version of a page, this will cause the interceptor to silently replace the version that it looks up with the most recent version, if necessary.boolean
boolean
If the action requires that the page be set before being run, then it should return true to this method.boolean
Consulted byPermissionCheckInterceptor
.boolean
boolean
boolean
Returns true if the user is watching the current page.boolean
Returns true if the user is watching the page/blog's space for the respective ContentType.boolean
protected boolean
renderExternalLink
(com.atlassian.renderer.links.Link link) void
setCollaborativeEditingHelper
(CollaborativeEditingHelper collaborativeEditingHelper) void
setComment
(Comment comment) Sets the currently focused comment.void
setCommentManager
(CommentManager commentManager) void
setDarkFeaturesManager
(DarkFeaturesManager darkFeaturesManager) void
setEditComment
(boolean editComment) void
setEditRenderer
(Renderer editRenderer) void
setEstimatedReadTimeService
(EstimatedReadTimeService estimatedReadTimeService) void
setNavigatingVersions
(boolean navigatingVersions) void
setNotificationManager
(NotificationManager notificationManager) void
setReplyToComment
(long replyToComment) void
setShowChildren
(Boolean showChildren) void
setShowCommentArea
(boolean showCommentArea) void
setThemeManager
(ThemeManager themeManager) void
setViewPageActionPathConverter
(ViewPageActionPathConverter viewPageActionPathConverter) void
setXhtmlContent
(XhtmlContent xhtmlContent) Methods inherited from class com.atlassian.confluence.pages.actions.AbstractPageAction
displayDatePath, getAttachmentSourceContent, getAvailableSpaces, getBeanKey, getBlogPost, getEditorVersion, getHelper, getIncomingLinks, getLabels, getMode, getNextPost, getNumberOfAttachmentsAsString, getNumberOfLabelsAsString, getPermissionTypes, getPermittedChildren, getPostingDateAsDate, getPostingDay, getPostingTimeAsTime, getPreviousPost, getPreviousVersion, getSpaceManager, getSuggestedLabels, getTinyUrl, hasAttachFilePermissions, hasPermittedChildren, isSpaceAdmin, isSuperUser, isUserWatchingOwnContent, setConfluenceWysiwygConverter, setEditorManager, setLinkManager, setMode, setPageManager, setPostingDate, setPostingTime, setViewRenderer, validate
Methods inherited from class com.atlassian.confluence.pages.actions.AbstractPageAwareAction
getCustomPageUrl, getPage, getPageId, getPageUrl, getSpace, getSpaceKey, getTitle, isCollaborativeContent, setContentPermissionManager, setPage, setSpaceManager
Methods inherited from class com.atlassian.confluence.core.ConfluenceActionSupport
addActionError, addActionMessage, addFieldError, addPermissionTypeTo, addToHistory, doDefault, getActionErrors, getActionMessages, getActionName, getAuthenticatedUser, getBootstrapStatusProvider, getCancelResult, getCurrentRequest, getCurrentResponse, getDateFormatter, getDefaultTimeZone, getFieldErrors, getGlobalSettings, getI18n, getLocale, getMessageHolder, getPermittedEntitiesOf, getPermittedEntitiesOf, getPermittedEntitiesOf, getPreviousLoginDate, getTimeZone, getUserByName, getUserInterfaceState, isAnonymousUser, isEmailVisible, setAccessModeService, setBootstrapStatusProvider, setCancel, setConfluenceAccessManager, setContentUiSupport, setEventPublisher, setFormatSettingsManager, setI18NBean, setI18NBeanFactory, setLabelManager, setLanguageManager, setLocaleManager, setLoginManager, setMessageHolder, setPermissionManager, setPluginAccessor, setPreviousLoginDate, setSettingsManager, setSkipIsPermitted, setSpacePermissionManager, setStrutsHelper, setSystemInformationService, setTimeZoneManager, setUserAccessor, setWebInterfaceManager, shouldSkipIsPermitted
Methods inherited from class com.atlassian.confluence.core.AbstractI18nActionSupport
getText, getText, getText, getText, getText, getText, getText, getText, getTextStrict
Methods inherited from class org.apache.struts2.ActionSupport
addActionError, addActionMessage, addFieldError, clearActionErrors, clearErrors, clearErrorsAndMessages, clearFieldErrors, clearMessages, clone, getContainer, getFormatted, getLocaleProvider, getText, getText, getTextProvider, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, hasKey, input, isValidLocale, isValidLocaleString, pause, setActionErrors, setActionMessages, setContainer, setFieldErrors, toLocale
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.atlassian.confluence.pages.actions.PageAware
isEditPermissionRequired
Methods inherited from interface org.apache.struts2.interceptor.ValidationAware
addActionError, addActionMessage, addFieldError, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, setActionErrors, setActionMessages, setFieldErrors
-
Field Details
-
REQUEST_KEY_HELPER
- See Also:
-
DARKFEATUE_CONFLUENCE_PAGE_READTIME
- See Also:
-
DARK_FEATURE_CONFLUENCE_READABLE_URL
- See Also:
-
notificationManager
-
commentManager
-
editRenderer
-
-
Constructor Details
-
ViewPageAction
public ViewPageAction()
-
-
Method Details
-
getComment
Deprecated, for removal: This API element is subject to removal in a future version.since 8.8.0. Hibernate objects are not supported in Struts anymore. Use action's direct method calls.Gets the currently focused comment. Might be the comment from a permalink, a comment being replied to, or a comment being edited. Returns null if no comment is active.- Specified by:
getComment
in interfaceCommentAware
- Returns:
- the comment which is focused
-
getCommentId
public long getCommentId() -
setComment
Sets the currently focused comment. Might be the comment from a permalink, a comment being replied to, or a comment being edited. Set to null if no comment is active.Used by the
CommentAwareInterceptor
.- Specified by:
setComment
in interfaceCommentAware
- Parameters:
comment
- the comment which is to be focused
-
getParentPage
Deprecated, for removal: This API element is subject to removal in a future version.since 8.8.0. Hibernate objects are not supported in Struts anymore. Use action's direct method calls.Returns the parentPage
of the currentPage
or null if the currentAbstractPage
is a root page or a blogpost. -
getExternalReferences
-
isPageRequired
public boolean isPageRequired()Description copied from interface:PageAware
If the action requires that the page be set before being run, then it should return true to this method. If the action requires a page, but no page is available, then the interceptor will automatically redirect to the 'pagenotfound' result- Specified by:
isPageRequired
in interfacePageAware
- Overrides:
isPageRequired
in classAbstractPageAwareAction
- Returns:
- true if the action requires a page in order to execute
-
isLatestVersionRequired
public boolean isLatestVersionRequired()Description copied from interface:PageAware
If the action can only work on the most recent version of a page, this will cause the interceptor to silently replace the version that it looks up with the most recent version, if necessary.- Specified by:
isLatestVersionRequired
in interfacePageAware
- Overrides:
isLatestVersionRequired
in classAbstractPageAwareAction
- Returns:
- true if the action requires the most recent version of a page
-
isViewPermissionRequired
public boolean isViewPermissionRequired()- Specified by:
isViewPermissionRequired
in interfacePageAware
- Overrides:
isViewPermissionRequired
in classAbstractPageAwareAction
- Returns:
- true if the action requires a check on the view page level permissions on this page
-
getEditingUser
-
execute
- Specified by:
execute
in interfaceorg.apache.struts2.action.Action
- Overrides:
execute
in classorg.apache.struts2.ActionSupport
- Throws:
Exception
-
pageIsLatestVersionAndDoesNotHaveSpace
protected boolean pageIsLatestVersionAndDoesNotHaveSpace() -
getEventToPublish
Description copied from interface:Evented
Gets the event to publish.- Specified by:
getEventToPublish
in interfaceEvented<ConfluenceEvent>
- Parameters:
result
- the result of the action executing.- Returns:
- the event. Can be null, in which case no event will be published.
-
getPageXHtmlContent
-
getXHtmlComments
-
getChildrenShowing
-
setShowChildren
-
getNotificationManager
-
setNotificationManager
-
isThreadComments
public boolean isThreadComments() -
isUserWatchingPage
public boolean isUserWatchingPage()Returns true if the user is watching the current page. Returns false otherwise, or if the user is anonymous. -
isUserWatchingSpace
public boolean isUserWatchingSpace()Returns true if the user is watching the page/blog's space for the respective ContentType. For example, if getPage returns a BlogPost and the user is only watching Pages in the Space, this method returns false. -
getDateString
-
renderExternalLink
-
getReplyToComment
public long getReplyToComment() -
setReplyToComment
public void setReplyToComment(long replyToComment) -
getInheritedContentPermissions
-
getThisPagePermissions
-
getPageIdOfVersionBefore
-
getPageIdOfVersionAfter
-
hasPreviousVersion
-
hasNextVersion
-
isShowCommentArea
public boolean isShowCommentArea() -
setShowCommentArea
public void setShowCommentArea(boolean showCommentArea) -
isEditComment
public boolean isEditComment() -
setEditComment
public void setEditComment(boolean editComment) -
setCommentManager
-
getCommentAsXHtmlForWysiwyg
-
getWebInterfaceContext
Description copied from interface:WebInterface
Returns a context which can be passed to web items when rendering them.Typically, Struts actions will implement this to provide extra details in the context such as content objects, and so on.
- Specified by:
getWebInterfaceContext
in interfaceWebInterface
- Overrides:
getWebInterfaceContext
in classAbstractPageAction
-
getWebInterfaceContext
-
isPermitted
public boolean isPermitted()Description copied from class:ConfluenceActionSupport
Consulted byPermissionCheckInterceptor
.- Overrides:
isPermitted
in classAbstractPageAwareAction
-
getViewInheritedContentPermissionSets
-
hasAnyPermissions
public boolean hasAnyPermissions()checks if the page has any direct contentpermissions or inherited ones -
setEditRenderer
-
setXhtmlContent
-
setThemeManager
-
isChildrenNotShown
public boolean isChildrenNotShown()Used to hide the page children if we are using the left sidebar. It's necessary to do it like this because a theme may not override page.vmd.- Returns:
- true if children are not shown, and false if it's the opposite.
-
setCollaborativeEditingHelper
@ExperimentalApi public void setCollaborativeEditingHelper(CollaborativeEditingHelper collaborativeEditingHelper) -
getCollaborativeEditingHelper
-
setDarkFeaturesManager
-
setEstimatedReadTimeService
-
getReadTime
public int getReadTime() -
getForwardLocation
-
getRedirectLocation
-
setViewPageActionPathConverter
-