Class DefaultLabelManager
- All Implemented Interfaces:
LabelManagerInternal,LabelManager
-
Field Summary
Fields inherited from interface com.atlassian.confluence.labels.LabelManager
CONTENT_TYPES, DEFAULT_LABEL_COUNT, FAVOURITE_LABEL, FAVOURITE_LABEL_YANKEE, LABEL_ADDED, LABEL_CREATED, LABEL_DELETED, LABEL_REMOVED, NO_CHANGE, NO_MAX_RESULTS, NO_OFFSET -
Constructor Summary
ConstructorsConstructorDescriptionDefaultLabelManager(LabelDaoInternal dao, com.atlassian.event.api.EventPublisher eventPublisher, Clock clock) -
Method Summary
Modifier and TypeMethodDescriptionintAdd a label to the specified content.calculateRanksForLiteLabels(List<LiteLabelSearchResult> labelList, Comparator<? super RankedLiteLabelSearchResult> comparator) Calculate ranks for input labels.createLabel(Label label) booleandeleteLabel(long id) Delete the label with the specified id.booleandeleteLabel(Label label) Delete the specified label.findGlobalLabelsByNamePrefix(String namePrefix, LimitedRequest pageRequest) Returns global-namespaced labels starting with the given string.findTeamLabelsByNamePrefix(String namePrefix, LimitedRequest pageRequest) Returns team-namespaced labels starting with the given string.getAllContentForAllLabels(int offset, int maxResults, Label... labels) Retrieve all ContentEntityObjects, current or deleted which are labelled with ALL provided labels.getAllContentForLabel(int offset, int maxResults, Label label) Retrieve all ContentEntityObjects, current or deleted which are labelled with the provided label.getContent(Label label) Get all content associated with a label Get all versions of content associated with a label and any space.intgetContentCount(Label label) getContentForAllLabels(int offset, int maxResults, Label... labels) Retrieve current ContentEntityObjects which are labelled with ALL provided labels.getContentForAllLabels(Collection<Label> labels, int maxResults, int offset) getContentForLabel(int offset, int maxResults, Label label) Retrieve current ContentEntityObjects which are labelled with the provided label.getContentInSpaceForAllLabels(int offset, int maxResults, String spaceKey, Label... labels) Retrieve current ContentEntityObjects in the given space which are labelled with ALL provided labels.getContentInSpaceForLabel(int offset, int maxResults, String spaceKey, Label label) Retrieve current ContentEntityObjects in the given space which are labelled with the provided label.getContentInSpacesForAllLabels(int offset, int maxResults, Set<String> spaceKeys, Label... labels) Retrieve current ContentEntityObjects in the given spaces which are labelled with ALL provided labels.getCurrentContentForLabel(Label label) Get all content associated with a label and space Get all current content associated with a label and any space.getCurrentContentForLabelAndSpace(Label label, String spaceKey) Get all current content associated with a label and space.getCurrentContentWithPersonalLabel(String username) Get all current content labelled by a usergetFavouriteLabellingsByContentIds(Collection<ContentId> contentIds, com.atlassian.sal.api.user.UserKey userKey) Get the labellings that represent the favourite labellings for the given user on the given content.getFavouriteSpaces(String username) <T extends EditableLabelable>
PartialList<T> getForLabel(Class<T> labelableClass, int offset, int maxResults, Label label) Retrieve EditableLabelables of the supplied type which are labelled with the provided label.getForLabels(int offset, int maxResults, Label... labels) Retrieve EditableLabelables of any type which are labelled with the provided labels.<T extends EditableLabelable>
PartialList<T> getForLabels(Class<T> labelableClass, int offset, int maxResults, Label... labels) Retrieve EditableLabelables of the supplied type which are labelled with the provided labels.getLabel(long id) Retrieve a label based on its id.Retrieve the persistent instance of the label with the exact same details as the specified label.getLabel(ParsedLabelName parsedLabelName) Retrieve the label by name.convenience method to fetch a label without having to call the label parserConvenience method to fetch a label without having to create a Label objectgetLabels(Collection<String> unparsedLabelNames) convenience method to fetch labels without having to call the label parsergetLabelsByDetail(LimitedRequest limitedRequest, String labelName, String namespace, String spaceKey, String owner) Returns labels filtered by the given parameters.getLabelsByDetail(String labelName, String namespace, String spaceKey, String owner) Retrieves the labels matching the given labelName, namespace or ownergetLabelsInSpace(String key) Retrieve all of the labels that label content within the specified space.getLabelsInSpace(String key, LimitedRequest limitedRequest) Get all labels in Space with paginationRetrieve the list of the DEFAULT_LABEL_COUNT most popular labels within the system.getMostPopularLabels(int count) Retrieve the most popular labels within the system.getMostPopularLabels(LimitedRequest limitedRequest) Returns the most popular global labels in the system.getMostPopularLabelsInSiteLite(int maxResults) Returns most used labels across the site.getMostPopularLabelsInSiteLite(LimitedRequest limitedRequest) Returns most used labels across the site.Retrieve the list of the DEFAULT_LABEL_COUNT most used labels in the specific space, ordered from most popular to least popular.getMostPopularLabelsInSpace(String key, int count) Retrieve a list of the 'n' most used labels in the specified space, ordered from most popular to least popular.getMostPopularLabelsInSpace(String key, LimitedRequest limitedRequest) Retrieve a list of the 'n' most used labels in the specified space, ordered from most popular to least popular.getMostPopularLabelsInSpaceLite(String spaceKey, int maxResults) Returns most used labels.getMostPopularLabelsInSpaceLite(String spaceKey, LimitedRequest limitedRequest) Returns most used labels.getMostPopularLabelsWithRanks(int maxResults, Comparator<? super RankedLabelSearchResult> comparator) Retrieve the most popular labels within the system, including their ranks and ordered using the comparator provided.getMostPopularLabelsWithRanks(Comparator<? super RankedLabelSearchResult> comparator) Retrieve a set of the DEFAULT_LABEL_COUNT most popular labels within the system, including their ranks and ordered using the compartor provided.getMostPopularLabelsWithRanksInSpace(String key, int maxResults, Comparator<? super RankedLabelSearchResult> comparator) Retrieve a set of the 'n' most used labels in the specified space, ordered using the compartor given.getRankedLabels(List<LabelSearchResult> labelList, Comparator<? super RankedLabelSearchResult> comparator) Calculate ranks for input labels.getRecentlyUsedLabellings(int maxResults) getRecentlyUsedLabellings(LimitedRequest limitedRequest) getRecentlyUsedLabellingsInSpace(String spaceKey, int maxResults) getRecentlyUsedLabellingsInSpace(String spaceKey, LimitedRequest limitedRequest) Retrieve the most recently used labellings within the specified space.Retrieve the DEFAULT_LABEL_COUNT most recently used labels within the system.getRecentlyUsedLabels(int maxResults) Retrieve the x most recently used labels.getRecentlyUsedLabels(LimitedRequest limitedRequest) Returns the most recently used global labels in the system.Retrieve the DEFAULT_LABEL_COUNT most recently used labels within the specified space.getRecentlyUsedLabelsInSpace(String key, int maxResults) Retrieve the most recently used labels within the specified spae.getRecentlyUsedLabelsInSpace(String key, LimitedRequest limitedRequest) Retrieve the most recently used labels within the specified space.getRecentlyUsedPersonalLabellings(String username, int maxResults) getRecentlyUsedPersonalLabellings(String username, LimitedRequest limitedRequest) getRecentlyUsedPersonalLabels(String username) Retrieve the labels that were recently used by currently authenticated user.getRecentlyUsedPersonalLabels(String username, int maxResults) Retrieve the labels that were recently used by currently authenticated user.getRecentlyUsedPersonalLabels(String username, LimitedRequest limitedRequest) Retrieve the labels that were recently used by currently authenticated user.getRelatedLabels(Label label) Retrieve the DEFAULT_LABEL_COUNT labels that are 'related' to the specified label.getRelatedLabels(Label label, int count) Retrieve the labels that are 'related' to the specified label.getRelatedLabels(Label label, LimitedRequest limitedRequest) Retrieve the labels which are related (i.e.getRelatedLabels(List<? extends Label> labels, String spaceKey, int maxResultsPerLabel) Retrieve the labels that are 'related' to the labels in the list.getRelatedLabelsInSpace(Label label, String spaceKey) Retrieve the DEFAULT_LABEL_COUNT labels that are 'related' to the specified label and that are used to label content within the specified space.getRelatedLabelsInSpace(Label label, String spaceKey, int maxResults) Retrieve the labels that are 'related' to the specified label and that are used to to label content within the specified space.getRelatedLabelsInSpace(Label label, String spaceKey, LimitedRequest limitedRequest) Get related labels in Space with paginationLook up the spaces that have been labelled by the specific label.getSpacesWithLabel(Label label) Spaces cannot be directly labelled.getSuggestedLabels(Labelable content) Retrieve the DEFAULT_LABEL_COUNT suggested labels for the specified content.getSuggestedLabels(Labelable content, int count) Retrieve the suggested labels for the specified content.getSuggestedLabelsInSpace(Labelable content, String spaceKey) Retrieve the DEFAULT_LABEL_COUNT suggested labels for the specified content bound to the specified space.getSuggestedLabelsInSpace(Labelable content, String spaceKey, int maxResults) Retrieve the suggested labels for the specified content bound to the specified space.Retrieve all of the team labels in the system.getTeamLabels(String name) Retrieve all of the team labels in the system with name.getTeamLabelsForSpace(String spaceKey) Retrieve all of the team labels used to label content in the specified space.getTeamLabelsForSpaces(Collection<Space> spaces) Retrieve all of the team labels used to label content in the specified spaces.longGet total label in a particular spacegetUsersLabels(String name) Retrieve the personal labels that belong to the specified user.voidremoveAllLabels(Labelable content) Remove all of the labels from the specified content.intremoveLabel(Labelable content, Label label) Remove a label from the specified content.voidremoveLabels(Labelable content, List<Label> labels) removes a list of labels from the labelable objectMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.atlassian.confluence.dmz.labels.LabelManagerInternal
findGlobalLabelsByNamePrefix, findTeamLabelsByNamePrefix
-
Constructor Details
-
DefaultLabelManager
public DefaultLabelManager(LabelDaoInternal dao, com.atlassian.event.api.EventPublisher eventPublisher, Clock clock)
-
-
Method Details
-
addLabel
Description copied from interface:LabelManagerAdd a label to the specified content.Note: the specified label does not need to be persistent. A persistent instance of the label will be created if necessary. eg: you can write code like:
labelManager.addLabel(page, new Label("name", "namespace", "owner"));- Specified by:
addLabelin interfaceLabelManager- Parameters:
labelable-label-- Returns:
- one of NO_CHANGE, LABEL_ADDED or LABEL_CREATED
-
removeLabel
Description copied from interface:LabelManagerRemove a label from the specified content.- Specified by:
removeLabelin interfaceLabelManager- Parameters:
content-label-- Returns:
- one of NO_CHANGE, LABEL_DELETED, LABEL_REMOVED
-
removeLabels
Description copied from interface:LabelManagerremoves a list of labels from the labelable object- Specified by:
removeLabelsin interfaceLabelManager
-
removeAllLabels
Description copied from interface:LabelManagerRemove all of the labels from the specified content. Any labels that then no longer label content will be deleted.- Specified by:
removeAllLabelsin interfaceLabelManager- Parameters:
content-
-
getLabel
Retrieve a label based on its id.- Specified by:
getLabelin interfaceLabelManager- Parameters:
id-- Returns:
- the label instance.
-
getSuggestedLabels
Description copied from interface:LabelManagerRetrieve the DEFAULT_LABEL_COUNT suggested labels for the specified content. The process used to identify 'suggested' labels may change and therefore is not defined here.- Specified by:
getSuggestedLabelsin interfaceLabelManager- Parameters:
content-- Returns:
- a list of label instances. The order of these labels is undefined.
- See Also:
-
getSuggestedLabels
Description copied from interface:LabelManagerRetrieve the suggested labels for the specified content. The process used to identify 'suggested' labels may change and therefore is not defined here.- Specified by:
getSuggestedLabelsin interfaceLabelManager- Parameters:
count- is the maximum number of labels to be returned.- Returns:
- a list of label instances. The order of these labels is undefined.
-
getSuggestedLabelsInSpace
Description copied from interface:LabelManagerRetrieve the DEFAULT_LABEL_COUNT suggested labels for the specified content bound to the specified space.- Specified by:
getSuggestedLabelsInSpacein interfaceLabelManager- Parameters:
content-spaceKey-- Returns:
- a list of label instances. The order of these labels is undefined.
- See Also:
-
getSuggestedLabelsInSpace
Description copied from interface:LabelManagerRetrieve the suggested labels for the specified content bound to the specified space.- Specified by:
getSuggestedLabelsInSpacein interfaceLabelManager- Parameters:
content-spaceKey-maxResults- is the maximum number of labels to be returned.- Returns:
- a list of label instances. The order of these labels is undefined.
-
getRelatedLabels
Description copied from interface:LabelManagerRetrieve the DEFAULT_LABEL_COUNT labels that are 'related' to the specified label. The process used to identify 'related' labels may change and therefore is not define here.- Specified by:
getRelatedLabelsin interfaceLabelManager- Parameters:
label-- Returns:
- a list of label instances. The order of these labels is undefined.
- See Also:
-
getRelatedLabels
Description copied from interface:LabelManagerRetrieve the labels that are 'related' to the specified label. The process used to identify 'related' labels may change and therefore is not defined here.- Specified by:
getRelatedLabelsin interfaceLabelManager- Parameters:
count- is the maximum number of labels to be returned.- Returns:
- a list of label instances. The order of these labels is undefined.
-
getRelatedLabels
public List<Label> getRelatedLabels(List<? extends Label> labels, String spaceKey, int maxResultsPerLabel) Description copied from interface:LabelManagerRetrieve the labels that are 'related' to the labels in the list. The process used to identify 'related' labels may change and therefore is not defined here.- Specified by:
getRelatedLabelsin interfaceLabelManager- Parameters:
spaceKey- - may be null to search globallymaxResultsPerLabel- is the maximum number of labels to be returned for each label.- Returns:
- a list of label instances. The order of these labels is undefined.
-
getRelatedLabelsInSpace
Description copied from interface:LabelManagerRetrieve the DEFAULT_LABEL_COUNT labels that are 'related' to the specified label and that are used to label content within the specified space.- Specified by:
getRelatedLabelsInSpacein interfaceLabelManager- Parameters:
label-spaceKey-- Returns:
- a list of label instances. The order of these labels is undefined.
- See Also:
-
getRelatedLabelsInSpace
Description copied from interface:LabelManagerRetrieve the labels that are 'related' to the specified label and that are used to to label content within the specified space.- Specified by:
getRelatedLabelsInSpacein interfaceLabelManager- Parameters:
label-spaceKey-maxResults-- Returns:
- a list of label instance. The order of these labels is undefined.
-
getSpacesContainingContentWithLabel
Description copied from interface:LabelManagerLook up the spaces that have been labelled by the specific label.- Specified by:
getSpacesContainingContentWithLabelin interfaceLabelManager- Parameters:
label-- Returns:
- a list of Spaces. The order of these labels is undefined.
-
getUsersLabels
Description copied from interface:LabelManagerRetrieve the personal labels that belong to the specified user.- Specified by:
getUsersLabelsin interfaceLabelManager- Parameters:
name-
-
getTeamLabels
Description copied from interface:LabelManagerRetrieve all of the team labels in the system.- Specified by:
getTeamLabelsin interfaceLabelManager- Returns:
- a list of labels with the namespace Namespace.TEAM
-
getTeamLabels
Description copied from interface:LabelManagerRetrieve all of the team labels in the system with name.- Specified by:
getTeamLabelsin interfaceLabelManager- Returns:
- a list of labels with the namespace Namespace.TEAM
-
getTeamLabelsForSpace
Description copied from interface:LabelManagerRetrieve all of the team labels used to label content in the specified space.- Specified by:
getTeamLabelsForSpacein interfaceLabelManager- Parameters:
spaceKey-- Returns:
- a list of team labels with the namespace Namespace.TEAM. The order of the list is undefined.
-
getTeamLabelsForSpaces
Description copied from interface:LabelManagerRetrieve all of the team labels used to label content in the specified spaces.- Specified by:
getTeamLabelsForSpacesin interfaceLabelManager- Parameters:
spaces- collection of spaces whose labels to get- Returns:
- a list of team labels with the namespace Namespace.TEAM. The order of the list is undefined.
-
getRecentlyUsedLabelsInSpace
Description copied from interface:LabelManagerRetrieve the DEFAULT_LABEL_COUNT most recently used labels within the specified space.- Specified by:
getRecentlyUsedLabelsInSpacein interfaceLabelManager- Parameters:
key- identifies the space to which the results are restricted.- Returns:
- a list of label instances in order of most recently used to least recently used.
- See Also:
-
getRecentlyUsedLabelsInSpace
Description copied from interface:LabelManagerRetrieve the most recently used labels within the specified spae.- Specified by:
getRecentlyUsedLabelsInSpacein interfaceLabelManager- Parameters:
key-maxResults- is the maximum number of labels to be returned.- Returns:
- a list of label instances in order of the most recently used to least recently used.
-
getRecentlyUsedLabelsInSpace
Description copied from interface:LabelManagerInternalRetrieve the most recently used labels within the specified space.- Specified by:
getRecentlyUsedLabelsInSpacein interfaceLabelManagerInternal- Parameters:
key- is the space key.limitedRequest- defines pagination parameters.- Returns:
- a paginated response with label instances in order of the most recently used to least recently used.
- See Also:
-
getRecentlyUsedLabels
Description copied from interface:LabelManagerRetrieve the x most recently used labels.- Specified by:
getRecentlyUsedLabelsin interfaceLabelManager- Parameters:
maxResults- is the maximum number of labels to be returned.- Returns:
- a list of label instances in order of most recently used to least recently used.
-
getRecentlyUsedLabels
Description copied from interface:LabelManagerRetrieve the DEFAULT_LABEL_COUNT most recently used labels within the system.- Specified by:
getRecentlyUsedLabelsin interfaceLabelManager- Returns:
- a list of label instances in order of most recently used to least recently used.
- See Also:
-
getRecentlyUsedPersonalLabels
Description copied from interface:LabelManagerRetrieve the labels that were recently used by currently authenticated user. 'Recently Used' includes labels that the user recently added, created, removed and deleted.Note: labels in this list may or may not exist.
The UserHistory can be retrieved from the session via the ActionContext (if using an action) or the Execution Context (DWR)
- Specified by:
getRecentlyUsedPersonalLabelsin interfaceLabelManager- Parameters:
username- the user history from the session- Returns:
- a list of labels
-
getRecentlyUsedPersonalLabels
Description copied from interface:LabelManagerRetrieve the labels that were recently used by currently authenticated user. 'Recently Used' includes labels that the user recently added, created, removed and deleted.Note: labels in this list may or may not exist.
The UserHistory can be retrieved from the session via the ActionContext (if using an action) or the Execution Context (DWR)
- Specified by:
getRecentlyUsedPersonalLabelsin interfaceLabelManager- Parameters:
username- the user history from the sessionmaxResults- the maximum number of results to return to the user- Returns:
- a list of labels
-
getRecentlyUsedPersonalLabels
public PageResponse<Label> getRecentlyUsedPersonalLabels(String username, LimitedRequest limitedRequest) Description copied from interface:LabelManagerInternalRetrieve the labels that were recently used by currently authenticated user. 'Recently Used' includes labels that the user recently added, created, removed and deleted.Note: labels in this list may or may not exist.
The UserHistory can be retrieved from the session via the ActionContext (if using an action) or the Execution Context (DWR)
- Specified by:
getRecentlyUsedPersonalLabelsin interfaceLabelManagerInternal- Parameters:
username- the user history from the sessionlimitedRequest- defines pagination parameters.- Returns:
- a paginated response with list of labels
-
getRecentlyUsedPersonalLabellings
- Specified by:
getRecentlyUsedPersonalLabellingsin interfaceLabelManager
-
getRecentlyUsedPersonalLabellings
public PageResponse<Labelling> getRecentlyUsedPersonalLabellings(String username, LimitedRequest limitedRequest) - Specified by:
getRecentlyUsedPersonalLabellingsin interfaceLabelManagerInternal
-
getCurrentContentForLabel
Description copied from interface:LabelManagerGet all content associated with a label and space Get all current content associated with a label and any space. Content in the trash will not be returned.- Specified by:
getCurrentContentForLabelin interfaceLabelManager- Returns:
- a list of Labelables, sorted by last modification date
-
getContentForAllLabels
public List<? extends Labelable> getContentForAllLabels(Collection<Label> labels, int maxResults, int offset) - Specified by:
getContentForAllLabelsin interfaceLabelManager
-
getContentForLabel
Description copied from interface:LabelManagerRetrieve current ContentEntityObjects which are labelled with the provided label.ContentEntityObjects in the Trash will *not* be returned.
- Specified by:
getContentForLabelin interfaceLabelManager- Parameters:
offset- the offset into the resultsmaxResults- the maximum number of results to returnlabel- label which must appear on ContentEntityObjects- Returns:
- a partial list of ContentEntityObjects labelled with the labels provided
-
getContentForAllLabels
public PartialList<ContentEntityObject> getContentForAllLabels(int offset, int maxResults, Label... labels) Description copied from interface:LabelManagerRetrieve current ContentEntityObjects which are labelled with ALL provided labels.ContentEntityObjects in the Trash will *not* be returned.
- Specified by:
getContentForAllLabelsin interfaceLabelManager- Parameters:
offset- the offset into the resultsmaxResults- the maximum number of results to returnlabels- labels which must appear on ContentEntityObjects- Returns:
- a partial list of ContentEntityObjects labelled with the labels provided
-
getForLabel
public <T extends EditableLabelable> PartialList<T> getForLabel(Class<T> labelableClass, int offset, int maxResults, Label label) Description copied from interface:LabelManagerRetrieve EditableLabelables of the supplied type which are labelled with the provided label.ContentEntityObjects in the Trash *will* be returned.
- Specified by:
getForLabelin interfaceLabelManager- Parameters:
labelableClass- the type of labelable to return. Use one of these values:- ContentEntityObject.class - all CEO labelings except Attachments
- Attachment.class - all attachment labellings
- PageTemplate.class - all page template labellings
offset- the offset into the resultsmaxResults- the maximum number of results to returnlabel- label which must appear on labelables- Returns:
- a partial list of EditableLabelables labelled with the labels provided
-
getForLabels
public <T extends EditableLabelable> PartialList<T> getForLabels(Class<T> labelableClass, int offset, int maxResults, Label... labels) Description copied from interface:LabelManagerRetrieve EditableLabelables of the supplied type which are labelled with the provided labels.ContentEntityObjects in the Trash will *not* be returned.
- Specified by:
getForLabelsin interfaceLabelManager- Parameters:
labelableClass- the type of labelable to return. Use one of these values:- ContentEntityObject.class - all CEO labelings except Attachments
- Attachment.class - all attachment labellings
- PageTemplate.class - all page template labellings
offset- the offset into the resultsmaxResults- the maximum number of results to returnlabels- labels which must all appear on labelables- Returns:
- a partial list of EditableLabelables labelled with the labels provided
-
getForLabels
Description copied from interface:LabelManagerRetrieve EditableLabelables of any type which are labelled with the provided labels.ContentEntityObjects in the Trash *will* be returned.
- Specified by:
getForLabelsin interfaceLabelManager- Parameters:
offset- the offset into the resultsmaxResults- the maximum number of results to returnlabels- labels which must all appear on labelables- Returns:
- a partial list of EditableLabelables labelled with the labels provided
-
getContentInSpaceForLabel
public PartialList<ContentEntityObject> getContentInSpaceForLabel(int offset, int maxResults, String spaceKey, Label label) Description copied from interface:LabelManagerRetrieve current ContentEntityObjects in the given space which are labelled with the provided label.ContentEntityObjects in the Trash will *not* be returned.
- Specified by:
getContentInSpaceForLabelin interfaceLabelManager- Parameters:
offset- the offset into the resultsmaxResults- the maximum number of results to returnspaceKey- the key of the space to search content inlabel- label which must appear on ContentEntityObjects- Returns:
- a partial list of ContentEntityObjects labelled with the labels provided
-
getContentInSpaceForAllLabels
public PartialList<ContentEntityObject> getContentInSpaceForAllLabels(int offset, int maxResults, String spaceKey, Label... labels) Description copied from interface:LabelManagerRetrieve current ContentEntityObjects in the given space which are labelled with ALL provided labels.ContentEntityObjects in the Trash will *not* be returned.
- Specified by:
getContentInSpaceForAllLabelsin interfaceLabelManager- Parameters:
offset- the offset into the resultsmaxResults- the maximum number of results to returnspaceKey- the key of the space to search content inlabels- labels which must appear on ContentEntityObjects- Returns:
- a partial list of ContentEntityObjects labelled with the labels provided
-
getContentInSpacesForAllLabels
public PartialList<ContentEntityObject> getContentInSpacesForAllLabels(int offset, int maxResults, Set<String> spaceKeys, Label... labels) Description copied from interface:LabelManagerRetrieve current ContentEntityObjects in the given spaces which are labelled with ALL provided labels.ContentEntityObjects in the Trash will *not* be returned.
- Specified by:
getContentInSpacesForAllLabelsin interfaceLabelManager- Parameters:
offset- the offset into the resultsmaxResults- the maximum number of results to returnspaceKeys- the keys of the spaces to search content inlabels- labels which must appear on ContentEntityObjects- Returns:
- a partial list of ContentEntityObjects labelled with the labels provided
-
getAllContentForLabel
public PartialList<ContentEntityObject> getAllContentForLabel(int offset, int maxResults, Label label) Description copied from interface:LabelManagerRetrieve all ContentEntityObjects, current or deleted which are labelled with the provided label.ContentEntityObjects in the Trash *will* be returned.
- Specified by:
getAllContentForLabelin interfaceLabelManager- Parameters:
offset- the offset into the resultsmaxResults- the maximum number of results to returnlabel- label which must appear on ContentEntityObjects- Returns:
- a partial list of ContentEntityObjects labelled with the labels provided
-
getAllContentForAllLabels
public PartialList<ContentEntityObject> getAllContentForAllLabels(int offset, int maxResults, Label... labels) Description copied from interface:LabelManagerRetrieve all ContentEntityObjects, current or deleted which are labelled with ALL provided labels.ContentEntityObjects in the Trash *will* be returned.
- Specified by:
getAllContentForAllLabelsin interfaceLabelManager- Parameters:
offset- the offset into the resultsmaxResults- the maximum number of results to returnlabels- labels which must appear on ContentEntityObjects- Returns:
- a partial list of ContentEntityObjects labelled with the labels provided
-
getCurrentContentForLabelAndSpace
Description copied from interface:LabelManagerGet all current content associated with a label and space. Content in the trash will not be returned.- Specified by:
getCurrentContentForLabelAndSpacein interfaceLabelManager- Returns:
- a list of Labelable
-
getCurrentContentWithPersonalLabel
Description copied from interface:LabelManagerGet all current content labelled by a user- Specified by:
getCurrentContentWithPersonalLabelin interfaceLabelManager
-
getSpacesWithLabel
Description copied from interface:LabelManagerSpaces cannot be directly labelled. Howevever, their space descriptions can. This method searches for all space descriptions with the label passed in- Specified by:
getSpacesWithLabelin interfaceLabelManager- Parameters:
label-- Returns:
- list of spaces associated with matching space descriptions
-
deleteLabel
public boolean deleteLabel(long id) Description copied from interface:LabelManagerDelete the label with the specified id.- Specified by:
deleteLabelin interfaceLabelManager- Parameters:
id-- Returns:
- true if the label was deleted, false otherwise.
-
getFavouriteSpaces
- Specified by:
getFavouriteSpacesin interfaceLabelManager- Parameters:
username- username of label owner
-
getFavouriteLabellingsByContentIds
public List<Labelling> getFavouriteLabellingsByContentIds(Collection<ContentId> contentIds, com.atlassian.sal.api.user.UserKey userKey) Description copied from interface:LabelManagerGet the labellings that represent the favourite labellings for the given user on the given content.- Specified by:
getFavouriteLabellingsByContentIdsin interfaceLabelManager- Parameters:
contentIds- the contentIds to get favourite labellings foruserKey- the key of the user to get favourite labellings for- Returns:
- the labellings that represent the favourite labellings for the given user on the given content.
-
deleteLabel
Description copied from interface:LabelManagerDelete the specified label.NOTE: The specified label does note need to be the persistent instance of the label, it simply needs to uniquely identify the label.
- Specified by:
deleteLabelin interfaceLabelManager- Parameters:
label-- Returns:
- true if the label was deleted, false otherwise.
-
getLabel
Description copied from interface:LabelManagerRetrieve the label by name.- Specified by:
getLabelin interfaceLabelManager- Parameters:
parsedLabelName-- Returns:
- a persistent instance of the label or null if it can not be found.
- See Also:
-
getLabel
Description copied from interface:LabelManagerconvenience method to fetch a label without having to call the label parser- Specified by:
getLabelin interfaceLabelManager- Parameters:
unparsedLabelName- - example - my:foo
-
getLabels
Description copied from interface:LabelManagerconvenience method to fetch labels without having to call the label parser- Specified by:
getLabelsin interfaceLabelManager- Parameters:
unparsedLabelNames- - example - my:foo, bar
-
getLabel
Description copied from interface:LabelManagerRetrieve the persistent instance of the label with the exact same details as the specified label. Note, the specified label does not need to contain an id.- Specified by:
getLabelin interfaceLabelManager- Parameters:
label-- Returns:
- a persistent instance of the label, or null if it does not exist.
-
getLabel
Description copied from interface:LabelManagerConvenience method to fetch a label without having to create a Label object- Specified by:
getLabelin interfaceLabelManager- Parameters:
labelName- The label namenamespace- The namespace of the label- Returns:
- a label instance or null if no such label exists
-
getLabelsByDetail
public List<Label> getLabelsByDetail(String labelName, String namespace, String spaceKey, String owner) Description copied from interface:LabelManagerRetrieves the labels matching the given labelName, namespace or owner- Specified by:
getLabelsByDetailin interfaceLabelManager- Parameters:
labelName- The name of the label (null to ignore)namespace- The namespace of the labels (null to ignore)spaceKey- The spaceKey to restrict by (null to ignore)owner- The owner of the labels (null to ignore)- Returns:
- a list of Label instances
-
getLabelsInSpace
Description copied from interface:LabelManagerRetrieve all of the labels that label content within the specified space.- Specified by:
getLabelsInSpacein interfaceLabelManager- Parameters:
key- identifying the space to be queried.- Returns:
- a list of labels that appear in the space.
-
getLabelsInSpace
Description copied from interface:LabelManagerInternalGet all labels in Space with pagination- Specified by:
getLabelsInSpacein interfaceLabelManagerInternal- Parameters:
key-limitedRequest-- Returns:
-
getRelatedLabelsInSpace
public PageResponse<Label> getRelatedLabelsInSpace(Label label, String spaceKey, LimitedRequest limitedRequest) Description copied from interface:LabelManagerInternalGet related labels in Space with pagination- Specified by:
getRelatedLabelsInSpacein interfaceLabelManagerInternal- Parameters:
label-spaceKey-limitedRequest-- Returns:
-
getTotalLabelInSpace
Description copied from interface:LabelManagerInternalGet total label in a particular space- Specified by:
getTotalLabelInSpacein interfaceLabelManagerInternal- Parameters:
key-- Returns:
-
getMostPopularLabels
Description copied from interface:LabelManagerRetrieve the list of the DEFAULT_LABEL_COUNT most popular labels within the system.- Specified by:
getMostPopularLabelsin interfaceLabelManager- Returns:
- a list of label search result instances in order of their popularity.
- See Also:
-
getMostPopularLabels
Description copied from interface:LabelManagerRetrieve the most popular labels within the system. The number of labels returned can be specified through the count parameter. If the count value is greater than the number of labels, then all labels will be returned.This function does not return the labels itself, but wrapped into a search result with a count!
- Specified by:
getMostPopularLabelsin interfaceLabelManager- Parameters:
count- is the maximum number of labels to be returned.- Returns:
- a list of label search result instances in order of their popularity.
- See Also:
-
getMostPopularLabelsInSpace
Description copied from interface:LabelManagerRetrieve the list of the DEFAULT_LABEL_COUNT most used labels in the specific space, ordered from most popular to least popular.This function does not return the labels itself, but wrapped into a search result with a count!
- Specified by:
getMostPopularLabelsInSpacein interfaceLabelManager- Parameters:
key- the space key- Returns:
- a list of label search result instances in order of their popularity.
- See Also:
-
getMostPopularLabelsInSpace
Description copied from interface:LabelManagerRetrieve a list of the 'n' most used labels in the specified space, ordered from most popular to least popular.This function does not return the labels itself, but wrapped into a search result with a count!
- Specified by:
getMostPopularLabelsInSpacein interfaceLabelManager- Parameters:
key- is the space keycount- is the maximum number of labels to be returned.- Returns:
- a list of label search result instances in order of their popularity.
- See Also:
-
getMostPopularLabelsInSpace
public PageResponse<LabelSearchResult> getMostPopularLabelsInSpace(String key, LimitedRequest limitedRequest) Description copied from interface:LabelManagerInternalRetrieve a list of the 'n' most used labels in the specified space, ordered from most popular to least popular.This function does not return the labels itself, but wrapped into a search result with a count!
- Specified by:
getMostPopularLabelsInSpacein interfaceLabelManagerInternal- Parameters:
key- is the space key.limitedRequest- defines pagination parameters.- Returns:
- a list of label search result instances in order of their popularity.
- See Also:
-
getMostPopularLabelsWithRanks
public Set<RankedLabelSearchResult> getMostPopularLabelsWithRanks(Comparator<? super RankedLabelSearchResult> comparator) Description copied from interface:LabelManagerRetrieve a set of the DEFAULT_LABEL_COUNT most popular labels within the system, including their ranks and ordered using the compartor provided.- Specified by:
getMostPopularLabelsWithRanksin interfaceLabelManager- Returns:
- an ordered set of ranked label search result instances
- See Also:
-
getMostPopularLabelsWithRanks
public Set<RankedLabelSearchResult> getMostPopularLabelsWithRanks(int maxResults, Comparator<? super RankedLabelSearchResult> comparator) Description copied from interface:LabelManagerRetrieve the most popular labels within the system, including their ranks and ordered using the comparator provided. The number of labels returned can be specified through the count parameter. If the count value is greater than the number of labels, then all labels will be returned.This function does not return the labels itself, but wrapped into a search result with a count!
- Specified by:
getMostPopularLabelsWithRanksin interfaceLabelManager- Parameters:
maxResults- is the maximum number of labels to be returned.- Returns:
- an ordered set of ranked label search result instances
- See Also:
-
getMostPopularLabelsWithRanksInSpace
public Set<RankedLabelSearchResult> getMostPopularLabelsWithRanksInSpace(String key, int maxResults, Comparator<? super RankedLabelSearchResult> comparator) Description copied from interface:LabelManagerRetrieve a set of the 'n' most used labels in the specified space, ordered using the compartor given.This function does not return the labels itself, but wrapped into a search result with a count!
- Specified by:
getMostPopularLabelsWithRanksInSpacein interfaceLabelManager- Parameters:
key- is the space keymaxResults- is the maximum number of labels to be returned.- Returns:
- an ordered set of rankded label search result instances
- See Also:
-
getRankedLabels
public Set<RankedLabelSearchResult> getRankedLabels(List<LabelSearchResult> labelList, Comparator<? super RankedLabelSearchResult> comparator) Description copied from interface:LabelManagerCalculate ranks for input labels. Ranks reflect the frequency of labels. Rank 1 is used for the most popular labels. Rank 10 is used for the least popular labels- Specified by:
getRankedLabelsin interfaceLabelManager- Parameters:
labelList- - list of labelscomparator- - comparator- Returns:
- list of labels with calculated ranks
-
getContent
Description copied from interface:LabelManagerGet all content associated with a label Get all versions of content associated with a label and any space. Content in the trash WILL be returned.- Specified by:
getContentin interfaceLabelManager- Returns:
- a list of Labelables
-
getContentCount
- Specified by:
getContentCountin interfaceLabelManager
-
createLabel
- Specified by:
createLabelin interfaceLabelManager
-
getRecentlyUsedLabellings
- Specified by:
getRecentlyUsedLabellingsin interfaceLabelManager
-
getRecentlyUsedLabellings
- Specified by:
getRecentlyUsedLabellingsin interfaceLabelManagerInternal
-
getRecentlyUsedLabellingsInSpace
- Specified by:
getRecentlyUsedLabellingsInSpacein interfaceLabelManager
-
getRecentlyUsedLabellingsInSpace
public PageResponse<Labelling> getRecentlyUsedLabellingsInSpace(String spaceKey, LimitedRequest limitedRequest) Description copied from interface:LabelManagerInternalRetrieve the most recently used labellings within the specified space.- Specified by:
getRecentlyUsedLabellingsInSpacein interfaceLabelManagerInternal- Parameters:
spaceKey- is the space key.limitedRequest- defines pagination parameters.- Returns:
- a paginated response with list of labelling instances in order of the most recently used to least recently used.
- See Also:
-
getRelatedLabels
Description copied from interface:LabelManagerInternalRetrieve the labels which are related (i.e. used together) with the specified label.- Specified by:
getRelatedLabelsin interfaceLabelManagerInternal
-
getRecentlyUsedLabels
Description copied from interface:LabelManagerInternalReturns the most recently used global labels in the system. The labels are ordered in descending order of the last time it was modified- Specified by:
getRecentlyUsedLabelsin interfaceLabelManagerInternal
-
getMostPopularLabels
Description copied from interface:LabelManagerInternalReturns the most popular global labels in the system. The labels are ordered in descending order of popularity.- Specified by:
getMostPopularLabelsin interfaceLabelManagerInternal
-
findGlobalLabelsByNamePrefix
public PageResponse<Label> findGlobalLabelsByNamePrefix(String namePrefix, LimitedRequest pageRequest) Description copied from interface:LabelManagerInternalReturns global-namespaced labels starting with the given string.- Specified by:
findGlobalLabelsByNamePrefixin interfaceLabelManagerInternal
-
findTeamLabelsByNamePrefix
public PageResponse<Label> findTeamLabelsByNamePrefix(String namePrefix, LimitedRequest pageRequest) Description copied from interface:LabelManagerInternalReturns team-namespaced labels starting with the given string.- Specified by:
findTeamLabelsByNamePrefixin interfaceLabelManagerInternal
-
getMostPopularLabelsInSpaceLite
Returns most used labels. Similar to getMostPopularLabelsInSpace, but returns lite objects (no references to hibernate objects).- Specified by:
getMostPopularLabelsInSpaceLitein interfaceLabelManager- Parameters:
spaceKey- - space keymaxResults- - limit- Returns:
- list of LiteLabelSearchResult
-
getMostPopularLabelsInSpaceLite
public PageResponse<LiteLabelSearchResult> getMostPopularLabelsInSpaceLite(String spaceKey, LimitedRequest limitedRequest) Description copied from interface:LabelManagerInternalReturns most used labels. Similar to getMostPopularLabelsInSpace, but returns lite objects (no references to hibernate objects).- Specified by:
getMostPopularLabelsInSpaceLitein interfaceLabelManagerInternal- Parameters:
spaceKey- - space keylimitedRequest- defines pagination parameters.- Returns:
- list of LiteLabelSearchResult
-
getMostPopularLabelsInSiteLite
Description copied from interface:LabelManagerReturns most used labels across the site. Similar to getMostPopularLabels, but returns lite objects (no references to hibernate objects). Note: implementation would limit the amount of labels.- Specified by:
getMostPopularLabelsInSiteLitein interfaceLabelManager- Parameters:
maxResults- - max results- Returns:
- list of LiteLabelSearchResult
-
getMostPopularLabelsInSiteLite
public PageResponse<LiteLabelSearchResult> getMostPopularLabelsInSiteLite(LimitedRequest limitedRequest) Description copied from interface:LabelManagerInternalReturns most used labels across the site. Similar to getMostPopularLabels, but returns lite objects (no references to hibernate objects). Note: implementation would limit the amount of labels.- Specified by:
getMostPopularLabelsInSiteLitein interfaceLabelManagerInternal- Parameters:
limitedRequest- defines pagination parameters.- Returns:
- list of LiteLabelSearchResult
-
calculateRanksForLiteLabels
public Set<RankedLiteLabelSearchResult> calculateRanksForLiteLabels(List<LiteLabelSearchResult> labelList, Comparator<? super RankedLiteLabelSearchResult> comparator) Description copied from interface:LabelManagerCalculate ranks for input labels. Ranks reflect the frequency of labels. Rank 1 is used for the most popular labels. Rank 10 is used for the least popular labels- Specified by:
calculateRanksForLiteLabelsin interfaceLabelManager- Parameters:
labelList- - list of labelscomparator- - comparator- Returns:
- list of labels with calculated ranks
-
getLabelsByDetail
public PageResponse<Label> getLabelsByDetail(LimitedRequest limitedRequest, String labelName, String namespace, String spaceKey, String owner) Description copied from interface:LabelManagerInternalReturns labels filtered by the given parameters.- Specified by:
getLabelsByDetailin interfaceLabelManagerInternal
-