org.exoplatform.wiki.service
Interface WikiService

All Known Implementing Classes:
WikiServiceImpl

public interface WikiService

Created by The eXo Platform SARL.

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

Since:
Mar 04, 2010
Author:
exoplatform

Method Summary
 void addComponentPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
          register a PageWikiListener
 boolean addRelatedPage(WikiPageParams orginaryPageParams, WikiPageParams relatedPageParams)
           
 void addWikiTemplatePagePlugin(WikiTemplatePagePlugin templatePlugin)
           
 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)
           
 Template createTemplatePage(String title, WikiPageParams params)
           
 void deleteDraftNewPage(String draftNewPageId)
           
 boolean deletePage(String wikiType, String wikiOwner, String pageId)
           
 void deleteTemplatePage(String wikiType, String wikiOwner, String templateId)
           
 Object findByPath(String path, String objectNodeType)
           
 InputStream getAttachmentAsStream(String path)
           
 List<BreadcrumbData> getBreadcumb(String wikiType, String wikiOwner, String pageId)
           
 String getDefaultWikiSyntaxId()
           
 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)
           
 PageImpl getHelpSyntaxPage(String syntaxId)
           
 DraftPage getLastestDraft()
          Get the draft that's created lastest
 Page getMetaDataPage(MetaDataPage metaPage)
           
 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)
           
 Page getPageByRootPermission(String wikiType, String wikiOwner, String pageId)
           
 Page getPageByUUID(String uuid)
           
 List<PageWikiListener> getPageListeners()
           
 String getPageTitleOfAttachment(String path)
           
 String getPortalOwner()
          Get portal owner
 Page getRelatedPage(String wikiType, String wikiOwner, String pageId)
           
 List<Page> getRelatedPage(WikiPageParams pageParams)
           
 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)
           
 Map<String,Template> getTemplates(WikiPageParams params)
           
 TemplateContainer getTemplatesContainer(WikiPageParams params)
           
 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)
           
 List<PermissionEntry> getWikiPermission(String wikiType, String wikiOwner)
           
 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)
           
 boolean isExisting(String wikiType, String wikiOwner, String pageId)
           
 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)
           
 boolean movePage(WikiPageParams currentLocationParams, WikiPageParams newLocationParams)
           
 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)
           
 boolean renamePage(String wikiType, String wikiOwner, String pageName, String newName, String newTitle)
           
 org.exoplatform.commons.utils.PageList<SearchResult> search(WikiSearchData data)
           
 org.exoplatform.commons.utils.PageList<SearchResult> searchContent(WikiSearchData data)
           
 List<TitleSearchResult> searchDataByTitle(WikiSearchData data)
           
 List<SearchResult> searchRenamedPage(String wikiType, String wikiOwner, String pageId)
           
 List<SpaceBean> searchSpaces(String keyword)
          Search for spaces by keyword
 List<TemplateSearchResult> searchTemplate(TemplateSearchData data)
           
 void setWikiPermission(String wikiType, String wikiOwner, List<PermissionEntry> permissionEntries)
           
 

Method Detail

createPage

Page createPage(String wikiType,
                String wikiOwner,
                String title,
                String parentId)
                throws Exception
Throws:
Exception

createTemplatePage

Template createTemplatePage(String title,
                            WikiPageParams params)
                            throws Exception
Throws:
Exception

initDefaultTemplatePage

void initDefaultTemplatePage(String path)

deletePage

boolean deletePage(String wikiType,
                   String wikiOwner,
                   String pageId)
                   throws Exception
Throws:
Exception

deleteTemplatePage

void deleteTemplatePage(String wikiType,
                        String wikiOwner,
                        String templateId)
                        throws Exception
Throws:
Exception

deleteDraftNewPage

void deleteDraftNewPage(String draftNewPageId)
                        throws Exception
Throws:
Exception

renamePage

boolean renamePage(String wikiType,
                   String wikiOwner,
                   String pageName,
                   String newName,
                   String newTitle)
                   throws Exception
Throws:
Exception

movePage

boolean movePage(WikiPageParams currentLocationParams,
                 WikiPageParams newLocationParams)
                 throws Exception
Throws:
Exception

getWikiPermission

List<PermissionEntry> getWikiPermission(String wikiType,
                                        String wikiOwner)
                                        throws Exception
Throws:
Exception

setWikiPermission

void setWikiPermission(String wikiType,
                       String wikiOwner,
                       List<PermissionEntry> permissionEntries)
                       throws Exception
Throws:
Exception

getPageById

Page getPageById(String wikiType,
                 String wikiOwner,
                 String pageId)
                 throws Exception
Throws:
Exception

getPageByRootPermission

Page getPageByRootPermission(String wikiType,
                             String wikiOwner,
                             String pageId)
                             throws Exception
Throws:
Exception

getRelatedPage

Page getRelatedPage(String wikiType,
                    String wikiOwner,
                    String pageId)
                    throws Exception
Throws:
Exception

getExsitedOrNewDraftPageById

Page getExsitedOrNewDraftPageById(String wikiType,
                                  String wikiOwner,
                                  String pageId)
                                  throws Exception
Throws:
Exception

getPageByUUID

Page getPageByUUID(String uuid)
                   throws Exception
Throws:
Exception

getTemplatePage

Template getTemplatePage(WikiPageParams params,
                         String templateId)
                         throws Exception
Throws:
Exception

searchContent

org.exoplatform.commons.utils.PageList<SearchResult> searchContent(WikiSearchData data)
                                                                   throws Exception
Throws:
Exception

getBreadcumb

List<BreadcrumbData> getBreadcumb(String wikiType,
                                  String wikiOwner,
                                  String pageId)
                                  throws Exception
Throws:
Exception

getWikiPageParams

WikiPageParams getWikiPageParams(BreadcrumbData data)
                                 throws Exception
Throws:
Exception

search

org.exoplatform.commons.utils.PageList<SearchResult> search(WikiSearchData data)
                                                            throws Exception
Throws:
Exception

searchTemplate

List<TemplateSearchResult> searchTemplate(TemplateSearchData data)
                                          throws Exception
Throws:
Exception

searchRenamedPage

List<SearchResult> searchRenamedPage(String wikiType,
                                     String wikiOwner,
                                     String pageId)
                                     throws Exception
Throws:
Exception

searchDataByTitle

List<TitleSearchResult> searchDataByTitle(WikiSearchData data)
                                          throws Exception
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
Throws:
Exception

getDefaultWikiSyntaxId

String getDefaultWikiSyntaxId()

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
Throws:
Exception

getAttachmentAsStream

InputStream getAttachmentAsStream(String path)
                                  throws Exception
Throws:
Exception

getHelpSyntaxPage

PageImpl getHelpSyntaxPage(String syntaxId)
                           throws Exception
Throws:
Exception

getMetaDataPage

Page getMetaDataPage(MetaDataPage metaPage)
                     throws Exception
Throws:
Exception

getTemplates

Map<String,Template> getTemplates(WikiPageParams params)
                                  throws Exception
Throws:
Exception

getTemplatesContainer

TemplateContainer getTemplatesContainer(WikiPageParams params)
                                        throws Exception
Throws:
Exception

modifyTemplate

void modifyTemplate(WikiPageParams params,
                    Template template,
                    String newName,
                    String newDescription,
                    String newContent,
                    String newSyntaxId)
                    throws Exception
Throws:
Exception

isExisting

boolean isExisting(String wikiType,
                   String wikiOwner,
                   String pageId)
                   throws Exception
Throws:
Exception

getWikiDefaultPermissions

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

Parameters:
wikiType - The type of wiki
wikiOwner - The owner of wiki
Returns:
The permisison list for wiki
Throws:
Exception

addComponentPlugin

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

Parameters:
listener -

addWikiTemplatePagePlugin

void addWikiTemplatePagePlugin(WikiTemplatePagePlugin templatePlugin)

getPageListeners

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

addRelatedPage

boolean addRelatedPage(WikiPageParams orginaryPageParams,
                       WikiPageParams relatedPageParams)
                       throws Exception
Throws:
Exception

getRelatedPage

List<Page> getRelatedPage(WikiPageParams pageParams)
                          throws Exception
Throws:
Exception

removeRelatedPage

boolean removeRelatedPage(WikiPageParams orginaryPageParams,
                          WikiPageParams relatedPageParams)
                          throws Exception
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:
param - 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 - The wiki type
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:
The uri of wiki webapp

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 - The wiki type of the space
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

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 © 2013 eXo Platform SAS. All Rights Reserved.