Class WikiServiceImpl
java.lang.Object
org.exoplatform.wiki.service.impl.WikiServiceImpl
- All Implemented Interfaces:
WikiService
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionWikiServiceImpl(org.exoplatform.portal.config.UserACL userACL, DataStorage dataStorage, org.exoplatform.services.cache.CacheService cacheService, org.exoplatform.services.organization.OrganizationService orgService) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddAttachment(Attachment attachment, Page page) voidaddAttachmentToPage(Attachment attachment, Page page) Add the given attachment to the given pagevoidaddComponentPlugin(org.exoplatform.container.component.ComponentPlugin plugin) ConfigurationcreateWiki(String wikiType, String owner) Creates a wiki with the given type and ownervoiddeleteAttachment(String attachmentId, Page page) voiddeleteAttachmentOfPage(String attachmentId, Page page) Deletes the given attachment of the given pageGets attachment listeners that are registered into the Wiki service.getAttachmentOfPageByName(String attachmentName, Page page) Get a attachment of a the given page by name, without loading its contentgetAttachmentOfPageByName(String attachmentName, Page page, boolean loadContent) Get a attachment of a the given page by name, and allow to load the attachment content by setting loadContent to truegetAttachmentsOfPage(Page page) AttachmentgetAttachmentsOfPage(Page page, boolean loadContent) Gets attachments of the given page, and allow to load their attachment content by setting loadContent to trueGets Id of a default Wiki syntax.intgetNbOfAttachmentsOfPage(Page page) Get the number of attachment of the given pagegetOrCreateUserWiki(String username) Gets a user Wiki.Gets listeners of all wiki pages that are registered into the Wiki service.getPageOfWikiByName(String wikiType, String wikiOwner, String pageName) Gets a wiki page by its unique name in the wiki.org.exoplatform.services.cache.ExoCache<Integer,MarkupData> getSpaceNameByGroupId(String groupId) Gets a space name by a given group Id.getWikiById(String wikiId) Gets a Wiki by its Id.getWikiByTypeAndOwner(String wikiType, String owner) WikigetWikiDefaultPermissions(String wikiType, String wikiOwner) Gets a list of Wiki default permissions.getWikiNameById(String wikiId) Gets a Wiki name by its Id.Gets parameters of a wiki page based on the data stored in the breadcrumb.getWikiPermission(String wikiType, String wikiOwner) Gets a list of Wiki permissions based on its type and owner.getWikisByType(String wikiType) Gets all wikis of the given typeGets a Wiki webapp URI.booleanhasAdminPagePermission(String wikiType, String owner) Checks if the current user has the admin permission on a wiki page.booleanhasAdminSpacePermission(String wikiType, String owner) Checks if the current user has the admin permission on a space or not.booleanhasPermissionOnWiki(Wiki wiki, PermissionType permissionType, org.exoplatform.services.security.Identity user) Check if the identity has the given permission type on a wikiprotected voidvoidpostAddPage(String wikiType, String wikiOwner, String pageId, Page page) voidpostDeletePage(String wikiType, String wikiOwner, String pageId, Page page) voidpostUpdatePage(String wikiType, String wikiOwner, String pageId, Page page, PageUpdateType wikiUpdateType) searchSpaces(String keyword) SpacesvoidupdateWikiPermission(String wikiType, String wikiOwner, List<PermissionEntry> permissionEntries) Adds a list of permissions to Wiki.
-
Field Details
-
CACHE_NAME
- See Also:
-
ATT_CACHE_NAME
- See Also:
-
-
Constructor Details
-
WikiServiceImpl
public WikiServiceImpl(org.exoplatform.portal.config.UserACL userACL, DataStorage dataStorage, org.exoplatform.services.cache.CacheService cacheService, org.exoplatform.services.organization.OrganizationService orgService)
-
-
Method Details
-
getRenderingCache
-
getPageLinksMap
-
addComponentPlugin
public void addComponentPlugin(org.exoplatform.container.component.ComponentPlugin plugin) Configuration- Specified by:
addComponentPluginin interfaceWikiService- Parameters:
plugin- The component plugin to be registered.
-
getPageListeners
Description copied from interface:WikiServiceGets listeners of all wiki pages that are registered into the Wiki service.- Specified by:
getPageListenersin interfaceWikiService- Returns:
- The list of listeners.
-
getAttachmentListeners
Description copied from interface:WikiServiceGets attachment listeners that are registered into the Wiki service.- Specified by:
getAttachmentListenersin interfaceWikiService- Returns:
- The list of attachment listeners.
-
getWikiWebappUri
Description copied from interface:WikiServiceGets a Wiki webapp URI.- Specified by:
getWikiWebappUriin interfaceWikiService- Returns:
- The Wiki webapp URI.
-
getDefaultWikiSyntaxId
Description copied from interface:WikiServiceGets Id of a default Wiki syntax.- Specified by:
getDefaultWikiSyntaxIdin interfaceWikiService- Returns:
- The Id.
-
getWikiByTypeAndOwner
Wiki- Specified by:
getWikiByTypeAndOwnerin interfaceWikiService- Parameters:
wikiType- It can be Portal, Group, or User.owner- The Wiki owner.- Returns:
- The Wiki.
- Throws:
WikiException- if an error occured
-
getWikisByType
Description copied from interface:WikiServiceGets all wikis of the given type- Specified by:
getWikisByTypein interfaceWikiService- Parameters:
wikiType- Type of wiki- Returns:
- Wikis of the given type
- Throws:
WikiException- if an error occured
-
getOrCreateUserWiki
Description copied from interface:WikiServiceGets a user Wiki. If it does not exist, the new one will be created.- Specified by:
getOrCreateUserWikiin interfaceWikiService- Parameters:
username- Name of the user.- Returns:
- The user Wiki.
- Throws:
WikiException- if an error occured
-
getWikiPermission
public List<PermissionEntry> getWikiPermission(String wikiType, String wikiOwner) throws WikiException Description copied from interface:WikiServiceGets a list of Wiki permissions based on its type and owner.- Specified by:
getWikiPermissionin interfaceWikiService- Parameters:
wikiType- It can be Portal, Group, or User.wikiOwner- The Wiki owner.- Returns:
- The list of Wiki permissions.
- Throws:
WikiException- if an error occured if an error occured
-
updateWikiPermission
public void updateWikiPermission(String wikiType, String wikiOwner, List<PermissionEntry> permissionEntries) throws WikiException Description copied from interface:WikiServiceAdds a list of permissions to Wiki.- Specified by:
updateWikiPermissionin interfaceWikiService- Parameters:
wikiType- It can be Portal, Group, or User.wikiOwner- The Wiki owner.permissionEntries- The list of permissions.- Throws:
WikiException- if an error occured if an error occured
-
getWikiDefaultPermissions
public List<PermissionEntry> getWikiDefaultPermissions(String wikiType, String wikiOwner) throws WikiException Description copied from interface:WikiServiceGets a list of Wiki default permissions.- Specified by:
getWikiDefaultPermissionsin interfaceWikiService- Parameters:
wikiType- It can be Portal, Group, or User.wikiOwner- The Wiki owner.- Returns:
- The list of Wiki default permissions.
- Throws:
WikiException- if an error occured
-
getWikiById
Description copied from interface:WikiServiceGets a Wiki by its Id.- Specified by:
getWikiByIdin interfaceWikiService- Parameters:
wikiId- The Wiki Id.- Returns:
- The Wiki.
- Throws:
WikiException- if an error occured
-
getWikiNameById
Description copied from interface:WikiServiceGets a Wiki name by its Id.- Specified by:
getWikiNameByIdin interfaceWikiService- Parameters:
wikiId- The Wiki Id.- Returns:
- The Wiki name.
- Throws:
WikiException- if an error occured
-
createWiki
Description copied from interface:WikiServiceCreates a wiki with the given type and owner- Specified by:
createWikiin interfaceWikiService- Parameters:
wikiType- It can be Portal, Group, or User.owner- The Wiki owner.- Returns:
- Wiki created
- Throws:
WikiException- if an error occured
-
invalidateAttachmentCache
-
getAttachmentsOfPage
Attachment- Specified by:
getAttachmentsOfPagein interfaceWikiService- Parameters:
page- The wiki page- Returns:
- The attachments of the page
- Throws:
WikiException- if an error occured if an error occured
-
getAttachmentsOfPage
Description copied from interface:WikiServiceGets attachments of the given page, and allow to load their attachment content by setting loadContent to true- Specified by:
getAttachmentsOfPagein interfaceWikiService- Parameters:
page- The wiki pageloadContent- treue if need to load the attachement content- Returns:
- The attachments of the page
- Throws:
WikiException- if an error occured if an error occured
-
getNbOfAttachmentsOfPage
Description copied from interface:WikiServiceGet the number of attachment of the given page- Specified by:
getNbOfAttachmentsOfPagein interfaceWikiService- Parameters:
page- The wiki page- Returns:
- The number of attachments of the page
- Throws:
WikiException- if an error occured if an error occured
-
getAttachmentOfPageByName
Description copied from interface:WikiServiceGet a attachment of a the given page by name, without loading its content- Specified by:
getAttachmentOfPageByNamein interfaceWikiService- Parameters:
attachmentName- The name of the attachmentpage- The wiki page- Returns:
- Attachment
- Throws:
WikiException- if an error occured if an error occured
-
getAttachmentOfPageByName
public Attachment getAttachmentOfPageByName(String attachmentName, Page page, boolean loadContent) throws WikiException Description copied from interface:WikiServiceGet a attachment of a the given page by name, and allow to load the attachment content by setting loadContent to true- Specified by:
getAttachmentOfPageByNamein interfaceWikiService- Parameters:
attachmentName- The name of the attachmentpage- The wiki pageloadContent- true to load the attachment content- Returns:
- attachement
- Throws:
WikiException- if an error occured if an error occured
-
addAttachmentToPage
Description copied from interface:WikiServiceAdd the given attachment to the given page- Specified by:
addAttachmentToPagein interfaceWikiService- Parameters:
attachment- The attachment to addpage- The wiki page- Throws:
WikiException- if an error occured if an error occured
-
deleteAttachmentOfPage
Description copied from interface:WikiServiceDeletes the given attachment of the given page- Specified by:
deleteAttachmentOfPagein interfaceWikiService- Parameters:
attachmentId- Id of the attachmentpage- The wiki page- Throws:
WikiException- if an error occured
-
searchSpaces
Spaces- Specified by:
searchSpacesin interfaceWikiService- Parameters:
keyword- The keyword to search for spaces.- Returns:
- The list of spaces matching with the keyword.
- Throws:
WikiException- if an error occured
-
hasAdminSpacePermission
Description copied from interface:WikiServiceChecks if the current user has the admin permission on a space or not.- Specified by:
hasAdminSpacePermissionin interfaceWikiService- 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:
WikiException- if an error occured
-
getSpaceNameByGroupId
Description copied from interface:WikiServiceGets a space name by a given group Id.- Specified by:
getSpaceNameByGroupIdin interfaceWikiService- Parameters:
groupId- The group Id.- Returns:
- The space name.
-
postUpdatePage
public void postUpdatePage(String wikiType, String wikiOwner, String pageId, Page page, PageUpdateType wikiUpdateType) throws WikiException - Throws:
WikiException
-
postAddPage
public void postAddPage(String wikiType, String wikiOwner, String pageId, Page page) throws WikiException - Throws:
WikiException
-
postDeletePage
public void postDeletePage(String wikiType, String wikiOwner, String pageId, Page page) throws WikiException - Throws:
WikiException
-
addAttachment
- Throws:
WikiException
-
deleteAttachment
- Throws:
WikiException
-
getWikiPageParams
Description copied from interface:WikiServiceGets parameters of a wiki page based on the data stored in the breadcrumb.- Specified by:
getWikiPageParamsin interfaceWikiService- Parameters:
data- The data in the breadcrumb that identifies the wiki page.- Returns:
- The parameters identifying the wiki page.
-
hasAdminPagePermission
Description copied from interface:WikiServiceChecks if the current user has the admin permission on a wiki page.- Specified by:
hasAdminPagePermissionin interfaceWikiService- 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:
WikiException- if an error occured
-
getPageOfWikiByName
public Page getPageOfWikiByName(String wikiType, String wikiOwner, String pageName) throws WikiException Description copied from interface:WikiServiceGets a wiki page by its unique name in the wiki.- Specified by:
getPageOfWikiByNamein interfaceWikiService- Parameters:
wikiType- It can be Portal, Group, or User.wikiOwner- The Wiki owner.pageName- Id of the wiki page.- Returns:
- The wiki page if the current user has the read permission. Otherwise, it is "null".
- Throws:
WikiException- if an error occured if an error occured
-
hasPermissionOnWiki
public boolean hasPermissionOnWiki(Wiki wiki, PermissionType permissionType, org.exoplatform.services.security.Identity user) throws WikiException Description copied from interface:WikiServiceCheck if the identity has the given permission type on a wiki- Specified by:
hasPermissionOnWikiin interfaceWikiService- Parameters:
wiki- WikipermissionType- Permission type to checkuser- Identity of the user- Returns:
- true if the user has the given permission type on the wiki
- Throws:
WikiException- if an error occured
-