Package org.exoplatform.wiki.service
Interface WikiService
- All Known Implementing Classes:
WikiServiceImpl
public interface WikiService
Provides functions for processing database
with wikis and pages, including: adding, editing, removing and searching for data.
- eXo level API
- Provisional
-
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttachmentToPage(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.createWiki(String wikiType, String owner) Creates a wiki with the given type and ownervoiddeleteAttachmentOfPage(String attachmentId, Page page) Deletes the given attachment of the given pageGets attachment listeners that are registered into the Wiki service.getAttachmentOfPageByName(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 truegetAttachmentsOfPage(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 trueGets Id of a default Wiki syntax.intgetNbOfAttachmentsOfPage(Page page) Get the number of attachment of the given pagegetOrCreateUserWiki(String username) Gets a user Wiki.Gets listeners of all wiki pages that are registered into the Wiki service.getPageOfWikiByName(String wikiType, String wikiOwner, String pageName) Gets a wiki page by its unique name in the wiki.getSpaceNameByGroupId(String groupId) Gets a space name by a given group Id.getWikiById(String wikiId) Gets a Wiki by its Id.getWikiByTypeAndOwner(String wikiType, String owner) Gets a Wiki which is defined by its type and owner.getWikiDefaultPermissions(String wikiType, String wikiOwner) Gets a list of Wiki default permissions.getWikiNameById(String wikiId) Gets a Wiki name by its Id.Gets parameters of a wiki page based on the data stored in the breadcrumb.getWikiPermission(String wikiType, String wikiOwner) Gets a list of Wiki permissions based on its type and owner.getWikisByType(String wikiType) Gets all wikis of the given typeGets 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.booleanhasPermissionOnWiki(Wiki wiki, PermissionType permissionType, org.exoplatform.services.security.Identity user) Check if the identity has the given permission type on a wikisearchSpaces(String keyword) Searches for spaces by a given keyword.voidupdateWikiPermission(String wikiType, String wikiOwner, List<PermissionEntry> permissionEntries) Adds a list of permissions to Wiki.
-
Method Details
-
getWikiPageParams
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
-
getWikiPermission
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
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
-
getDefaultWikiSyntaxId
String getDefaultWikiSyntaxId()Gets Id of a default Wiki syntax.- Returns:
- The Id.
-
getAttachmentsOfPage
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
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
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
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
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
Deletes the given attachment of the given page- Parameters:
attachmentId- Id of the attachmentpage- The wiki page- 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.
-
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.
-
getOrCreateUserWiki
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
Gets a space name by a given group Id.- Parameters:
groupId- The group Id.- Returns:
- The space name.
-
searchSpaces
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
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
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
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
-
hasAdminSpacePermission
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
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
Gets a Wiki by its Id.- Parameters:
wikiId- The Wiki Id.- Returns:
- The Wiki.
- Throws:
WikiException- if an error occured
-
getWikiNameById
Gets a Wiki name by its Id.- Parameters:
wikiId- The Wiki Id.- Returns:
- The Wiki name.
- Throws:
WikiException- if an error occured
-