|
||||||||||
| 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 List |
CONTENT_TYPES
Content Types that can have a label applied. |
static int |
DEFAULT_LABEL_COUNT
|
static String |
FAVOURITE_LABEL
|
static 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. |
List |
getContent(Label label)
|
int |
getContentCount(Label label)
|
List<ContentEntityObject> |
getContentForAllLabels(Collection<Label> labels,
int maxResults,
int offset)
Retrieve all ContentEntityObjects which are labelled with ALL provided labels. |
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. |
List |
getCurrentContentForLabel(Label label)
Get all content associated with a label and space Get all current content associated with a label and any space. |
List |
getCurrentContentForLabelAndSpace(Label label,
String spaceKey)
Get all current content associated with a label and space. |
List |
getCurrentContentWithPersonalLabel(String username)
Get all current content labelled by a user |
List |
getFavouriteSpaces(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(String unparsedLabelName)
convenience method to fetch a label without having to call the label parser |
List |
getLabels(Collection unparsedLabelNames)
convenience method to fetch labels without having to call the label parser |
List |
getLabelsByDetail(String labelName,
String namespace,
String spaceKey,
String owner)
Retrieves the labels matching the given labelName, namespace or owner |
List |
getLabelsInSpace(String key)
Retrieve all of the labels that label content within the specified space. |
List |
getMostPopularLabels()
Retrieve the list of the DEFAULT_LABEL_COUNT most popular labels within the system. |
List |
getMostPopularLabels(int maxResults)
Retrieve the most popular labels within the system. |
List |
getMostPopularLabelsInSpace(String key)
Retrieve the list of the DEFAULT_LABEL_COUNT most used labels in the specific space, ordered from most popular to least popular. |
List |
getMostPopularLabelsInSpace(String key,
int maxResults)
Retrieve a list of the 'n' most used labels in the specified space, ordered from most popular to least popular. |
Set |
getMostPopularLabelsWithRanks(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. |
Set |
getMostPopularLabelsWithRanks(int maxResults,
Comparator comparator)
Retrieve the most popular labels within the system, including their ranks and ordered using the comparator provided. |
Set |
getMostPopularLabelsWithRanksInSpace(String key,
int maxResults,
Comparator comparator)
Retrieve a set of the 'n' most used labels in the specified space, ordered using the compartor given. |
List |
getRecentlyUsedLabellings(int maxResults)
|
List |
getRecentlyUsedLabellingsInSpace(String spaceKey,
int maxResults)
|
List |
getRecentlyUsedLabels()
Retrieve the DEFAULT_LABEL_COUNT most recently used labels within the system. |
List |
getRecentlyUsedLabels(int maxResults)
Retrieve the x most recently used labels. |
List |
getRecentlyUsedLabelsInSpace(String spaceKey)
Retrieve the DEFAULT_LABEL_COUNT most recently used labels within the specified space. |
List |
getRecentlyUsedLabelsInSpace(String spaceKey,
int maxResults)
Retrieve the most recently used labels within the specified spae. |
List |
getRecentlyUsedPersonalLabellings(String username,
int maxResults)
|
List |
getRecentlyUsedPersonalLabels(String username)
Retrieve the labels that were recently used by currently authenticated user. |
List |
getRecentlyUsedPersonalLabels(String username,
int maxResults)
Retrieve the labels that were recently used by currently authenticated user. |
List |
getRelatedLabels(Label label)
Retrieve the DEFAULT_LABEL_COUNT labels that are 'related' to the specified label. |
List |
getRelatedLabels(Label label,
int maxResults)
Retrieve the labels that are 'related' to the specified label. |
List |
getRelatedLabels(List labels,
String spaceKey,
int maxResultsPerLabel)
Retrieve the labels that are 'related' to the labels in the list. |
List |
getRelatedLabelsInSpace(Label label,
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. |
List |
getRelatedLabelsInSpace(Label label,
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. |
List |
getSpacesContainingContentWithLabel(Label label)
Look up the spaces that have been labelled by the specific label. |
List |
getSpacesWithLabel(Label label)
Spaces cannot be directly labelled. |
List |
getSuggestedLabels(ContentEntityObject content)
Retrieve the DEFAULT_LABEL_COUNT suggested labels for the specified content. |
List |
getSuggestedLabels(ContentEntityObject content,
int maxResults)
Retrieve the suggested labels for the specified content. |
List |
getSuggestedLabelsInSpace(ContentEntityObject content,
String spaceKey)
Retrieve the DEFAULT_LABEL_COUNT suggested labels for the specified content bound to the specified space. |
List |
getSuggestedLabelsInSpace(ContentEntityObject content,
String spaceKey,
int maxResults)
Retrieve the suggested labels for the specified content bound to the specified space. |
List |
getTeamLabels()
Retrieve all of the team labels in the system. |
List |
getTeamLabelsForSpace(String spaceKey)
Retrieve all of the team labels used to label content in the specified space. |
List<Label> |
getTeamLabelsForSpaces(Collection<Space> spaces)
Retrieve all of the team labels used to label content in the specified spaces. |
List |
getUsersLabels(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,
List labels)
|
| Field Detail |
|---|
static final List CONTENT_TYPES
static final String FAVOURITE_LABEL
static final 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,
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(String unparsedLabelName)
unparsedLabelName - - example - my:fooList getLabels(Collection unparsedLabelNames)
unparsedLabelNames - - example - my:foo, barLabel getLabel(Label label)
label -
List getLabelsByDetail(String labelName,
String namespace,
String spaceKey,
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)
List getLabelsInSpace(String key)
key - identifying the space to be queried.
List getMostPopularLabels()
DEFAULT_LABEL_COUNT,
LabelSearchResultList 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.
LabelSearchResultList getMostPopularLabelsInSpace(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
List getMostPopularLabelsInSpace(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.
LabelSearchResultSet getMostPopularLabelsWithRanks(Comparator comparator)
DEFAULT_LABEL_COUNT,
RankedLabelSearchResult
Set getMostPopularLabelsWithRanks(int maxResults,
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
Set getMostPopularLabelsWithRanksInSpace(String key,
int maxResults,
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.
RankedLabelSearchResultList getRecentlyUsedLabels()
DEFAULT_LABEL_COUNTList getRecentlyUsedLabels(int maxResults)
maxResults - is the maximum number of labels to be returned.
List getRecentlyUsedLabellings(int maxResults)
List getRecentlyUsedLabelsInSpace(String spaceKey)
spaceKey - identifies the space to which the results are restricted.
DEFAULT_LABEL_COUNT
List getRecentlyUsedLabelsInSpace(String spaceKey,
int maxResults)
spaceKey - maxResults - is the maximum number of labels to be returned.
List getRecentlyUsedLabellingsInSpace(String spaceKey,
int maxResults)
List getSuggestedLabels(ContentEntityObject content)
content -
DEFAULT_LABEL_COUNT
List getSuggestedLabels(ContentEntityObject content,
int maxResults)
maxResults - is the maximum number of labels to be returned.
List getSuggestedLabelsInSpace(ContentEntityObject content,
String spaceKey)
content - spaceKey -
DEFAULT_LABEL_COUNT
List getSuggestedLabelsInSpace(ContentEntityObject content,
String spaceKey,
int maxResults)
content - spaceKey - maxResults - is the maximum number of labels to be returned.
List getRelatedLabels(Label label)
label -
DEFAULT_LABEL_COUNT
List getRelatedLabels(Label label,
int maxResults)
maxResults - is the maximum number of labels to be returned.
List getRelatedLabels(List labels,
String spaceKey,
int maxResultsPerLabel)
spaceKey - - may be null to search globallymaxResultsPerLabel - is the maximum number of labels to be returned for each label.
List getRelatedLabelsInSpace(Label label,
String spaceKey)
label - spaceKey -
DEFAULT_LABEL_COUNT
List getRelatedLabelsInSpace(Label label,
String spaceKey,
int maxResults)
label - spaceKey - maxResults -
List getSpacesContainingContentWithLabel(Label label)
label -
List getUsersLabels(String owner)
owner - List getTeamLabels()
List getTeamLabelsForSpace(String spaceKey)
spaceKey -
List<Label> getTeamLabelsForSpaces(Collection<Space> spaces)
spaces - collection of spaces whose labels to get
List getCurrentContentForLabel(Label label)
List<ContentEntityObject> getContentForLabel(Label label,
int maxResults)
List getCurrentContentForLabelAndSpace(Label label,
String spaceKey)
List getCurrentContentWithPersonalLabel(String username)
List getSpacesWithLabel(Label label)
label -
List getFavouriteSpaces(String username)
username - username of label ownerList getRecentlyUsedPersonalLabels(String username)
username - the user history from the session
List getRecentlyUsedPersonalLabels(String username,
int maxResults)
maxResults - the maximum number of results to return to the userusername - the user history from the session
List getRecentlyUsedPersonalLabellings(String username,
int maxResults)
List getContent(Label label)
int getContentCount(Label label)
Label createLabel(Label label)
List<ContentEntityObject> getContentForAllLabels(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 | |||||||||