|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.atlassian.confluence.pages.ContentTree
public class ContentTree
A graph of ContentNode
s. Its purpose is to store a hierarchy of pages (maybe a subset
of the full tree) that a user can see after applying permission checks. This saves us from having to repeat
permission checks every time we need to display or walk the page hierarchy.
Constructor Summary | |
---|---|
ContentTree()
|
|
ContentTree(ContentNode rootNode)
Create a ContentTree with only a single root nodel |
|
ContentTree(java.util.List<ContentNode> rootContentNodes)
|
Method Summary | |
---|---|
void |
addRootNode(ContentNode contentNode)
|
boolean |
equals(java.lang.Object obj)
|
void |
filter(java.util.List<java.lang.String> ids)
Remove all nodes in this tree whose id does not match the list passed in |
void |
filter(java.util.Set<java.lang.Long> includedIds,
java.util.Set<java.lang.Long> excludedIds)
Filters the tree according to included and excluded ids of content nodes. |
java.util.List<ContentNode> |
getAllContentNodes()
|
Page |
getPage(long pageId)
|
java.util.List<Page> |
getPages()
|
java.util.List<ContentNode> |
getRootNodes()
|
int |
hashCode()
|
boolean |
isRootNode(ContentNode node)
|
void |
removeNode(ContentNode contentNode)
|
int |
size()
|
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ContentTree()
public ContentTree(ContentNode rootNode)
rootNode
- the only root node in this content treepublic ContentTree(java.util.List<ContentNode> rootContentNodes)
Method Detail |
---|
public java.util.List<ContentNode> getRootNodes()
public boolean isRootNode(ContentNode node)
public void filter(java.util.List<java.lang.String> ids)
ids
- List of String representations of the ids of pagespublic void filter(java.util.Set<java.lang.Long> includedIds, java.util.Set<java.lang.Long> excludedIds)
Any nodes included whose immediate parents are not included are moved to the root.
Any root nodes not mentioned at all are excluded.
If we were to make this handle hidden pages too then we'd add an extra rule:
includedIds
- ids of pages to include (including their descendants except where exclusions apply)excludedIds
- ids of pages to exclude (their descendants are also excluded except where more specific inclusions apply)public void addRootNode(ContentNode contentNode)
public void removeNode(ContentNode contentNode)
public java.util.List<ContentNode> getAllContentNodes()
public Page getPage(long pageId)
pageId
- the id of the required page
public java.util.List<Page> getPages()
public int size()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |