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)
          Registers a component plugin into the Wiki service.
 boolean addRelatedPage(WikiPageParams orginaryPageParams, WikiPageParams relatedPageParams)
          Adds a related page to the current wiki page.
 void addWikiTemplatePagePlugin(WikiTemplatePagePlugin plugin)
          Adds a Wiki template as plugin.
 DraftPage createDraftForExistPage(WikiPageParams param, String revision, long clientTime)
          Creates a draft page for a wiki page which is specified by a given param object.
 DraftPage createDraftForNewPage(WikiPageParams parentPageParam, long clientTime)
          Creates a draft page for a new wiki page whose parent is specified by a given param object.
 Page createPage(String wikiType, String wikiOwner, String title, String parentId)
          Creates a new wiki page.
 Template createTemplatePage(String title, WikiPageParams params)
          Creates a new Wiki template.
 void deleteDraftNewPage(String newDraftPageId)
          Deletes a draft page based on its Id.
 boolean deletePage(String wikiType, String wikiOwner, String pageId)
          Deletes a wiki page.
 void deleteTemplatePage(String wikiType, String wikiOwner, String templateId)
          Deletes a Wiki template.
 Object findByPath(String path, String objectNodeType)
          Finds a wiki page based on its type and relative path.
 InputStream getAttachmentAsStream(String path)
          Gets a stream of a wiki attachment.
 List<BreadcrumbData> getBreadcumb(String wikiType, String wikiOwner, String pageId)
          Gets a list of data which is used for composing the breadcrumb.
 String getDefaultWikiSyntaxId()
          Gets Id of a default Wiki syntax.
 DraftPage getDraft(String draftName)
          Gets a draft page by its name.
 DraftPage getDraft(WikiPageParams param)
          Gets a draft page of a wiki page which is specified by a given param object.
 List<DraftPage> getDrafts(String username)
          Gets a list of draft pages belonging to a given user.
 List<PageImpl> getDuplicatePages(PageImpl parentPage, Wiki targetWiki, List<PageImpl> resultList)
          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.
 long getEditPageLivingTime()
          Get the living time of edited page
 Page getExsitedOrNewDraftPageById(String wikiType, String wikiOwner, String pageId)
          Gets a wiki page or its draft if existing by its Id.
 PageImpl getHelpSyntaxPage(String syntaxId)
          Gets a Help wiki page based on a given syntax Id.
 DraftPage getLastestDraft()
          Gets the last created draft of a wiki page.
 Page getMetaDataPage(MetaDataPage metaPage)
          Gets a wiki page of metadata.
 UserWiki getOrCreateUserWiki(String username)
          Gets a user Wiki.
 Page getPageById(String wikiType, String wikiOwner, String pageId)
          Gets a wiki page by a given Id.
 Page getPageByIdJCRQuery(String wikiType, String wikiOwner, String pageId)
          Gets a wiki page by a given Id using JCR query
 Page getPageByRootPermission(String wikiType, String wikiOwner, String pageId)
          Gets a wiki page regardless of the current user's permission.
 Page getPageByUUID(String uuid)
          Gets a wiki page based on its UUID.
 List<PageWikiListener> getPageListeners()
          Gets listeners of all wiki pages that are registered into the Wiki service.
 String getPageTitleOfAttachment(String path)
          Gets title of a wiki attachment.
 String getPortalOwner()
          Gets a portal owner.
 Page getRelatedPage(String wikiType, String wikiOwner, String pageId)
          Gets a related page of a wiki page which is specified by a given Id.
 List<Page> getRelatedPage(WikiPageParams pageParams)
          Gets a list of related pages based on a given param.
 long getSaveDraftSequenceTime()
          Gets an interval which specifies the periodical auto-saving for pages in Wiki.
 String getSpaceNameByGroupId(String groupId)
          Gets a space name by a given group Id.
 Template getTemplatePage(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.
 TemplateContainer getTemplatesContainer(WikiPageParams params)
          Gets a container of templates based on a given params object.
 Wiki getWiki(String wikiType, String owner)
          Gets a Wiki which is defined by its type and owner.
 Wiki getWikiById(String wikiId)
          Gets a Wiki by its Id.
 List<String> getWikiDefaultPermissions(String wikiType, String wikiOwner)
          Gets a list of Wiki default permissions.
 String getWikiNameById(String wikiId)
          Gets a Wiki name by its Id.
 Page getWikiPageByUUID(String uuid)
          Gets a wiki page by its UUID.
 WikiPageParams getWikiPageParams(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.
 String getWikiWebappUri()
          Gets a Wiki webapp URI.
 boolean hasAdminPagePermission(String wikiType, String owner)
          Checks if the current user has the admin permission on a wiki page.
 boolean hasAdminSpacePermission(String wikiType, String owner)
          Checks if the current user has the admin permission on a space or not.
 void initDefaultTemplatePage(String path)
          Initializes a default Wiki template.
 boolean isExisting(String wikiType, String wikiOwner, String pageId)
          Checks if a wiki page exists or not.
 boolean isHiddenSpace(String groupId)
          Checks if a space is hidden or not.
 boolean isSpaceMember(String spaceId, String userId)
          Checks if a given user is member of space or not.
 void modifyTemplate(WikiPageParams params, Template template, String newTitle, String newDescription, String newContent, String newSyntaxId)
          Modifies an existing wiki template.
 boolean movePage(WikiPageParams currentLocationParams, WikiPageParams newLocationParams)
          Moves a wiki page.
 void postAddPage(String wikiType, String wikiOwner, String pageId, Page page)
          Creates an activity of a newly added wiki page.
 void postDeletePage(String wikiType, String wikiOwner, String pageId, Page page)
          Removes all activities related to a deleted wiki page.
 void postUpdatePage(String wikiType, String wikiOwner, String pageId, Page page, String wikiUpdateType)
          Creates an activity once a wiki page is updated.
 void removeDraft(String draftName)
          Removes a draft page by its name.
 void removeDraft(WikiPageParams param)
          Removes a draft page of a wiki page which is specified by the wiki page param.
 boolean removeRelatedPage(WikiPageParams orginaryPageParams, WikiPageParams relatedPageParams)
          Removes a related page of the current wiki page.
 boolean renamePage(String wikiType, String wikiOwner, String pageName, String newName, String newTitle)
          Renames a wiki page.
 org.exoplatform.commons.utils.PageList<SearchResult> search(WikiSearchData data)
          Searches in all wiki pages.
 List<SearchResult> searchRenamedPage(String wikiType, String wikiOwner, String pageId)
          Searches from a list of renamed pages to find the pages whose old Ids are equal to the given page Id.
 List<SpaceBean> searchSpaces(String keyword)
          Searches for spaces by a given keyword.
 List<TemplateSearchResult> searchTemplate(TemplateSearchData data)
          Searches in all templates.
 void setTemplatePagePlugin()
           
 void setWikiPermission(String wikiType, String wikiOwner, List<PermissionEntry> permissionEntries)
          Adds a list of permissions to 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
Initializes a default Wiki template.

Specified by:
initDefaultTemplatePage in interface WikiService
Parameters:
path - The path in which the default Wiki template is initialized.

createPage

public Page createPage(String wikiType,
                       String wikiOwner,
                       String title,
                       String parentId)
                throws Exception
Description copied from interface: WikiService
Creates a new wiki page.

Specified by:
createPage in interface WikiService
Parameters:
wikiType - It can be Portal, Group, or User.
wikiOwner - The Wiki owner.
title - Title of the wiki page.
parentId - Id of the parent wiki page.
Returns:
The new wiki page.
Throws:
Exception

isExisting

public boolean isExisting(String wikiType,
                          String wikiOwner,
                          String pageId)
                   throws Exception
Description copied from interface: WikiService
Checks if a wiki page exists or not.

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

deletePage

public boolean deletePage(String wikiType,
                          String wikiOwner,
                          String pageId)
                   throws Exception
Description copied from interface: WikiService
Deletes a wiki page.

Specified by:
deletePage in interface WikiService
Parameters:
wikiType - It can be Portal, Group, or User.
wikiOwner - The Wiki owner.
pageId - Id of the wiki page.
Returns:
"True" if deleting the wiki page is successful, or "false" if not.
Throws:
Exception

deleteTemplatePage

public void deleteTemplatePage(String wikiType,
                               String wikiOwner,
                               String templateId)
                        throws Exception
Description copied from interface: WikiService
Deletes a Wiki template.

Specified by:
deleteTemplatePage in interface WikiService
Parameters:
wikiType - It can be Portal, Group, or User.
wikiOwner - The Wiki owner.
templateId - Id of the Wiki template.
Throws:
Exception

deleteDraftNewPage

public void deleteDraftNewPage(String newDraftPageId)
                        throws Exception
Description copied from interface: WikiService
Deletes a draft page based on its Id.

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

renamePage

public boolean renamePage(String wikiType,
                          String wikiOwner,
                          String pageName,
                          String newName,
                          String newTitle)
                   throws Exception
Description copied from interface: WikiService
Renames a wiki page.

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

movePage

public boolean movePage(WikiPageParams currentLocationParams,
                        WikiPageParams newLocationParams)
                 throws Exception
Description copied from interface: WikiService
Moves a wiki page.

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

getWikiPermission

public List<PermissionEntry> getWikiPermission(String wikiType,
                                               String wikiOwner)
                                        throws Exception
Description copied from interface: WikiService
Gets a list of Wiki permissions based on its type and owner.

Specified by:
getWikiPermission in interface WikiService
Parameters:
wikiType - It can be Portal, Group, or User.
wikiOwner - The Wiki owner.
Returns:
The list of Wiki permissions.
Throws:
Exception

setWikiPermission

public void setWikiPermission(String wikiType,
                              String wikiOwner,
                              List<PermissionEntry> permissionEntries)
                       throws Exception
Description copied from interface: WikiService
Adds a list of permissions to Wiki.

Specified by:
setWikiPermission in interface WikiService
Parameters:
wikiType - It can be Portal, Group, or User.
wikiOwner - The Wiki owner.
permissionEntries - The list of permissions.
Throws:
Exception

getPageById

public Page getPageById(String wikiType,
                        String wikiOwner,
                        String pageId)
                 throws Exception
Description copied from interface: WikiService
Gets a wiki page by a given Id.

Specified by:
getPageById in interface WikiService
Parameters:
wikiType - It can be Portal, Group, or User.
wikiOwner - The Wiki owner.
pageId - Id of the wiki page.
Returns:
The wiki page if the current user has the read permission. Otherwise, it is "null".
Throws:
Exception

getPageByIdJCRQuery

public Page getPageByIdJCRQuery(String wikiType,
                                String wikiOwner,
                                String pageId)
                         throws Exception
Description copied from interface: WikiService
Gets a wiki page by a given Id using JCR query

Specified by:
getPageByIdJCRQuery in interface WikiService
Parameters:
wikiType - It can be Portal, Group, or User.
wikiOwner - The Wiki owner.
pageId - Id of the wiki page.
Returns:
The wiki page if the current user has the read permission. Otherwise, it is "null".
Throws:
Exception

getPageByRootPermission

public Page getPageByRootPermission(String wikiType,
                                    String wikiOwner,
                                    String pageId)
                             throws Exception
Description copied from interface: WikiService
Gets a wiki page regardless of the current user's permission.

Specified by:
getPageByRootPermission in interface WikiService
Parameters:
wikiType - It can be Portal, Group, or User.
wikiOwner - The Wiki owner.
pageId - Id of the wiki page.
Returns:
The wiki page.
Throws:
Exception

getRelatedPage

public Page getRelatedPage(String wikiType,
                           String wikiOwner,
                           String pageId)
                    throws Exception
Description copied from interface: WikiService
Gets a related page of a wiki page which is specified by a given Id.

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

getExsitedOrNewDraftPageById

public Page getExsitedOrNewDraftPageById(String wikiType,
                                         String wikiOwner,
                                         String pageId)
                                  throws Exception
Description copied from interface: WikiService
Gets a wiki page or its draft if existing by its Id.

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

getPageByUUID

public Page getPageByUUID(String uuid)
                   throws Exception
Description copied from interface: WikiService
Gets a wiki page based on its UUID.

Specified by:
getPageByUUID in interface WikiService
Parameters:
uuid - UUID of the wiki page.
Returns:
The wiki page.
Throws:
Exception

getTemplatePage

public Template getTemplatePage(WikiPageParams params,
                                String templateId)
                         throws Exception
Description copied from interface: WikiService
Gets a Wiki template.

Specified by:
getTemplatePage in interface WikiService
Parameters:
params - The params object which is used for creating the Wiki template.
templateId - Id of the wiki template.
Returns:
The wiki template.
Throws:
Exception

getTemplates

public Map<String,Template> getTemplates(WikiPageParams params)
                                  throws Exception
Description copied from interface: WikiService
Gets a map of wiki templates based on a given params object.

Specified by:
getTemplates in interface WikiService
Parameters:
params - The params object which is used for getting the wiki templates.
Returns:
The map of wiki templates.
Throws:
Exception

getTemplatesContainer

public TemplateContainer getTemplatesContainer(WikiPageParams params)
                                        throws Exception
Description copied from interface: WikiService
Gets a container of templates based on a given params object.

Specified by:
getTemplatesContainer in interface WikiService
Parameters:
params - The params object which is used for getting the containers.
Returns:
The container of templates.
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
Modifies an existing wiki template.

Specified by:
modifyTemplate in interface WikiService
Parameters:
params - The params object which is used for getting the wiki template.
template - The wiki template to be modified.
newTitle - New name of the wiki template.
newDescription - New description of the wiki template.
newContent - New content of the wiki template.
newSyntaxId - New syntax Id of the wiki template.
Throws:
Exception

search

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

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

searchTemplate

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

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

searchRenamedPage

public List<SearchResult> searchRenamedPage(String wikiType,
                                            String wikiOwner,
                                            String pageId)
                                     throws Exception
Description copied from interface: WikiService
Searches from a list of renamed pages to find the pages whose old Ids are equal to the given page Id.

Specified by:
searchRenamedPage in interface WikiService
Parameters:
wikiType - It can be Portal, Group, or User.
wikiOwner - The Wiki owner.
pageId - Id of the page before it is renamed.
Returns:
The pages whose old Ids are equal to 'pageId'.
Throws:
Exception

findByPath

public Object findByPath(String path,
                         String objectNodeType)
Description copied from interface: WikiService
Finds a wiki page based on its type and relative path.

Specified by:
findByPath in interface WikiService
Parameters:
path - The relative path to find.
objectNodeType - The node type can be page, attachment or template.
Returns:
A wiki object that can be page, attachement or template.

getPageTitleOfAttachment

public String getPageTitleOfAttachment(String path)
                                throws Exception
Description copied from interface: WikiService
Gets title of a wiki attachment.

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

getAttachmentAsStream

public InputStream getAttachmentAsStream(String path)
                                  throws Exception
Description copied from interface: WikiService
Gets a stream of a wiki attachment.

Specified by:
getAttachmentAsStream in interface WikiService
Parameters:
path - Path of the wiki attachment.
Returns:
The stream of the wiki attachment.
Throws:
Exception

getBreadcumb

public List<BreadcrumbData> getBreadcumb(String wikiType,
                                         String wikiOwner,
                                         String pageId)
                                  throws Exception
Description copied from interface: WikiService
Gets a list of data which is used for composing the breadcrumb.

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

getHelpSyntaxPage

public PageImpl getHelpSyntaxPage(String syntaxId)
                           throws Exception
Description copied from interface: WikiService
Gets a Help wiki page based on a given syntax Id.

Specified by:
getHelpSyntaxPage in interface WikiService
Parameters:
syntaxId - Id of the syntax.
Returns:
The Help wiki page.
Throws:
Exception

getMetaDataPage

public Page getMetaDataPage(MetaDataPage metaPage)
                     throws Exception
Description copied from interface: WikiService
Gets a wiki page of metadata.

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

getDefaultWikiSyntaxId

public String getDefaultWikiSyntaxId()
Description copied from interface: WikiService
Gets Id of a default Wiki syntax.

Specified by:
getDefaultWikiSyntaxId in interface WikiService
Returns:
The Id.

getSaveDraftSequenceTime

public long getSaveDraftSequenceTime()
Description copied from interface: WikiService
Gets an interval which specifies the periodical auto-saving for pages in Wiki.

Specified by:
getSaveDraftSequenceTime in interface WikiService
Returns:
The interval. Its default value is 30 seconds.

getEditPageLivingTime

public long getEditPageLivingTime()
Description copied from interface: WikiService
Get the living time of edited page

Specified by:
getEditPageLivingTime in interface WikiService
Returns:
The living time of edited page

getWikiPageParams

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

Specified by:
getWikiPageParams in interface WikiService
Parameters:
data - The data in the breadcrumb that identifies the wiki page.
Returns:
The parameters identifying the wiki page.

getDuplicatePages

public List<PageImpl> getDuplicatePages(PageImpl parentPage,
                                        Wiki targetWiki,
                                        List<PageImpl> resultList)
                                 throws Exception
Description copied from interface: WikiService
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.

Specified by:
getDuplicatePages in interface WikiService
Parameters:
parentPage - The page to check.
targetWiki - The target Wiki to check.
resultList - The list of duplicated wiki pages.
Returns:
The list of duplicated wiki pages.
Throws:
Exception

getWiki

public Wiki getWiki(String wikiType,
                    String owner)
Description copied from interface: WikiService
Gets a Wiki which is defined by its type and owner.

Specified by:
getWiki in interface WikiService
Parameters:
wikiType - It can be Portal, Group, or User.
owner - The Wiki owner.
Returns:
The Wiki.

getPortalOwner

public String getPortalOwner()
Description copied from interface: WikiService
Gets a portal owner.

Specified by:
getPortalOwner in interface WikiService
Returns:
The portal owner.

hasAdminSpacePermission

public boolean hasAdminSpacePermission(String wikiType,
                                       String owner)
                                throws Exception
Description copied from interface: WikiService
Checks if the current user has the admin permission on a space or not.

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

hasAdminPagePermission

public boolean hasAdminPagePermission(String wikiType,
                                      String owner)
                               throws Exception
Description copied from interface: WikiService
Checks if the current user has the admin permission on a wiki page.

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

createTemplatePage

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

Specified by:
createTemplatePage in interface WikiService
Parameters:
title - Title of the Wiki template.
params - The params object which is used for creating the new Wiki template.
Returns:
The new Wiki template.
Throws:
Exception

getWikiDefaultPermissions

public List<String> getWikiDefaultPermissions(String wikiType,
                                              String wikiOwner)
                                       throws Exception
Description copied from interface: WikiService
Gets a list of Wiki default permissions.

Specified by:
getWikiDefaultPermissions in interface WikiService
Parameters:
wikiType - It can be Portal, Group, or User.
wikiOwner - The Wiki owner.
Returns:
The list of Wiki default permissions.
Throws:
Exception

addComponentPlugin

public void addComponentPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
Description copied from interface: WikiService
Registers a component plugin into the Wiki service.

Specified by:
addComponentPlugin in interface WikiService
Parameters:
plugin - The component plugin to be registered.

addWikiTemplatePagePlugin

public void addWikiTemplatePagePlugin(WikiTemplatePagePlugin plugin)
Description copied from interface: WikiService
Adds a Wiki template as plugin.

Specified by:
addWikiTemplatePagePlugin in interface WikiService
Parameters:
plugin - The wiki template plugin to be added.

getPageListeners

public List<PageWikiListener> getPageListeners()
Description copied from interface: WikiService
Gets listeners of all wiki pages that are registered into the Wiki service.

Specified by:
getPageListeners in interface WikiService
Returns:
The list of listeners.

setTemplatePagePlugin

public void setTemplatePagePlugin()

getOrCreateUserWiki

public UserWiki getOrCreateUserWiki(String username)
Description copied from interface: WikiService
Gets a user Wiki. If it does not exist, the new one will be created.

Specified by:
getOrCreateUserWiki in interface WikiService
Parameters:
username - Name of the user.
Returns:
The user Wiki.

searchSpaces

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

Specified by:
searchSpaces in interface WikiService
Parameters:
keyword - The keyword to search for spaces.
Returns:
The list of spaces matching with the keyword.
Throws:
Exception

addRelatedPage

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

Specified by:
addRelatedPage in interface WikiService
Parameters:
orginaryPageParams - The params object of the current wiki page.
relatedPageParams - The params object of the related page.
Returns:
"True" if adding the related page is successful, or "false" if not.
Throws:
Exception

getRelatedPage

public List<Page> getRelatedPage(WikiPageParams pageParams)
                          throws Exception
Description copied from interface: WikiService
Gets a list of related pages based on a given param.

Specified by:
getRelatedPage in interface WikiService
Parameters:
pageParams - The params object of the wiki page.
Returns:
The list of related pages.
Throws:
Exception

removeRelatedPage

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

Specified by:
removeRelatedPage in interface WikiService
Parameters:
orginaryPageParams - The params object of the current wiki page.
relatedPageParams - The params object of the related page.
Returns:
"True" if removing the related page is successful, or "false" if not.
Throws:
Exception

getWikiWebappUri

public String getWikiWebappUri()
Description copied from interface: WikiService
Gets a Wiki webapp URI.

Specified by:
getWikiWebappUri in interface WikiService
Returns:
The Wiki webapp URI.

isSpaceMember

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

Specified by:
isSpaceMember in interface WikiService
Parameters:
spaceId - Id of the space.
userId - The username.
Returns:
"True" if the user is member, or "false" if not.

isHiddenSpace

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

Specified by:
isHiddenSpace in interface WikiService
Parameters:
groupId - Id of the group.
Returns:
The returned value is "true" if the space is hidden, or "false" if not.
Throws:
Exception

createDraftForNewPage

public DraftPage createDraftForNewPage(WikiPageParams parentPageParam,
                                       long clientTime)
                                throws Exception
Description copied from interface: WikiService
Creates a draft page for a new wiki page whose parent is specified by a given param object.

Specified by:
createDraftForNewPage in interface WikiService
Parameters:
parentPageParam - The param object of the parent wiki page.
clientTime - The time of client when the draft page is saved.
Returns:
The draft page.
Throws:
Exception - if the draft page cannot be created.

createDraftForExistPage

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

Specified by:
createDraftForExistPage in interface WikiService
Parameters:
param - The param object of the 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:
Exception - if the draft page cannot be created.

getDraft

public DraftPage getDraft(WikiPageParams param)
                   throws Exception
Description copied from interface: WikiService
Gets a draft page of a wiki page which is specified by a given param object.

Specified by:
getDraft in interface WikiService
Parameters:
param - The param object of the wiki page.
Returns:
The draft page, or "null" if the draft page does not exist.
Throws:
Exception

getLastestDraft

public DraftPage getLastestDraft()
                          throws Exception
Description copied from interface: WikiService
Gets the last created draft of a wiki page.

Specified by:
getLastestDraft in interface WikiService
Returns:
The last draft.
Throws:
Exception

getDraft

public DraftPage getDraft(String draftName)
                   throws Exception
Description copied from interface: WikiService
Gets a draft page by its name.

Specified by:
getDraft in interface WikiService
Parameters:
draftName - Name of the draft page.
Returns:
The draft page, or "null" if it does not exist.
Throws:
Exception

removeDraft

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

Specified by:
removeDraft in interface WikiService
Parameters:
param - The param object of the wiki page param.
Throws:
Exception

removeDraft

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

Specified by:
removeDraft in interface WikiService
Parameters:
draftName - Name of the draft page.
Throws:
Exception

getDrafts

public List<DraftPage> getDrafts(String username)
                          throws Exception
Description copied from interface: WikiService
Gets a list of draft pages belonging to a given user.

Specified by:
getDrafts in interface WikiService
Parameters:
username - Name of the user.
Returns:
The list of draft pages.
Throws:
Exception

getWikiPageByUUID

public Page getWikiPageByUUID(String uuid)
                       throws Exception
Description copied from interface: WikiService
Gets a wiki page by its UUID.

Specified by:
getWikiPageByUUID in interface WikiService
Parameters:
uuid - UUID of the wiki page.
Returns:
The 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
Creates an activity once a wiki page is updated.

Specified by:
postUpdatePage in interface WikiService
Parameters:
wikiType - It can be Portal, Group, or User.
wikiOwner - The Wiki owner.
pageId - Id of the wiki page.
page - The wiki page.
wikiUpdateType - The update type (edit title, edit content, or edit both).
Throws:
Exception

postAddPage

public void postAddPage(String wikiType,
                        String wikiOwner,
                        String pageId,
                        Page page)
                 throws Exception
Description copied from interface: WikiService
Creates an activity of a newly added wiki page.

Specified by:
postAddPage in interface WikiService
Parameters:
wikiType - It can be Portal, Group, or User.
wikiOwner - The Wiki owner.
pageId - Id of the new wiki page.
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
Removes all activities related to a deleted wiki page.

Specified by:
postDeletePage in interface WikiService
Parameters:
wikiType - It can be Portal, Group, or User.
wikiOwner - The Wiki owner.
pageId - Id of the deleted wiki page.
page - The deleted wiki page.
Throws:
Exception

getSpaceNameByGroupId

public String getSpaceNameByGroupId(String groupId)
                             throws Exception
Description copied from interface: WikiService
Gets a space name by a given group Id.

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

getWikiById

public Wiki getWikiById(String wikiId)
Description copied from interface: WikiService
Gets a Wiki by its 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
Gets a Wiki name by its 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.