public interface LabelDao extends ObjectDao
Modifier and Type | Field and Description |
---|---|
static int |
UNLIMITED
Specify no limit on the number of results returned by the dao.
|
NON_CACHEABLE
Modifier and Type | Method and Description |
---|---|
void |
deleteLabellingBySpace(String key) |
PartialList<ContentEntityObject> |
findAllContentForAllLabels(int offset,
int maxResults,
Label... labels)
Retrieve all ContentEntityObjects which are labelled with ALL provided labels.
|
List<? extends EditableLabelable> |
findAllUserLabelledContent(String username) |
List |
findByDetails(String name,
String namespace,
String owner)
Find all labels based on the details passed in.
|
List |
findByDetailsInSpace(String name,
String namespace,
String owner,
String spaceKey)
Find all labels for a specific space, based on the details passed in.
|
List |
findByDetailsInSpaces(String name,
String namespace,
String owner,
Collection<Space> spaces)
Find all labels for a specific space, based on the details passed in.
|
Label |
findById(long id)
Find the label by its id.
|
Label |
findByLabel(Label label) |
List<Label> |
findBySingleDegreeSeparation(EditableLabelable content,
int maxResults)
Find the labels that are a single degree of separation away from the specified content.
|
List<Label> |
findBySingleDegreeSeparation(EditableLabelable content,
String spaceKey,
int maxResults) |
List |
findBySingleDegreeSeparation(Label label,
int maxResults)
Find the labels that are a single degree of separation away from the specified label.
|
List |
findBySingleDegreeSeparation(Label label,
String spaceKey,
int maxResults) |
List |
findBySpace(String spaceKey,
String namespace)
Find the labels used to label the content with the specified space.
|
int |
findContentCountForLabel(Label label) |
List<? extends EditableLabelable> |
findContentForLabel(Label label,
int maxResults)
Deprecated.
since 5.3. Use a findContentForAllLabels variant with an offset and maxResults.
|
PartialList<ContentEntityObject> |
findContentInSpaceForAllLabels(int offset,
int maxResults,
String spaceKey,
Label... labels)
Retrieve current ContentEntityObjects in the space which are labelled with ALL provided labels.
|
PartialList<ContentEntityObject> |
findContentInSpacesForAllLabels(int offset,
int maxResults,
Set<String> spaceKeys,
Label... labels)
Retrieve current ContentEntityObjects in the given spaces which are labelled with ALL provided labels.
|
List<? extends EditableLabelable> |
findCurrentContentForLabel(Label label)
Deprecated.
since 5.3. Use
findForAllLabels(Class, int, int, Label...) |
List<? extends EditableLabelable> |
findCurrentContentForLabelAndSpace(Label label,
String spaceKey)
Deprecated.
Since 5.3. Use
findContentInSpaceForAllLabels(int, int, String, Label...) . |
<T extends EditableLabelable> |
findForAllLabels(Class<T> labelableClass,
int offset,
int maxResults,
Label... labels)
Retrieve current EditableLabelables which are labelled with ALL provided labels.
|
PartialList<EditableLabelable> |
findForAllLabels(int offset,
int maxResults,
Label... labels)
Retrieve EditableLabelables which are labelled with ALL provided labels.
|
PageResponse<Label> |
findGlobalLabelsByNamePrefix(String namePrefix,
LimitedRequest pageRequest)
Returns global-namespaced labels starting with the given string.
|
Labelling |
findLabellingByContentAndLabel(EditableLabelable content,
Label label) |
Labelling |
findLabellingById(long id) |
List |
findMostPopular(String namespace,
int maxResults)
Find the most popular labels.
|
List |
findMostPopularBySpace(String namespace,
String key,
int maxResults)
Find the most popular labels in the specified space.
|
List |
findRecentlyUsed(int maxResults) |
List |
findRecentlyUsedBySpace(String key,
int maxResults) |
List |
findRecentlyUsedLabelling(int maxResults) |
List |
findRecentlyUsedLabellingsBySpace(String spaceKey,
int maxResults) |
List |
findRecentlyUsedUserLabellings(String username,
int maxResults) |
List |
findRecentlyUsedUserLabels(String username,
int maxResults) |
List |
findSpacesContainingContentWithLabel(Label label) |
List |
findSpacesWithLabel(Label label) |
List |
findUnusedLabels() |
List<Labelling> |
getFavouriteLabellingsByContentIds(Collection<Long> contentIds,
com.atlassian.sal.api.user.UserKey userKey) |
List |
getFavouriteSpaces(String username) |
findAll, findAllSorted, findAllSorted, findByClassIds, getPersistentClass, refresh, remove, replicate, save, saveRaw
static final int UNLIMITED
Label findById(long id)
id
- ID of the labelList findByDetails(String name, String namespace, String owner)
The list of labels returned will be ordered by name.
name
- Label name (can be null)namespace
- Namespace of the label (can be null)owner
- Owner of the label (can be null)List findByDetailsInSpace(String name, String namespace, String owner, String spaceKey)
The list of labels returned will be ordered by name.
name
- Label name (can be null)namespace
- Namespace of the label (can be null)owner
- Owner of the label (can be null)spaceKey
- Key of the space whose content must have the returned labels (can be null)List findByDetailsInSpaces(String name, String namespace, String owner, Collection<Space> spaces)
The list of labels returned will be ordered by name.
name
- Label name (can be null)namespace
- Namespace of the label (can be null)owner
- Owner of the label (can be null)spaces
- Collection of spaces whose content must have the returned labels (can be null)List findBySpace(String spaceKey, String namespace)
spaceKey
- Key of the space whose content must have the returned labels (can be null)namespace
- Namespace of the label (can be null)List findMostPopular(String namespace, int maxResults)
Label popularity is defined by the number of times a label has been used / applied to content.
maxResults
- Maximum size of list to returnList findMostPopularBySpace(String namespace, String key, int maxResults)
key
- of the space whose content must have the returned labelsmaxResults
- allows you to specify the maximum number of results returned by this method. Leaving max results
at zero will return all of the results.List findRecentlyUsedLabellingsBySpace(String spaceKey, int maxResults)
List findRecentlyUsed(int maxResults)
List findRecentlyUsedLabelling(int maxResults)
List<Label> findBySingleDegreeSeparation(EditableLabelable content, int maxResults)
This query will retrieve the labels on the given content object and find any content with those labels. The labels that are used on the second "level" of content will be returned.
e.g. Page H is passed in as the content object, which is labelled with A and B. All pages labelled with A and B are retrieved (J, K, L, M), and the labels on those four pages are returned in order of frequency.
content
- the content object used to search for related labelsmaxResults
- specifies the number of labels to be returned.List<Label> findBySingleDegreeSeparation(EditableLabelable content, String spaceKey, int maxResults)
List findBySingleDegreeSeparation(Label label, int maxResults)
This query will return the labels located on the same pages with the given label, in order of frequency
e.g. Page A has labels ABCX, Page B has labels ABX. A query for X will return A (2 uses) then B (1 use)
label
- the label to look for on pagesmaxResults
- the maximum number of results to returnList findBySingleDegreeSeparation(Label label, String spaceKey, int maxResults)
@Deprecated List<? extends EditableLabelable> findCurrentContentForLabel(Label label)
findForAllLabels(Class, int, int, Label...)
#findContentForLabel(Label)
.label
- search for content with this label@Deprecated List<? extends EditableLabelable> findCurrentContentForLabelAndSpace(Label label, String spaceKey)
findContentInSpaceForAllLabels(int, int, String, Label...)
.label
- search for content with this labelspaceKey
- (optional) search for content belonging to the space with this spaceKeyint findContentCountForLabel(Label label)
Labelling findLabellingByContentAndLabel(EditableLabelable content, Label label)
Labelling findLabellingById(long id)
void deleteLabellingBySpace(String key)
List findUnusedLabels()
List getFavouriteSpaces(String username)
username
- username of label ownerList<? extends EditableLabelable> findAllUserLabelledContent(String username)
@Deprecated List<? extends EditableLabelable> findContentForLabel(Label label, int maxResults)
findCurrentContentForLabel(Label)
.label
- search for content with this labelmaxResults
- the number of results to return; use -1 to get all results<T extends EditableLabelable> PartialList<T> findForAllLabels(Class<T> labelableClass, int offset, int maxResults, Label... labels)
labelableClass
- the type of EditableLabelable to return. Use one of these values:
offset
- the offset into the resultsmaxResults
- the maximum number of results to returnlabels
- labels which must appear on ContentEntityObjectsPartialList<EditableLabelable> findForAllLabels(int offset, int maxResults, Label... labels)
If ContentEntityObject
s are returned in the list they may be current or in the trash.
offset
- the offset into the resultsmaxResults
- the maximum number of results to returnlabels
- labels which must appear on ContentEntityObjectsPartialList<ContentEntityObject> findContentInSpaceForAllLabels(int offset, int maxResults, String spaceKey, Label... labels)
offset
- the offset into the resultsmaxResults
- the maximum number of results to returnspaceKey
- the key of the space to search inlabels
- labels which must appear on ContentEntityObjectsPartialList<ContentEntityObject> findContentInSpacesForAllLabels(int offset, int maxResults, Set<String> spaceKeys, Label... labels)
offset
- the offset into the resultsmaxResults
- the maximum number of results to returnspaceKeys
- the keys of the spaces to search inlabels
- labels which must appear on ContentEntityObjectsPartialList<ContentEntityObject> findAllContentForAllLabels(int offset, int maxResults, Label... labels)
offset
- the offset into the resultsmaxResults
- the maximum number of results to returnlabels
- labels which must appear on ContentEntityObjectsPageResponse<Label> findGlobalLabelsByNamePrefix(String namePrefix, LimitedRequest pageRequest)
List<Labelling> getFavouriteLabellingsByContentIds(Collection<Long> contentIds, com.atlassian.sal.api.user.UserKey userKey)
Copyright © 2003–2017 Atlassian. All rights reserved.