|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface LabelManager
The label manager provides all that is necessary for interacting with labels.
Field Summary | |
---|---|
static java.util.List<java.lang.String> |
CONTENT_TYPES
Content Types that can have a label applied. |
static int |
DEFAULT_LABEL_COUNT
|
static java.lang.String |
FAVOURITE_LABEL
|
static java.lang.String |
FAVOURITE_LABEL_YANKEE
|
static int |
LABEL_ADDED
Indicates that a label was added. |
static int |
LABEL_CREATED
Indicates that a label was created. |
static int |
LABEL_DELETED
Indicates that a label was deleted. |
static int |
LABEL_REMOVED
Indicates that a label was removed. |
static int |
NO_CHANGE
Indicates no change. |
static int |
NO_MAX_RESULTS
Indicates no maximum (i.e. |
static int |
NO_OFFSET
Indicates zero offset to methods accepting an 'offset' parameter. |
Method Summary | ||
---|---|---|
int |
addLabel(ContentEntityObject content,
Label label)
Deprecated. since 4.2 |
|
int |
addLabel(Labelable content,
Label label)
Add a label to the specified content. |
|
Label |
createLabel(Label label)
|
|
boolean |
deleteLabel(Label l)
Delete the specified label. |
|
boolean |
deleteLabel(long id)
Delete the label with the specified id. |
|
PartialList<ContentEntityObject> |
getAllContentForAllLabels(int offset,
int maxResults,
Label... labels)
Retrieve all ContentEntityObjects, current or deleted which are labelled with ALL provided labels. |
|
PartialList<ContentEntityObject> |
getAllContentForLabel(int offset,
int maxResults,
Label label)
Retrieve all ContentEntityObjects, current or deleted which are labelled with the provided label. |
|
java.util.List |
getContent(Label label)
Deprecated. since 5.3. Use a method like getContentForLabel(int, int, Label) that provides a specific return type. |
|
int |
getContentCount(Label label)
|
|
java.util.List<? extends Labelable> |
getContentForAllLabels(java.util.Collection<Label> labels,
int maxResults,
int offset)
Deprecated. since 5.3. Use getContentForAllLabels(int, int, Label...) instead. |
|
PartialList<ContentEntityObject> |
getContentForAllLabels(int offset,
int maxResults,
Label... labels)
Retrieve current ContentEntityObjects which are labelled with ALL provided labels. |
|
PartialList<ContentEntityObject> |
getContentForLabel(int offset,
int maxResults,
Label label)
Retrieve current ContentEntityObjects which are labelled with the provided label. |
|
java.util.List<? extends Labelable> |
getContentForLabel(Label label,
int maxResults)
Deprecated. since 5.3. Use getAllContentForLabel(int, int, Label) . |
|
PartialList<ContentEntityObject> |
getContentInSpaceForAllLabels(int offset,
int maxResults,
java.lang.String spaceKey,
Label... labels)
Retrieve current ContentEntityObjects in the given space which are labelled with ALL provided labels. |
|
PartialList<ContentEntityObject> |
getContentInSpaceForLabel(int offset,
int maxResults,
java.lang.String spaceKey,
Label label)
Retrieve current ContentEntityObjects in the given space which are labelled with the provided label. |
|
PartialList<ContentEntityObject> |
getContentInSpacesForAllLabels(int offset,
int maxResults,
java.util.Set<java.lang.String> spaceKeys,
Label... labels)
Retrieve current ContentEntityObjects in the given spaces which are labelled with ALL provided labels. |
|
java.util.List<? extends Labelable> |
getCurrentContentForLabel(Label label)
Deprecated. since 5.3. Use getContentForLabel(int, int, Label) . |
|
java.util.List<? extends Labelable> |
getCurrentContentForLabelAndSpace(Label label,
java.lang.String spaceKey)
Deprecated. since 5.3. Use the getContentInSpaceForLabel(int, int, String, Label) . |
|
java.util.List<? extends Labelable> |
getCurrentContentWithPersonalLabel(java.lang.String username)
Get all current content labelled by a user |
|
java.util.List<Space> |
getFavouriteSpaces(java.lang.String username)
|
|
|
getForLabel(java.lang.Class<T> labelableClass,
int offset,
int maxResults,
Label label)
Retrieve EditableLabelables of the supplied type which are labelled with the provided label. |
|
|
getForLabels(java.lang.Class<T> labelableClass,
int offset,
int maxResults,
Label... labels)
Retrieve EditableLabelables of the supplied type which are labelled with the provided labels. |
|
PartialList<EditableLabelable> |
getForLabels(int offset,
int maxResults,
Label... labels)
Retrieve EditableLabelables of any type which are labelled with the provided labels. |
|
Label |
getLabel(Label label)
Retrieve the persistent instance of the label with the exact same details as the specified label. |
|
Label |
getLabel(long id)
Retrieve the label with the specified id. |
|
Label |
getLabel(ParsedLabelName parsedLabelName)
Retrieve the label by name. |
|
Label |
getLabel(java.lang.String unparsedLabelName)
convenience method to fetch a label without having to call the label parser |
|
Label |
getLabel(java.lang.String labelName,
Namespace namespace)
Convenience method to fetch a label without having to create a Label object |
|
java.util.List<Label> |
getLabels(java.util.Collection<java.lang.String> unparsedLabelNames)
convenience method to fetch labels without having to call the label parser |
|
java.util.List |
getLabelsByDetail(java.lang.String labelName,
java.lang.String namespace,
java.lang.String spaceKey,
java.lang.String owner)
Retrieves the labels matching the given labelName, namespace or owner |
|
java.util.List |
getLabelsInSpace(java.lang.String key)
Retrieve all of the labels that label content within the specified space. |
|
java.util.List |
getMostPopularLabels()
Retrieve the list of the DEFAULT_LABEL_COUNT most popular labels within the system. |
|
java.util.List |
getMostPopularLabels(int maxResults)
Retrieve the most popular labels within the system. |
|
java.util.List |
getMostPopularLabelsInSpace(java.lang.String key)
Retrieve the list of the DEFAULT_LABEL_COUNT most used labels in the specific space, ordered from most popular to least popular. |
|
java.util.List |
getMostPopularLabelsInSpace(java.lang.String key,
int maxResults)
Retrieve a list of the 'n' most used labels in the specified space, ordered from most popular to least popular. |
|
java.util.Set |
getMostPopularLabelsWithRanks(java.util.Comparator comparator)
Retrieve a set of the DEFAULT_LABEL_COUNT most popular labels within the system, including their ranks and ordered using the compartor provided. |
|
java.util.Set |
getMostPopularLabelsWithRanks(int maxResults,
java.util.Comparator comparator)
Retrieve the most popular labels within the system, including their ranks and ordered using the comparator provided. |
|
java.util.Set |
getMostPopularLabelsWithRanksInSpace(java.lang.String key,
int maxResults,
java.util.Comparator comparator)
Retrieve a set of the 'n' most used labels in the specified space, ordered using the compartor given. |
|
java.util.List |
getRecentlyUsedLabellings(int maxResults)
|
|
java.util.List |
getRecentlyUsedLabellingsInSpace(java.lang.String spaceKey,
int maxResults)
|
|
java.util.List<Label> |
getRecentlyUsedLabels()
Retrieve the DEFAULT_LABEL_COUNT most recently used labels within the system. |
|
java.util.List |
getRecentlyUsedLabels(int maxResults)
Retrieve the x most recently used labels. |
|
java.util.List |
getRecentlyUsedLabelsInSpace(java.lang.String spaceKey)
Retrieve the DEFAULT_LABEL_COUNT most recently used labels within the specified space. |
|
java.util.List |
getRecentlyUsedLabelsInSpace(java.lang.String spaceKey,
int maxResults)
Retrieve the most recently used labels within the specified spae. |
|
java.util.List |
getRecentlyUsedPersonalLabellings(java.lang.String username,
int maxResults)
|
|
java.util.List |
getRecentlyUsedPersonalLabels(java.lang.String username)
Retrieve the labels that were recently used by currently authenticated user. |
|
java.util.List |
getRecentlyUsedPersonalLabels(java.lang.String username,
int maxResults)
Retrieve the labels that were recently used by currently authenticated user. |
|
java.util.List<Label> |
getRelatedLabels(Label label)
Retrieve the DEFAULT_LABEL_COUNT labels that are 'related' to the specified label. |
|
java.util.List<Label> |
getRelatedLabels(Label label,
int maxResults)
Retrieve the labels that are 'related' to the specified label. |
|
java.util.List<Label> |
getRelatedLabels(java.util.List<? extends Label> labels,
java.lang.String spaceKey,
int maxResultsPerLabel)
Retrieve the labels that are 'related' to the labels in the list. |
|
java.util.List<Label> |
getRelatedLabelsInSpace(Label label,
java.lang.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. |
|
java.util.List<Label> |
getRelatedLabelsInSpace(Label label,
java.lang.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. |
|
java.util.List |
getSpacesContainingContentWithLabel(Label label)
Look up the spaces that have been labelled by the specific label. |
|
java.util.List<Space> |
getSpacesWithLabel(Label label)
Spaces cannot be directly labelled. |
|
java.util.List |
getSuggestedLabels(ContentEntityObject content)
Deprecated. since 4.2 |
|
java.util.List |
getSuggestedLabels(ContentEntityObject content,
int maxResults)
Deprecated. since 4.2 |
|
java.util.List |
getSuggestedLabels(Labelable content)
Retrieve the DEFAULT_LABEL_COUNT suggested labels for the specified content. |
|
java.util.List |
getSuggestedLabels(Labelable content,
int maxResults)
Retrieve the suggested labels for the specified content. |
|
java.util.List |
getSuggestedLabelsInSpace(ContentEntityObject content,
java.lang.String spaceKey)
Deprecated. since 4.2 |
|
java.util.List |
getSuggestedLabelsInSpace(ContentEntityObject content,
java.lang.String spaceKey,
int maxResults)
Deprecated. since 4.2 |
|
java.util.List |
getSuggestedLabelsInSpace(Labelable content,
java.lang.String spaceKey)
Retrieve the DEFAULT_LABEL_COUNT suggested labels for the specified content bound to the specified space. |
|
java.util.List<Label> |
getSuggestedLabelsInSpace(Labelable content,
java.lang.String spaceKey,
int maxResults)
Retrieve the suggested labels for the specified content bound to the specified space. |
|
java.util.List |
getTeamLabels()
Retrieve all of the team labels in the system. |
|
java.util.List |
getTeamLabelsForSpace(java.lang.String spaceKey)
Retrieve all of the team labels used to label content in the specified space. |
|
java.util.List<Label> |
getTeamLabelsForSpaces(java.util.Collection<Space> spaces)
Retrieve all of the team labels used to label content in the specified spaces. |
|
java.util.List |
getUsersLabels(java.lang.String owner)
Retrieve the personal labels that belong to the specified user. |
|
void |
removeAllLabels(ContentEntityObject ceo)
Deprecated. since 4.2. Use removeAllLabels(Labelable) . |
|
void |
removeAllLabels(Labelable content)
Remove all of the labels from the specified content. |
|
int |
removeLabel(ContentEntityObject object,
Label label)
Deprecated. since 4.2 |
|
int |
removeLabel(Labelable object,
Label label)
Remove a label from the specified content. |
|
void |
removeLabels(ContentEntityObject object,
java.util.List labels)
Deprecated. since 4.2 |
|
void |
removeLabels(Labelable object,
java.util.List labels)
removes a list of labels from the labelable object |
Field Detail |
---|
static final java.util.List<java.lang.String> CONTENT_TYPES
static final java.lang.String FAVOURITE_LABEL
static final java.lang.String FAVOURITE_LABEL_YANKEE
static final int DEFAULT_LABEL_COUNT
static final int NO_CHANGE
addLabel(com.atlassian.confluence.core.ContentEntityObject, Label)
,
removeLabel(com.atlassian.confluence.core.ContentEntityObject, Label)
,
Constant Field Valuesstatic final int LABEL_ADDED
addLabel(com.atlassian.confluence.core.ContentEntityObject, Label)
,
Constant Field Valuesstatic final int LABEL_CREATED
addLabel(com.atlassian.confluence.core.ContentEntityObject, Label)
,
Constant Field Valuesstatic final int LABEL_REMOVED
removeLabel(com.atlassian.confluence.core.ContentEntityObject, Label)
,
Constant Field Valuesstatic final int LABEL_DELETED
removeLabel(com.atlassian.confluence.core.ContentEntityObject, Label)
,
Constant Field Valuesstatic final int NO_OFFSET
static final int NO_MAX_RESULTS
Method Detail |
---|
int addLabel(Labelable content, Label label)
labelManager.addLabel(page, new Label("name", "namespace", "owner"));
content
- label
-
@Deprecated int addLabel(ContentEntityObject content, Label label)
int removeLabel(Labelable object, Label label)
object
- label
-
@Deprecated int removeLabel(ContentEntityObject object, Label label)
void removeLabels(Labelable object, java.util.List labels)
@Deprecated void removeLabels(ContentEntityObject object, java.util.List labels)
void removeAllLabels(Labelable content)
content
- @Deprecated void removeAllLabels(ContentEntityObject ceo)
removeAllLabels(Labelable)
.
boolean deleteLabel(long id)
id
-
boolean deleteLabel(Label l)
l
-
Label getLabel(long id)
id
-
Label getLabel(ParsedLabelName parsedLabelName)
parsedLabelName
-
for details on the format of the labelReference parameter.
Label getLabel(java.lang.String unparsedLabelName)
unparsedLabelName
- - example - my:foojava.util.List<Label> getLabels(java.util.Collection<java.lang.String> unparsedLabelNames)
unparsedLabelNames
- - example - my:foo, barLabel getLabel(Label label)
label
-
Label getLabel(java.lang.String labelName, Namespace namespace)
labelName
- The label namenamespace
- The namespace of the label
java.util.List getLabelsByDetail(java.lang.String labelName, java.lang.String namespace, java.lang.String spaceKey, java.lang.String owner)
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)
java.util.List getLabelsInSpace(java.lang.String key)
key
- identifying the space to be queried.
java.util.List getMostPopularLabels()
DEFAULT_LABEL_COUNT
,
LabelSearchResult
java.util.List getMostPopularLabels(int maxResults)
This function does not return the labels itself, but wrapped into a search result with a count!
maxResults
- is the maximum number of labels to be returned.
LabelSearchResult
java.util.List getMostPopularLabelsInSpace(java.lang.String key)
This function does not return the labels itself, but wrapped into a search result with a count!
key
- the space key
DEFAULT_LABEL_COUNT
,
LabelSearchResult
java.util.List getMostPopularLabelsInSpace(java.lang.String key, int maxResults)
This function does not return the labels itself, but wrapped into a search result with a count!
key
- is the space keymaxResults
- is the maximum number of labels to be returned.
LabelSearchResult
java.util.Set getMostPopularLabelsWithRanks(java.util.Comparator comparator)
DEFAULT_LABEL_COUNT
,
RankedLabelSearchResult
java.util.Set getMostPopularLabelsWithRanks(int maxResults, java.util.Comparator comparator)
This function does not return the labels itself, but wrapped into a search result with a count!
maxResults
- is the maximum number of labels to be returned.
RankedLabelSearchResult
java.util.Set getMostPopularLabelsWithRanksInSpace(java.lang.String key, int maxResults, java.util.Comparator comparator)
This function does not return the labels itself, but wrapped into a search result with a count!
key
- is the space keymaxResults
- is the maximum number of labels to be returned.
RankedLabelSearchResult
java.util.List<Label> getRecentlyUsedLabels()
DEFAULT_LABEL_COUNT
java.util.List getRecentlyUsedLabels(int maxResults)
maxResults
- is the maximum number of labels to be returned.
java.util.List getRecentlyUsedLabellings(int maxResults)
java.util.List getRecentlyUsedLabelsInSpace(java.lang.String spaceKey)
spaceKey
- identifies the space to which the results are restricted.
DEFAULT_LABEL_COUNT
java.util.List getRecentlyUsedLabelsInSpace(java.lang.String spaceKey, int maxResults)
spaceKey
- maxResults
- is the maximum number of labels to be returned.
java.util.List getRecentlyUsedLabellingsInSpace(java.lang.String spaceKey, int maxResults)
java.util.List getSuggestedLabels(Labelable content)
content
-
DEFAULT_LABEL_COUNT
@Deprecated java.util.List getSuggestedLabels(ContentEntityObject content)
java.util.List getSuggestedLabels(Labelable content, int maxResults)
maxResults
- is the maximum number of labels to be returned.
@Deprecated java.util.List getSuggestedLabels(ContentEntityObject content, int maxResults)
java.util.List getSuggestedLabelsInSpace(Labelable content, java.lang.String spaceKey)
content
- spaceKey
-
DEFAULT_LABEL_COUNT
@Deprecated java.util.List getSuggestedLabelsInSpace(ContentEntityObject content, java.lang.String spaceKey)
java.util.List<Label> getSuggestedLabelsInSpace(Labelable content, java.lang.String spaceKey, int maxResults)
content
- spaceKey
- maxResults
- is the maximum number of labels to be returned.
@Deprecated java.util.List getSuggestedLabelsInSpace(ContentEntityObject content, java.lang.String spaceKey, int maxResults)
java.util.List<Label> getRelatedLabels(Label label)
label
-
DEFAULT_LABEL_COUNT
java.util.List<Label> getRelatedLabels(Label label, int maxResults)
maxResults
- is the maximum number of labels to be returned.
java.util.List<Label> getRelatedLabels(java.util.List<? extends Label> labels, java.lang.String spaceKey, int maxResultsPerLabel)
spaceKey
- - may be null to search globallymaxResultsPerLabel
- is the maximum number of labels to be returned for each label.
java.util.List<Label> getRelatedLabelsInSpace(Label label, java.lang.String spaceKey)
label
- spaceKey
-
DEFAULT_LABEL_COUNT
java.util.List<Label> getRelatedLabelsInSpace(Label label, java.lang.String spaceKey, int maxResults)
label
- spaceKey
- maxResults
-
java.util.List getSpacesContainingContentWithLabel(Label label)
label
-
java.util.List getUsersLabels(java.lang.String owner)
owner
- java.util.List getTeamLabels()
java.util.List getTeamLabelsForSpace(java.lang.String spaceKey)
spaceKey
-
java.util.List<Label> getTeamLabelsForSpaces(java.util.Collection<Space> spaces)
spaces
- collection of spaces whose labels to get
@Deprecated java.util.List<? extends Labelable> getCurrentContentForLabel(Label label)
getContentForLabel(int, int, Label)
.
@Deprecated java.util.List<? extends Labelable> getContentForLabel(Label label, int maxResults)
getAllContentForLabel(int, int, Label)
.
@Deprecated java.util.List<? extends Labelable> getCurrentContentForLabelAndSpace(Label label, java.lang.String spaceKey)
getContentInSpaceForLabel(int, int, String, Label)
.
java.util.List<? extends Labelable> getCurrentContentWithPersonalLabel(java.lang.String username)
java.util.List<Space> getSpacesWithLabel(Label label)
label
-
java.util.List<Space> getFavouriteSpaces(java.lang.String username)
username
- username of label ownerjava.util.List getRecentlyUsedPersonalLabels(java.lang.String username)
username
- the user history from the session
java.util.List getRecentlyUsedPersonalLabels(java.lang.String username, int maxResults)
maxResults
- the maximum number of results to return to the userusername
- the user history from the session
java.util.List getRecentlyUsedPersonalLabellings(java.lang.String username, int maxResults)
@Deprecated java.util.List getContent(Label label)
getContentForLabel(int, int, Label)
that provides a specific return type.
int getContentCount(Label label)
Label createLabel(Label label)
@Deprecated java.util.List<? extends Labelable> getContentForAllLabels(java.util.Collection<Label> labels, int maxResults, int offset)
getContentForAllLabels(int, int, Label...)
instead.
PartialList<ContentEntityObject> getContentForLabel(int offset, int maxResults, Label label)
offset
- the offset into the resultsmaxResults
- the maximum number of results to returnlabel
- label which must appear on ContentEntityObjects
<T extends EditableLabelable> PartialList<T> getForLabel(java.lang.Class<T> labelableClass, int offset, int maxResults, Label label)
labelableClass
- the type of labelable to returnoffset
- the offset into the resultsmaxResults
- the maximum number of results to returnlabel
- label which must appear on labelables
<T extends EditableLabelable> PartialList<T> getForLabels(java.lang.Class<T> labelableClass, int offset, int maxResults, Label... labels)
labelableClass
- the type of labelable to returnoffset
- the offset into the resultsmaxResults
- the maximum number of results to returnlabels
- labels which must all appear on labelables
PartialList<EditableLabelable> getForLabels(int offset, int maxResults, Label... labels)
offset
- the offset into the resultsmaxResults
- the maximum number of results to returnlabels
- labels which must all appear on labelables
PartialList<ContentEntityObject> getContentForAllLabels(int offset, int maxResults, Label... labels)
offset
- the offset into the resultsmaxResults
- the maximum number of results to returnlabels
- labels which must appear on ContentEntityObjects
PartialList<ContentEntityObject> getContentInSpaceForLabel(int offset, int maxResults, java.lang.String spaceKey, Label label)
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
PartialList<ContentEntityObject> getContentInSpaceForAllLabels(int offset, int maxResults, java.lang.String spaceKey, Label... labels)
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
PartialList<ContentEntityObject> getContentInSpacesForAllLabels(int offset, int maxResults, java.util.Set<java.lang.String> spaceKeys, Label... labels)
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
PartialList<ContentEntityObject> getAllContentForLabel(int offset, int maxResults, Label label)
offset
- the offset into the resultsmaxResults
- the maximum number of results to returnlabel
- label which must appear on ContentEntityObjects
PartialList<ContentEntityObject> getAllContentForAllLabels(int offset, int maxResults, Label... labels)
offset
- the offset into the resultsmaxResults
- the maximum number of results to returnlabels
- labels which must appear on ContentEntityObjects
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |