|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.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)
LabelManager
labelManager.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 LabelManager
public void removeAllLabels(ContentEntityObject content)
LabelManager
removeAllLabels
in interface LabelManager
public Label getLabel(long id)
getLabel
in interface LabelManager
public java.util.List getSuggestedLabels(ContentEntityObject content)
LabelManager
getSuggestedLabels
in interface LabelManager
LabelManager.DEFAULT_LABEL_COUNT
public java.util.List getSuggestedLabels(ContentEntityObject content, int count)
LabelManager
getSuggestedLabels
in interface LabelManager
count
- is the maximum number of labels to be returned.
public java.util.List getSuggestedLabelsInSpace(ContentEntityObject content, java.lang.String spaceKey)
LabelManager
getSuggestedLabelsInSpace
in interface LabelManager
LabelManager.DEFAULT_LABEL_COUNT
public java.util.List getSuggestedLabelsInSpace(ContentEntityObject content, java.lang.String spaceKey, int maxResults)
LabelManager
getSuggestedLabelsInSpace
in interface LabelManager
maxResults
- is the maximum number of labels to be returned.
public java.util.List getRelatedLabels(Label label)
LabelManager
getRelatedLabels
in interface LabelManager
LabelManager.DEFAULT_LABEL_COUNT
public java.util.List getRelatedLabels(Label label, int count)
LabelManager
getRelatedLabels
in interface LabelManager
count
- 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 LabelManager
spaceKey
- - 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 LabelManager
LabelManager.DEFAULT_LABEL_COUNT
public java.util.List getRelatedLabelsInSpace(Label label, java.lang.String spaceKey, int maxResults)
LabelManager
getRelatedLabelsInSpace
in interface LabelManager
public java.util.List getSpacesContainingContentWithLabel(Label label)
LabelManager
getSpacesContainingContentWithLabel
in interface LabelManager
public java.util.List getUsersLabels(java.lang.String name)
LabelManager
getUsersLabels
in interface LabelManager
public java.util.List getTeamLabels()
LabelManager
getTeamLabels
in interface LabelManager
public java.util.List getTeamLabelsForSpace(java.lang.String spaceKey)
LabelManager
getTeamLabelsForSpace
in interface LabelManager
public java.util.List getRecentlyUsedLabelsInSpace(java.lang.String key)
LabelManager
getRecentlyUsedLabelsInSpace
in interface LabelManager
key
- 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 LabelManager
maxResults
- is the maximum number of labels to be returned.
public java.util.List getRecentlyUsedLabels(int maxResults)
LabelManager
getRecentlyUsedLabels
in interface LabelManager
maxResults
- is the maximum number of labels to be returned.
public java.util.List getRecentlyUsedLabels()
LabelManager
getRecentlyUsedLabels
in interface LabelManager
LabelManager.DEFAULT_LABEL_COUNT
public java.util.List getRecentlyUsedPersonalLabels(java.lang.String username)
LabelManager
getRecentlyUsedPersonalLabels
in interface LabelManager
username
- the user history from the session
public java.util.List getRecentlyUsedPersonalLabels(java.lang.String username, int maxResults)
LabelManager
getRecentlyUsedPersonalLabels
in interface LabelManager
username
- 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 LabelManager
public 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 LabelManager
labels
- 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 LabelManager
public java.util.List getCurrentContentWithPersonalLabel(java.lang.String username)
LabelManager
getCurrentContentWithPersonalLabel
in interface LabelManager
public java.util.List getSpacesWithLabel(Label label)
LabelManager
getSpacesWithLabel
in interface LabelManager
public boolean deleteLabel(long id)
LabelManager
deleteLabel
in interface LabelManager
public java.util.List getFavouriteSpaces(java.lang.String username)
getFavouriteSpaces
in interface LabelManager
username
- username of label ownerpublic boolean deleteLabel(Label label)
LabelManager
deleteLabel
in interface LabelManager
public Label getLabel(ParsedLabelName parsedLabelName)
LabelManager
getLabel
in interface LabelManager
for details on the format of the labelReference parameter.
public Label getLabel(java.lang.String unparsedLabelName)
LabelManager
getLabel
in interface LabelManager
unparsedLabelName
- - example - my:foopublic java.util.List getLabels(java.util.Collection unparsedLabelNames)
LabelManager
getLabels
in interface LabelManager
unparsedLabelNames
- - 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 LabelManager
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)
public java.util.List getLabelsInSpace(java.lang.String key)
LabelManager
getLabelsInSpace
in interface LabelManager
key
-
public java.util.List getMostPopularLabels()
LabelManager
getMostPopularLabels
in interface LabelManager
LabelManager.DEFAULT_LABEL_COUNT
,
LabelSearchResult
public java.util.List getMostPopularLabels(int count)
LabelManager
This function does not return the labels itself, but wrapped into a search result with a count!
getMostPopularLabels
in interface LabelManager
count
- is the maximum number of labels to be returned.
LabelSearchResult
public java.util.List getMostPopularLabelsInSpace(java.lang.String key)
LabelManager
This function does not return the labels itself, but wrapped into a search result with a count!
getMostPopularLabelsInSpace
in interface LabelManager
key
- the space key
LabelManager.DEFAULT_LABEL_COUNT
,
LabelSearchResult
public java.util.List getMostPopularLabelsInSpace(java.lang.String key, int count)
LabelManager
This function does not return the labels itself, but wrapped into a search result with a count!
getMostPopularLabelsInSpace
in interface LabelManager
key
- is the space keycount
- is the maximum number of labels to be returned.
LabelSearchResult
public java.util.Set getMostPopularLabelsWithRanks(java.util.Comparator comparator)
LabelManager
getMostPopularLabelsWithRanks
in interface LabelManager
LabelManager.DEFAULT_LABEL_COUNT
,
RankedLabelSearchResult
public java.util.Set getMostPopularLabelsWithRanks(int maxResults, java.util.Comparator comparator)
LabelManager
This function does not return the labels itself, but wrapped into a search result with a count!
getMostPopularLabelsWithRanks
in interface LabelManager
maxResults
- 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)
LabelManager
This function does not return the labels itself, but wrapped into a search result with a count!
getMostPopularLabelsWithRanksInSpace
in interface LabelManager
key
- is the space keymaxResults
- is the maximum number of labels to be returned.
RankedLabelSearchResult
public java.util.List getContent(Label label)
getContent
in interface LabelManager
public int getContentCount(Label label)
getContentCount
in interface LabelManager
public Label createLabel(Label label)
createLabel
in interface LabelManager
public 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 |