public interface

LabelDao

implements ObjectDao
com.atlassian.confluence.labels.persistence.dao.LabelDao
Known Indirect Subclasses

Summary

Constants
int UNLIMITED Specify no limit on the number of results returned by the dao.
Public Methods
abstract void deleteLabellingBySpace(String key)
abstract List findAllUserLabelledContent(String username)
abstract List findByDetails(String name, String namespace, String owner)
Find all labels based on the details passed in.
abstract List findByDetailsInSpace(String name, String namespace, String owner, String spaceKey)
Find all labels for a specific space, based on the details passed in.
abstract List<Label> findByDetailsInSpaces(String name, String namespace, String owner, Collection<Space> spaces)
Find all labels for a specific space, based on the details passed in.
abstract Label findById(long id)
Find the label by its id.
abstract Label findByLabel(Label label)
abstract List findBySingleDegreeSeparation(Label label, String spaceKey, int maxResults)
abstract List findBySingleDegreeSeparation(ContentEntityObject content, String spaceKey, int maxResults)
abstract List findBySingleDegreeSeparation(Label label, int maxResults)
Find the labels that are a single degree of separation away from the specified label.
abstract List findBySingleDegreeSeparation(ContentEntityObject content, int maxResults)
Find the labels that are a single degree of separation away from the specified content.
abstract List findBySpace(String spaceKey, String namespace)
Find the labels used to label the content with the specified space.
abstract int findContentCountForLabel(Label label)
abstract List<ContentEntityObject> findContentForAllLabels(Collection<Label> labels, int maxResults, int offset)
Retrieve all ContentEntityObjects which are labelled with ALL provided labels.
abstract List<ContentEntityObject> findContentForLabel(Label label, int maxResults)
abstract List findCurrentContentForLabel(Label label)
abstract List findCurrentContentForLabelAndSpace(Label label, String spaceKey)
Returns current content with the specified label and spaceKey.
abstract Labelling findLabellingByContentAndLabel(ContentEntityObject content, Label label)
abstract Labelling findLabellingById(long id)
abstract List findMostPopular(String namespace, int maxResults)
Find the most popular labels.
abstract List findMostPopularBySpace(String namespace, String key, int maxResults)
Find the most popular labels in the specified space.
abstract List findRecentlyUsed(int maxResults)
abstract List findRecentlyUsedBySpace(String key, int maxResults)
abstract List findRecentlyUsedLabelling(int maxResults)
abstract List findRecentlyUsedLabellingsBySpace(String spaceKey, int maxResults)
abstract List findRecentlyUsedUserLabellings(String username, int maxResults)
abstract List findRecentlyUsedUserLabels(String username, int maxResults)
abstract List findSpacesContainingContentWithLabel(Label label)
abstract List findSpacesWithLabel(Label label)
abstract List findUnusedLabels()
abstract List getFavouriteSpaces(String username)
[Expand]
Inherited Methods
From interface bucket.core.persistence.ObjectDao

Constants

public static final int UNLIMITED

Specify no limit on the number of results returned by the dao.

Constant Value: 0 (0x00000000)

Public Methods

public abstract void deleteLabellingBySpace (String key)

public abstract List findAllUserLabelledContent (String username)

public abstract List findByDetails (String name, String namespace, String owner)

Find all labels based on the details passed in. If a parameter is null, it will not be considered in the search.

The list of labels returned will be ordered by name.

Parameters
name Label name (can be null)
namespace Namespace of the label (can be null)
owner Owner of the label (can be null)
Returns
  • List The list of labels matching the given criteria

public abstract List findByDetailsInSpace (String name, String namespace, String owner, String spaceKey)

Find all labels for a specific space, based on the details passed in. If a parameter is null, it will not be considered in the search.

The list of labels returned will be ordered by name.

Parameters
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)
Returns
  • List The list of labels matching the given criteria

public abstract List<Label> findByDetailsInSpaces (String name, String namespace, String owner, Collection<Space> spaces)

Find all labels for a specific space, based on the details passed in. If a parameter is null, it will not be considered in the search.

The list of labels returned will be ordered by name.

Parameters
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)
Returns
  • List The list of labels matching the given criteria

public abstract Label findById (long id)

Find the label by its id.

Parameters
id ID of the label
Returns
  • a label instance, or null if the label does not exist.

public abstract Label findByLabel (Label label)

public abstract List findBySingleDegreeSeparation (Label label, String spaceKey, int maxResults)

public abstract List findBySingleDegreeSeparation (ContentEntityObject content, String spaceKey, int maxResults)

public abstract List findBySingleDegreeSeparation (Label label, int maxResults)

Find the labels that are a single degree of separation away from the specified label. 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)

Parameters
label the label to look for on pages
maxResults the maximum number of results to return
Returns
  • a list of labels, ordered by their frequency of occurance.

public abstract List findBySingleDegreeSeparation (ContentEntityObject content, int maxResults)

Find the labels that are a single degree of separation away from the specified content. 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.

Parameters
content the content object used to search for related labels
maxResults specifies the number of labels to be returned.
Returns
  • a list of labels, ordered by their frequency of occurance.

public abstract List findBySpace (String spaceKey, String namespace)

Find the labels used to label the content with the specified space.

Parameters
spaceKey Key of the space whose content must have the returned labels (can be null)
namespace Namespace of the label (can be null)
Returns
  • a list of labels, or an empty list if none exist.

public abstract int findContentCountForLabel (Label label)

public abstract List<ContentEntityObject> findContentForAllLabels (Collection<Label> labels, int maxResults, int offset)

Retrieve all ContentEntityObjects which are labelled with ALL provided labels.

Parameters
labels labels which must appear on ContentEntityObjects
maxResults the maximum number of results to return
offset the offset into the results
Returns
  • a list of ContentEntityObjects labelled with the labels provided

public abstract List<ContentEntityObject> findContentForLabel (Label label, int maxResults)

public abstract List findCurrentContentForLabel (Label label)

public abstract List findCurrentContentForLabelAndSpace (Label label, String spaceKey)

Returns current content with the specified label and spaceKey. If no spaceKey is specified, a search will be performed against the label only.

Parameters
label search for content with this label
spaceKey (optional) search for content belonging to the space with this spaceKey
Returns
  • current content with the specified label and spaceKey.

public abstract Labelling findLabellingByContentAndLabel (ContentEntityObject content, Label label)

public abstract Labelling findLabellingById (long id)

public abstract List findMostPopular (String namespace, int maxResults)

Find the most popular labels. Label popularity is defined by the number of times a label has been used / applied to content.

Parameters
maxResults Maximum size of list to return
Returns
  • a list of label instances, or an empty list if non exist.

public abstract List findMostPopularBySpace (String namespace, String key, int maxResults)

Find the most popular labels in the specified space. You can restrict the number of results returned by this query by setting the maxResults parameter.

Parameters
key of the space whose content must have the returned labels
maxResults allows you to specify the maximum number of results returned by this method. Leaving max results at zero will return all of the results.
Returns
  • a list of LabelSearchResult objects that map the label to the number of times it appears in the space.

public abstract List findRecentlyUsed (int maxResults)

public abstract List findRecentlyUsedBySpace (String key, int maxResults)

public abstract List findRecentlyUsedLabelling (int maxResults)

public abstract List findRecentlyUsedLabellingsBySpace (String spaceKey, int maxResults)

public abstract List findRecentlyUsedUserLabellings (String username, int maxResults)

public abstract List findRecentlyUsedUserLabels (String username, int maxResults)

public abstract List findSpacesContainingContentWithLabel (Label label)

public abstract List findSpacesWithLabel (Label label)

public abstract List findUnusedLabels ()

public abstract List getFavouriteSpaces (String username)

Parameters
username username of label owner