com.atlassian.confluence.pages.actions
Class ViewPageAction

java.lang.Object
  extended by com.opensymphony.xwork.ActionSupport
      extended by com.atlassian.confluence.core.ConfluenceActionSupport
          extended by com.atlassian.confluence.pages.actions.AbstractPageAwareAction
              extended by com.atlassian.confluence.pages.actions.AbstractPageAction
                  extended by com.atlassian.confluence.pages.actions.ViewPageAction
All Implemented Interfaces:
Evented<ConfluenceEvent>, CommentAware, PageAware, TinyUrlAware, WebInterface, MessageHolderAware, com.opensymphony.xwork.Action, com.opensymphony.xwork.LocaleProvider, com.opensymphony.xwork.TextProvider, com.opensymphony.xwork.Validateable, com.opensymphony.xwork.ValidationAware, java.io.Serializable
Direct Known Subclasses:
PageInfoAction

public class ViewPageAction
extends AbstractPageAction
implements CommentAware, Evented<ConfluenceEvent>

See Also:
Serialized Form

Field Summary
protected  CommentManager commentManager
           
protected  Renderer editRenderer
           
static int HOT_REFERRERS_COUNT
           
protected  NotificationManager notificationManager
           
protected  ReferralManager referralManager
           
 
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
CANCEL, DEVMODE, eventManager, i18NBeanFactory, labelManager, languageManager, LICENSE_EXPIRED, LICENSE_USERS_EXCEEDED, messageHolder, permissionManager, permitted, pluginAccessor, settingsManager, spacePermissionManager, userAccessor, webInterfaceManager
 
Fields inherited from class com.opensymphony.xwork.ActionSupport
LOG
 
Fields inherited from interface com.opensymphony.xwork.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS
 
Constructor Summary
ViewPageAction()
           
 
Method Summary
 java.lang.String execute()
           
 java.lang.String getAttachmentsWebDavUrl()
           
 java.lang.String getAttachmentsWebDavUrlForPage()
           
 BlogPostsCalendar getCalendarForThisMonth()
           
 CaptchaManager getCaptchaManager()
           
 java.lang.Boolean getChildrenShowing()
           
 Comment getComment()
          Gets the currently focused comment.
 java.lang.String getCommentAsXHtmlForWysiwyg()
           
 java.lang.Boolean getCommentsShowing()
          Deprecated. since 5.1.5 - comment collapse feature has been removed
 java.lang.String getDateString(java.util.Date date)
           
 ConfluenceEvent getEventToPublish(java.lang.String result)
          Gets the event to publish.
 java.util.List getExternalReferences()
           
 BlogPost getFirstPostInNextMonth(java.util.Calendar postingDate)
          Returns the first post in the month after the current postingDay

This method is a duplication of the method in AbstractBlogPostsAction - they really shouldn't be here.

 long getFocusedCommentId()
          Deprecated. since 2.8 use 'commentId' parameter from the web or getComment() from the application.
 java.util.List<ReferralLink> getHotReferrers()
          Return a list of ReferralLinks that point to this page.
 java.util.List<ContentPermission> getInheritedContentPermissions()
           
 BlogPost getLastPostInPreviousMonth(java.util.Calendar postingDate)
          Returns the last post in the month before the current postingDay

This method is a duplication of the method in AbstractBlogPostsAction - they really shouldn't be here.

 NotificationManager getNotificationManager()
           
 java.lang.String getPageContent()
          Deprecated. since 4.0. This is not used anywhere.
 long getPageIdOfVersionAfter(AbstractPage page)
           
 long getPageIdOfVersionBefore(AbstractPage page)
           
 java.lang.String getPageXHtmlContent()
           
 Page getParentPage()
          Returns the parent Page of the current Page or null if the current AbstractPage is a root page or a blogpost.
 java.util.List getPossibleAlternativesElsewhere()
          Deprecated. since 3.1 This action no longer uses possible alternatives so this method can be deleted. See PageNotFoundAction
 java.util.List getPossibleAlternativesInSpace()
          Deprecated. since 3.1 This action no longer uses possible alternatives so this method can be deleted. See PageNotFoundAction
 long getReplyToComment()
           
 Comment getRootComment()
          Deprecated. since 2.8 the default theme no longer uses a "root comment". This method will remain until the other themes do the same.
 java.util.List<ContentPermission> getThisPagePermissions()
           
 ConfluenceTrackbackUtils getTrackbackUtils()
           
 java.util.List getViewInheritedContentPermissionSets()
           
 WebInterfaceContext getWebInterfaceContext()
          Returns a context which can be passed to web items when rendering them.
 WebInterfaceContext getWebInterfaceContext(Comment comment)
           
 java.util.Map<Comment,java.lang.String> getXHtmlComments()
           
 boolean hasAnyPermissions()
          checks if the page has any direct contentpermissions or inherited ones
 boolean hasNextVersion(AbstractPage page)
           
 boolean hasPreviousVersion(AbstractPage page)
           
 boolean isAttachmentsInWebDavFolder()
           
 boolean isChildrenNotShown()
          Used to hide the page children if we are using the left sidebar.
 boolean isEditComment()
           
 boolean isLatestVersionRequired()
          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 isNavigatingVersions()
           
 boolean isPageRequired()
          If the action requires that the page be set before being run, then it should return true to this method.
 boolean isPermitted()
           
 boolean isShowCommentArea()
           
 boolean isThreadComments()
           
 boolean isUserWatchingPage()
          Returns true if the user is watching the current page.
 boolean isUserWatchingSpace()
          Returns true if the user is watching the page/blog's space for the respective ContentType.
 boolean isViewPermissionRequired()
           
 java.lang.String renderExternalLink(com.atlassian.renderer.links.Link link)
           
 java.lang.String renderLink(java.lang.String link)
          Deprecated. Since 4.0. See PageInfoAction.renderWikiLink(String) instead.
 void setCaptchaManager(CaptchaManager captchaManager)
           
 void setComment(Comment comment)
          Sets the currently focused comment.
 void setCommentManager(CommentManager commentManager)
           
 void setEditComment(boolean editComment)
           
 void setEditRenderer(Renderer editRenderer)
           
 void setFocusedCommentId(long focusedCommentId)
          Deprecated. since 2.8 use 'commentId' parameter from the web or setComment(Comment) from the application.
 void setNavigatingVersions(boolean navigatingVersions)
           
 void setNotificationManager(NotificationManager notificationManager)
           
 void setPageContent(java.lang.String pageContent)
          Deprecated. since 4.0. This is not used anywhere.
 void setReferralManager(ReferralManager referralManager)
           
 void setReplyToComment(long replyToComment)
           
 void setRootCommentId(long rootCommentId)
          Deprecated. since 2.8 the default theme no longer uses a "root comment". This method will remain until the other themes do the same.
 void setShowChildren(java.lang.Boolean showChildren)
           
 void setShowCommentArea(boolean showCommentArea)
           
 void setShowComments(java.lang.Boolean showComments)
          Deprecated. since 5.1.5 - comment collapse feature has been removed
 void setThemeManager(ThemeManager themeManager)
           
 void setWikiStyleRenderer(com.atlassian.renderer.WikiStyleRenderer wikiStyleRenderer)
          Deprecated. Since 4.0. See PageInfoAction.renderWikiLink(String) instead.
 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, getPostingDate, getPostingDay, getPreviousPost, getPreviousVersion, getSpaceManager, getSuggestedLabels, getTinyUrl, hasAttachFilePermissions, hasPermittedChildren, isSpaceAdmin, isSuperUser, isUserWatchingOwnContent, setConfluenceWysiwygConverter, setEditorManager, setLinkManager, setMode, setPageManager, setPostingDate, setViewRenderer
 
Methods inherited from class com.atlassian.confluence.pages.actions.AbstractPageAwareAction
getFriendlyDateFormatterHelper, getPage, getPageId, getSpace, getSpaceKey, getTitle, hasViewPagePermission, setContentPermissionManager, setPage, setSpaceManager
 
Methods inherited from class com.atlassian.confluence.core.ConfluenceActionSupport
addActionError, addActionMessage, addFieldError, addPermissionTypeTo, addToHistory, doDefault, formatFriendlyDate, getActionName, getActionName, getAuthenticatedUser, getBootstrapManager, getCancel, getCancelResult, getContext, getDateFormatSetting, getDateFormatter, getDefaultResourceBundle, getDocLink, getEventManager, getFriendlyDateFormatter, getGlobalSettings, getI18n, getInstalledLanguages, getLabelManager, getLanguageManager, getLanguageUserFriendly, getLocale, getLocaleManager, getLocaleString, getMessageHolder, getNiceContentType, getPermittedEntitiesOf, getPermittedEntitiesOf, getPermittedEntitiesOf, getPreviousLoginDate, getRemoteUser, getSession, getSystemInformationService, getText, getText, getText, getText, getTextStatic, getTextStatic, getTextStrict, getTimeZone, getUser, getUserAccessor, getUserByName, getUserFullName, getUserInterfaceState, getUserLocaleDefaultDatePattern, getUserProfilePicUrl, getWebInterfaceManager, hasPermissionForSpace, isAnonymousUser, isCanceled, isDevMode, isEmailVisible, isExternalUserManagementEnabled, isLabelable, isPermissionCheck, isPermittedAsString, isPrintableVersion, isSharedMode, isUserStatusPluginEnabled, isUsingHSQL, setApiDateFormatService, setBootstrapManager, setCancel, setContentUiSupport, setEventManager, setFormatSettingsManager, setI18NBean, setI18NBeanFactory, setLabelManager, setLanguageManager, setLocaleManager, setLoginManager, setMessageHolder, setPermissionCheck, setPermissionManager, setPluginAccessor, setPreviousLoginDate, setSettingsManager, setSpacePermissionManager, setSystemInformationService, setUserAccessor, setWebInterfaceManager
 
Methods inherited from class com.opensymphony.xwork.ActionSupport
addActionError, addActionMessage, addFieldError, getActionErrors, getActionMessages, getErrorMessages, getErrors, getFieldErrors, getText, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, setActionErrors, setActionMessages, setFieldErrors, validate
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.atlassian.confluence.validation.MessageHolderAware
validate
 

Field Detail

HOT_REFERRERS_COUNT

public static final int HOT_REFERRERS_COUNT
See Also:
Constant Field Values

referralManager

protected ReferralManager referralManager

notificationManager

protected NotificationManager notificationManager

commentManager

protected CommentManager commentManager

editRenderer

protected Renderer editRenderer
Constructor Detail

ViewPageAction

public ViewPageAction()
Method Detail

getComment

public Comment getComment()
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 interface CommentAware
Returns:
the comment which is focused

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:
setComment in interface CommentAware
Parameters:
comment - the comment which is to be focused

setWikiStyleRenderer

@Deprecated
public void setWikiStyleRenderer(com.atlassian.renderer.WikiStyleRenderer wikiStyleRenderer)
Deprecated. Since 4.0. See PageInfoAction.renderWikiLink(String) instead.


setReferralManager

public void setReferralManager(ReferralManager referralManager)

setPageContent

@Deprecated
public void setPageContent(java.lang.String pageContent)
Deprecated. since 4.0. This is not used anywhere.


getPageContent

@Deprecated
public java.lang.String getPageContent()
Deprecated. since 4.0. This is not used anywhere.


getParentPage

public Page getParentPage()
Returns the parent Page of the current Page or null if the current AbstractPage is a root page or a blogpost.


getHotReferrers

public java.util.List<ReferralLink> getHotReferrers()
Return a list of ReferralLinks that point to this page.

Returns:
a list of ReferralLinks, empty if referrers are disabled.

getExternalReferences

public java.util.List 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 interface PageAware
Overrides:
isPageRequired in class AbstractPageAwareAction
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 interface PageAware
Overrides:
isLatestVersionRequired in class AbstractPageAwareAction
Returns:
true if the action requires the most recent version of a page

isViewPermissionRequired

public boolean isViewPermissionRequired()
Specified by:
isViewPermissionRequired in interface PageAware
Overrides:
isViewPermissionRequired in class AbstractPageAwareAction
Returns:
true if the action requires a check on the view page level permissions on this page

execute

public java.lang.String execute()
                         throws java.lang.Exception
Specified by:
execute in interface com.opensymphony.xwork.Action
Overrides:
execute in class com.opensymphony.xwork.ActionSupport
Throws:
java.lang.Exception

getEventToPublish

public ConfluenceEvent getEventToPublish(java.lang.String result)
Description copied from interface: Evented
Gets the event to publish.

Specified by:
getEventToPublish in interface Evented<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 java.lang.String getPageXHtmlContent()

getXHtmlComments

public java.util.Map<Comment,java.lang.String> getXHtmlComments()

getCommentsShowing

@Deprecated
public java.lang.Boolean getCommentsShowing()
Deprecated. since 5.1.5 - comment collapse feature has been removed


setShowComments

@Deprecated
public void setShowComments(java.lang.Boolean showComments)
Deprecated. since 5.1.5 - comment collapse feature has been removed


getChildrenShowing

public java.lang.Boolean getChildrenShowing()

setShowChildren

public void setShowChildren(java.lang.Boolean showChildren)

getNotificationManager

public NotificationManager getNotificationManager()

setNotificationManager

public void setNotificationManager(NotificationManager notificationManager)

isThreadComments

public boolean isThreadComments()

getPossibleAlternativesInSpace

@Deprecated
public java.util.List getPossibleAlternativesInSpace()
Deprecated. since 3.1 This action no longer uses possible alternatives so this method can be deleted. See PageNotFoundAction


getPossibleAlternativesElsewhere

@Deprecated
public java.util.List getPossibleAlternativesElsewhere()
Deprecated. since 3.1 This action no longer uses possible alternatives so this method can be deleted. See PageNotFoundAction


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.


getTrackbackUtils

public ConfluenceTrackbackUtils getTrackbackUtils()

getDateString

public java.lang.String getDateString(java.util.Date date)

isAttachmentsInWebDavFolder

public boolean isAttachmentsInWebDavFolder()

getAttachmentsWebDavUrl

public java.lang.String getAttachmentsWebDavUrl()

getAttachmentsWebDavUrlForPage

public java.lang.String getAttachmentsWebDavUrlForPage()

renderLink

@Deprecated
public java.lang.String renderLink(java.lang.String link)
Deprecated. Since 4.0. See PageInfoAction.renderWikiLink(String) instead.


renderExternalLink

public java.lang.String renderExternalLink(com.atlassian.renderer.links.Link link)

getReplyToComment

public long getReplyToComment()

setReplyToComment

public void setReplyToComment(long replyToComment)

getRootComment

@Deprecated
public Comment getRootComment()
Deprecated. since 2.8 the default theme no longer uses a "root comment". This method will remain until the other themes do the same.

When you have a comment thread that is too deep to display all at once, only a portion of it is displayed. To see the rest of the thread you can specify the rootCommentId of a comment in the middle of the thread to start rendering from


setRootCommentId

@Deprecated
public void setRootCommentId(long rootCommentId)
Deprecated. since 2.8 the default theme no longer uses a "root comment". This method will remain until the other themes do the same.


setFocusedCommentId

@Deprecated
public void setFocusedCommentId(long focusedCommentId)
Deprecated. since 2.8 use 'commentId' parameter from the web or setComment(Comment) from the application.


getFocusedCommentId

@Deprecated
public long getFocusedCommentId()
Deprecated. since 2.8 use 'commentId' parameter from the web or getComment() from the application.


getCalendarForThisMonth

public BlogPostsCalendar getCalendarForThisMonth()

getFirstPostInNextMonth

public BlogPost getFirstPostInNextMonth(java.util.Calendar postingDate)
Returns the first post in the month after the current postingDay

This 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

public BlogPost getLastPostInPreviousMonth(java.util.Calendar postingDate)
Returns the last post in the month before the current postingDay

This 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 java.util.List<ContentPermission> getInheritedContentPermissions()

getThisPagePermissions

public java.util.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 java.lang.String getCommentAsXHtmlForWysiwyg()

getWebInterfaceContext

public WebInterfaceContext getWebInterfaceContext()
Description copied from interface: WebInterface
Returns a context which can be passed to web items when rendering them.

Typically, WebWork actions will implement this to provide extra details in the context such as content objects, and so on.

Specified by:
getWebInterfaceContext in interface WebInterface
Overrides:
getWebInterfaceContext in class AbstractPageAction

getWebInterfaceContext

public WebInterfaceContext getWebInterfaceContext(Comment comment)

getCaptchaManager

public CaptchaManager getCaptchaManager()

setCaptchaManager

public void setCaptchaManager(CaptchaManager captchaManager)

isPermitted

public boolean isPermitted()
Overrides:
isPermitted in class AbstractPageAwareAction

getViewInheritedContentPermissionSets

public java.util.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.


Copyright © 2003-2014 Atlassian. All Rights Reserved.