Package org.exoplatform.wiki.service
Interface WikiService
-
- All Known Implementing Classes:
WikiServiceImpl
public interface WikiServiceProvides functions for processing database with wikis and pages, including: adding, editing, removing and searching for data.- eXo level API
- Provisional
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description voidaddAttachmentToPage(Attachment attachment, Page page)Add the given attachment to the given pagevoidaddComponentPlugin(org.exoplatform.container.component.ComponentPlugin plugin)Registers a component plugin into the Wiki service.voidaddEmotionIconsPlugin(WikiEmotionIconsPlugin plugin)Adds a Wiki emotion icons as plugin.voidaddPageLink(WikiPageParams param, WikiPageParams entity)Add a link between 2 pagesvoidaddRelatedPage(WikiPageParams orginaryPageParams, WikiPageParams relatedPageParams)Adds a related page to the current wiki page.voidaddWatcherToPage(String username, Page page)Add the given user as watcher of the wiki pagevoidaddWikiTemplatePagePlugin(WikiTemplatePagePlugin templatePlugin)Adds a Wiki template as plugin.booleancanModifyPagePermission(Page currentPage, String currentUser)Check if the given user can update the pagebooleancanPublicAndRetrictPage(Page currentPage, String currentUser)Check if the given user can public or restrict the pageDraftPagecreateDraftForExistPage(DraftPage draftPage, Page targetPage, String revision, long clientTime)Creates a draft page for a wiki page which is specified by a given param object.DraftPagecreateDraftForNewPage(DraftPage draftPage, Page parentPage, long clientTime)Creates a draft page for a new wiki page whose parent is specified by a given param object.voidcreateEmotionIcon(EmotionIcon emotionIcon)Creates a emotion iconPagecreatePage(Wiki wiki, String parentPageName, Page page)Create a new wiki page in the given wiki, under the given parent page.voidcreateTemplatePage(Wiki wiki, Template template)Creates a new Wiki template.voidcreateVersionOfPage(Page page)Creates a version of a page.WikicreateWiki(String wikiType, String owner)Creates a wiki with the given type and ownervoiddeleteAttachmentOfPage(String attachmentId, Page page)Deletes the given attachment of the given pagebooleandeletePage(String wikiType, String wikiOwner, String pageId, String userId)Deletes a wiki page.voiddeleteTemplatePage(String wikiType, String wikiOwner, String templateName)Deletes a Wiki template.voiddeleteWatcherOfPage(String username, Page page)Delete a user as watcher of the given pageList<AttachmentWikiListener>getAttachmentListeners()Gets attachment listeners that are registered into the Wiki service.AttachmentgetAttachmentOfPageByName(String attachmentName, Page page)Get a attachment of a the given page by name, without loading its contentdefault AttachmentgetAttachmentOfPageByName(String attachmentName, Page page, boolean loadContent)Get a attachment of a the given page by name, and allow to load the attachment content by setting loadContent to trueList<Attachment>getAttachmentsOfPage(Page page)Gets attachments of the given page, without loading their contentdefault List<Attachment>getAttachmentsOfPage(Page page, boolean loadContent)Gets attachments of the given page, and allow to load their attachment content by setting loadContent to trueList<BreadcrumbData>getBreadcumb(String wikiType, String wikiOwner, String pageId)Gets a list of data which is used for composing the breadcrumb.List<Page>getChildrenPageOf(Page page, String userId, boolean withDrafts)Get all the children pages of a wiki pageStringgetDefaultWikiSyntaxId()Gets Id of a default Wiki syntax.DraftPagegetDraft(String draftName)Gets a draft page by its name.org.exoplatform.commons.diff.DiffResultgetDraftChanges(DraftPage draftPage)Gets the changes between the draft page and the target pageDraftPagegetDraftOfPage(Page page)Gets a draft page of a wiki page which is specified by a given param object.PagegetDraftPageById(String id)Gets a wiki draft page based on its unique id.List<DraftPage>getDraftsOfUser(String username)Gets a list of draft pages belonging to a given user.List<Page>getDuplicatePages(Page parentPage, Wiki targetWiki, List<Page> resultList, String userId)Checks if a page and its children are duplicated with ones in the target Wiki or not, then gets a list of duplicated pages if any.longgetEditPageLivingTime()Get the living time of edited pageEmotionIcongetEmotionIconByName(String name)Gets an emotion icon by nameList<EmotionIcon>getEmotionIcons()Gets all the emotion iconsPagegetExsitedOrNewDraftPageById(String wikiType, String wikiOwner, String pageId)Gets a wiki page or its draft if existing by its Id.PagegetHelpSyntaxPage(String syntaxId, boolean fullContent)Deprecated.DraftPagegetLastestDraft()Gets the last created draft of a wiki page.intgetNbOfAttachmentsOfPage(Page page)Get the number of attachment of the given pageWikigetOrCreateUserWiki(String username)Gets a user Wiki.PagegetPageById(String id)Gets a wiki page based on its unique id.PagegetPageByRootPermission(String wikiType, String wikiOwner, String pageId)Gets a wiki page regardless of the current user's permission.List<PageWikiListener>getPageListeners()Gets listeners of all wiki pages that are registered into the Wiki service.PagegetPageOfWikiByName(String wikiType, String wikiOwner, String pageName)Gets a wiki page by its unique name in the wiki.StringgetPageRenderedContent(Page page)Get renderd content of a pageList<Page>getPagesOfWiki(String wikiType, String wikiOwner)Retrieve the all pages contained in wikiPagegetParentPageOf(Page page)Get parent page of a wiki pageList<String>getPreviousNamesOfPage(Page page)Get previous names of a pagePagegetRelatedPage(String wikiType, String wikiOwner, String pageId)Gets a related page of a wiki page which is specified by a given Id.List<Page>getRelatedPagesOfPage(Page page)Gets a list of related pages based on a given param.longgetSaveDraftSequenceTime()Gets an interval which specifies the periodical auto-saving for pages in Wiki.StringgetSpaceNameByGroupId(String groupId)Gets a space name by a given group Id.TemplategetTemplatePage(WikiPageParams params, String templateId)Gets a Wiki template.Map<String,Template>getTemplates(WikiPageParams params)Gets a map of wiki templates based on a given params object.intgetUploadLimit()PageVersiongetVersionOfPageByName(String versionName, Page page)Gets a specific version by name of the given pageList<PageVersion>getVersionsOfPage(Page page)Gets all the versions of the given pageList<String>getWatchersOfPage(Page page)Get all the watchers of a pageWikigetWikiById(String wikiId)Gets a Wiki by its Id.WikigetWikiByTypeAndOwner(String wikiType, String owner)Gets a Wiki which is defined by its type and owner.List<PermissionEntry>getWikiDefaultPermissions(String wikiType, String wikiOwner)Gets a list of Wiki default permissions.StringgetWikiNameById(String wikiId)Gets a Wiki name by its Id.WikiPageParamsgetWikiPageParams(BreadcrumbData data)Gets parameters of a wiki page based on the data stored in the breadcrumb.List<PermissionEntry>getWikiPermission(String wikiType, String wikiOwner)Gets a list of Wiki permissions based on its type and owner.List<Wiki>getWikisByType(String wikiType)Gets all wikis of the given typeStringgetWikiWebappUri()Gets a Wiki webapp URI.booleanhasAdminPagePermission(String wikiType, String owner)Checks if the current user has the admin permission on a wiki page.booleanhasAdminSpacePermission(String wikiType, String owner)Checks if the current user has the admin permission on a space or not.booleanhasPermissionOnPage(Page page, PermissionType permissionType, org.exoplatform.services.security.Identity user)Checks if the given user has the permission on a pagebooleanhasPermissionOnWiki(Wiki wiki, PermissionType permissionType, org.exoplatform.services.security.Identity user)Check if the identity has the given permission type on a wikibooleanisDraftOutDated(DraftPage draftPage)Check if a draft page is outdatedbooleanisExisting(String wikiType, String wikiOwner, String pageId)Checks if a wiki page exists or not.booleanmovePage(WikiPageParams currentLocationParams, WikiPageParams newLocationParams)Move a wiki PagevoidremoveDraft(String draftName)Removes a draft page by its name.voidremoveDraftOfPage(WikiPageParams param)Removes a draft page of a wiki page which is specified by the wiki page param.voidremoveRelatedPage(WikiPageParams orginaryPageParams, WikiPageParams relatedPageParams)Removes a related page of the current wiki page.booleanrenamePage(String wikiType, String wikiOwner, String pageName, String newName, String newTitle)Renames a wiki page.voidrestoreVersionOfPage(String versionName, Page page)Restores a version of a pageorg.exoplatform.commons.utils.PageList<SearchResult>search(WikiSearchData data)Searches in all wiki pages.List<SpaceBean>searchSpaces(String keyword)Searches for spaces by a given keyword.List<TemplateSearchResult>searchTemplate(TemplateSearchData data)Searches in all templates.voidupdatePage(Page page, PageUpdateType type)Update the given page.voidupdateTemplate(Template template)Modifies an existing wiki template.voidupdateWikiPermission(String wikiType, String wikiOwner, List<PermissionEntry> permissionEntries)Adds a list of permissions to Wiki.
-
-
-
Method Detail
-
createPage
Page createPage(Wiki wiki, String parentPageName, Page page) throws WikiException
Create a new wiki page in the given wiki, under the given parent page.- Parameters:
wiki- It can be Portal, Group, or User.parentPageName- Name of the parent wiki page.page- wiki page object to create.- Returns:
- The new wiki page.
- Throws:
WikiException- if an error occured if an error occured
-
createTemplatePage
void createTemplatePage(Wiki wiki, Template template) throws WikiException
Creates a new Wiki template.- Parameters:
wiki- Wiki of the templatetemplate- The params object which is used for creating the new Wiki template.- Throws:
WikiException- if an error occured if an error occured
-
deletePage
boolean deletePage(String wikiType, String wikiOwner, String pageId, String userId) throws WikiException
Deletes a wiki page.- Parameters:
wikiType- It can be Portal, Group, or User.wikiOwner- The Wiki owner.pageId- Id of the wiki page.userId-- Returns:
- "True" if deleting the wiki page is successful, or "false" if not.
- Throws:
WikiException- if an error occured if an error occured
-
deleteTemplatePage
void deleteTemplatePage(String wikiType, String wikiOwner, String templateName) throws WikiException
Deletes a Wiki template.- Parameters:
wikiType- It can be Portal, Group, or User.wikiOwner- The Wiki owner.templateName- Name of the Wiki template.- Throws:
WikiException- if an error occured if an error occured
-
renamePage
boolean renamePage(String wikiType, String wikiOwner, String pageName, String newName, String newTitle) throws WikiException
Renames a wiki page.- Parameters:
wikiType- It can be Portal, Group, or User.wikiOwner- The Wiki owner.pageName- Old name of the wiki page.newName- New name of the wiki page.newTitle- New title of the wiki page.- Returns:
- "True" if renaming the wiki page is successful, or "false" if not.
- Throws:
WikiException- if an error occured if an error occured
-
movePage
boolean movePage(WikiPageParams currentLocationParams, WikiPageParams newLocationParams) throws WikiException
Move a wiki Page- Parameters:
currentLocationParams- The current location of the wiki page.newLocationParams- The new location of the wiki page.- Returns:
- "True" if moving the wiki page is successful, or "false" if not.
- Throws:
WikiException- if an error occured if an error occured
-
getWikiPermission
List<PermissionEntry> getWikiPermission(String wikiType, String wikiOwner) throws WikiException
Gets a list of Wiki permissions based on its type and owner.- Parameters:
wikiType- It can be Portal, Group, or User.wikiOwner- The Wiki owner.- Returns:
- The list of Wiki permissions.
- Throws:
WikiException- if an error occured if an error occured
-
updateWikiPermission
void updateWikiPermission(String wikiType, String wikiOwner, List<PermissionEntry> permissionEntries) throws WikiException
Adds a list of permissions to Wiki.- Parameters:
wikiType- It can be Portal, Group, or User.wikiOwner- The Wiki owner.permissionEntries- The list of permissions.- Throws:
WikiException- if an error occured if an error occured
-
getPageOfWikiByName
Page getPageOfWikiByName(String wikiType, String wikiOwner, String pageName) throws WikiException
Gets a wiki page by its unique name in the wiki.- Parameters:
wikiType- It can be Portal, Group, or User.wikiOwner- The Wiki owner.pageName- Id of the wiki page.- Returns:
- The wiki page if the current user has the read permission. Otherwise, it is "null".
- Throws:
WikiException- if an error occured if an error occured
-
getPageByRootPermission
Page getPageByRootPermission(String wikiType, String wikiOwner, String pageId) throws WikiException
Gets a wiki page regardless of the current user's permission.- Parameters:
wikiType- It can be Portal, Group, or User.wikiOwner- The Wiki owner.pageId- Id of the wiki page.- Returns:
- The wiki page.
- Throws:
WikiException- if an error occured if an error occured
-
getRelatedPage
Page getRelatedPage(String wikiType, String wikiOwner, String pageId) throws WikiException
Gets a related page of a wiki page which is specified by a given Id.- Parameters:
wikiType- It can be Portal, Group, or User.wikiOwner- The Wiki owner.pageId- Id of the wiki page.- Returns:
- The related wiki page.
- Throws:
WikiException- if an error occured if an error occured
-
getExsitedOrNewDraftPageById
Page getExsitedOrNewDraftPageById(String wikiType, String wikiOwner, String pageId) throws WikiException
Gets a wiki page or its draft if existing by its Id.- Parameters:
wikiType- It can be Portal, Group, or User.wikiOwner- The Wiki owner.pageId- Id of the wiki page.- Returns:
- The wiki page or its draft.
- Throws:
WikiException- if an error occured if an error occured
-
getPageById
Page getPageById(String id) throws WikiException
Gets a wiki page based on its unique id.- Parameters:
id- Unique id of the wiki page.- Returns:
- The wiki page.
- Throws:
WikiException- if an error occured if an error occured
-
getDraftPageById
Page getDraftPageById(String id) throws WikiException
Gets a wiki draft page based on its unique id.- Parameters:
id- Unique id of the wiki page.- Returns:
- The wiki draft page.
- Throws:
WikiException- if an error occured if an error occured
-
getPageRenderedContent
String getPageRenderedContent(Page page)
Get renderd content of a page- Parameters:
page- The wiki page- Returns:
- The rendered content
-
addPageLink
void addPageLink(WikiPageParams param, WikiPageParams entity)
Add a link between 2 pages- Parameters:
param- First pageentity- Second page
-
getParentPageOf
Page getParentPageOf(Page page) throws WikiException
Get parent page of a wiki page- Parameters:
page- Wiki page.- Returns:
- The list of children pages
- Throws:
WikiException- if an error occured
-
getChildrenPageOf
List<Page> getChildrenPageOf(Page page, String userId, boolean withDrafts) throws WikiException
Get all the children pages of a wiki page- Parameters:
page- Wiki page.userId-withDrafts- if set to true returns the children notes and draft notes- Returns:
- The list of children pages
- Throws:
WikiException- if an error occured
-
getTemplatePage
Template getTemplatePage(WikiPageParams params, String templateId) throws WikiException
Gets a Wiki template.- Parameters:
params- The params object which is used for creating the Wiki template.templateId- Id of the wiki template.- Returns:
- The wiki template.
- Throws:
WikiException- if an error occured if an error occured
-
getBreadcumb
List<BreadcrumbData> getBreadcumb(String wikiType, String wikiOwner, String pageId) throws WikiException
Gets a list of data which is used for composing the breadcrumb.- Parameters:
wikiType- It can be Portal, Group, or User.wikiOwner- The Wiki owner.pageId- Id of the wiki page to which the breadcrumb points.- Returns:
- The list of data.
- Throws:
WikiException- if an error occured if an error occured
-
getWikiPageParams
WikiPageParams getWikiPageParams(BreadcrumbData data) throws WikiException
Gets parameters of a wiki page based on the data stored in the breadcrumb.- Parameters:
data- The data in the breadcrumb that identifies the wiki page.- Returns:
- The parameters identifying the wiki page.
- Throws:
WikiException- if an error occured if an error occured
-
search
org.exoplatform.commons.utils.PageList<SearchResult> search(WikiSearchData data) throws WikiException
Searches in all wiki pages.- Parameters:
data- The data to search.- Returns:
- Search results.
- Throws:
WikiException- if an error occured if an error occured
-
searchTemplate
List<TemplateSearchResult> searchTemplate(TemplateSearchData data) throws WikiException
Searches in all templates.- Parameters:
data- The data to search.- Returns:
- Search results.
- Throws:
WikiException- if an error occured if an error occured
-
getDuplicatePages
List<Page> getDuplicatePages(Page parentPage, Wiki targetWiki, List<Page> resultList, String userId) throws WikiException
Checks if a page and its children are duplicated with ones in the target Wiki or not, then gets a list of duplicated pages if any.- Parameters:
parentPage- The page to check.targetWiki- The target Wiki to check.resultList- The list of duplicated wiki pages.userId-- Returns:
- The list of duplicated wiki pages.
- Throws:
WikiException- if an error occured if an error occured
-
getDefaultWikiSyntaxId
String getDefaultWikiSyntaxId()
Gets Id of a default Wiki syntax.- Returns:
- The Id.
-
getSaveDraftSequenceTime
long getSaveDraftSequenceTime()
Gets an interval which specifies the periodical auto-saving for pages in Wiki.- Returns:
- The interval. Its default value is 30 seconds.
-
getEditPageLivingTime
long getEditPageLivingTime()
Get the living time of edited page- Returns:
- The living time of edited page
-
getAttachmentsOfPage
List<Attachment> getAttachmentsOfPage(Page page) throws WikiException
Gets attachments of the given page, without loading their content- Parameters:
page- The wiki page- Returns:
- The attachments of the page
- Throws:
WikiException- if an error occured if an error occured
-
getAttachmentsOfPage
default List<Attachment> getAttachmentsOfPage(Page page, boolean loadContent) throws WikiException
Gets attachments of the given page, and allow to load their attachment content by setting loadContent to true- Parameters:
page- The wiki pageloadContent- treue if need to load the attachement content- Returns:
- The attachments of the page
- Throws:
WikiException- if an error occured if an error occured
-
getNbOfAttachmentsOfPage
int getNbOfAttachmentsOfPage(Page page) throws WikiException
Get the number of attachment of the given page- Parameters:
page- The wiki page- Returns:
- The number of attachments of the page
- Throws:
WikiException- if an error occured if an error occured
-
getAttachmentOfPageByName
Attachment getAttachmentOfPageByName(String attachmentName, Page page) throws WikiException
Get a attachment of a the given page by name, without loading its content- Parameters:
attachmentName- The name of the attachmentpage- The wiki page- Returns:
- Attachment
- Throws:
WikiException- if an error occured if an error occured
-
getAttachmentOfPageByName
default Attachment getAttachmentOfPageByName(String attachmentName, Page page, boolean loadContent) throws WikiException
Get a attachment of a the given page by name, and allow to load the attachment content by setting loadContent to true- Parameters:
attachmentName- The name of the attachmentpage- The wiki pageloadContent- true to load the attachment content- Returns:
- attachement
- Throws:
WikiException- if an error occured if an error occured
-
addAttachmentToPage
void addAttachmentToPage(Attachment attachment, Page page) throws WikiException
Add the given attachment to the given page- Parameters:
attachment- The attachment to addpage- The wiki page- Throws:
WikiException- if an error occured if an error occured
-
deleteAttachmentOfPage
void deleteAttachmentOfPage(String attachmentId, Page page) throws WikiException
Deletes the given attachment of the given page- Parameters:
attachmentId- Id of the attachmentpage- The wiki page- Throws:
WikiException- if an error occured
-
getHelpSyntaxPage
@Deprecated Page getHelpSyntaxPage(String syntaxId, boolean fullContent) throws WikiException
Deprecated.Gets a Help wiki page based on a given syntax Id.- Parameters:
syntaxId- Id of the syntax.fullContent- true to get the full help page content, false to get an excerpt- Returns:
- The Help wiki page.
- Throws:
WikiException- if an error occured
-
getTemplates
Map<String,Template> getTemplates(WikiPageParams params) throws WikiException
Gets a map of wiki templates based on a given params object.- Parameters:
params- The params object which is used for getting the wiki templates.- Returns:
- The map of wiki templates.
- Throws:
WikiException- if an error occured
-
updateTemplate
void updateTemplate(Template template) throws WikiException
Modifies an existing wiki template.- Parameters:
template- The updated wiki template.- Throws:
WikiException- if an error occured
-
isExisting
boolean isExisting(String wikiType, String wikiOwner, String pageId) throws WikiException
Checks if a wiki page exists or not.- Parameters:
wikiType- It can be Portal, Group, or User.wikiOwner- The Wiki owner.pageId- Id of the wiki page.- Returns:
- The returned value is "true" if the page exists, or "false" if not.
- Throws:
WikiException- if an error occured
-
getWikiDefaultPermissions
List<PermissionEntry> getWikiDefaultPermissions(String wikiType, String wikiOwner) throws WikiException
Gets a list of Wiki default permissions.- Parameters:
wikiType- It can be Portal, Group, or User.wikiOwner- The Wiki owner.- Returns:
- The list of Wiki default permissions.
- Throws:
WikiException- if an error occured
-
addComponentPlugin
void addComponentPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
Registers a component plugin into the Wiki service.- Parameters:
plugin- The component plugin to be registered.
-
addWikiTemplatePagePlugin
void addWikiTemplatePagePlugin(WikiTemplatePagePlugin templatePlugin)
Adds a Wiki template as plugin.- Parameters:
templatePlugin- The wiki template plugin to be added.
-
addEmotionIconsPlugin
void addEmotionIconsPlugin(WikiEmotionIconsPlugin plugin)
Adds a Wiki emotion icons as plugin.- Parameters:
plugin- The wiki emotion icons plugin to be added.
-
getPageListeners
List<PageWikiListener> getPageListeners()
Gets listeners of all wiki pages that are registered into the Wiki service.- Returns:
- The list of listeners.
-
getAttachmentListeners
List<AttachmentWikiListener> getAttachmentListeners()
Gets attachment listeners that are registered into the Wiki service.- Returns:
- The list of attachment listeners.
-
addRelatedPage
void addRelatedPage(WikiPageParams orginaryPageParams, WikiPageParams relatedPageParams) throws WikiException
Adds a related page to the current wiki page.- Parameters:
orginaryPageParams- The params object of the current wiki page.relatedPageParams- The params object of the related page.- Throws:
WikiException- if an error occured
-
getRelatedPagesOfPage
List<Page> getRelatedPagesOfPage(Page page) throws WikiException
Gets a list of related pages based on a given param.- Parameters:
page- The wiki page.- Returns:
- The list of related pages.
- Throws:
WikiException- if an error occured
-
removeRelatedPage
void removeRelatedPage(WikiPageParams orginaryPageParams, WikiPageParams relatedPageParams) throws WikiException
Removes a related page of the current wiki page.- Parameters:
orginaryPageParams- The params object of the current wiki page.relatedPageParams- The params object of the related page.- Throws:
WikiException- if an error occured
-
createDraftForExistPage
DraftPage createDraftForExistPage(DraftPage draftPage, Page targetPage, String revision, long clientTime) throws WikiException
Creates a draft page for a wiki page which is specified by a given param object.- Parameters:
draftPage- The draft objecttargetPage- The target wiki page.revision- The revision which is used for creating the draft page. If "null", this will be the last revision.clientTime- The time of client when the draft page is saved.- Returns:
- The draft page.
- Throws:
WikiException- if an error occured if the draft page cannot be created.
-
createDraftForNewPage
DraftPage createDraftForNewPage(DraftPage draftPage, Page parentPage, long clientTime) throws WikiException
Creates a draft page for a new wiki page whose parent is specified by a given param object.- Parameters:
draftPage- The draft objectparentPage- The parent wiki page.clientTime- The time of client when the draft page is saved.- Returns:
- The draft page.
- Throws:
WikiException- if an error occured if the draft page cannot be created.
-
getDraftOfPage
DraftPage getDraftOfPage(Page page) throws WikiException
Gets a draft page of a wiki page which is specified by a given param object.- Parameters:
page- The wiki page.- Returns:
- The draft page, or "null" if the draft page does not exist.
- Throws:
WikiException- if an error occured
-
getDraft
DraftPage getDraft(String draftName) throws WikiException
Gets a draft page by its name.- Parameters:
draftName- Name of the draft page.- Returns:
- The draft page, or "null" if it does not exist.
- Throws:
WikiException- if an error occured
-
removeDraftOfPage
void removeDraftOfPage(WikiPageParams param) throws WikiException
Removes a draft page of a wiki page which is specified by the wiki page param.- Parameters:
param- The param object of the wiki page param.- Throws:
WikiException- if an error occured
-
removeDraft
void removeDraft(String draftName) throws WikiException
Removes a draft page by its name.- Parameters:
draftName- Name of the draft page.- Throws:
WikiException- if an error occured
-
getDraftsOfUser
List<DraftPage> getDraftsOfUser(String username) throws WikiException
Gets a list of draft pages belonging to a given user.- Parameters:
username- Name of the user.- Returns:
- The list of draft pages.
- Throws:
WikiException- if an error occured
-
isDraftOutDated
boolean isDraftOutDated(DraftPage draftPage) throws WikiException
Check if a draft page is outdated- Parameters:
draftPage- the draft page object- Returns:
- true if the draft is outdated
- Throws:
WikiException- if an error occured
-
getLastestDraft
DraftPage getLastestDraft() throws WikiException
Gets the last created draft of a wiki page.- Returns:
- The last draft.
- Throws:
WikiException- if an error occured
-
getDraftChanges
org.exoplatform.commons.diff.DiffResult getDraftChanges(DraftPage draftPage) throws WikiException
Gets the changes between the draft page and the target page- Parameters:
draftPage- the draft page object- Returns:
- list of changes
- Throws:
WikiException- if an error occured
-
getOrCreateUserWiki
Wiki getOrCreateUserWiki(String username) throws WikiException
Gets a user Wiki. If it does not exist, the new one will be created.- Parameters:
username- Name of the user.- Returns:
- The user Wiki.
- Throws:
WikiException- if an error occured
-
getSpaceNameByGroupId
String getSpaceNameByGroupId(String groupId)
Gets a space name by a given group Id.- Parameters:
groupId- The group Id.- Returns:
- The space name.
-
searchSpaces
List<SpaceBean> searchSpaces(String keyword) throws WikiException
Searches for spaces by a given keyword.- Parameters:
keyword- The keyword to search for spaces.- Returns:
- The list of spaces matching with the keyword.
- Throws:
WikiException- if an error occured
-
getWikiByTypeAndOwner
Wiki getWikiByTypeAndOwner(String wikiType, String owner) throws WikiException
Gets a Wiki which is defined by its type and owner.- Parameters:
wikiType- It can be Portal, Group, or User.owner- The Wiki owner.- Returns:
- The Wiki.
- Throws:
WikiException- if an error occured
-
getWikisByType
List<Wiki> getWikisByType(String wikiType) throws WikiException
Gets all wikis of the given type- Parameters:
wikiType- Type of wiki- Returns:
- Wikis of the given type
- Throws:
WikiException- if an error occured
-
createWiki
Wiki createWiki(String wikiType, String owner) throws WikiException
Creates a wiki with the given type and owner- Parameters:
wikiType- It can be Portal, Group, or User.owner- The Wiki owner.- Returns:
- Wiki created
- Throws:
WikiException- if an error occured
-
getWikiWebappUri
String getWikiWebappUri()
Gets a Wiki webapp URI.- Returns:
- The Wiki webapp URI.
-
hasPermissionOnWiki
boolean hasPermissionOnWiki(Wiki wiki, PermissionType permissionType, org.exoplatform.services.security.Identity user) throws WikiException
Check if the identity has the given permission type on a wiki- Parameters:
wiki- WikipermissionType- Permission type to checkuser- Identity of the user- Returns:
- true if the user has the given permission type on the wiki
- Throws:
WikiException- if an error occured
-
hasPermissionOnPage
boolean hasPermissionOnPage(Page page, PermissionType permissionType, org.exoplatform.services.security.Identity user) throws WikiException
Checks if the given user has the permission on a page- Parameters:
user- the userNamepage- the wiki page objectpermissionType- permission Type- Returns:
- true if user has permissions
- Throws:
WikiException- if an error occured
-
hasAdminSpacePermission
boolean hasAdminSpacePermission(String wikiType, String owner) throws WikiException
Checks if the current user has the admin permission on a space or not.- Parameters:
wikiType- It can be Portal, Group, or User.owner- Owner of the space.- Returns:
- The returned value is "true" if the current user has the admin permission on the space, or "false" if not.
- Throws:
WikiException- if an error occured
-
hasAdminPagePermission
boolean hasAdminPagePermission(String wikiType, String owner) throws WikiException
Checks if the current user has the admin permission on a wiki page.- Parameters:
wikiType- It can be Portal, Group, or User.owner- Owner of the wiki page.- Returns:
- "True" if the current user has the admin permission on the wiki page, or "false" if not.
- Throws:
WikiException- if an error occured
-
getWikiById
Wiki getWikiById(String wikiId) throws WikiException
Gets a Wiki by its Id.- Parameters:
wikiId- The Wiki Id.- Returns:
- The Wiki.
- Throws:
WikiException- if an error occured
-
getWikiNameById
String getWikiNameById(String wikiId) throws WikiException
Gets a Wiki name by its Id.- Parameters:
wikiId- The Wiki Id.- Returns:
- The Wiki name.
- Throws:
WikiException- if an error occured
-
canModifyPagePermission
boolean canModifyPagePermission(Page currentPage, String currentUser) throws WikiException
Check if the given user can update the page- Parameters:
currentPage- The page to updatecurrentUser- The user that needs to update the page- Returns:
- true if the user can update the page
- Throws:
WikiException- if an error occured
-
canPublicAndRetrictPage
boolean canPublicAndRetrictPage(Page currentPage, String currentUser) throws WikiException
Check if the given user can public or restrict the page- Parameters:
currentPage- page to checkcurrentUser- user to chck permissions- Returns:
- true if the current user has EditPage permission or admin page or admin space
- Throws:
WikiException- if an error occured
-
getVersionsOfPage
List<PageVersion> getVersionsOfPage(Page page) throws WikiException
Gets all the versions of the given page- Parameters:
page- The wiki page- Returns:
- All the versions of the page
- Throws:
WikiException- if an error occured
-
getVersionOfPageByName
PageVersion getVersionOfPageByName(String versionName, Page page) throws WikiException
Gets a specific version by name of the given page- Parameters:
versionName- The name of the versionpage- The wiki page- Returns:
- The version of the wiki page
- Throws:
WikiException- if an error occured
-
createVersionOfPage
void createVersionOfPage(Page page) throws WikiException
Creates a version of a page. This method only tag the current page data as a new version, it does not update the page data- Parameters:
page- The wiki page- Throws:
WikiException- if an error occured
-
restoreVersionOfPage
void restoreVersionOfPage(String versionName, Page page) throws WikiException
Restores a version of a page- Parameters:
versionName- The name of the version to restorepage- The wiki page- Throws:
WikiException- if an error occured
-
updatePage
void updatePage(Page page, PageUpdateType type) throws WikiException
Update the given page. This does not automatically create a new version. If a new version must be created it should be explicitly done by calling createVersionOfPage(). The second parameter is the type of update done (title only, content only, both, move, ...).- Parameters:
page- Updated pagetype- Type of update- Throws:
WikiException- if an error occured
-
getPreviousNamesOfPage
List<String> getPreviousNamesOfPage(Page page) throws WikiException
Get previous names of a page- Parameters:
page- The wiki page- Returns:
- List of all the previous names of the page
- Throws:
WikiException- if an error occured
-
createEmotionIcon
void createEmotionIcon(EmotionIcon emotionIcon) throws WikiException
Creates a emotion icon- Parameters:
emotionIcon- The emotion icon to add- Throws:
WikiException- if an error occured
-
getEmotionIcons
List<EmotionIcon> getEmotionIcons() throws WikiException
Gets all the emotion icons- Returns:
- All the emotion icons
- Throws:
WikiException- if an error occured
-
getEmotionIconByName
EmotionIcon getEmotionIconByName(String name) throws WikiException
Gets an emotion icon by name- Parameters:
name- The name of the emotion icon- Returns:
- The emotion icon
- Throws:
WikiException- if an error occured
-
getWatchersOfPage
List<String> getWatchersOfPage(Page page) throws WikiException
Get all the watchers of a page- Parameters:
page- The wiki page- Returns:
- liste of watchers
- Throws:
WikiException- if an error occured
-
addWatcherToPage
void addWatcherToPage(String username, Page page) throws WikiException
Add the given user as watcher of the wiki page- Parameters:
username- Username of the user to add as watcherpage- The wiki page- Throws:
WikiException- if an error occured
-
deleteWatcherOfPage
void deleteWatcherOfPage(String username, Page page) throws WikiException
Delete a user as watcher of the given page- Parameters:
username- Username of the user to delete as watcherpage- The wiki page- Throws:
WikiException- if an error occured
-
getUploadLimit
int getUploadLimit()
- Returns:
- Upload limit for Wiki Attachment
-
-