public class WikiServiceImpl extends Object implements WikiService, org.picocontainer.Startable
| Constructor and Description |
|---|
WikiServiceImpl(org.exoplatform.container.configuration.ConfigurationManager configManager,
JCRDataStorage jcrDataStorage,
org.exoplatform.container.xml.InitParams initParams) |
| Modifier and Type | Method and Description |
|---|---|
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)
Move 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() |
public WikiServiceImpl(org.exoplatform.container.configuration.ConfigurationManager configManager,
JCRDataStorage jcrDataStorage,
org.exoplatform.container.xml.InitParams initParams)
public void initDefaultTemplatePage(String path)
WikiServiceinitDefaultTemplatePage in interface WikiServicepath - The path in which the default Wiki template is initialized.public Page createPage(String wikiType, String wikiOwner, String title, String parentId) throws Exception
WikiServicecreatePage in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.title - Title of the wiki page.parentId - Id of the parent wiki page.Exceptionpublic boolean isExisting(String wikiType, String wikiOwner, String pageId) throws Exception
WikiServiceisExisting in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.pageId - Id of the wiki page.Exceptionpublic boolean deletePage(String wikiType, String wikiOwner, String pageId) throws Exception
WikiServicedeletePage in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.pageId - Id of the wiki page.Exceptionpublic void deleteTemplatePage(String wikiType, String wikiOwner, String templateId) throws Exception
WikiServicedeleteTemplatePage in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.templateId - Id of the Wiki template.Exceptionpublic void deleteDraftNewPage(String newDraftPageId) throws Exception
WikiServicedeleteDraftNewPage in interface WikiServicenewDraftPageId - Id of the draft page.Exceptionpublic boolean renamePage(String wikiType, String wikiOwner, String pageName, String newName, String newTitle) throws Exception
WikiServicerenamePage in interface WikiServicewikiType - 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.Exceptionpublic boolean movePage(WikiPageParams currentLocationParams, WikiPageParams newLocationParams) throws Exception
WikiServicemovePage in interface WikiServicecurrentLocationParams - The current location of the wiki page.newLocationParams - The new location of the wiki page.Exceptionpublic List<PermissionEntry> getWikiPermission(String wikiType, String wikiOwner) throws Exception
WikiServicegetWikiPermission in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.Exceptionpublic void setWikiPermission(String wikiType, String wikiOwner, List<PermissionEntry> permissionEntries) throws Exception
WikiServicesetWikiPermission in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.permissionEntries - The list of permissions.Exceptionpublic Page getPageById(String wikiType, String wikiOwner, String pageId) throws Exception
WikiServicegetPageById in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.pageId - Id of the wiki page.Exceptionpublic Page getPageByIdJCRQuery(String wikiType, String wikiOwner, String pageId) throws Exception
WikiServicegetPageByIdJCRQuery in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.pageId - Id of the wiki page.Exceptionpublic Page getPageByRootPermission(String wikiType, String wikiOwner, String pageId) throws Exception
WikiServicegetPageByRootPermission in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.pageId - Id of the wiki page.Exceptionpublic Page getRelatedPage(String wikiType, String wikiOwner, String pageId) throws Exception
WikiServicegetRelatedPage in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.pageId - Id of the wiki page.Exceptionpublic Page getExsitedOrNewDraftPageById(String wikiType, String wikiOwner, String pageId) throws Exception
WikiServicegetExsitedOrNewDraftPageById in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.pageId - Id of the wiki page.Exceptionpublic Page getPageByUUID(String uuid) throws Exception
WikiServicegetPageByUUID in interface WikiServiceuuid - UUID of the wiki page.Exceptionpublic Template getTemplatePage(WikiPageParams params, String templateId) throws Exception
WikiServicegetTemplatePage in interface WikiServiceparams - The params object which is used for creating the Wiki template.templateId - Id of the wiki template.Exceptionpublic Map<String,Template> getTemplates(WikiPageParams params) throws Exception
WikiServicegetTemplates in interface WikiServiceparams - The params object which is used for getting the wiki templates.Exceptionpublic TemplateContainer getTemplatesContainer(WikiPageParams params) throws Exception
WikiServicegetTemplatesContainer in interface WikiServiceparams - The params object which is used for getting the containers.Exceptionpublic void modifyTemplate(WikiPageParams params, Template template, String newTitle, String newDescription, String newContent, String newSyntaxId) throws Exception
WikiServicemodifyTemplate in interface WikiServiceparams - 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.Exceptionpublic org.exoplatform.commons.utils.PageList<SearchResult> search(WikiSearchData data) throws Exception
WikiServicesearch in interface WikiServicedata - The data to search.Exceptionpublic List<TemplateSearchResult> searchTemplate(TemplateSearchData data) throws Exception
WikiServicesearchTemplate in interface WikiServicedata - The data to search.Exceptionpublic List<SearchResult> searchRenamedPage(String wikiType, String wikiOwner, String pageId) throws Exception
WikiServicesearchRenamedPage in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.pageId - Id of the page before it is renamed.Exceptionpublic Object findByPath(String path, String objectNodeType)
WikiServicefindByPath in interface WikiServicepath - The relative path to find.objectNodeType - The node type can be page, attachment or template.public String getPageTitleOfAttachment(String path) throws Exception
WikiServicegetPageTitleOfAttachment in interface WikiServicepath - Path of the attachment.Exceptionpublic InputStream getAttachmentAsStream(String path) throws Exception
WikiServicegetAttachmentAsStream in interface WikiServicepath - Path of the wiki attachment.Exceptionpublic List<BreadcrumbData> getBreadcumb(String wikiType, String wikiOwner, String pageId) throws Exception
WikiServicegetBreadcumb in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.pageId - Id of the wiki page to which the breadcrumb points.Exceptionpublic PageImpl getHelpSyntaxPage(String syntaxId) throws Exception
WikiServicegetHelpSyntaxPage in interface WikiServicesyntaxId - Id of the syntax.Exceptionpublic Page getMetaDataPage(MetaDataPage metaPage) throws Exception
WikiServicegetMetaDataPage in interface WikiServicemetaPage - The metadata to use, mainly emoticons.Exceptionpublic String getDefaultWikiSyntaxId()
WikiServicegetDefaultWikiSyntaxId in interface WikiServicepublic long getSaveDraftSequenceTime()
WikiServicegetSaveDraftSequenceTime in interface WikiServicepublic long getEditPageLivingTime()
WikiServicegetEditPageLivingTime in interface WikiServicepublic WikiPageParams getWikiPageParams(BreadcrumbData data)
WikiServicegetWikiPageParams in interface WikiServicedata - The data in the breadcrumb that identifies the wiki page.public List<PageImpl> getDuplicatePages(PageImpl parentPage, Wiki targetWiki, List<PageImpl> resultList) throws Exception
WikiServicegetDuplicatePages in interface WikiServiceparentPage - The page to check.targetWiki - The target Wiki to check.resultList - The list of duplicated wiki pages.Exceptionpublic Wiki getWiki(String wikiType, String owner)
WikiServicegetWiki in interface WikiServicewikiType - It can be Portal, Group, or User.owner - The Wiki owner.public String getPortalOwner()
WikiServicegetPortalOwner in interface WikiServicepublic boolean hasAdminSpacePermission(String wikiType, String owner) throws Exception
WikiServicehasAdminSpacePermission in interface WikiServicewikiType - It can be Portal, Group, or User.owner - Owner of the space.Exceptionpublic boolean hasAdminPagePermission(String wikiType, String owner) throws Exception
WikiServicehasAdminPagePermission in interface WikiServicewikiType - It can be Portal, Group, or User.owner - Owner of the wiki page.Exceptionpublic Template createTemplatePage(String title, WikiPageParams params) throws Exception
WikiServicecreateTemplatePage in interface WikiServicetitle - Title of the Wiki template.params - The params object which is used for creating the new Wiki template.Exceptionpublic List<String> getWikiDefaultPermissions(String wikiType, String wikiOwner) throws Exception
WikiServicegetWikiDefaultPermissions in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.Exceptionpublic void addComponentPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
WikiServiceaddComponentPlugin in interface WikiServiceplugin - The component plugin to be registered.public void addWikiTemplatePagePlugin(WikiTemplatePagePlugin plugin)
WikiServiceaddWikiTemplatePagePlugin in interface WikiServiceplugin - The wiki template plugin to be added.public List<PageWikiListener> getPageListeners()
WikiServicegetPageListeners in interface WikiServicepublic void setTemplatePagePlugin()
public UserWiki getOrCreateUserWiki(String username)
WikiServicegetOrCreateUserWiki in interface WikiServiceusername - Name of the user.public List<SpaceBean> searchSpaces(String keyword) throws Exception
WikiServicesearchSpaces in interface WikiServicekeyword - The keyword to search for spaces.Exceptionpublic boolean addRelatedPage(WikiPageParams orginaryPageParams, WikiPageParams relatedPageParams) throws Exception
WikiServiceaddRelatedPage in interface WikiServiceorginaryPageParams - The params object of the current wiki page.relatedPageParams - The params object of the related page.Exceptionpublic List<Page> getRelatedPage(WikiPageParams pageParams) throws Exception
WikiServicegetRelatedPage in interface WikiServicepageParams - The params object of the wiki page.Exceptionpublic boolean removeRelatedPage(WikiPageParams orginaryPageParams, WikiPageParams relatedPageParams) throws Exception
WikiServiceremoveRelatedPage in interface WikiServiceorginaryPageParams - The params object of the current wiki page.relatedPageParams - The params object of the related page.Exceptionpublic String getWikiWebappUri()
WikiServicegetWikiWebappUri in interface WikiServicepublic boolean isSpaceMember(String spaceId, String userId)
WikiServiceisSpaceMember in interface WikiServicespaceId - Id of the space.userId - The username.public boolean isHiddenSpace(String groupId) throws Exception
WikiServiceisHiddenSpace in interface WikiServicegroupId - Id of the group.Exceptionpublic DraftPage createDraftForNewPage(WikiPageParams parentPageParam, long clientTime) throws Exception
WikiServicecreateDraftForNewPage in interface WikiServiceparentPageParam - The param object of the parent wiki page.clientTime - The time of client when the draft page is saved.Exception - if the draft page cannot be created.public DraftPage createDraftForExistPage(WikiPageParams param, String revision, long clientTime) throws Exception
WikiServicecreateDraftForExistPage in interface WikiServiceparam - 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.Exception - if the draft page cannot be created.public DraftPage getDraft(WikiPageParams param) throws Exception
WikiServicegetDraft in interface WikiServiceparam - The param object of the wiki page.Exceptionpublic DraftPage getLastestDraft() throws Exception
WikiServicegetLastestDraft in interface WikiServiceExceptionpublic DraftPage getDraft(String draftName) throws Exception
WikiServicegetDraft in interface WikiServicedraftName - Name of the draft page.Exceptionpublic void removeDraft(WikiPageParams param) throws Exception
WikiServiceremoveDraft in interface WikiServiceparam - The param object of the wiki page param.Exceptionpublic void removeDraft(String draftName) throws Exception
WikiServiceremoveDraft in interface WikiServicedraftName - Name of the draft page.Exceptionpublic List<DraftPage> getDrafts(String username) throws Exception
WikiServicegetDrafts in interface WikiServiceusername - Name of the user.Exceptionpublic Page getWikiPageByUUID(String uuid) throws Exception
WikiServicegetWikiPageByUUID in interface WikiServiceuuid - UUID of the wiki page.Exceptionpublic void postUpdatePage(String wikiType, String wikiOwner, String pageId, Page page, String wikiUpdateType) throws Exception
WikiServicepostUpdatePage in interface WikiServicewikiType - 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).Exceptionpublic void postAddPage(String wikiType, String wikiOwner, String pageId, Page page) throws Exception
WikiServicepostAddPage in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.pageId - Id of the new wiki page.page - The wiki page.Exceptionpublic void postDeletePage(String wikiType, String wikiOwner, String pageId, Page page) throws Exception
WikiServicepostDeletePage in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.pageId - Id of the deleted wiki page.page - The deleted wiki page.Exceptionpublic String getSpaceNameByGroupId(String groupId) throws Exception
WikiServicegetSpaceNameByGroupId in interface WikiServicegroupId - The group Id.Exceptionpublic Wiki getWikiById(String wikiId)
WikiServicegetWikiById in interface WikiServicewikiId - The Wiki Id.public String getWikiNameById(String wikiId) throws Exception
WikiServicegetWikiNameById in interface WikiServicewikiId - The Wiki Id.Exceptionpublic void start()
start in interface org.picocontainer.Startablepublic void stop()
stop in interface org.picocontainer.StartableCopyright © 2003–2015 eXo Platform SAS. All rights reserved.