Class ViewLabelAction
- All Implemented Interfaces:
WebInterface,SpaceAware,Spaced,MessageHolderAware,Serializable,org.apache.struts2.action.Action,org.apache.struts2.interceptor.ValidationAware,org.apache.struts2.locale.LocaleProvider,org.apache.struts2.text.TextProvider,org.apache.struts2.Validateable
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.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe default number of content to be displayed on each page.protected PaginationSupportPagination support to assist in the display of the list of content associated with the label.Fields inherited from class com.atlassian.confluence.plugins.labels.actions.AbstractLabelDisplayingAction
MAX_LABELSFields inherited from class com.atlassian.confluence.spaces.actions.AbstractSpaceAction
key, notificationManager, space, spaceManager, themeManager, wikiStyleRendererFields 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, PREVIEW, request, response, spacePermissionManager, strutsHelper, systemInformationService, userAccessor, webInterfaceManagerFields inherited from class org.apache.struts2.ActionSupport
containerFields inherited from interface org.apache.struts2.action.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionexecute()getAddLabel(Label label) Returns a DisplayableLabel representing the currently viewed labels and the given label.getLabel()Returns a DisplayableLabel based on all the labels being viewed.getOtherLabels(Labelable content) Returns the first nine global labels on the given content that are not this.label.getRemoveLabel(Label label) Returns a DisplayableLabel representing the currently viewed labels, minus the given label.Returns a context which can be passed to web items when rendering them.booleanFor 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!)voidsetDescription(String description) voidsetIds(long[] ids) voidsetSearchManager(SearchManager searchManager) voidsetSiteSearchPermissionsQueryFactory(SiteSearchPermissionsQueryFactory siteSearchPermissionsQueryFactory) voidsetStartIndex(int startIndex) voidvalidate()Methods inherited from class com.atlassian.confluence.plugins.labels.actions.AbstractLabelDisplayingAction
getPopularLabels, getRecentLabels, isSpaceRequiredMethods inherited from class com.atlassian.confluence.spaces.actions.AbstractSpaceAction
getActionSpaceKey, getKey, getPermissionTypes, getSpace, getSpaceKey, getSpaceManager, getSubscribableName, getThemeManager, hasSpaceIA, isPermitted, isPersonalSpace, isUserWatchingSpace, isValidSpaceKey, setKey, setNotificationManager, setSpace, setSpaceManager, setThemeManager, setWikiStyleRendererMethods inherited from class com.atlassian.confluence.core.ConfluenceActionSupport
addActionError, addActionMessage, addFieldError, addPermissionTypeTo, addToHistory, doDefault, getActionErrors, getActionMessages, getActionName, getActiveRequest, getActiveResponse, getAuthenticatedUser, getBootstrapStatusProvider, getCancelResult, getDateFormatter, getDefaultTimeZone, getFieldErrors, getGlobalSettings, getHelper, 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, setSpacePermissionManager, setStrutsHelper, setSystemInformationService, setTimeZoneManager, setUserAccessor, setWebInterfaceManagerMethods inherited from class com.atlassian.confluence.core.AbstractI18nActionSupport
getText, getText, getText, getText, getText, getText, getText, getText, getTextStrictMethods 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, toLocaleMethods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.confluence.spaces.actions.SpaceAware
setSpace
-
Field Details
-
ITEMS_PER_PAGE
public static final int ITEMS_PER_PAGEThe default number of content to be displayed on each page.- See Also:
-
paginationSupport
Pagination support to assist in the display of the list of content associated with the label.
-
-
Constructor Details
-
ViewLabelAction
public ViewLabelAction()
-
-
Method Details
-
setIds
public void setIds(long[] ids) -
setStartIndex
public void setStartIndex(int startIndex) -
setSearchManager
-
getLabels
-
getContent
-
getRelated
-
getPaginationSupport
-
validate
public void validate()- Specified by:
validatein interfaceMessageHolderAware- Specified by:
validatein interfaceorg.apache.struts2.Validateable- Overrides:
validatein classorg.apache.struts2.ActionSupport
-
execute
- Specified by:
executein interfaceorg.apache.struts2.action.Action- Overrides:
executein classorg.apache.struts2.ActionSupport- Throws:
Exception
-
isViewPermissionRequired
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!)- Specified by:
isViewPermissionRequiredin interfaceSpaceAware- Overrides:
isViewPermissionRequiredin classAbstractLabelDisplayingAction- Returns:
- true if the action requires view space permission
-
getOtherLabels
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.
-
getLabel
Returns a DisplayableLabel based on all the labels being viewed. -
getAddLabel
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.
-
getRemoveLabel
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.
-
getPaginationUrl
-
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 classConfluenceActionSupport
-
getDescription
-
setDescription
-
getSiteSearchPermissionsQueryFactory
-
setSiteSearchPermissionsQueryFactory
public void setSiteSearchPermissionsQueryFactory(SiteSearchPermissionsQueryFactory siteSearchPermissionsQueryFactory)
-