Package org.exoplatform.wiki.service
Interface DataStorage
- All Known Implementing Classes:
JPADataStorage
public interface DataStorage
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttachmentToPage(Attachment attachment, Page page) addPageVersion(Page page, String userName) Creates a new page versionvoidaddRelatedPage(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) voiddeleteAttachmentsOfDraftPage(DraftPage draftPage) Delete attachments of target draft pagevoidDeletes 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, boolean withChild) Get children notes and draft notes of pagegetDraft(WikiPageParams param) getDraftOfPageByLang(Page page, String lang) getDraftsOfPage(Long pageId) getDraftsOfWiki(String wikiOwner, String wikiType) Gets draft pages of a given wikigetExsitedOrNewDraftPageById(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 wikigetPageVersionById(long versionId) Gets page version by its given idgetParentPageOf(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) Check if the given note page has children or notbooleanhasDrafts(long noteId) Check if the given note page has drafts or notbooleanhasPermissionOnPage(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) voidrestoreVersionOfPage(String versionName, Page page) Restore a note from given versionorg.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
-
getDraftOfPageByLang
- 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,withChild- Check if note has child- Returns:
- children notes of page
- Throws:
WikiException
-
hasChildren
boolean hasChildren(long noteId) Check if the given note page has children or not- Parameters:
noteId- note page id- Returns:
- true if the given note page has children and false if not
-
hasDrafts
boolean hasDrafts(long noteId) Check if the given note page has drafts or not- Parameters:
noteId- note page id- Returns:
- true if the given note page has drafts and false if not
-
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
Creates a new page version- Parameters:
page- target note pageuserName- current username- Returns:
PageVersion- Throws:
WikiException
-
restoreVersionOfPage
Restore a note from given version- Parameters:
versionName- version namepage- target note page- Returns:
PageVersion- 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
-
deleteAttachmentsOfDraftPage
Delete attachments of target draft page- Parameters:
draftPage- target draft page
-
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
-
getPageVersionById
Gets page version by its given id- Parameters:
versionId- page version id- Returns:
PageVersion
-
getDraftsOfWiki
Gets draft pages of a given wiki
-