public class

ViewLabelAction

extends AbstractLabelDisplayingAction
java.lang.Object
   ↳ com.opensymphony.xwork.ActionSupport
     ↳ com.atlassian.confluence.core.ConfluenceActionSupport
       ↳ com.atlassian.confluence.labels.actions.AbstractLabelDisplayingAction
         ↳ com.atlassian.confluence.labels.actions.ViewLabelAction

Class Overview

Action for viewing a label. The label can be specified by either using the labels name(s) or the labels id(s), but not both. The names and ids are the parameters passed in, and used for null-input validation, but are not "maintained" once the labels they point to are retrieved. This means that the names and ids fields have trivial state after retrieveLabels has been called and should not be accessed via getter methods.

Summary

Constants
int ITEMS_PER_PAGE The default number of content to be displayed on each page.
[Expand]
Inherited Constants
From class com.atlassian.confluence.labels.actions.AbstractLabelDisplayingAction
From class com.atlassian.confluence.core.ConfluenceActionSupport
From interface com.opensymphony.xwork.Action
Fields
protected PaginationSupport paginationSupport Pagination support to assist in the display of the list of content associated with the label.
public List preloadedPage
[Expand]
Inherited Fields
From class com.atlassian.confluence.labels.actions.AbstractLabelDisplayingAction
From class com.atlassian.confluence.core.ConfluenceActionSupport
From class com.opensymphony.xwork.ActionSupport
Public Constructors
ViewLabelAction()
Public Methods
String execute()
DisplayableLabel getAddLabel(Label label)
Returns a DisplayableLabel representing the currently viewed labels and the given label.
List getContent()
DisplayableLabel getLabel()
Returns a DisplayableLabel based on all the labels being viewed.
List getLabels()
List<DisplayableLabel> getOtherLabels(Labelable content)
Returns the first nine global labels on the given content that are not this.label.
PaginationSupport getPaginationSupport()
String getPaginationUrl()
List getPreloadedPage()
List getRelated()
DisplayableLabel getRemoveLabel(Label label)
Returns a DisplayableLabel representing the currently viewed labels, minus the given label.
WebInterfaceContext getWebInterfaceContext()
Returns a context which can be passed to web items when rendering them.
boolean isViewPermissionRequired()
For viewing individual labels, we don't require view permission on any particular space (actually, this doesn't matter right now - but might in the future!)
void setIds(long[] ids)
void setSearchManager(SearchManager searchManager)
void setStartIndex(int startIndex)
void validate()
[Expand]
Inherited Methods
From class com.atlassian.confluence.labels.actions.AbstractLabelDisplayingAction
From class com.atlassian.confluence.core.ConfluenceActionSupport
From class com.opensymphony.xwork.ActionSupport
From class java.lang.Object
From interface com.atlassian.confluence.plugin.descriptor.web.WebInterface
From interface com.atlassian.confluence.spaces.Spaced
From interface com.atlassian.confluence.spaces.actions.SpaceAware
From interface com.opensymphony.xwork.Action
From interface com.opensymphony.xwork.LocaleProvider
From interface com.opensymphony.xwork.TextProvider
From interface com.opensymphony.xwork.Validateable
From interface com.opensymphony.xwork.ValidationAware

Constants

public static final int ITEMS_PER_PAGE

The default number of content to be displayed on each page.

Constant Value: 10 (0x0000000a)

Fields

protected PaginationSupport paginationSupport

Pagination support to assist in the display of the list of content associated with the label.

public List preloadedPage

Public Constructors

public ViewLabelAction ()

Public Methods

public String execute ()

Throws
Exception

public DisplayableLabel getAddLabel (Label label)

Returns a DisplayableLabel representing the currently viewed labels and the given label.

For example, if the current viewed labels are "a+b" and the passed label is "c", it returns a DisplayableLabel of "a+b+c"

Sorts the labels by title before returning them, so the order is canonical.

public List getContent ()

public DisplayableLabel getLabel ()

Returns a DisplayableLabel based on all the labels being viewed.

public List getLabels ()

public List<DisplayableLabel> getOtherLabels (Labelable content)

Returns the first nine global labels on the given content that are not this.label. It is expected that the view will only display the first eight such labels, and use the ninth as a signal that a "..." is required

Parameters
content the content to get labels for
Returns
  • a list of Labels with size between 0 and 8 inclusive. Not null.

public PaginationSupport getPaginationSupport ()

public String getPaginationUrl ()

public List getPreloadedPage ()

public List getRelated ()

public DisplayableLabel getRemoveLabel (Label label)

Returns a DisplayableLabel representing the currently viewed labels, minus the given label.

For example, if the current viewed labels are "a+b+c" and the passed label is "a", it returns a DisplayableLabel of "b+c"

Sorts the labels by title before returning them, so the order is canonical.

public WebInterfaceContext getWebInterfaceContext ()

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.

public boolean isViewPermissionRequired ()

For viewing individual labels, we don't require view permission on any particular space (actually, this doesn't matter right now - but might in the future!)

public void setIds (long[] ids)

public void setSearchManager (SearchManager searchManager)

public void setStartIndex (int startIndex)

public void validate ()