|
||||||||||
| 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 |
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. |
| Method Summary | |
|---|---|
int |
addLabel(ContentEntityObject 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. |
java.util.List |
getContent(Label label)
|
int |
getContentCount(Label label)
|
java.util.List<ContentEntityObject> |
getContentForAllLabels(java.util.Collection<Label> labels,
int maxResults,
int offset)
Retrieve all ContentEntityObjects which are labelled with ALL provided labels. |
java.util.List<ContentEntityObject> |
getContentForLabel(Label label,
int maxResults)
Get all content associated with a label Get all versions of content associated with a label and any space. |
java.util.List |
getCurrentContentForLabel(Label label)
Get all content associated with a label and space Get all current content associated with a label and any space. |
java.util.List |
getCurrentContentForLabelAndSpace(Label label,
java.lang.String spaceKey)
Get all current content associated with a label and space. |
java.util.List |
getCurrentContentWithPersonalLabel(java.lang.String username)
Get all current content labelled by a user |
java.util.List |
getFavouriteSpaces(java.lang.String username)
|
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 |
java.util.List |
getLabels(java.util.Collection 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 |
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 |
getRelatedLabels(Label label)
Retrieve the DEFAULT_LABEL_COUNT labels that are 'related' to the specified label. |
java.util.List |
getRelatedLabels(Label label,
int maxResults)
Retrieve the labels that are 'related' to the specified label. |
java.util.List |
getRelatedLabels(java.util.List labels,
java.lang.String spaceKey,
int maxResultsPerLabel)
Retrieve the labels that are 'related' to the labels in the list. |
java.util.List |
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 |
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 |
getSpacesWithLabel(Label label)
Spaces cannot be directly labelled. |
java.util.List |
getSuggestedLabels(ContentEntityObject content)
Retrieve the DEFAULT_LABEL_COUNT suggested labels for the specified content. |
java.util.List |
getSuggestedLabels(ContentEntityObject content,
int maxResults)
Retrieve the suggested labels for the specified content. |
java.util.List |
getSuggestedLabelsInSpace(ContentEntityObject content,
java.lang.String spaceKey)
Retrieve the DEFAULT_LABEL_COUNT suggested labels for the specified content bound to the specified space. |
java.util.List |
getSuggestedLabelsInSpace(ContentEntityObject 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 content)
Remove all of the labels from the specified content. |
int |
removeLabel(ContentEntityObject object,
Label label)
Remove a label from the specified content. |
void |
removeLabels(ContentEntityObject object,
java.util.List labels)
|
| Field Detail |
|---|
static final java.util.List 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 Values| Method Detail |
|---|
int addLabel(ContentEntityObject content,
Label label)
labelManager.addLabel(page, new Label("name", "namespace", "owner"));
content - label -
int removeLabel(ContentEntityObject object,
Label label)
object - label -
void removeLabels(ContentEntityObject object,
java.util.List labels)
void removeAllLabels(ContentEntityObject content)
content - 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 getLabels(java.util.Collection unparsedLabelNames)
unparsedLabelNames - - example - my:foo, barLabel getLabel(Label label)
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,
LabelSearchResultjava.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.
LabelSearchResultjava.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.
LabelSearchResultjava.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.
RankedLabelSearchResultjava.util.List getRecentlyUsedLabels()
DEFAULT_LABEL_COUNTjava.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(ContentEntityObject content)
content -
DEFAULT_LABEL_COUNT
java.util.List getSuggestedLabels(ContentEntityObject content,
int maxResults)
maxResults - is the maximum number of labels to be returned.
java.util.List getSuggestedLabelsInSpace(ContentEntityObject content,
java.lang.String spaceKey)
content - spaceKey -
DEFAULT_LABEL_COUNT
java.util.List getSuggestedLabelsInSpace(ContentEntityObject content,
java.lang.String spaceKey,
int maxResults)
content - spaceKey - maxResults - is the maximum number of labels to be returned.
java.util.List getRelatedLabels(Label label)
label -
DEFAULT_LABEL_COUNT
java.util.List getRelatedLabels(Label label,
int maxResults)
maxResults - is the maximum number of labels to be returned.
java.util.List getRelatedLabels(java.util.List 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 getRelatedLabelsInSpace(Label label,
java.lang.String spaceKey)
label - spaceKey -
DEFAULT_LABEL_COUNT
java.util.List 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
java.util.List getCurrentContentForLabel(Label label)
java.util.List<ContentEntityObject> getContentForLabel(Label label,
int maxResults)
java.util.List getCurrentContentForLabelAndSpace(Label label,
java.lang.String spaceKey)
java.util.List getCurrentContentWithPersonalLabel(java.lang.String username)
java.util.List getSpacesWithLabel(Label label)
label -
java.util.List 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)
java.util.List getContent(Label label)
int getContentCount(Label label)
Label createLabel(Label label)
java.util.List<ContentEntityObject> getContentForAllLabels(java.util.Collection<Label> labels,
int maxResults,
int offset)
labels - labels which must appear on ContentEntityObjectsmaxResults - the maximum number of results to returnoffset - the offset into the results
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||