|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.exoplatform.wiki.service.impl.WikiServiceImpl
public class WikiServiceImpl
| 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 |
|---|
public WikiServiceImpl(org.exoplatform.container.configuration.ConfigurationManager configManager,
JCRDataStorage jcrDataStorage,
org.exoplatform.container.xml.InitParams initParams)
| Method Detail |
|---|
public void initDefaultTemplatePage(String path)
WikiService
initDefaultTemplatePage 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
WikiService
createPage 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.
Exception
public boolean isExisting(String wikiType,
String wikiOwner,
String pageId)
throws Exception
WikiService
isExisting in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.pageId - Id of the wiki page.
Exception
public boolean deletePage(String wikiType,
String wikiOwner,
String pageId)
throws Exception
WikiService
deletePage in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.pageId - Id of the wiki page.
Exception
public void deleteTemplatePage(String wikiType,
String wikiOwner,
String templateId)
throws Exception
WikiService
deleteTemplatePage in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.templateId - Id of the Wiki template.
Exception
public void deleteDraftNewPage(String newDraftPageId)
throws Exception
WikiService
deleteDraftNewPage in interface WikiServicenewDraftPageId - Id of the draft page.
Exception
public boolean renamePage(String wikiType,
String wikiOwner,
String pageName,
String newName,
String newTitle)
throws Exception
WikiService
renamePage 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.
Exception
public boolean movePage(WikiPageParams currentLocationParams,
WikiPageParams newLocationParams)
throws Exception
WikiService
movePage in interface WikiServicecurrentLocationParams - The current location of the wiki page.newLocationParams - The new location of the wiki page.
Exception
public List<PermissionEntry> getWikiPermission(String wikiType,
String wikiOwner)
throws Exception
WikiService
getWikiPermission in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.
Exception
public void setWikiPermission(String wikiType,
String wikiOwner,
List<PermissionEntry> permissionEntries)
throws Exception
WikiService
setWikiPermission in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.permissionEntries - The list of permissions.
Exception
public Page getPageById(String wikiType,
String wikiOwner,
String pageId)
throws Exception
WikiService
getPageById in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.pageId - Id of the wiki page.
Exception
public Page getPageByIdJCRQuery(String wikiType,
String wikiOwner,
String pageId)
throws Exception
WikiService
getPageByIdJCRQuery in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.pageId - Id of the wiki page.
Exception
public Page getPageByRootPermission(String wikiType,
String wikiOwner,
String pageId)
throws Exception
WikiService
getPageByRootPermission in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.pageId - Id of the wiki page.
Exception
public Page getRelatedPage(String wikiType,
String wikiOwner,
String pageId)
throws Exception
WikiService
getRelatedPage in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.pageId - Id of the wiki page.
Exception
public Page getExsitedOrNewDraftPageById(String wikiType,
String wikiOwner,
String pageId)
throws Exception
WikiService
getExsitedOrNewDraftPageById in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.pageId - Id of the wiki page.
Exception
public Page getPageByUUID(String uuid)
throws Exception
WikiService
getPageByUUID in interface WikiServiceuuid - UUID of the wiki page.
Exception
public Template getTemplatePage(WikiPageParams params,
String templateId)
throws Exception
WikiService
getTemplatePage in interface WikiServiceparams - The params object which is used for creating the Wiki template.templateId - Id of the wiki template.
Exception
public Map<String,Template> getTemplates(WikiPageParams params)
throws Exception
WikiService
getTemplates in interface WikiServiceparams - The params object which is used for getting the wiki templates.
Exception
public TemplateContainer getTemplatesContainer(WikiPageParams params)
throws Exception
WikiService
getTemplatesContainer in interface WikiServiceparams - The params object which is used for getting the containers.
Exception
public void modifyTemplate(WikiPageParams params,
Template template,
String newTitle,
String newDescription,
String newContent,
String newSyntaxId)
throws Exception
WikiService
modifyTemplate 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.
Exception
public org.exoplatform.commons.utils.PageList<SearchResult> search(WikiSearchData data)
throws Exception
WikiService
search in interface WikiServicedata - The data to search.
Exception
public List<TemplateSearchResult> searchTemplate(TemplateSearchData data)
throws Exception
WikiService
searchTemplate in interface WikiServicedata - The data to search.
Exception
public List<SearchResult> searchRenamedPage(String wikiType,
String wikiOwner,
String pageId)
throws Exception
WikiService
searchRenamedPage in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.pageId - Id of the page before it is renamed.
Exception
public Object findByPath(String path,
String objectNodeType)
WikiService
findByPath 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
WikiService
getPageTitleOfAttachment in interface WikiServicepath - Path of the attachment.
Exception
public InputStream getAttachmentAsStream(String path)
throws Exception
WikiService
getAttachmentAsStream in interface WikiServicepath - Path of the wiki attachment.
Exception
public List<BreadcrumbData> getBreadcumb(String wikiType,
String wikiOwner,
String pageId)
throws Exception
WikiService
getBreadcumb 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.
Exception
public PageImpl getHelpSyntaxPage(String syntaxId)
throws Exception
WikiService
getHelpSyntaxPage in interface WikiServicesyntaxId - Id of the syntax.
Exception
public Page getMetaDataPage(MetaDataPage metaPage)
throws Exception
WikiService
getMetaDataPage in interface WikiServicemetaPage - The metadata to use, mainly emoticons.
Exceptionpublic String getDefaultWikiSyntaxId()
WikiService
getDefaultWikiSyntaxId in interface WikiServicepublic long getSaveDraftSequenceTime()
WikiService
getSaveDraftSequenceTime in interface WikiServicepublic long getEditPageLivingTime()
WikiService
getEditPageLivingTime in interface WikiServicepublic WikiPageParams getWikiPageParams(BreadcrumbData data)
WikiService
getWikiPageParams 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
WikiService
getDuplicatePages in interface WikiServiceparentPage - The page to check.targetWiki - The target Wiki to check.resultList - The list of duplicated wiki pages.
Exception
public Wiki getWiki(String wikiType,
String owner)
WikiService
getWiki in interface WikiServicewikiType - It can be Portal, Group, or User.owner - The Wiki owner.
public String getPortalOwner()
WikiService
getPortalOwner in interface WikiService
public boolean hasAdminSpacePermission(String wikiType,
String owner)
throws Exception
WikiService
hasAdminSpacePermission in interface WikiServicewikiType - It can be Portal, Group, or User.owner - Owner of the space.
Exception
public boolean hasAdminPagePermission(String wikiType,
String owner)
throws Exception
WikiService
hasAdminPagePermission in interface WikiServicewikiType - It can be Portal, Group, or User.owner - Owner of the wiki page.
Exception
public Template createTemplatePage(String title,
WikiPageParams params)
throws Exception
WikiService
createTemplatePage in interface WikiServicetitle - Title of the Wiki template.params - The params object which is used for creating the new Wiki template.
Exception
public List<String> getWikiDefaultPermissions(String wikiType,
String wikiOwner)
throws Exception
WikiService
getWikiDefaultPermissions in interface WikiServicewikiType - It can be Portal, Group, or User.wikiOwner - The Wiki owner.
Exceptionpublic void addComponentPlugin(org.exoplatform.container.component.ComponentPlugin plugin)
WikiService
addComponentPlugin in interface WikiServiceplugin - The component plugin to be registered.public void addWikiTemplatePagePlugin(WikiTemplatePagePlugin plugin)
WikiService
addWikiTemplatePagePlugin in interface WikiServiceplugin - The wiki template plugin to be added.public List<PageWikiListener> getPageListeners()
WikiService
getPageListeners in interface WikiServicepublic void setTemplatePagePlugin()
public UserWiki getOrCreateUserWiki(String username)
WikiService
getOrCreateUserWiki in interface WikiServiceusername - Name of the user.
public List<SpaceBean> searchSpaces(String keyword)
throws Exception
WikiService
searchSpaces in interface WikiServicekeyword - The keyword to search for spaces.
Exception
public boolean addRelatedPage(WikiPageParams orginaryPageParams,
WikiPageParams relatedPageParams)
throws Exception
WikiService
addRelatedPage in interface WikiServiceorginaryPageParams - The params object of the current wiki page.relatedPageParams - The params object of the related page.
Exception
public List<Page> getRelatedPage(WikiPageParams pageParams)
throws Exception
WikiService
getRelatedPage in interface WikiServicepageParams - The params object of the wiki page.
Exception
public boolean removeRelatedPage(WikiPageParams orginaryPageParams,
WikiPageParams relatedPageParams)
throws Exception
WikiService
removeRelatedPage in interface WikiServiceorginaryPageParams - The params object of the current wiki page.relatedPageParams - The params object of the related page.
Exceptionpublic String getWikiWebappUri()
WikiService
getWikiWebappUri in interface WikiService
public boolean isSpaceMember(String spaceId,
String userId)
WikiService
isSpaceMember in interface WikiServicespaceId - Id of the space.userId - The username.
public boolean isHiddenSpace(String groupId)
throws Exception
WikiService
isHiddenSpace in interface WikiServicegroupId - Id of the group.
Exception
public DraftPage createDraftForNewPage(WikiPageParams parentPageParam,
long clientTime)
throws Exception
WikiService
createDraftForNewPage 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
WikiService
createDraftForExistPage 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
WikiService
getDraft in interface WikiServiceparam - The param object of the wiki page.
Exception
public DraftPage getLastestDraft()
throws Exception
WikiService
getLastestDraft in interface WikiServiceException
public DraftPage getDraft(String draftName)
throws Exception
WikiService
getDraft in interface WikiServicedraftName - Name of the draft page.
Exception
public void removeDraft(WikiPageParams param)
throws Exception
WikiService
removeDraft in interface WikiServiceparam - The param object of the wiki page param.
Exception
public void removeDraft(String draftName)
throws Exception
WikiService
removeDraft in interface WikiServicedraftName - Name of the draft page.
Exception
public List<DraftPage> getDrafts(String username)
throws Exception
WikiService
getDrafts in interface WikiServiceusername - Name of the user.
Exception
public Page getWikiPageByUUID(String uuid)
throws Exception
WikiService
getWikiPageByUUID in interface WikiServiceuuid - UUID of the wiki page.
Exception
public void postUpdatePage(String wikiType,
String wikiOwner,
String pageId,
Page page,
String wikiUpdateType)
throws Exception
WikiService
postUpdatePage 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).
Exception
public void postAddPage(String wikiType,
String wikiOwner,
String pageId,
Page page)
throws Exception
WikiService
postAddPage 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.
Exception
public void postDeletePage(String wikiType,
String wikiOwner,
String pageId,
Page page)
throws Exception
WikiService
postDeletePage 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.
Exception
public String getSpaceNameByGroupId(String groupId)
throws Exception
WikiService
getSpaceNameByGroupId in interface WikiServicegroupId - The group Id.
Exceptionpublic Wiki getWikiById(String wikiId)
WikiService
getWikiById in interface WikiServicewikiId - The Wiki Id.
public String getWikiNameById(String wikiId)
throws Exception
WikiService
getWikiNameById in interface WikiServicewikiId - The Wiki Id.
Exceptionpublic void start()
start in interface org.picocontainer.Startablepublic void stop()
stop in interface org.picocontainer.Startable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||