|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.atlassian.confluence.labels.DefaultLabelManager
public class DefaultLabelManager
Default implementation of the label manager interface. This implementation uses the LabelDao to access the label persistent store.
| Field Summary |
|---|
| Fields inherited from interface com.atlassian.confluence.labels.LabelManager |
|---|
CONTENT_TYPES, DEFAULT_LABEL_COUNT, FAVOURITE_LABEL, FAVOURITE_LABEL_YANKEE, LABEL_ADDED, LABEL_CREATED, LABEL_DELETED, LABEL_REMOVED, NO_CHANGE |
| Constructor Summary | |
|---|---|
DefaultLabelManager()
|
|
| Method Summary | |
|---|---|
int |
addLabel(ContentEntityObject content,
Label label)
Add a label to the specified content. |
Label |
createLabel(Label label)
|
boolean |
deleteLabel(Label label)
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 a label based on its 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 count)
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 count)
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 key)
Retrieve the DEFAULT_LABEL_COUNT most recently used labels within the specified space. |
java.util.List |
getRecentlyUsedLabelsInSpace(java.lang.String key,
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 count)
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 count)
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 |
getUsersLabels(java.lang.String name)
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 content,
Label label)
Remove a label from the specified content. |
void |
removeLabels(ContentEntityObject content,
java.util.List labels)
|
void |
setEventManager(com.atlassian.event.EventManager manager)
|
void |
setIndexer(ConfluenceIndexer indexer)
|
void |
setLabelDao(LabelDao dao)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultLabelManager()
| Method Detail |
|---|
public void setLabelDao(LabelDao dao)
public void setEventManager(com.atlassian.event.EventManager manager)
public void setIndexer(ConfluenceIndexer indexer)
public int addLabel(ContentEntityObject content,
Label label)
LabelManagerlabelManager.addLabel(page, new Label("name", "namespace", "owner"));
addLabel in interface LabelManager
public int removeLabel(ContentEntityObject content,
Label label)
LabelManager
removeLabel in interface LabelManager
public void removeLabels(ContentEntityObject content,
java.util.List labels)
removeLabels in interface LabelManagerpublic void removeAllLabels(ContentEntityObject content)
LabelManager
removeAllLabels in interface LabelManagerpublic Label getLabel(long id)
getLabel in interface LabelManagerpublic java.util.List getSuggestedLabels(ContentEntityObject content)
LabelManager
getSuggestedLabels in interface LabelManagerLabelManager.DEFAULT_LABEL_COUNT
public java.util.List getSuggestedLabels(ContentEntityObject content,
int count)
LabelManager
getSuggestedLabels in interface LabelManagercount - is the maximum number of labels to be returned.
public java.util.List getSuggestedLabelsInSpace(ContentEntityObject content,
java.lang.String spaceKey)
LabelManager
getSuggestedLabelsInSpace in interface LabelManagerLabelManager.DEFAULT_LABEL_COUNT
public java.util.List getSuggestedLabelsInSpace(ContentEntityObject content,
java.lang.String spaceKey,
int maxResults)
LabelManager
getSuggestedLabelsInSpace in interface LabelManagermaxResults - is the maximum number of labels to be returned.
public java.util.List getRelatedLabels(Label label)
LabelManager
getRelatedLabels in interface LabelManagerLabelManager.DEFAULT_LABEL_COUNT
public java.util.List getRelatedLabels(Label label,
int count)
LabelManager
getRelatedLabels in interface LabelManagercount - is the maximum number of labels to be returned.
public java.util.List getRelatedLabels(java.util.List labels,
java.lang.String spaceKey,
int maxResultsPerLabel)
LabelManager
getRelatedLabels in interface LabelManagerspaceKey - - may be null to search globallymaxResultsPerLabel - is the maximum number of labels to be returned for each label.
public java.util.List getRelatedLabelsInSpace(Label label,
java.lang.String spaceKey)
LabelManager
getRelatedLabelsInSpace in interface LabelManagerLabelManager.DEFAULT_LABEL_COUNT
public java.util.List getRelatedLabelsInSpace(Label label,
java.lang.String spaceKey,
int maxResults)
LabelManager
getRelatedLabelsInSpace in interface LabelManagerpublic java.util.List getSpacesContainingContentWithLabel(Label label)
LabelManager
getSpacesContainingContentWithLabel in interface LabelManagerpublic java.util.List getUsersLabels(java.lang.String name)
LabelManager
getUsersLabels in interface LabelManagerpublic java.util.List getTeamLabels()
LabelManager
getTeamLabels in interface LabelManagerpublic java.util.List getTeamLabelsForSpace(java.lang.String spaceKey)
LabelManager
getTeamLabelsForSpace in interface LabelManagerpublic java.util.List getRecentlyUsedLabelsInSpace(java.lang.String key)
LabelManager
getRecentlyUsedLabelsInSpace in interface LabelManagerkey - identifies the space to which the results are restricted.
LabelManager.DEFAULT_LABEL_COUNT
public java.util.List getRecentlyUsedLabelsInSpace(java.lang.String key,
int maxResults)
LabelManager
getRecentlyUsedLabelsInSpace in interface LabelManagermaxResults - is the maximum number of labels to be returned.
public java.util.List getRecentlyUsedLabels(int maxResults)
LabelManager
getRecentlyUsedLabels in interface LabelManagermaxResults - is the maximum number of labels to be returned.
public java.util.List getRecentlyUsedLabels()
LabelManager
getRecentlyUsedLabels in interface LabelManagerLabelManager.DEFAULT_LABEL_COUNTpublic java.util.List getRecentlyUsedPersonalLabels(java.lang.String username)
LabelManager
getRecentlyUsedPersonalLabels in interface LabelManagerusername - the user history from the session
public java.util.List getRecentlyUsedPersonalLabels(java.lang.String username,
int maxResults)
LabelManager
getRecentlyUsedPersonalLabels in interface LabelManagerusername - the user history from the sessionmaxResults - the maximum number of results to return to the user
public java.util.List getRecentlyUsedPersonalLabellings(java.lang.String username,
int maxResults)
getRecentlyUsedPersonalLabellings in interface LabelManagerpublic java.util.List getCurrentContentForLabel(Label label)
LabelManager
getCurrentContentForLabel in interface LabelManager
public java.util.List<ContentEntityObject> getContentForAllLabels(java.util.Collection<Label> labels,
int maxResults,
int offset)
LabelManager
getContentForAllLabels in interface LabelManagerlabels - labels which must appear on ContentEntityObjectsmaxResults - the maximum number of results to returnoffset - the offset into the results
public java.util.List<ContentEntityObject> getContentForLabel(Label label,
int maxResults)
LabelManager
getContentForLabel in interface LabelManager
public java.util.List getCurrentContentForLabelAndSpace(Label label,
java.lang.String spaceKey)
LabelManager
getCurrentContentForLabelAndSpace in interface LabelManagerpublic java.util.List getCurrentContentWithPersonalLabel(java.lang.String username)
LabelManager
getCurrentContentWithPersonalLabel in interface LabelManagerpublic java.util.List getSpacesWithLabel(Label label)
LabelManager
getSpacesWithLabel in interface LabelManagerpublic boolean deleteLabel(long id)
LabelManager
deleteLabel in interface LabelManagerpublic java.util.List getFavouriteSpaces(java.lang.String username)
getFavouriteSpaces in interface LabelManagerusername - username of label ownerpublic boolean deleteLabel(Label label)
LabelManager
deleteLabel in interface LabelManagerpublic Label getLabel(ParsedLabelName parsedLabelName)
LabelManager
getLabel in interface LabelManagerfor details on the format of the labelReference parameter.public Label getLabel(java.lang.String unparsedLabelName)
LabelManager
getLabel in interface LabelManagerunparsedLabelName - - example - my:foopublic java.util.List getLabels(java.util.Collection unparsedLabelNames)
LabelManager
getLabels in interface LabelManagerunparsedLabelNames - - example - my:foo, barpublic Label getLabel(Label label)
LabelManager
getLabel in interface LabelManager
public java.util.List getLabelsByDetail(java.lang.String labelName,
java.lang.String namespace,
java.lang.String spaceKey,
java.lang.String owner)
LabelManager
getLabelsByDetail in interface LabelManagerlabelName - 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)
public java.util.List getLabelsInSpace(java.lang.String key)
LabelManager
getLabelsInSpace in interface LabelManagerkey -
public java.util.List getMostPopularLabels()
LabelManager
getMostPopularLabels in interface LabelManagerLabelManager.DEFAULT_LABEL_COUNT,
LabelSearchResultpublic java.util.List getMostPopularLabels(int count)
LabelManagerThis function does not return the labels itself, but wrapped into a search result with a count!
getMostPopularLabels in interface LabelManagercount - is the maximum number of labels to be returned.
LabelSearchResultpublic java.util.List getMostPopularLabelsInSpace(java.lang.String key)
LabelManagerThis function does not return the labels itself, but wrapped into a search result with a count!
getMostPopularLabelsInSpace in interface LabelManagerkey - the space key
LabelManager.DEFAULT_LABEL_COUNT,
LabelSearchResult
public java.util.List getMostPopularLabelsInSpace(java.lang.String key,
int count)
LabelManagerThis function does not return the labels itself, but wrapped into a search result with a count!
getMostPopularLabelsInSpace in interface LabelManagerkey - is the space keycount - is the maximum number of labels to be returned.
LabelSearchResultpublic java.util.Set getMostPopularLabelsWithRanks(java.util.Comparator comparator)
LabelManager
getMostPopularLabelsWithRanks in interface LabelManagerLabelManager.DEFAULT_LABEL_COUNT,
RankedLabelSearchResult
public java.util.Set getMostPopularLabelsWithRanks(int maxResults,
java.util.Comparator comparator)
LabelManagerThis function does not return the labels itself, but wrapped into a search result with a count!
getMostPopularLabelsWithRanks in interface LabelManagermaxResults - is the maximum number of labels to be returned.
RankedLabelSearchResult
public java.util.Set getMostPopularLabelsWithRanksInSpace(java.lang.String key,
int maxResults,
java.util.Comparator comparator)
LabelManagerThis function does not return the labels itself, but wrapped into a search result with a count!
getMostPopularLabelsWithRanksInSpace in interface LabelManagerkey - is the space keymaxResults - is the maximum number of labels to be returned.
RankedLabelSearchResultpublic java.util.List getContent(Label label)
getContent in interface LabelManagerpublic int getContentCount(Label label)
getContentCount in interface LabelManagerpublic Label createLabel(Label label)
createLabel in interface LabelManagerpublic java.util.List getRecentlyUsedLabellings(int maxResults)
getRecentlyUsedLabellings in interface LabelManager
public java.util.List getRecentlyUsedLabellingsInSpace(java.lang.String spaceKey,
int maxResults)
getRecentlyUsedLabellingsInSpace in interface LabelManager
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||