org.exoplatform.wiki.service.impl
Class WikiServiceImpl

java.lang.Object
  extended by org.exoplatform.wiki.service.impl.WikiServiceImpl
All Implemented Interfaces:
WikiService, org.picocontainer.Startable

public class WikiServiceImpl
extends Object
implements WikiService, org.picocontainer.Startable


Constructor Summary
WikiServiceImpl(org.exoplatform.container.configuration.ConfigurationManager configManager, JCRDataStorage jcrDataStorage, org.exoplatform.container.xml.InitParams initParams)
           
 
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 plugin)
          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 newDraftPageId)
          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 newTitle, 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 setTemplatePagePlugin()
           
 void setWikiPermission(String wikiType, String wikiOwner, List<PermissionEntry> permissionEntries)
          Add new permissions to the wiki
 void start()
           
 void stop()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WikiServiceImpl

public WikiServiceImpl(org.exoplatform.container.configuration.ConfigurationManager configManager,
                       JCRDataStorage jcrDataStorage,
                       org.exoplatform.container.xml.InitParams initParams)
Method Detail

initDefaultTemplatePage

public void initDefaultTemplatePage(String path)
Description copied from interface: WikiService
Initialise the default template page

Specified by:
initDefaultTemplatePage in interface WikiService
Parameters:
path - the page to initialize the default template page

createPage

public Page createPage(String wikiType,
                       String wikiOwner,
                       String title,
                       String parentId)
                throws Exception
Description copied from interface: WikiService
Create a new Wiki Page

Specified by:
createPage in interface WikiService
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

isExisting

public boolean isExisting(String wikiType,
                          String wikiOwner,
                          String pageId)
                   throws Exception
Description copied from interface: WikiService
Return true if the page exist

Specified by:
isExisting in interface WikiService
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

deletePage

public boolean deletePage(String wikiType,
                          String wikiOwner,
                          String pageId)
                   throws Exception
Description copied from interface: WikiService
Delete the Wiki Page

Specified by:
deletePage in interface WikiService
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

public void deleteTemplatePage(String wikiType,
                               String wikiOwner,
                               String templateId)
                        throws Exception
Description copied from interface: WikiService
Delete the template

Specified by:
deleteTemplatePage in interface WikiService
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

public void deleteDraftNewPage(String newDraftPageId)
                        throws Exception
Description copied from interface: WikiService
Delete the draft based on is Id

Specified by:
deleteDraftNewPage in interface WikiService
Parameters:
newDraftPageId - Id of the draft
Throws:
Exception

renamePage

public boolean renamePage(String wikiType,
                          String wikiOwner,
                          String pageName,
                          String newName,
                          String newTitle)
                   throws Exception
Description copied from interface: WikiService
Rename the wiki Page

Specified by:
renamePage in interface WikiService
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

public boolean movePage(WikiPageParams currentLocationParams,
                        WikiPageParams newLocationParams)
                 throws Exception
Description copied from interface: WikiService
Move a wiki Page

Specified by:
movePage in interface WikiService
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

public List<PermissionEntry> getWikiPermission(String wikiType,
                                               String wikiOwner)
                                        throws Exception
Description copied from interface: WikiService
Return a lists permissions for the wiki based on the type and the owner

Specified by:
getWikiPermission in interface WikiService
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

public void setWikiPermission(String wikiType,
                              String wikiOwner,
                              List<PermissionEntry> permissionEntries)
                       throws Exception
Description copied from interface: WikiService
Add new permissions to the wiki

Specified by:
setWikiPermission in interface WikiService
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

public Page getPageById(String wikiType,
                        String wikiOwner,
                        String pageId)
                 throws Exception
Description copied from interface: WikiService
Get a page based on is Id

Specified by:
getPageById in interface WikiService
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

public Page getPageByRootPermission(String wikiType,
                                    String wikiOwner,
                                    String pageId)
                             throws Exception
Description copied from interface: WikiService
Return the wiki Home page with the root permissions

Specified by:
getPageByRootPermission in interface WikiService
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

public Page getRelatedPage(String wikiType,
                           String wikiOwner,
                           String pageId)
                    throws Exception
Description copied from interface: WikiService
Return the related page based on is Id

Specified by:
getRelatedPage in interface WikiService
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

public Page getExsitedOrNewDraftPageById(String wikiType,
                                         String wikiOwner,
                                         String pageId)
                                  throws Exception
Description copied from interface: WikiService
Return the page itself or is draft if one exist

Specified by:
getExsitedOrNewDraftPageById in interface WikiService
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

public Page getPageByUUID(String uuid)
                   throws Exception
Description copied from interface: WikiService
Retugn a wiki page based on is id

Specified by:
getPageByUUID in interface WikiService
Parameters:
uuid - Id of the wiki page
Returns:
Wiki page
Throws:
Exception

getTemplatePage

public Template getTemplatePage(WikiPageParams params,
                                String templateId)
                         throws Exception
Description copied from interface: WikiService
Return the template to use for the wiki page

Specified by:
getTemplatePage in interface WikiService
Returns:
A wiki template
Throws:
Exception

getTemplates

public Map<String,Template> getTemplates(WikiPageParams params)
                                  throws Exception
Description copied from interface: WikiService
Return a map of templates for the wiki page

Specified by:
getTemplates in interface WikiService
Parameters:
params - The full params to get a page
Returns:
Map of templates
Throws:
Exception

getTemplatesContainer

public TemplateContainer getTemplatesContainer(WikiPageParams params)
                                        throws Exception
Description copied from interface: WikiService
Return the template container

Specified by:
getTemplatesContainer in interface WikiService
Parameters:
params - The full params to get a page
Returns:
the template container
Throws:
Exception

modifyTemplate

public void modifyTemplate(WikiPageParams params,
                           Template template,
                           String newTitle,
                           String newDescription,
                           String newContent,
                           String newSyntaxId)
                    throws Exception
Description copied from interface: WikiService
Modify an existing template available

Specified by:
modifyTemplate in interface WikiService
Parameters:
params - The full params to get a page
template - the template
newTitle - 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

search

public org.exoplatform.commons.utils.PageList<SearchResult> search(WikiSearchData data)
                                                            throws Exception
Description copied from interface: WikiService
Search in all wiki pages

Specified by:
search in interface WikiService
Parameters:
data - The data to search
Returns:
List of results
Throws:
Exception

searchTemplate

public List<TemplateSearchResult> searchTemplate(TemplateSearchData data)
                                          throws Exception
Description copied from interface: WikiService
Search in all template

Specified by:
searchTemplate in interface WikiService
Parameters:
data - The data to search
Returns:
List of results
Throws:
Exception

searchRenamedPage

public List<SearchResult> searchRenamedPage(String wikiType,
                                            String wikiOwner,
                                            String pageId)
                                     throws Exception
Description copied from interface: WikiService
Search pages in the list of renamed pages

Specified by:
searchRenamedPage in interface WikiService
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

findByPath

public Object findByPath(String path,
                         String objectNodeType)
Description copied from interface: WikiService
Find the fullpath based on the type and is relative path.

Specified by:
findByPath in interface WikiService
Parameters:
path - relative path to search
objectNodeType - Can be a page, attachment or template
Returns:
An object based on is path and type

getPageTitleOfAttachment

public String getPageTitleOfAttachment(String path)
                                throws Exception
Description copied from interface: WikiService
Get the page title of an attachment

Specified by:
getPageTitleOfAttachment in interface WikiService
Parameters:
path - Path of the attachment
Returns:
title of the page
Throws:
Exception

getAttachmentAsStream

public InputStream getAttachmentAsStream(String path)
                                  throws Exception
Description copied from interface: WikiService
Return an attachment as stream

Specified by:
getAttachmentAsStream in interface WikiService
Parameters:
path - Path to use to get the attachment
Returns:
Stream of the attachment
Throws:
Exception

getBreadcumb

public List<BreadcrumbData> getBreadcumb(String wikiType,
                                         String wikiOwner,
                                         String pageId)
                                  throws Exception
Description copied from interface: WikiService
Return a list of data to compose the breadcrumb

Specified by:
getBreadcumb in interface WikiService
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

getHelpSyntaxPage

public PageImpl getHelpSyntaxPage(String syntaxId)
                           throws Exception
Description copied from interface: WikiService
Return the helps syntax page based on the syntax id

Specified by:
getHelpSyntaxPage in interface WikiService
Parameters:
syntaxId - Id of the syntax
Returns:
Wiki Page
Throws:
Exception

getMetaDataPage

public Page getMetaDataPage(MetaDataPage metaPage)
                     throws Exception
Description copied from interface: WikiService
Return the a page of metadata

Specified by:
getMetaDataPage in interface WikiService
Parameters:
metaPage - the metadata to use, mainly emoticons
Returns:
page of metadata
Throws:
Exception

getDefaultWikiSyntaxId

public String getDefaultWikiSyntaxId()
Description copied from interface: WikiService
Get the default wiki syntax Id

Specified by:
getDefaultWikiSyntaxId in interface WikiService
Returns:
the default wiki syntax Id

getSaveDraftSequenceTime

public long getSaveDraftSequenceTime()
Description copied from interface: WikiService
Get the draft save sequence time from config file

Specified by:
getSaveDraftSequenceTime in interface WikiService
Returns:
The save draft sequence time

getWikiPageParams

public WikiPageParams getWikiPageParams(BreadcrumbData data)
Description copied from interface: WikiService
Get a wiki page based on the data stored in the breadcrumb

Specified by:
getWikiPageParams in interface WikiService
Parameters:
data - A part of the breadcrumb
Returns:
Wiki Page params

getDuplicatePages

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

Specified by:
getDuplicatePages in interface WikiService
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

getWiki

public Wiki getWiki(String wikiType,
                    String owner)
Description copied from interface: WikiService
Get a wiki that definds by wikiType and owner

Specified by:
getWiki in interface WikiService
Parameters:
wikiType - It can be a Portal, Group, User type of wiki
owner - Wiki owner
Returns:
The wiki

getPortalOwner

public String getPortalOwner()
Description copied from interface: WikiService
Get portal owner

Specified by:
getPortalOwner in interface WikiService
Returns:
portal owner

hasAdminSpacePermission

public boolean hasAdminSpacePermission(String wikiType,
                                       String owner)
                                throws Exception
Description copied from interface: WikiService
Check if the current user has addmin permission on the space

Specified by:
hasAdminSpacePermission in interface WikiService
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

public boolean hasAdminPagePermission(String wikiType,
                                      String owner)
                               throws Exception
Description copied from interface: WikiService
Check if the current user has addmin permission on the page

Specified by:
hasAdminPagePermission in interface WikiService
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

createTemplatePage

public Template createTemplatePage(String title,
                                   WikiPageParams params)
                            throws Exception
Description copied from interface: WikiService
Create a new template Wiki Page

Specified by:
createTemplatePage in interface WikiService
Parameters:
title - The title of the template
params - Parameters to create the new template
Returns:
the new template
Throws:
Exception

getWikiDefaultPermissions

public List<String> getWikiDefaultPermissions(String wikiType,
                                              String wikiOwner)
                                       throws Exception
Description copied from interface: WikiService
Get wiki default permission

Specified by:
getWikiDefaultPermissions in interface WikiService
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

public void addComponentPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
Description copied from interface: WikiService
register a ComponentPlugin

Specified by:
addComponentPlugin in interface WikiService

addWikiTemplatePagePlugin

public void addWikiTemplatePagePlugin(WikiTemplatePagePlugin plugin)
Description copied from interface: WikiService
Add the wiki page as plugin

Specified by:
addWikiTemplatePagePlugin in interface WikiService
Parameters:
plugin - The template plugin to use

getPageListeners

public List<PageWikiListener> getPageListeners()
Specified by:
getPageListeners in interface WikiService
Returns:
list of PageWikiListener

setTemplatePagePlugin

public void setTemplatePagePlugin()

getOrCreateUserWiki

public UserWiki getOrCreateUserWiki(String username)
Description copied from interface: WikiService
Get user wiki, and if it did not create yet then create new one

Specified by:
getOrCreateUserWiki in interface WikiService
Parameters:
username - The user name
Returns:
The UserWiki for user

searchSpaces

public List<SpaceBean> searchSpaces(String keyword)
                             throws Exception
Description copied from interface: WikiService
Search for spaces by keyword

Specified by:
searchSpaces in interface WikiService
Parameters:
keyword - The keyword to search spaces
Returns:
The list of spaces that match wiki keyword
Throws:
Exception

addRelatedPage

public boolean addRelatedPage(WikiPageParams orginaryPageParams,
                              WikiPageParams relatedPageParams)
                       throws Exception
Description copied from interface: WikiService
Add a related page of the current wiki page

Specified by:
addRelatedPage in interface WikiService
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

public List<Page> getRelatedPage(WikiPageParams pageParams)
                          throws Exception
Description copied from interface: WikiService
Return a list of related page based on its param

Specified by:
getRelatedPage in interface WikiService
Parameters:
pageParams - Param of the wiki page
Returns:
List of related page
Throws:
Exception

removeRelatedPage

public boolean removeRelatedPage(WikiPageParams orginaryPageParams,
                                 WikiPageParams relatedPageParams)
                          throws Exception
Description copied from interface: WikiService
Remove a related page of the current wiki page

Specified by:
removeRelatedPage in interface WikiService
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

getWikiWebappUri

public String getWikiWebappUri()
Description copied from interface: WikiService
Get the uri of wiki webapp

Specified by:
getWikiWebappUri in interface WikiService
Returns:
wiki webapp uri

isSpaceMember

public boolean isSpaceMember(String spaceId,
                             String userId)
Description copied from interface: WikiService
Checks whether a user is a space's member or not.

Specified by:
isSpaceMember in interface WikiService
Parameters:
spaceId - the existing space id
userId - the remote user id
Returns:
true if that user is a member; otherwise, false

isHiddenSpace

public boolean isHiddenSpace(String groupId)
                      throws Exception
Description copied from interface: WikiService
Check if the space is hidden or not

Specified by:
isHiddenSpace in interface WikiService
Parameters:
groupId - The group Id to check
Returns:
the space is hidden or not
Throws:
Exception

createDraftForNewPage

public DraftPage createDraftForNewPage(WikiPageParams parentPageParam,
                                       long clientTime)
                                throws Exception
Description copied from interface: WikiService
Create a draft page for a new wiki page which parent is specified by the wiki page param

Specified by:
createDraftForNewPage in interface WikiService
Parameters:
parentPageParam - parent wiki page param
clientTime - The time of client when save draft
Returns:
draft page
Throws:
Exception - if create draft not success

createDraftForExistPage

public DraftPage createDraftForExistPage(WikiPageParams param,
                                         String revision,
                                         long clientTime)
                                  throws Exception
Description copied from interface: WikiService
Create a draft page for a wiki page which is specified by the wiki page param

Specified by:
createDraftForExistPage in interface WikiService
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

getDraft

public DraftPage getDraft(WikiPageParams param)
                   throws Exception
Description copied from interface: WikiService
Achieve a draft page for a wiki page which is specified by the wiki page param

Specified by:
getDraft in interface WikiService
Parameters:
param - wiki page param
Returns:
draft page or null if draft page doesn't exist.
Throws:
Exception

getLastestDraft

public DraftPage getLastestDraft()
                          throws Exception
Description copied from interface: WikiService
Get the draft that's created lastest

Specified by:
getLastestDraft in interface WikiService
Returns:
lastest draft
Throws:
Exception

getDraft

public DraftPage getDraft(String draftName)
                   throws Exception
Description copied from interface: WikiService
Get draft by draft name

Specified by:
getDraft in interface WikiService
Parameters:
draftName - draft name
Returns:
draft page or null if draft page doesn't exist.
Throws:
Exception

removeDraft

public void removeDraft(WikiPageParams param)
                 throws Exception
Description copied from interface: WikiService
Remove a draft page for a wiki page which is specified by the wiki page param

Specified by:
removeDraft in interface WikiService
Parameters:
param - wiki page param
Throws:
Exception

removeDraft

public void removeDraft(String draftName)
                 throws Exception
Description copied from interface: WikiService
Remove a draft page by draft name

Specified by:
removeDraft in interface WikiService
Parameters:
draftName - draft name
Throws:
Exception

getDrafts

public List<DraftPage> getDrafts(String username)
                          throws Exception
Description copied from interface: WikiService
Get collection of draft page belong to a user

Specified by:
getDrafts in interface WikiService
Parameters:
username - user name
Returns:
draft list of user
Throws:
Exception

getWikiPageByUUID

public Page getWikiPageByUUID(String uuid)
                       throws Exception
Description copied from interface: WikiService
Get wiki page by page UUID

Specified by:
getWikiPageByUUID in interface WikiService
Parameters:
uuid - of wiki page
Returns:
wiki page
Throws:
Exception

postUpdatePage

public void postUpdatePage(String wikiType,
                           String wikiOwner,
                           String pageId,
                           Page page,
                           String wikiUpdateType)
                    throws Exception
Description copied from interface: WikiService
Publish a update activity

Specified by:
postUpdatePage in interface WikiService
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

public void postAddPage(String wikiType,
                        String wikiOwner,
                        String pageId,
                        Page page)
                 throws Exception
Description copied from interface: WikiService
Publish a add activity

Specified by:
postAddPage in interface WikiService
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

public void postDeletePage(String wikiType,
                           String wikiOwner,
                           String pageId,
                           Page page)
                    throws Exception
Description copied from interface: WikiService
Publish a delete page activity

Specified by:
postDeletePage in interface WikiService
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

getSpaceNameByGroupId

public String getSpaceNameByGroupId(String groupId)
                             throws Exception
Description copied from interface: WikiService
Get space name by group Id

Specified by:
getSpaceNameByGroupId in interface WikiService
Parameters:
groupId - The group Id to get space name
Returns:
The space name
Throws:
Exception

getWikiById

public Wiki getWikiById(String wikiId)
Description copied from interface: WikiService
Get wiki by Id

Specified by:
getWikiById in interface WikiService
Parameters:
wikiId - The wiki id
Returns:
The wiki

getWikiNameById

public String getWikiNameById(String wikiId)
                       throws Exception
Description copied from interface: WikiService
Get wiki name by wiki id

Specified by:
getWikiNameById in interface WikiService
Parameters:
wikiId - The wiki id
Returns:
The wiki name
Throws:
Exception

start

public void start()
Specified by:
start in interface org.picocontainer.Startable

stop

public void stop()
Specified by:
stop in interface org.picocontainer.Startable


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