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 Details

    • 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
    • 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
    • getDefaultWikiSyntaxId

      String getDefaultWikiSyntaxId()
      Gets Id of a default Wiki syntax.
      Returns:
      The Id.
    • 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 page
      loadContent - 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 attachment
      page - 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 attachment
      page - The wiki page
      loadContent - 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 add
      page - 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 attachment
      page - 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

      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 - Wiki
      permissionType - Permission type to check
      user - 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) 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