org.exoplatform.wiki.service
Interface WikiService

All Known Implementing Classes:
WikiServiceImpl

public interface WikiService

WikiService is interface provide functions for processing database with wikis and pages include: add, edit, remove and searching data


Method Summary
 void addComponentPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
          register a ComponentPlugin
 boolean addRelatedPage(WikiPageParams orginaryPageParams, WikiPageParams relatedPageParams)
          Add a related page of the current wiki page
 void addWikiTemplatePagePlugin(WikiTemplatePagePlugin templatePlugin)
          Add the wiki page as plugin
 DraftPage createDraftForExistPage(WikiPageParams param, String revision, long clientTime)
          Create a draft page for a wiki page which is specified by the wiki page param
 DraftPage createDraftForNewPage(WikiPageParams parentPageParam, long clientTime)
          Create a draft page for a new wiki page which parent is specified by the wiki page param
 Page createPage(String wikiType, String wikiOwner, String title, String parentId)
          Create a new Wiki Page
 Template createTemplatePage(String title, WikiPageParams params)
          Create a new template Wiki Page
 void deleteDraftNewPage(String draftNewPageId)
          Delete the draft based on is Id
 boolean deletePage(String wikiType, String wikiOwner, String pageId)
          Delete the Wiki Page
 void deleteTemplatePage(String wikiType, String wikiOwner, String templateId)
          Delete the template
 Object findByPath(String path, String objectNodeType)
          Find the fullpath based on the type and is relative path.
 InputStream getAttachmentAsStream(String path)
          Return an attachment as stream
 List<BreadcrumbData> getBreadcumb(String wikiType, String wikiOwner, String pageId)
          Return a list of data to compose the breadcrumb
 String getDefaultWikiSyntaxId()
          Get the default wiki syntax Id
 DraftPage getDraft(String draftName)
          Get draft by draft name
 DraftPage getDraft(WikiPageParams param)
          Achieve a draft page for a wiki page which is specified by the wiki page param
 List<DraftPage> getDrafts(String username)
          Get collection of draft page belong to a user
 List<PageImpl> getDuplicatePages(PageImpl parentPage, Wiki targetWiki, List<PageImpl> resultList)
          Get a list of duppilcated page between all children pages of parentPage and targetWiki before execute moving page
 Page getExsitedOrNewDraftPageById(String wikiType, String wikiOwner, String pageId)
          Return the page itself or is draft if one exist
 PageImpl getHelpSyntaxPage(String syntaxId)
          Return the helps syntax page based on the syntax id
 DraftPage getLastestDraft()
          Get the draft that's created lastest
 Page getMetaDataPage(MetaDataPage metaPage)
          Return the a page of metadata
 UserWiki getOrCreateUserWiki(String username)
          Get user wiki, and if it did not create yet then create new one
 Page getPageById(String wikiType, String wikiOwner, String pageId)
          Get a page based on is Id
 Page getPageByRootPermission(String wikiType, String wikiOwner, String pageId)
          Return the wiki Home page with the root permissions
 Page getPageByUUID(String uuid)
          Retugn a wiki page based on is id
 List<PageWikiListener> getPageListeners()
           
 String getPageTitleOfAttachment(String path)
          Get the page title of an attachment
 String getPortalOwner()
          Get portal owner
 Page getRelatedPage(String wikiType, String wikiOwner, String pageId)
          Return the related page based on is Id
 List<Page> getRelatedPage(WikiPageParams pageParams)
          Return a list of related page based on its param
 long getSaveDraftSequenceTime()
          Get the draft save sequence time from config file
 String getSpaceNameByGroupId(String groupId)
          Get space name by group Id
 Template getTemplatePage(WikiPageParams params, String templateId)
          Return the template to use for the wiki page
 Map<String,Template> getTemplates(WikiPageParams params)
          Return a map of templates for the wiki page
 TemplateContainer getTemplatesContainer(WikiPageParams params)
          Return the template container
 Wiki getWiki(String wikiType, String owner)
          Get a wiki that definds by wikiType and owner
 Wiki getWikiById(String wikiId)
          Get wiki by Id
 List<String> getWikiDefaultPermissions(String wikiType, String wikiOwner)
          Get wiki default permission
 String getWikiNameById(String wikiId)
          Get wiki name by wiki id
 Page getWikiPageByUUID(String uuid)
          Get wiki page by page UUID
 WikiPageParams getWikiPageParams(BreadcrumbData data)
          Get a wiki page based on the data stored in the breadcrumb
 List<PermissionEntry> getWikiPermission(String wikiType, String wikiOwner)
          Return a lists permissions for the wiki based on the type and the owner
 String getWikiWebappUri()
          Get the uri of wiki webapp
 boolean hasAdminPagePermission(String wikiType, String owner)
          Check if the current user has addmin permission on the page
 boolean hasAdminSpacePermission(String wikiType, String owner)
          Check if the current user has addmin permission on the space
 void initDefaultTemplatePage(String path)
          Initialise the default template page
 boolean isExisting(String wikiType, String wikiOwner, String pageId)
          Return true if the page exist
 boolean isHiddenSpace(String groupId)
          Check if the space is hidden or not
 boolean isSpaceMember(String spaceId, String userId)
          Checks whether a user is a space's member or not.
 void modifyTemplate(WikiPageParams params, Template template, String newName, String newDescription, String newContent, String newSyntaxId)
          Modify an existing template available
 boolean movePage(WikiPageParams currentLocationParams, WikiPageParams newLocationParams)
          Move a wiki Page
 void postAddPage(String wikiType, String wikiOwner, String pageId, Page page)
          Publish a add activity
 void postDeletePage(String wikiType, String wikiOwner, String pageId, Page page)
          Publish a delete page activity
 void postUpdatePage(String wikiType, String wikiOwner, String pageId, Page page, String wikiUpdateType)
          Publish a update activity
 void removeDraft(String draftName)
          Remove a draft page by draft name
 void removeDraft(WikiPageParams param)
          Remove a draft page for a wiki page which is specified by the wiki page param
 boolean removeRelatedPage(WikiPageParams orginaryPageParams, WikiPageParams relatedPageParams)
          Remove a related page of the current wiki page
 boolean renamePage(String wikiType, String wikiOwner, String pageName, String newName, String newTitle)
          Rename the wiki Page
 org.exoplatform.commons.utils.PageList<SearchResult> search(WikiSearchData data)
          Search in all wiki pages
 List<SearchResult> searchRenamedPage(String wikiType, String wikiOwner, String pageId)
          Search pages in the list of renamed pages
 List<SpaceBean> searchSpaces(String keyword)
          Search for spaces by keyword
 List<TemplateSearchResult> searchTemplate(TemplateSearchData data)
          Search in all template
 void setWikiPermission(String wikiType, String wikiOwner, List<PermissionEntry> permissionEntries)
          Add new permissions to the wiki
 

Method Detail

createPage

Page createPage(String wikiType,
                String wikiOwner,
                String title,
                String parentId)
                throws Exception
Create a new Wiki Page

Parameters:
wikiType - It can be a Portal, Group, User type of wiki
wikiOwner - The owner of the wiki
title - The title of the page
parentId - The parent Id of the new page
Returns:
The new page
Throws:
Exception

createTemplatePage

Template createTemplatePage(String title,
                            WikiPageParams params)
                            throws Exception
Create a new template Wiki Page

Parameters:
title - The title of the template
params - Parameters to create the new template
Returns:
the new template
Throws:
Exception

initDefaultTemplatePage

void initDefaultTemplatePage(String path)
Initialise the default template page

Parameters:
path - the page to initialize the default template page

deletePage

boolean deletePage(String wikiType,
                   String wikiOwner,
                   String pageId)
                   throws Exception
Delete the Wiki Page

Parameters:
wikiType - It can be a Portal, Group, User type of wiki
wikiOwner - Is the owner of the wiki
pageId - Id of the wiki page
Returns:
True if the page is deleted, False if not
Throws:
Exception

deleteTemplatePage

void deleteTemplatePage(String wikiType,
                        String wikiOwner,
                        String templateId)
                        throws Exception
Delete the template

Parameters:
wikiType - It can be a Portal, Group, User type of wiki
wikiOwner - Is the owner of the wiki
templateId - Id of the template
Throws:
Exception

deleteDraftNewPage

void deleteDraftNewPage(String draftNewPageId)
                        throws Exception
Delete the draft based on is Id

Parameters:
draftNewPageId - Id of the draft
Throws:
Exception

renamePage

boolean renamePage(String wikiType,
                   String wikiOwner,
                   String pageName,
                   String newName,
                   String newTitle)
                   throws Exception
Rename the wiki Page

Parameters:
wikiType - It can be a Portal, Group, User type of wiki
wikiOwner - Is the owner of the wik
pageName - The old name of the page
newName - The new name of the page
newTitle - The new title of the page
Returns:
True if the page is renamed, False if not
Throws:
Exception

movePage

boolean movePage(WikiPageParams currentLocationParams,
                 WikiPageParams newLocationParams)
                 throws Exception
Move a wiki Page

Parameters:
currentLocationParams - The current location of the page
newLocationParams - The new location of the page
Returns:
True if the page is moved, False if not
Throws:
Exception

getWikiPermission

List<PermissionEntry> getWikiPermission(String wikiType,
                                        String wikiOwner)
                                        throws Exception
Return a lists permissions for the wiki based on the type and the owner

Parameters:
wikiType - It can be a Portal, Group, User type of wiki
wikiOwner - Is the owner of the wik
Returns:
List of permissions
Throws:
Exception

setWikiPermission

void setWikiPermission(String wikiType,
                       String wikiOwner,
                       List<PermissionEntry> permissionEntries)
                       throws Exception
Add new permissions to the wiki

Parameters:
wikiType - It can be a Portal, Group, User type of wiki
wikiOwner - Is the owner of the wik
permissionEntries - list of permissions
Throws:
Exception

getPageById

Page getPageById(String wikiType,
                 String wikiOwner,
                 String pageId)
                 throws Exception
Get a page based on is Id

Parameters:
wikiType - It can be a Portal, Group, User type of wiki
wikiOwner - Is the owner of the wik
pageId - Is the pageId used by the system
Returns:
The page
Throws:
Exception

getPageByRootPermission

Page getPageByRootPermission(String wikiType,
                             String wikiOwner,
                             String pageId)
                             throws Exception
Return the wiki Home page with the root permissions

Parameters:
wikiType - It can be a Portal, Group, User type of wiki
wikiOwner - Is the owner of the wik
pageId - Is the pageId used by the system
Returns:
The page
Throws:
Exception

getRelatedPage

Page getRelatedPage(String wikiType,
                    String wikiOwner,
                    String pageId)
                    throws Exception
Return the related page based on is Id

Parameters:
wikiType - It can be a Portal, Group, User type of wiki
wikiOwner - Is the owner of the wik
pageId - Is the pageId used by the system
Returns:
The related page
Throws:
Exception

getExsitedOrNewDraftPageById

Page getExsitedOrNewDraftPageById(String wikiType,
                                  String wikiOwner,
                                  String pageId)
                                  throws Exception
Return the page itself or is draft if one exist

Parameters:
wikiType - It can be a Portal, Group, User type of wiki
wikiOwner - Is the owner of the wik
pageId - Is the pageId used by the system
Returns:
wiki Page
Throws:
Exception

getPageByUUID

Page getPageByUUID(String uuid)
                   throws Exception
Retugn a wiki page based on is id

Parameters:
uuid - Id of the wiki page
Returns:
Wiki page
Throws:
Exception

getTemplatePage

Template getTemplatePage(WikiPageParams params,
                         String templateId)
                         throws Exception
Return the template to use for the wiki page

Parameters:
params -
templateId -
Returns:
A wiki template
Throws:
Exception

getBreadcumb

List<BreadcrumbData> getBreadcumb(String wikiType,
                                  String wikiOwner,
                                  String pageId)
                                  throws Exception
Return a list of data to compose the breadcrumb

Parameters:
wikiType - It can be a Portal, Group, User type of wiki
wikiOwner - Is the owner of the wik
pageId - Is the pageId used by the system
Returns:
List of BreadcrumbData
Throws:
Exception

getWikiPageParams

WikiPageParams getWikiPageParams(BreadcrumbData data)
                                 throws Exception
Get a wiki page based on the data stored in the breadcrumb

Parameters:
data - A part of the breadcrumb
Returns:
Wiki Page params
Throws:
Exception

search

org.exoplatform.commons.utils.PageList<SearchResult> search(WikiSearchData data)
                                                            throws Exception
Search in all wiki pages

Parameters:
data - The data to search
Returns:
List of results
Throws:
Exception

searchTemplate

List<TemplateSearchResult> searchTemplate(TemplateSearchData data)
                                          throws Exception
Search in all template

Parameters:
data - The data to search
Returns:
List of results
Throws:
Exception

searchRenamedPage

List<SearchResult> searchRenamedPage(String wikiType,
                                     String wikiOwner,
                                     String pageId)
                                     throws Exception
Search pages in the list of renamed pages

Parameters:
wikiType - It can be a Portal, Group, User type of wiki
wikiOwner - Is the owner of the wik
pageId - Is the pageId used by the system
Returns:
List of results
Throws:
Exception

getDuplicatePages

List<PageImpl> getDuplicatePages(PageImpl parentPage,
                                 Wiki targetWiki,
                                 List<PageImpl> resultList)
                                 throws Exception
Get a list of duppilcated page between all children pages of parentPage and targetWiki before execute moving page

Parameters:
parentPage - The page to check before execute moving
targetWiki - The target wiki to move page to
resultList - The list of duppicate wiki page
Returns:
The list of duppicate wiki page
Throws:
Exception

findByPath

Object findByPath(String path,
                  String objectNodeType)
                  throws Exception
Find the fullpath based on the type and is relative path.

Parameters:
path - relative path to search
objectNodeType - Can be a page, attachment or template
Returns:
An object based on is path and type
Throws:
Exception

getDefaultWikiSyntaxId

String getDefaultWikiSyntaxId()
Get the default wiki syntax Id

Returns:
the default wiki syntax Id

getSaveDraftSequenceTime

long getSaveDraftSequenceTime()
Get the draft save sequence time from config file

Returns:
The save draft sequence time

getPageTitleOfAttachment

String getPageTitleOfAttachment(String path)
                                throws Exception
Get the page title of an attachment

Parameters:
path - Path of the attachment
Returns:
title of the page
Throws:
Exception

getAttachmentAsStream

InputStream getAttachmentAsStream(String path)
                                  throws Exception
Return an attachment as stream

Parameters:
path - Path to use to get the attachment
Returns:
Stream of the attachment
Throws:
Exception

getHelpSyntaxPage

PageImpl getHelpSyntaxPage(String syntaxId)
                           throws Exception
Return the helps syntax page based on the syntax id

Parameters:
syntaxId - Id of the syntax
Returns:
Wiki Page
Throws:
Exception

getMetaDataPage

Page getMetaDataPage(MetaDataPage metaPage)
                     throws Exception
Return the a page of metadata

Parameters:
metaPage - the metadata to use, mainly emoticons
Returns:
page of metadata
Throws:
Exception

getTemplates

Map<String,Template> getTemplates(WikiPageParams params)
                                  throws Exception
Return a map of templates for the wiki page

Parameters:
params - The full params to get a page
Returns:
Map of templates
Throws:
Exception

getTemplatesContainer

TemplateContainer getTemplatesContainer(WikiPageParams params)
                                        throws Exception
Return the template container

Parameters:
params - The full params to get a page
Returns:
the template container
Throws:
Exception

modifyTemplate

void modifyTemplate(WikiPageParams params,
                    Template template,
                    String newName,
                    String newDescription,
                    String newContent,
                    String newSyntaxId)
                    throws Exception
Modify an existing template available

Parameters:
params - The full params to get a page
template - the template
newName - the new name for the template
newDescription - the new description for the template
newContent - the new description for the template
newSyntaxId - the new syntax for the template
Throws:
Exception

isExisting

boolean isExisting(String wikiType,
                   String wikiOwner,
                   String pageId)
                   throws Exception
Return true if the page exist

Parameters:
wikiType - It can be a Portal, Group, User type of wiki
wikiOwner - Is the owner of the wiki
pageId - Is the pageId used by the system
Returns:
true if the page exist, false if not
Throws:
Exception

getWikiDefaultPermissions

List<String> getWikiDefaultPermissions(String wikiType,
                                       String wikiOwner)
                                       throws Exception
Get wiki default permission

Parameters:
wikiType - It can be a Portal, Group, User type of wiki
wikiOwner - Is the owner of the wiki
Returns:
The permisison list for wiki
Throws:
Exception

addComponentPlugin

void addComponentPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
register a ComponentPlugin

Parameters:
plugin -

addWikiTemplatePagePlugin

void addWikiTemplatePagePlugin(WikiTemplatePagePlugin templatePlugin)
Add the wiki page as plugin

Parameters:
templatePlugin - The template plugin to use

getPageListeners

List<PageWikiListener> getPageListeners()
Returns:
list of PageWikiListener

addRelatedPage

boolean addRelatedPage(WikiPageParams orginaryPageParams,
                       WikiPageParams relatedPageParams)
                       throws Exception
Add a related page of the current wiki page

Parameters:
orginaryPageParams - Current wiki page param
relatedPageParams - Param of the related page
Returns:
true if it has been added or false if it's not possible
Throws:
Exception

getRelatedPage

List<Page> getRelatedPage(WikiPageParams pageParams)
                          throws Exception
Return a list of related page based on its param

Parameters:
pageParams - Param of the wiki page
Returns:
List of related page
Throws:
Exception

removeRelatedPage

boolean removeRelatedPage(WikiPageParams orginaryPageParams,
                          WikiPageParams relatedPageParams)
                          throws Exception
Remove a related page of the current wiki page

Parameters:
orginaryPageParams - Current wiki page param
relatedPageParams - Param of the related page
Returns:
true if it has been removed or false if it's not possible
Throws:
Exception

createDraftForExistPage

DraftPage createDraftForExistPage(WikiPageParams param,
                                  String revision,
                                  long clientTime)
                                  throws Exception
Create a draft page for a wiki page which is specified by the wiki page param

Parameters:
param - wiki page param
revision - the target revision, null if it's the lastest revision
clientTime - The time of client when save draft
Returns:
draft page
Throws:
Exception - if create draft not success

createDraftForNewPage

DraftPage createDraftForNewPage(WikiPageParams parentPageParam,
                                long clientTime)
                                throws Exception
Create a draft page for a new wiki page which parent is specified by the wiki page param

Parameters:
parentPageParam - parent wiki page param
clientTime - The time of client when save draft
Returns:
draft page
Throws:
Exception - if create draft not success

getDraft

DraftPage getDraft(WikiPageParams param)
                   throws Exception
Achieve a draft page for a wiki page which is specified by the wiki page param

Parameters:
param - wiki page param
Returns:
draft page or null if draft page doesn't exist.
Throws:
Exception

getDraft

DraftPage getDraft(String draftName)
                   throws Exception
Get draft by draft name

Parameters:
draftName - draft name
Returns:
draft page or null if draft page doesn't exist.
Throws:
Exception

removeDraft

void removeDraft(WikiPageParams param)
                 throws Exception
Remove a draft page for a wiki page which is specified by the wiki page param

Parameters:
param - wiki page param
Throws:
Exception

removeDraft

void removeDraft(String draftName)
                 throws Exception
Remove a draft page by draft name

Parameters:
draftName - draft name
Throws:
Exception

getDrafts

List<DraftPage> getDrafts(String username)
                          throws Exception
Get collection of draft page belong to a user

Parameters:
username - user name
Returns:
draft list of user
Throws:
Exception

getWikiPageByUUID

Page getWikiPageByUUID(String uuid)
                       throws Exception
Get wiki page by page UUID

Parameters:
uuid - of wiki page
Returns:
wiki page
Throws:
Exception

getLastestDraft

DraftPage getLastestDraft()
                          throws Exception
Get the draft that's created lastest

Returns:
lastest draft
Throws:
Exception

getOrCreateUserWiki

UserWiki getOrCreateUserWiki(String username)
Get user wiki, and if it did not create yet then create new one

Parameters:
username - The user name
Returns:
The UserWiki for user

getSpaceNameByGroupId

String getSpaceNameByGroupId(String groupId)
                             throws Exception
Get space name by group Id

Parameters:
groupId - The group Id to get space name
Returns:
The space name
Throws:
Exception

searchSpaces

List<SpaceBean> searchSpaces(String keyword)
                             throws Exception
Search for spaces by keyword

Parameters:
keyword - The keyword to search spaces
Returns:
The list of spaces that match wiki keyword
Throws:
Exception

getWiki

Wiki getWiki(String wikiType,
             String owner)
Get a wiki that definds by wikiType and owner

Parameters:
wikiType - It can be a Portal, Group, User type of wiki
owner - Wiki owner
Returns:
The wiki

getPortalOwner

String getPortalOwner()
Get portal owner

Returns:
portal owner

getWikiWebappUri

String getWikiWebappUri()
Get the uri of wiki webapp

Returns:
wiki webapp uri

isSpaceMember

boolean isSpaceMember(String spaceId,
                      String userId)
Checks whether a user is a space's member or not.

Parameters:
spaceId - the existing space id
userId - the remote user id
Returns:
true if that user is a member; otherwise, false

isHiddenSpace

boolean isHiddenSpace(String groupId)
                      throws Exception
Check if the space is hidden or not

Parameters:
groupId - The group Id to check
Returns:
the space is hidden or not
Throws:
Exception

hasAdminSpacePermission

boolean hasAdminSpacePermission(String wikiType,
                                String owner)
                                throws Exception
Check if the current user has addmin permission on the space

Parameters:
wikiType - It can be a Portal, Group, User type of wiki
owner - The owner of the space
Returns:
current user has addmin permisison on the space or not
Throws:
Exception

hasAdminPagePermission

boolean hasAdminPagePermission(String wikiType,
                               String owner)
                               throws Exception
Check if the current user has addmin permission on the page

Parameters:
wikiType - The wiki type of the space
owner - The owner of the space
Returns:
current user has addmin permisison on the page or not
Throws:
Exception

postUpdatePage

void postUpdatePage(String wikiType,
                    String wikiOwner,
                    String pageId,
                    Page page,
                    String wikiUpdateType)
                    throws Exception
Publish a update activity

Parameters:
wikiType - It can be a Portal, Group, User type of wiki
wikiOwner - The wiki owner
pageId - The page id
page - The wiki page
wikiUpdateType - The update type
Throws:
Exception

postAddPage

void postAddPage(String wikiType,
                 String wikiOwner,
                 String pageId,
                 Page page)
                 throws Exception
Publish a add activity

Parameters:
wikiType - It can be a Portal, Group, User type of wiki
wikiOwner - The wiki owner
pageId - The page id
page - The wiki page
Throws:
Exception

postDeletePage

void postDeletePage(String wikiType,
                    String wikiOwner,
                    String pageId,
                    Page page)
                    throws Exception
Publish a delete page activity

Parameters:
wikiType - It can be a Portal, Group, User type of wiki
wikiOwner - The wiki owner
pageId - The page id
page - The wiki page
Throws:
Exception

getWikiById

Wiki getWikiById(String wikiId)
Get wiki by Id

Parameters:
wikiId - The wiki id
Returns:
The wiki

getWikiNameById

String getWikiNameById(String wikiId)
                       throws Exception
Get wiki name by wiki id

Parameters:
wikiId - The wiki id
Returns:
The wiki name
Throws:
Exception


Copyright © 2003-2013 eXo Platform SAS. All Rights Reserved.