Package org.exoplatform.wiki.service
Interface DataStorage
- All Known Implementing Classes:
JPADataStorage
public interface DataStorage
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttachmentToPage(Attachment attachment, Page page) voidaddPageVersion(Page page, String userName) voidaddRelatedPage(Page page, Page relatedPage) voidaddWatcherToPage(String username, Page page) createDraftPageForUser(DraftPage draftPage, String username) Creates a new draft notecreatePage(Wiki wiki, Page parentPage, Page page) createWiki(Wiki wiki) voiddeleteAttachmentOfPage(String attachmentId, Page page) voidDeletes a draft note by its technical id.voiddeleteDraftByName(String newDraftPageName) voiddeleteDraftOfPage(Page page) voiddeleteDraftOfPage(Page page, String lang) voiddeleteOrphanDraftPagesByParentPage(long parentPageId) Remove all children drafts of a parent page without existing targetvoiddeletePage(String wikiType, String wikiOwner, String pageId) voiddeleteVersionsByNoteIdAndLang(Long noteId, String lang) Deletes a list of versions of note by language.voiddeleteWatcherOfPage(String username, Page page) getAttachmentsOfPage(Page page) default List<Attachment> getAttachmentsOfPage(Page page, boolean loadContent) getChildrenPageOf(Page page, boolean withDrafts) Get children notes and draft notes of pagegetDraft(WikiPageParams param) getDraftsOfPage(Long pageId) getExsitedOrNewDraftPageById(String wikiType, String wikiOwner, String pageId, String username) getHelpSyntaxPage(String syntaxId, boolean fullContent, List<org.exoplatform.container.xml.ValuesParam> syntaxHelpParams, org.exoplatform.container.configuration.ConfigurationManager configurationManager) getHistoryOfPage(Page page) getLatestDraftOfPage(Page targetPage) Returns latest draft of given page.getLatestDraftPageByTargetPageAndLang(Long targetPageId, String lang) Retrieves latest draft of a specific page by target page id and content languageRetrieves list of available translations languages of a pagegetPageById(String id) Get a wiki page by its unique idgetPageHistoryVersionsByPageIdAndLang(Long pageId, String lang) Retrieves list of page versions by page id and langgetPageOfWikiByName(String wikiType, String wikiOwner, String pageName) Get a wiki page by its unique name in the wikigetPagesOfWiki(String wikiType, String wikiOwner) Retrieve the all pages contained in wikigetParentPageOf(Page page) getPreviousNamesOfPage(Page page) getPublishedVersionByPageIdAndLang(Long pageId, String lang) Retrieves the published note page version by its id and content languagegetRelatedPage(String wikiType, String wikiOwner, String pageId) getRelatedPagesOfPage(Page page) getVersionsOfPage(Page page) getWatchersOfPage(Page page) getWikiByTypeAndOwner(String wikiType, String owner) getWikiPermission(String wikiType, String wikiOwner) getWikisByType(String wikiType) booleanhasAdminPagePermission(String wikiType, String owner, org.exoplatform.services.security.Identity user) booleanhasAdminSpacePermission(String wikiType, String owner, org.exoplatform.services.security.Identity user) booleanhasChildren(long noteId) booleanhasPermissionOnPage(Page page, PermissionType permissionType, org.exoplatform.services.security.Identity user) Check if the identity has the given permission type on a pagebooleanhasPermissionOnWiki(Wiki wiki, PermissionType permissionType, org.exoplatform.services.security.Identity identity) Check if the identity has the given permission type on a wikivoidmovePage(WikiPageParams currentLocationParams, WikiPageParams newLocationParams) voidremoveRelatedPage(Page page, Page relatedPage) voidvoidrestoreVersionOfPage(String versionName, Page page) org.exoplatform.commons.utils.PageList<SearchResult> search(WikiSearchData data) updateDraftPageForUser(DraftPage draftPage, String username) Updates a draft noteupdatePage(Page page) voidupdateWikiPermission(String wikiType, String wikiOwner, List<PermissionEntry> permissionEntries)
-
Method Details
-
getWikiByTypeAndOwner
- Throws:
WikiException
-
getWikisByType
- Throws:
WikiException
-
createWiki
- Throws:
WikiException
-
createPage
- Throws:
WikiException
-
getPageOfWikiByName
Get a wiki page by its unique name in the wiki- Parameters:
wikiType- The wiki typewikiOwner- The wiki ownerpageName- The unique name of the page in the wiki- Returns:
- The wiki page
- Throws:
WikiException- if an error occured
-
getPageById
Get a wiki page by its unique id- Parameters:
id- The unique id of wiki page- Returns:
- The wiki page
- Throws:
WikiException- if an error occured
-
getDraftPageById
- Throws:
WikiException
-
getParentPageOf
- Throws:
WikiException
-
getChildrenPageOf
Get children notes and draft notes of page- Parameters:
page- the target page to retrieve its childrenwithDrafts- if set to true returns the children notes and draft notes- Returns:
- children notes of page
- Throws:
WikiException
-
hasChildren
- Throws:
WikiException
-
deletePage
- Throws:
WikiException
-
deleteDraftOfPage
- Throws:
WikiException
-
deleteDraftOfPage
- Throws:
WikiException
-
deleteDraftById
Deletes a draft note by its technical id.- Parameters:
id- Id of the draft note.- Throws:
WikiException- if an error occured
-
deleteDraftByName
- Throws:
WikiException
-
renamePage
void renamePage(String wikiType, String wikiOwner, String pageName, String newName, String newTitle) throws WikiException - Throws:
WikiException
-
movePage
void movePage(WikiPageParams currentLocationParams, WikiPageParams newLocationParams) throws WikiException - Throws:
WikiException
-
getWikiPermission
- Throws:
WikiException
-
updateWikiPermission
void updateWikiPermission(String wikiType, String wikiOwner, List<PermissionEntry> permissionEntries) throws WikiException - Throws:
WikiException
-
getRelatedPagesOfPage
- Throws:
WikiException
-
getRelatedPage
- Throws:
WikiException
-
addRelatedPage
- Throws:
WikiException
-
removeRelatedPage
- Throws:
WikiException
-
getExsitedOrNewDraftPageById
Page getExsitedOrNewDraftPageById(String wikiType, String wikiOwner, String pageId, String username) throws WikiException - Throws:
WikiException
-
getDraftsOfPage
- Throws:
WikiException
-
getDraft
- Throws:
WikiException
-
getLatestDraftOfPage
Returns latest draft of given page.- Parameters:
targetPage-- Returns:
- latest draft of the given target page
- Throws:
WikiException
-
createDraftPageForUser
Creates a new draft note- Parameters:
draftPage- The draft note to be createdusername- Author name- Returns:
- Created draft note
- Throws:
WikiException
-
updateDraftPageForUser
Updates a draft note- Parameters:
draftPage- The draft note to be updatedusername-- Returns:
- Updated draft note
- Throws:
WikiException
-
search
org.exoplatform.commons.utils.PageList<SearchResult> search(WikiSearchData data) throws WikiException - Throws:
WikiException
-
searchTemplate
- Throws:
WikiException
-
getAttachmentsOfPage
- Throws:
WikiException
-
getAttachmentsOfPage
- Throws:
WikiException
-
addAttachmentToPage
- Throws:
WikiException
-
deleteAttachmentOfPage
- Throws:
WikiException
-
getHelpSyntaxPage
Page getHelpSyntaxPage(String syntaxId, boolean fullContent, List<org.exoplatform.container.xml.ValuesParam> syntaxHelpParams, org.exoplatform.container.configuration.ConfigurationManager configurationManager) throws WikiException - Throws:
WikiException
-
hasPermissionOnPage
boolean hasPermissionOnPage(Page page, PermissionType permissionType, org.exoplatform.services.security.Identity user) throws WikiException Check if the identity has the given permission type on a page- Parameters:
page- PagepermissionType- Permission type to checkuser- Identity of the user- Returns:
- true if the user has the given permission type on the page
- Throws:
WikiException- if an error occured
-
hasPermissionOnWiki
boolean hasPermissionOnWiki(Wiki wiki, PermissionType permissionType, org.exoplatform.services.security.Identity identity) throws WikiException Check if the identity has the given permission type on a wiki- Parameters:
wiki- WikipermissionType- Permission type to checkidentity- Identity of the user- Returns:
- true if the user has the given permission type on the wiki
- Throws:
WikiException- if an error occured
-
hasAdminSpacePermission
boolean hasAdminSpacePermission(String wikiType, String owner, org.exoplatform.services.security.Identity user) throws WikiException - Throws:
WikiException
-
hasAdminPagePermission
boolean hasAdminPagePermission(String wikiType, String owner, org.exoplatform.services.security.Identity user) throws WikiException - Throws:
WikiException
-
getVersionsOfPage
- Throws:
WikiException
-
getHistoryOfPage
- Throws:
WikiException
-
addPageVersion
- Throws:
WikiException
-
restoreVersionOfPage
- Throws:
WikiException
-
updatePage
- Throws:
WikiException
-
getPreviousNamesOfPage
- Throws:
WikiException
-
getWatchersOfPage
- Throws:
WikiException
-
addWatcherToPage
- Throws:
WikiException
-
deleteWatcherOfPage
- Throws:
WikiException
-
getPagesOfWiki
Retrieve the all pages contained in wiki- Parameters:
wikiType- the wiki typewikiOwner- the wiki owner- Returns:
- the List pf pages of the wiki
-
getPageHistoryVersionsByPageIdAndLang
Retrieves list of page versions by page id and lang- Parameters:
pageId- page idlang- content language- Returns:
ListofPageHistory
-
getLatestDraftPageByTargetPageAndLang
Retrieves latest draft of a specific page by target page id and content language- Parameters:
targetPageId- target page idlang- content language- Returns:
DraftPage
-
getPublishedVersionByPageIdAndLang
Retrieves the published note page version by its id and content language- Parameters:
pageId- page idlang- content language- Returns:
PageVersion
-
getPageAvailableTranslationLanguages
Retrieves list of available translations languages of a page -
deleteVersionsByNoteIdAndLang
Deletes a list of versions of note by language.- Parameters:
noteId- Id of the note.lang- language.- Throws:
WikiException- if an error occured
-
deleteOrphanDraftPagesByParentPage
void deleteOrphanDraftPagesByParentPage(long parentPageId) Remove all children drafts of a parent page without existing target- Parameters:
parentPageId- Note parent page id
-