Class ViewPageAction
- java.lang.Object
-
- com.opensymphony.xwork2.ActionSupport
-
- 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
- Direct Known Subclasses:
PageInfoAction
public class ViewPageAction extends AbstractPageAction implements CommentAware, Evented<ConfluenceEvent>
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected CommentManagercommentManagerprotected RenderereditRendererprotected NotificationManagernotificationManagerstatic StringREQUEST_KEY_HELPER-
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, DEVMODE, eventManager, i18NBeanFactory, labelManager, languageManager, LICENSE_EXPIRED, LICENSE_USERS_EXCEEDED, messageHolder, permissionManager, permitted, personService, pluginAccessor, settingsManager, spacePermissionManager, systemInformationService, userAccessor, webInterfaceManager
-
-
Constructor Summary
Constructors Constructor Description ViewPageAction()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Stringexecute()BlogPostsCalendargetCalendarForThisMonth()CaptchaManagergetCaptchaManager()BooleangetChildrenShowing()CollaborativeEditingHelpergetCollaborativeEditingHelper()CommentgetComment()Deprecated, for removal: This API element is subject to removal in a future version.since 8.8.0.StringgetCommentAsXHtmlForWysiwyg()longgetCommentId()StringgetDateString(Date date)StringgetEditingUser()ConfluenceEventgetEventToPublish(String result)Gets the event to publish.ListgetExternalReferences()BlogPostgetFirstPostInNextMonth(Calendar postingDate)Deprecated, for removal: This API element is subject to removal in a future version.since 8.8.0.List<ContentPermission>getInheritedContentPermissions()BlogPostgetLastPostInPreviousMonth(Calendar postingDate)Deprecated, for removal: This API element is subject to removal in a future version.since 8.8.0.NotificationManagergetNotificationManager()longgetPageIdOfVersionAfter(AbstractPage page)longgetPageIdOfVersionBefore(AbstractPage page)StringgetPageXHtmlContent()PagegetParentPage()Deprecated, for removal: This API element is subject to removal in a future version.since 8.8.0.longgetReplyToComment()List<ContentPermission>getThisPagePermissions()ListgetViewInheritedContentPermissionSets()WebInterfaceContextgetWebInterfaceContext()Returns a context which can be passed to web items when rendering them.WebInterfaceContextgetWebInterfaceContext(Comment comment)Map<Comment,String>getXHtmlComments()booleanhasAnyPermissions()checks if the page has any direct contentpermissions or inherited onesbooleanhasNextVersion(AbstractPage page)booleanhasPreviousVersion(AbstractPage page)booleanisChildrenNotShown()Used to hide the page children if we are using the left sidebar.booleanisEditComment()booleanisLatestVersionRequired()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.booleanisNavigatingVersions()booleanisPageRequired()If the action requires that the page be set before being run, then it should return true to this method.booleanisPermitted()booleanisShowCommentArea()booleanisThreadComments()booleanisUserWatchingPage()Returns true if the user is watching the current page.booleanisUserWatchingSpace()Returns true if the user is watching the page/blog's space for the respective ContentType.booleanisViewPermissionRequired()protected booleanpageIsLatestVersionAndDoesNotHaveSpace()StringrenderExternalLink(com.atlassian.renderer.links.Link link)voidsetCaptchaManager(CaptchaManager captchaManager)voidsetCollaborativeEditingHelper(CollaborativeEditingHelper collaborativeEditingHelper)voidsetComment(Comment comment)Sets the currently focused comment.voidsetCommentManager(CommentManager commentManager)voidsetEditComment(boolean editComment)voidsetEditRenderer(Renderer editRenderer)voidsetNavigatingVersions(boolean navigatingVersions)voidsetNotificationManager(NotificationManager notificationManager)voidsetReplyToComment(long replyToComment)voidsetShowChildren(Boolean showChildren)voidsetShowCommentArea(boolean showCommentArea)voidsetThemeManager(ThemeManager themeManager)voidsetXhtmlContent(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
-
Methods inherited from class com.atlassian.confluence.pages.actions.AbstractPageAwareAction
getCustomPageUrl, getFriendlyDateFormatterHelper, 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, formatFriendlyDate, getAccessMode, getActionName, getActionName, getAuthenticatedUser, getBootstrapManager, getBootstrapStatusProvider, getCancel, getCancelResult, getConfluenceAccessManager, getContentUiSupport, getContext, getCurrentRequest, getCurrentSession, getDateFormatSetting, getDateFormatter, getDefaultResourceBundle, getDefaultTimeZone, getDocBean, getDocLink, getEventManager, getFriendlyDateFormatter, getFrontendServiceURL, getGlobalSettings, getI18n, getInstalledLanguages, getLabelManager, getLanguageJs, getLanguageManager, getLanguageUserFriendly, getLocale, getLocaleManager, getLocaleString, getMessageHolder, getNiceContentType, getPermissionManager, getPermittedEntitiesOf, getPermittedEntitiesOf, getPermittedEntitiesOf, getPersonService, getPreviousLoginDate, getRemoteUser, getSession, getSystemInformationService, getText, getText, getText, getText, getText, getText, getText, getText, getTextStatic, getTextStatic, getTextStrict, getTimeZone, getUserAccessor, getUserByName, getUserFullName, getUserHasBrowseUsersPermission, getUserHasLicensedAccess, getUserInterfaceState, getUserLocaleDefaultDatePattern, getUserProfilePicUrl, getWebInterfaceManager, hasPermissionForSpace, isAnonymousUser, isCanceled, isDevMode, isEmailVisible, isExternalUserManagementEnabled, isLabelable, isPrintableVersion, isSkipAccessCheck, isUserStatusPluginEnabled, isUsingH2, isUsingHSQL, setAccessModeService, setApiDateFormatService, setApiPersonService, setBootstrapManager, setBootstrapStatusProvider, setCancel, setConfluenceAccessManager, setContentUiSupport, setEventManager, setFormatSettingsManager, setI18NBean, setI18NBeanFactory, setLabelManager, setLanguageManager, setLocaleManager, setLoginManager, setMessageHolder, setPermissionManager, setPluginAccessor, setPreviousLoginDate, setServletRequestSupplier, setSettingsManager, setSpacePermissionManager, setSystemInformationService, setTimeZoneManager, setUserAccessor, setWebInterfaceManager, useSkipAccessCheck, withServletRequestSupplier
-
Methods inherited from class com.opensymphony.xwork2.ActionSupport
addActionError, addActionMessage, addFieldError, clearActionErrors, clearErrors, clearErrorsAndMessages, clearFieldErrors, clearMessages, clone, getActionErrors, getActionMessages, getContainer, getFieldErrors, getFormatted, getLocaleProvider, getText, getText, getTextProvider, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, hasKey, input, isValidLocale, isValidLocaleString, pause, setActionErrors, setActionMessages, setContainer, setFieldErrors, validate
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.opensymphony.xwork2.LocaleProvider
isValidLocale, isValidLocaleString
-
Methods inherited from interface com.atlassian.confluence.validation.MessageHolderAware
validate
-
Methods inherited from interface com.atlassian.confluence.pages.actions.PageAware
isEditPermissionRequired
-
-
-
-
Field Detail
-
REQUEST_KEY_HELPER
public static final String REQUEST_KEY_HELPER
- See Also:
- Constant Field Values
-
notificationManager
protected NotificationManager notificationManager
-
commentManager
protected CommentManager commentManager
-
editRenderer
protected Renderer editRenderer
-
-
Method Detail
-
getComment
@Deprecated(since="8.8.0", forRemoval=true) public Comment 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:
getCommentin interfaceCommentAware- Returns:
- the comment which is focused
-
getCommentId
public long getCommentId()
-
setComment
public void setComment(Comment comment)
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:
setCommentin interfaceCommentAware- Parameters:
comment- the comment which is to be focused
-
getParentPage
@Deprecated(since="8.8.0", forRemoval=true) public Page 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 parentPageof the currentPageor null if the currentAbstractPageis a root page or a blogpost.
-
getExternalReferences
public List getExternalReferences()
-
isPageRequired
public boolean isPageRequired()
Description copied from interface:PageAwareIf 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:
isPageRequiredin interfacePageAware- Overrides:
isPageRequiredin classAbstractPageAwareAction- Returns:
- true if the action requires a page in order to execute
-
isLatestVersionRequired
public boolean isLatestVersionRequired()
Description copied from interface:PageAwareIf 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:
isLatestVersionRequiredin interfacePageAware- Overrides:
isLatestVersionRequiredin classAbstractPageAwareAction- Returns:
- true if the action requires the most recent version of a page
-
isViewPermissionRequired
public boolean isViewPermissionRequired()
- Specified by:
isViewPermissionRequiredin interfacePageAware- Overrides:
isViewPermissionRequiredin classAbstractPageAwareAction- Returns:
- true if the action requires a check on the view page level permissions on this page
-
getEditingUser
@Internal public String getEditingUser()
-
execute
@XsrfProtectionExcluded public String execute() throws Exception
- Specified by:
executein interfacecom.opensymphony.xwork2.Action- Overrides:
executein classcom.opensymphony.xwork2.ActionSupport- Throws:
Exception
-
pageIsLatestVersionAndDoesNotHaveSpace
protected boolean pageIsLatestVersionAndDoesNotHaveSpace()
-
getEventToPublish
public ConfluenceEvent getEventToPublish(String result)
Description copied from interface:EventedGets the event to publish.- Specified by:
getEventToPublishin 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
public String getPageXHtmlContent()
-
getChildrenShowing
public Boolean getChildrenShowing()
-
setShowChildren
public void setShowChildren(Boolean showChildren)
-
getNotificationManager
public NotificationManager getNotificationManager()
-
setNotificationManager
public void setNotificationManager(NotificationManager notificationManager)
-
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.
-
renderExternalLink
public String renderExternalLink(com.atlassian.renderer.links.Link link)
-
getReplyToComment
public long getReplyToComment()
-
setReplyToComment
public void setReplyToComment(long replyToComment)
-
getCalendarForThisMonth
public BlogPostsCalendar getCalendarForThisMonth()
-
getFirstPostInNextMonth
@Deprecated(since="8.8.0", forRemoval=true) public BlogPost getFirstPostInNextMonth(Calendar postingDate)
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 first post in the month after the current postingDayThis method is a duplication of the method in AbstractBlogPostsAction - they really shouldn't be here.
- Returns:
- BlogPost for the first post in the next month, null otherwise
- See Also:
AbstractBlogPostsAction
-
getLastPostInPreviousMonth
@Deprecated(since="8.8.0", forRemoval=true) public BlogPost getLastPostInPreviousMonth(Calendar postingDate)
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 last post in the month before the current postingDayThis method is a duplication of the method in AbstractBlogPostsAction - they really shouldn't be here.
- Returns:
- BlogPost for the last post in the previous month, null otherwise
- See Also:
AbstractBlogPostsAction
-
getInheritedContentPermissions
public List<ContentPermission> getInheritedContentPermissions()
-
getThisPagePermissions
public List<ContentPermission> getThisPagePermissions()
-
getPageIdOfVersionBefore
public long getPageIdOfVersionBefore(AbstractPage page)
-
getPageIdOfVersionAfter
public long getPageIdOfVersionAfter(AbstractPage page)
-
hasPreviousVersion
public boolean hasPreviousVersion(AbstractPage page)
-
hasNextVersion
public boolean hasNextVersion(AbstractPage page)
-
isShowCommentArea
public boolean isShowCommentArea()
-
setShowCommentArea
public void setShowCommentArea(boolean showCommentArea)
-
isEditComment
public boolean isEditComment()
-
setEditComment
public void setEditComment(boolean editComment)
-
isNavigatingVersions
public boolean isNavigatingVersions()
-
setNavigatingVersions
public void setNavigatingVersions(boolean navigatingVersions)
-
setCommentManager
public void setCommentManager(CommentManager commentManager)
-
getCommentAsXHtmlForWysiwyg
public String getCommentAsXHtmlForWysiwyg()
-
getWebInterfaceContext
public WebInterfaceContext getWebInterfaceContext()
Description copied from interface:WebInterfaceReturns 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:
getWebInterfaceContextin interfaceWebInterface- Overrides:
getWebInterfaceContextin classAbstractPageAction
-
getWebInterfaceContext
public WebInterfaceContext getWebInterfaceContext(Comment comment)
-
getCaptchaManager
public CaptchaManager getCaptchaManager()
-
setCaptchaManager
public void setCaptchaManager(CaptchaManager captchaManager)
-
isPermitted
public boolean isPermitted()
- Overrides:
isPermittedin classAbstractPageAwareAction
-
getViewInheritedContentPermissionSets
public List getViewInheritedContentPermissionSets()
-
hasAnyPermissions
public boolean hasAnyPermissions()
checks if the page has any direct contentpermissions or inherited ones
-
setEditRenderer
public void setEditRenderer(Renderer editRenderer)
-
setXhtmlContent
public void setXhtmlContent(XhtmlContent xhtmlContent)
-
setThemeManager
public void setThemeManager(ThemeManager themeManager)
-
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
@ExperimentalApi public CollaborativeEditingHelper getCollaborativeEditingHelper()
-
-