Interface LabelManager
- All Known Subinterfaces:
- LabelManagerInternal
- All Known Implementing Classes:
- CachingLabelManager,- DefaultLabelManager
The label manager provides all that is necessary for interacting with labels.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionContent Types that can have a label applied.static final intstatic final Stringstatic final Stringstatic final intIndicates that a label was added.static final intIndicates that a label was created.static final intIndicates that a label was deleted.static final intIndicates that a label was removed.static final intIndicates no change.static final intIndicates no maximum (i.e.static final intIndicates zero offset to methods accepting an 'offset' parameter.
- 
Method SummaryModifier 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 l) Delete the specified label.findGlobalLabelsByNamePrefix(int offset, int maxResults, String namePrefix) Returns global-namespaced labels starting with the given string.findTeamLabelsByNamePrefix(int offset, int maxResults, String namePrefix) 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) Deprecated.since 5.3.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) Deprecated.since 5.3.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) Deprecated.since 5.3.getCurrentContentForLabelAndSpace(Label label, String spaceKey) Deprecated.since 5.3.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 the label with the specified 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(String labelName, String namespace, String spaceKey, String owner) Deprecated.since 9.3.0, useLabelService.getLabelsByDetail(PageRequest, String, String, String, String)instead.getLabelsInSpace(String key) Deprecated.since 9.2.6 UseSpaceLabelServiceDeprecated.since 9.3.0.getMostPopularLabels(int maxResults) Deprecated.since 9.3.0.getMostPopularLabelsInSiteLite(int maxResults) Returns most used labels across the site.Deprecated.since 9.3.0.getMostPopularLabelsInSpace(String key, int maxResults) Deprecated.since 9.2.6 UseSpaceLabelServicegetMostPopularLabelsInSpaceLite(String spaceKey, int maxResults) 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) getRecentlyUsedLabellingsInSpace(String spaceKey, int maxResults) Deprecated.Deprecated.since 9.2.4.getRecentlyUsedLabels(int maxResults) Retrieve the x most recently used labels.getRecentlyUsedLabelsInSpace(String spaceKey) Deprecated.getRecentlyUsedLabelsInSpace(String spaceKey, int maxResults) Deprecated.getRecentlyUsedPersonalLabellings(String username, int maxResults) 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.getRelatedLabels(Label label) Retrieve the DEFAULT_LABEL_COUNT labels that are 'related' to the specified label.getRelatedLabels(Label label, int maxResults) Deprecated.since 9.3.0.getRelatedLabels(List<? extends Label> labels, String spaceKey, int maxResultsPerLabel) Deprecated.since 9.3.0.getRelatedLabelsInSpace(Label label, String spaceKey) Deprecated.since 9.3.0.getRelatedLabelsInSpace(Label label, String spaceKey, int maxResults) Deprecated.since 9.2.6 UseSpaceLabelServiceDeprecated.since 9.3.0.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 maxResults) 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.getUsersLabels(String owner) Retrieve the personal labels that belong to the specified user.voidremoveAllLabels(Labelable content) Remove all of the labels from the specified content.intremoveLabel(Labelable object, Label label) Remove a label from the specified content.voidremoveLabels(Labelable object, List<Label> labels) removes a list of labels from the labelable object
- 
Field Details- 
CONTENT_TYPESContent Types that can have a label applied.
- 
FAVOURITE_LABEL- See Also:
 
- 
FAVOURITE_LABEL_YANKEE- See Also:
 
- 
DEFAULT_LABEL_COUNTstatic final int DEFAULT_LABEL_COUNT
- 
NO_CHANGEstatic final int NO_CHANGEIndicates no change.- See Also:
 
- 
LABEL_ADDEDstatic final int LABEL_ADDEDIndicates that a label was added.- See Also:
 
- 
LABEL_CREATEDstatic final int LABEL_CREATEDIndicates that a label was created.- See Also:
 
- 
LABEL_REMOVEDstatic final int LABEL_REMOVEDIndicates that a label was removed.- See Also:
 
- 
LABEL_DELETEDstatic final int LABEL_DELETEDIndicates that a label was deleted.- See Also:
 
- 
NO_OFFSETstatic final int NO_OFFSETIndicates zero offset to methods accepting an 'offset' parameter.- See Also:
 
- 
NO_MAX_RESULTSstatic final int NO_MAX_RESULTSIndicates no maximum (i.e. return all results) to methods accepting a 'maxResults' parameter.- See Also:
 
 
- 
- 
Method Details- 
addLabelAdd 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"));- Parameters:
- content-
- label-
- Returns:
- one of NO_CHANGE, LABEL_ADDED or LABEL_CREATED
- Since:
- 4.2
 
- 
removeLabelRemove a label from the specified content.- Parameters:
- object-
- label-
- Returns:
- one of NO_CHANGE, LABEL_DELETED, LABEL_REMOVED
- Since:
- 4.2
 
- 
removeLabelsremoves a list of labels from the labelable object- Since:
- 4.2
 
- 
removeAllLabelsRemove all of the labels from the specified content. Any labels that then no longer label content will be deleted.- Parameters:
- content-
- Since:
- 4.2
 
- 
deleteLabelboolean deleteLabel(long id) Delete the label with the specified id.- Parameters:
- id-
- Returns:
- true if the label was deleted, false otherwise.
 
- 
deleteLabelDelete 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. - Parameters:
- l-
- Returns:
- true if the label was deleted, false otherwise.
 
- 
getLabelRetrieve the label with the specified id.- Parameters:
- id-
- Returns:
- the persistent instance of label with the specified id, or null if none exists.
 
- 
getLabelRetrieve the label by name.- Parameters:
- parsedLabelName-
- Returns:
- a persistent instance of the label or null if it can not be found.
- See Also:
 
- 
getLabelconvenience method to fetch a label without having to call the label parser- Parameters:
- unparsedLabelName- - example - my:foo
 
- 
getLabelsconvenience method to fetch labels without having to call the label parser- Parameters:
- unparsedLabelNames- - example - my:foo, bar
 
- 
getLabelRetrieve 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.- Parameters:
- label-
- Returns:
- a persistent instance of the label, or null if it does not exist.
 
- 
getLabelConvenience method to fetch a label without having to create a Label object- Parameters:
- labelName- The label name
- namespace- The namespace of the label
- Returns:
- a label instance or null if no such label exists
- Since:
- 4.1
 
- 
getLabelsByDetail@Deprecated List<Label> getLabelsByDetail(String labelName, String namespace, String spaceKey, String owner) Deprecated.since 9.3.0, useLabelService.getLabelsByDetail(PageRequest, String, String, String, String)instead.Retrieves the labels matching the given labelName, namespace or owner- 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
 
- 
getLabelsInSpaceDeprecated.since 9.2.6 UseSpaceLabelServiceRetrieve all of the labels that label content within the specified space.- Parameters:
- key- identifying the space to be queried.
- Returns:
- a list of labels that appear in the space.
 
- 
getMostPopularLabelsDeprecated.since 9.3.0. UseLabelService.getMostPopularLabels(PageRequest)Retrieve the list of the DEFAULT_LABEL_COUNT most popular labels within the system.- Returns:
- a list of label search result instances in order of their popularity.
- See Also:
 
- 
getMostPopularLabelsDeprecated.since 9.3.0. UseLabelService.getMostPopularLabels(PageRequest)Retrieve 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! - Parameters:
- maxResults- is the maximum number of labels to be returned.
- Returns:
- a list of label search result instances in order of their popularity.
- See Also:
 
- 
getMostPopularLabelsInSpaceDeprecated.Retrieve 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! - Parameters:
- key- the space key
- Returns:
- a list of label search result instances in order of their popularity.
- See Also:
 
- 
getMostPopularLabelsInSpaceDeprecated.since 9.2.6 UseSpaceLabelServiceRetrieve 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! - Parameters:
- key- is the space key
- maxResults- is the maximum number of labels to be returned.
- Returns:
- a list of label search result instances in order of their popularity.
- See Also:
 
- 
getMostPopularLabelsWithRanksSet<RankedLabelSearchResult> 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.- Returns:
- an ordered set of ranked label search result instances
- See Also:
 
- 
getMostPopularLabelsWithRanksSet<RankedLabelSearchResult> getMostPopularLabelsWithRanks(int maxResults, Comparator<? super RankedLabelSearchResult> comparator) Retrieve 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! - Parameters:
- maxResults- is the maximum number of labels to be returned.
- Returns:
- an ordered set of ranked label search result instances
- See Also:
 
- 
getMostPopularLabelsWithRanksInSpaceSet<RankedLabelSearchResult> 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.This function does not return the labels itself, but wrapped into a search result with a count! - Parameters:
- key- is the space key
- maxResults- is the maximum number of labels to be returned.
- Returns:
- an ordered set of rankded label search result instances
- See Also:
 
- 
getRankedLabelsSet<RankedLabelSearchResult> getRankedLabels(List<LabelSearchResult> labelList, Comparator<? super RankedLabelSearchResult> comparator) Calculate 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- Parameters:
- labelList- - list of labels
- comparator- - comparator
- Returns:
- list of labels with calculated ranks
- Since:
- 10.0.0
 
- 
getRecentlyUsedLabelsDeprecated.since 9.2.4. UseLabelServiceRetrieve the DEFAULT_LABEL_COUNT most recently used labels within the system.- Returns:
- a list of label instances in order of most recently used to least recently used.
- See Also:
 
- 
getRecentlyUsedLabelsRetrieve the x most recently used labels.- 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.
 
- 
getRecentlyUsedLabellings
- 
getRecentlyUsedLabelsInSpaceDeprecated.Retrieve the DEFAULT_LABEL_COUNT most recently used labels within the specified space.- Parameters:
- spaceKey- 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:
 
- 
getRecentlyUsedLabelsInSpaceDeprecated.Retrieve the most recently used labels within the specified spae.- Parameters:
- spaceKey-
- 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.
 
- 
getRecentlyUsedLabellingsInSpaceDeprecated.
- 
getSuggestedLabelsRetrieve 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.- Parameters:
- content-
- Returns:
- a list of label instances. The order of these labels is undefined.
- Since:
- 4.2
- See Also:
 
- 
getSuggestedLabelsRetrieve the suggested labels for the specified content. The process used to identify 'suggested' labels may change and therefore is not defined here.- Parameters:
- maxResults- is the maximum number of labels to be returned.
- Returns:
- a list of label instances. The order of these labels is undefined.
- Since:
- 4.2
 
- 
getSuggestedLabelsInSpaceRetrieve the DEFAULT_LABEL_COUNT suggested labels for the specified content bound to the specified space.- Parameters:
- content-
- spaceKey-
- Returns:
- a list of label instances. The order of these labels is undefined.
- Since:
- 4.2
- See Also:
 
- 
getSuggestedLabelsInSpaceRetrieve the suggested labels for the specified content bound to the specified space.- 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.
- Since:
- 4.2
 
- 
getRelatedLabelsRetrieve 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.- Parameters:
- label-
- Returns:
- a list of label instances. The order of these labels is undefined.
- See Also:
 
- 
getRelatedLabelsDeprecated.since 9.3.0. UseLabelService.getRelatedLabels(String, PageRequest)Retrieve the labels that are 'related' to the specified label. The process used to identify 'related' labels may change and therefore is not defined here.- Parameters:
- maxResults- is the maximum number of labels to be returned.
- Returns:
- a list of label instances. The order of these labels is undefined.
 
- 
getRelatedLabels@Deprecated List<Label> getRelatedLabels(List<? extends Label> labels, String spaceKey, int maxResultsPerLabel) Deprecated.Retrieve 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.- Parameters:
- spaceKey- - may be null to search globally
- maxResultsPerLabel- 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.
 
- 
getRelatedLabelsInSpaceDeprecated.Retrieve the DEFAULT_LABEL_COUNT labels that are 'related' to the specified label and that are used to label content within the specified space.- Parameters:
- label-
- spaceKey-
- Returns:
- a list of label instances. The order of these labels is undefined.
- See Also:
 
- 
getRelatedLabelsInSpaceDeprecated.since 9.2.6 UseSpaceLabelServiceRetrieve the labels that are 'related' to the specified label and that are used to to label content within the specified space.- Parameters:
- label-
- spaceKey-
- maxResults-
- Returns:
- a list of label instance. The order of these labels is undefined.
 
- 
getSpacesContainingContentWithLabelDeprecated.since 9.3.0. UseSpaceService.find(Expansion...)Look up the spaces that have been labelled by the specific label.- Parameters:
- label-
- Returns:
- a list of Spaces. The order of these labels is undefined.
 
- 
getUsersLabelsRetrieve the personal labels that belong to the specified user.- Parameters:
- owner-
 
- 
getTeamLabelsRetrieve all of the team labels in the system.- Returns:
- a list of labels with the namespace Namespace.TEAM
 
- 
getTeamLabelsRetrieve all of the team labels in the system with name.- Returns:
- a list of labels with the namespace Namespace.TEAM
 
- 
getTeamLabelsForSpaceRetrieve all of the team labels used to label content in the specified space.- Parameters:
- spaceKey-
- Returns:
- a list of team labels with the namespace Namespace.TEAM. The order of the list is undefined.
 
- 
getTeamLabelsForSpacesRetrieve all of the team labels used to label content in the specified spaces.- 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.
 
- 
getCurrentContentForLabelDeprecated.since 5.3. UsegetContentForLabel(int, int, Label).Get 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.- Returns:
- a list of Labelables, sorted by last modification date
 
- 
getCurrentContentForLabelAndSpace@Deprecated List<? extends Labelable> getCurrentContentForLabelAndSpace(Label label, String spaceKey) Deprecated.since 5.3. Use thegetContentInSpaceForLabel(int, int, String, Label).Get all current content associated with a label and space. Content in the trash will not be returned.- Returns:
- a list of Labelable
 
- 
getCurrentContentWithPersonalLabelGet all current content labelled by a user
- 
getSpacesWithLabelSpaces cannot be directly labelled. Howevever, their space descriptions can. This method searches for all space descriptions with the label passed in- Parameters:
- label-
- Returns:
- list of spaces associated with matching space descriptions
 
- 
getFavouriteSpaces- Parameters:
- username- username of label owner
 
- 
getFavouriteLabellingsByContentIdsList<Labelling> getFavouriteLabellingsByContentIds(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.- Parameters:
- contentIds- the contentIds to get favourite labellings for
- userKey- 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.
- Since:
- 5.9.1
 
- 
getRecentlyUsedPersonalLabelsRetrieve 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) - Parameters:
- username- the user history from the session
- Returns:
- a list of labels
 
- 
getRecentlyUsedPersonalLabelsRetrieve 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) - Parameters:
- username- the user history from the session
- maxResults- the maximum number of results to return to the user
- Returns:
- a list of labels
 
- 
getRecentlyUsedPersonalLabellings
- 
getContentDeprecated.since 5.3. Use a method likegetContentForLabel(int, int, Label)that provides a specific return type.Get 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.- Returns:
- a list of Labelables
 
- 
getContentCount
- 
createLabel
- 
getContentForAllLabels@Deprecated List<? extends Labelable> getContentForAllLabels(Collection<Label> labels, int maxResults, int offset) Deprecated.since 5.3. UsegetContentForAllLabels(int, int, Label...)instead.
- 
getContentForLabelRetrieve current ContentEntityObjects which are labelled with the provided label.ContentEntityObjects in the Trash will *not* be returned. - Parameters:
- offset- the offset into the results
- maxResults- the maximum number of results to return
- label- label which must appear on ContentEntityObjects
- Returns:
- a partial list of ContentEntityObjects labelled with the labels provided
 
- 
getForLabel<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.ContentEntityObjects in the Trash *will* be returned. - 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 results
- maxResults- the maximum number of results to return
- label- label which must appear on labelables
- Returns:
- a partial list of EditableLabelables labelled with the labels provided
 
- 
getForLabels<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.ContentEntityObjects in the Trash will *not* be returned. - 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 results
- maxResults- the maximum number of results to return
- labels- labels which must all appear on labelables
- Returns:
- a partial list of EditableLabelables labelled with the labels provided
 
- 
getForLabelsRetrieve EditableLabelables of any type which are labelled with the provided labels.ContentEntityObjects in the Trash *will* be returned. - Parameters:
- offset- the offset into the results
- maxResults- the maximum number of results to return
- labels- labels which must all appear on labelables
- Returns:
- a partial list of EditableLabelables labelled with the labels provided
 
- 
getContentForAllLabelsPartialList<ContentEntityObject> getContentForAllLabels(int offset, int maxResults, Label... labels) Retrieve current ContentEntityObjects which are labelled with ALL provided labels.ContentEntityObjects in the Trash will *not* be returned. - Parameters:
- offset- the offset into the results
- maxResults- the maximum number of results to return
- labels- labels which must appear on ContentEntityObjects
- Returns:
- a partial list of ContentEntityObjects labelled with the labels provided
 
- 
getContentInSpaceForLabelPartialList<ContentEntityObject> getContentInSpaceForLabel(int offset, int maxResults, String spaceKey, Label label) Retrieve current ContentEntityObjects in the given space which are labelled with the provided label.ContentEntityObjects in the Trash will *not* be returned. - Parameters:
- offset- the offset into the results
- maxResults- the maximum number of results to return
- spaceKey- the key of the space to search content in
- label- label which must appear on ContentEntityObjects
- Returns:
- a partial list of ContentEntityObjects labelled with the labels provided
 
- 
getContentInSpaceForAllLabelsPartialList<ContentEntityObject> getContentInSpaceForAllLabels(int offset, int maxResults, String spaceKey, Label... labels) Retrieve current ContentEntityObjects in the given space which are labelled with ALL provided labels.ContentEntityObjects in the Trash will *not* be returned. - Parameters:
- offset- the offset into the results
- maxResults- the maximum number of results to return
- spaceKey- the key of the space to search content in
- labels- labels which must appear on ContentEntityObjects
- Returns:
- a partial list of ContentEntityObjects labelled with the labels provided
 
- 
getContentInSpacesForAllLabelsPartialList<ContentEntityObject> getContentInSpacesForAllLabels(int offset, int maxResults, Set<String> spaceKeys, Label... labels) Retrieve current ContentEntityObjects in the given spaces which are labelled with ALL provided labels.ContentEntityObjects in the Trash will *not* be returned. - Parameters:
- offset- the offset into the results
- maxResults- the maximum number of results to return
- spaceKeys- the keys of the spaces to search content in
- labels- labels which must appear on ContentEntityObjects
- Returns:
- a partial list of ContentEntityObjects labelled with the labels provided
 
- 
getAllContentForLabelRetrieve all ContentEntityObjects, current or deleted which are labelled with the provided label.ContentEntityObjects in the Trash *will* be returned. - Parameters:
- offset- the offset into the results
- maxResults- the maximum number of results to return
- label- label which must appear on ContentEntityObjects
- Returns:
- a partial list of ContentEntityObjects labelled with the labels provided
 
- 
getAllContentForAllLabelsPartialList<ContentEntityObject> getAllContentForAllLabels(int offset, int maxResults, Label... labels) Retrieve all ContentEntityObjects, current or deleted which are labelled with ALL provided labels.ContentEntityObjects in the Trash *will* be returned. - Parameters:
- offset- the offset into the results
- maxResults- the maximum number of results to return
- labels- labels which must appear on ContentEntityObjects
- Returns:
- a partial list of ContentEntityObjects labelled with the labels provided
 
- 
getMostPopularLabelsInSpaceLite@ExperimentalApi List<LiteLabelSearchResult> getMostPopularLabelsInSpaceLite(String spaceKey, int maxResults) Returns most used labels. Similar to getMostPopularLabelsInSpace, but returns lite objects (no references to hibernate objects).- Parameters:
- spaceKey- - space key
- maxResults- - limit
- Returns:
- list of LiteLabelSearchResult
- Since:
- 7.7.0
 
- 
getMostPopularLabelsInSiteLiteReturns 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.- Parameters:
- maxResults- - max results
- Returns:
- list of LiteLabelSearchResult
- Since:
- 7.7.0
 
- 
calculateRanksForLiteLabels@ExperimentalApi Set<RankedLiteLabelSearchResult> calculateRanksForLiteLabels(List<LiteLabelSearchResult> labelList, Comparator<? super RankedLiteLabelSearchResult> comparator) Calculate 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- Parameters:
- labelList- - list of labels
- comparator- - comparator
- Returns:
- list of labels with calculated ranks
- Since:
- 7.7.0
 
- 
findGlobalLabelsByNamePrefixReturns global-namespaced labels starting with the given string.- Since:
- 7.17
 
- 
findTeamLabelsByNamePrefixReturns team-namespaced labels starting with the given string.- Since:
- 7.17
 
 
-