Class WikiItemHome
java.lang.Object
fr.paris.lutece.plugins.wiki.business.item.WikiItemHome
-
Method Summary
Modifier and TypeMethodDescriptionstatic AbstractWikiItemcreate(AbstractWikiItem wikiItem) Create a new wiki itemstatic Optional<AbstractWikiItem>findByCode(String strCode) Find a wiki item by its codestatic List<AbstractWikiItem>Bulk-loads wiki items matching the provided primary keys, in a single query.static Optional<AbstractWikiItem>findByPrimaryKey(int nKey) Find a wiki item by its primary keystatic List<AbstractWikiItem>getDescendants(int nRootId) Loads all descendants of the given root item using breadth-first bulk queries.static Map<Integer,List<AbstractWikiItem>> getDescendantsByParent(int nRootId) Loads all descendants of the given root item and returns them grouped by parent id.static List<AbstractWikiItem>getWikiItemsByParent(int nIdParent) Get all wiki items by parent idstatic List<AbstractWikiItem>getWikiItemsByParentAndType(int nIdParent, WikiItemType type) Get all wiki items by parent id and typestatic List<AbstractWikiItem>Get all wiki items by typestatic voidremove(int nKey) Remove a wiki item by its keystatic AbstractWikiItemupdate(AbstractWikiItem wikiItem) Update an existing wiki item
-
Method Details
-
create
Create a new wiki item- Parameters:
wikiItem- the wiki item to create- Returns:
- the created wiki item
-
update
Update an existing wiki item- Parameters:
wikiItem- the wiki item to update- Returns:
- the updated wiki item
-
remove
public static void remove(int nKey) Remove a wiki item by its key- Parameters:
nKey- the wiki item key
-
findByPrimaryKey
Find a wiki item by its primary key- Parameters:
nKey- the wiki item key- Returns:
- an Optional containing the wiki item if found, empty otherwise
-
getWikiItemsByType
Get all wiki items by type- Parameters:
type- the wiki item type- Returns:
- the list of wiki items matching the type
-
getWikiItemsByParent
Get all wiki items by parent id- Parameters:
nIdParent- the parent id- Returns:
- the list of wiki items having the specified parent
-
getWikiItemsByParentAndType
Get all wiki items by parent id and type- Parameters:
nIdParent- the parent idtype- the wiki item type- Returns:
- the list of wiki items matching the parent and type
-
findByCode
Find a wiki item by its code- Parameters:
strCode- the wiki item code- Returns:
- an Optional containing the wiki item if found, empty otherwise
-
findByIds
Bulk-loads wiki items matching the provided primary keys, in a single query.- Parameters:
listIds- the wiki item ids- Returns:
- the matching items (caches each result by id)
-
getDescendants
Loads all descendants of the given root item using breadth-first bulk queries. Returns a flat list of all descendants (excluding the root itself).- Parameters:
nRootId- the root item id- Returns:
- the flat list of all descendants
-
getDescendantsByParent
Loads all descendants of the given root item and returns them grouped by parent id.- Parameters:
nRootId- the root item id- Returns:
- a map of parent id to list of children
-