public class JPADataStorage extends Object implements DataStorage
| Modifier and Type | Field and Description |
|---|---|
static String |
WIKI_FILES_NAMESPACE_DESCRIPTION |
static String |
WIKI_FILES_NAMESPACE_NAME |
static String |
WIKI_TYPE_DRAFT |
| Constructor and Description |
|---|
JPADataStorage(WikiDAO wikiDAO,
PageDAO pageDAO,
PageAttachmentDAO pageAttachmentDAO,
DraftPageAttachmentDAO draftPageAttachmentDAO,
DraftPageDAO draftPageDAO,
PageVersionDAO pageVersionDAO,
PageMoveDAO pageMoveDAO,
TemplateDAO templateDAO,
EmotionIconDAO emotionIconDAO,
org.exoplatform.commons.api.persistence.DataInitializer dataInitializer,
org.exoplatform.commons.file.services.FileService fileService,
org.exoplatform.portal.config.UserACL userACL)
JPADataStorage must depends on DataInitializer to make sure data structure is created before initializing it
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAttachmentToPage(Attachment attachment,
Page page) |
void |
addPageVersion(Page page) |
void |
addRelatedPage(Page page,
Page relatedPage) |
void |
addWatcherToPage(String username,
Page page) |
void |
createDraftPageForUser(DraftPage draftPage,
String username) |
void |
createEmotionIcon(EmotionIcon emotionIcon) |
Page |
createPage(Wiki wiki,
Page parentPage,
Page page) |
void |
createTemplatePage(Wiki wiki,
Template template) |
Wiki |
createWiki(Wiki wiki) |
void |
deleteAttachmentOfPage(String attachmentName,
Page page) |
void |
deleteAttachmentsOfDraftPage(DraftPageEntity page) |
void |
deleteDraftByName(String draftPageName,
String username) |
void |
deleteDraftOfPage(Page page,
String username) |
void |
deletePage(String wikiType,
String wikiOwner,
String pageName) |
void |
deleteTemplatePage(String wikiType,
String wikiOwner,
String templateName) |
void |
deleteWatcherOfPage(String username,
Page page) |
PageEntity |
fetchPageEntity(Page page)
Fecth Page Entity from a Page domain object
|
List<Attachment> |
getAttachmentsOfPage(Page page) |
List<Attachment> |
getAttachmentsOfPage(Page page,
boolean loadContent) |
List<Page> |
getChildrenPageOf(Page page) |
DraftPage |
getDraft(String draftName,
String username) |
DraftPage |
getDraft(WikiPageParams wikiPageParams,
String username) |
DraftPage |
getDraftPageById(String id) |
List<DraftPage> |
getDraftPagesOfUser(String username) |
EmotionIcon |
getEmotionIconByName(String emotionIconName) |
List<EmotionIcon> |
getEmotionIcons() |
Page |
getExsitedOrNewDraftPageById(String wikiType,
String wikiOwner,
String pageName,
String username) |
Page |
getHelpSyntaxPage(String syntaxId,
boolean fullContent,
List<org.exoplatform.container.xml.ValuesParam> syntaxHelpParams,
org.exoplatform.container.configuration.ConfigurationManager configurationManager)
Deprecated.
|
DraftPage |
getLastestDraft(String username) |
Page |
getPageById(String id)
Get a wiki page by its unique id
|
Page |
getPageOfWikiByName(String wikiType,
String wikiOwner,
String pageName)
Get a wiki page by its unique name in the wiki
|
List<Page> |
getPagesOfWiki(String wikiType,
String wikiOwner)
Retrieve the all pages contained in wiki
|
Page |
getParentPageOf(Page page) |
List<String> |
getPreviousNamesOfPage(Page page) |
Page |
getRelatedPage(String wikiType,
String wikiOwner,
String pageName) |
List<Page> |
getRelatedPagesOfPage(Page page) |
Template |
getTemplatePage(WikiPageParams params,
String templateName) |
Map<String,Template> |
getTemplates(WikiPageParams wikiPageParams) |
List<PageVersion> |
getVersionsOfPage(Page page) |
List<String> |
getWatchersOfPage(Page page) |
Wiki |
getWikiByTypeAndOwner(String wikiType,
String wikiOwner) |
List<PermissionEntry> |
getWikiPermission(String wikiType,
String wikiOwner) |
List<Wiki> |
getWikisByType(String wikiType) |
boolean |
hasAdminPagePermission(String wikiType,
String owner,
org.exoplatform.services.security.Identity identity) |
boolean |
hasAdminSpacePermission(String wikiType,
String owner,
org.exoplatform.services.security.Identity identity) |
boolean |
hasPermissionOnPage(Page page,
PermissionType permissionType,
org.exoplatform.services.security.Identity identity)
Check if the identity has the given permission type on a page
|
boolean |
hasPermissionOnWiki(Wiki wiki,
PermissionType permissionType,
org.exoplatform.services.security.Identity identity)
Check if the identity has the given permission type on a wiki
|
void |
movePage(WikiPageParams currentLocationParams,
WikiPageParams newLocationParams) |
void |
removeRelatedPage(Page page,
Page relatedPage) |
void |
renamePage(String wikiType,
String wikiOwner,
String pageName,
String newName,
String newTitle) |
void |
restoreVersionOfPage(String versionName,
Page page) |
org.exoplatform.commons.utils.PageList<SearchResult> |
search(WikiSearchData wikiSearchData) |
List<TemplateSearchResult> |
searchTemplate(TemplateSearchData templateSearchData) |
void |
updatePage(Page page) |
void |
updateTemplatePage(Template template) |
void |
updateWikiPermission(String wikiType,
String wikiOwner,
List<PermissionEntry> permissionEntries) |
public static final String WIKI_TYPE_DRAFT
public static final String WIKI_FILES_NAMESPACE_NAME
public static final String WIKI_FILES_NAMESPACE_DESCRIPTION
public JPADataStorage(WikiDAO wikiDAO, PageDAO pageDAO, PageAttachmentDAO pageAttachmentDAO, DraftPageAttachmentDAO draftPageAttachmentDAO, DraftPageDAO draftPageDAO, PageVersionDAO pageVersionDAO, PageMoveDAO pageMoveDAO, TemplateDAO templateDAO, EmotionIconDAO emotionIconDAO, org.exoplatform.commons.api.persistence.DataInitializer dataInitializer, org.exoplatform.commons.file.services.FileService fileService, org.exoplatform.portal.config.UserACL userACL)
public org.exoplatform.commons.utils.PageList<SearchResult> search(WikiSearchData wikiSearchData)
search in interface DataStoragepublic Wiki getWikiByTypeAndOwner(String wikiType, String wikiOwner) throws WikiException
getWikiByTypeAndOwner in interface DataStorageWikiExceptionpublic List<Wiki> getWikisByType(String wikiType) throws WikiException
getWikisByType in interface DataStorageWikiExceptionpublic Wiki createWiki(Wiki wiki) throws WikiException
createWiki in interface DataStorageWikiExceptionpublic Page createPage(Wiki wiki, Page parentPage, Page page) throws WikiException
createPage in interface DataStorageWikiExceptionpublic Page getPageOfWikiByName(String wikiType, String wikiOwner, String pageName) throws WikiException
DataStoragegetPageOfWikiByName in interface DataStoragepageName - The unique name of the page in the wikiWikiExceptionpublic Page getPageById(String id) throws WikiException
DataStoragegetPageById in interface DataStorageid - The unique id of wiki pageWikiExceptionpublic DraftPage getDraftPageById(String id) throws WikiException
getDraftPageById in interface DataStorageWikiExceptionpublic Page getParentPageOf(Page page) throws WikiException
getParentPageOf in interface DataStorageWikiExceptionpublic List<Page> getChildrenPageOf(Page page) throws WikiException
getChildrenPageOf in interface DataStorageWikiExceptionpublic void deletePage(String wikiType, String wikiOwner, String pageName) throws WikiException
deletePage in interface DataStorageWikiExceptionpublic void createTemplatePage(Wiki wiki, Template template) throws WikiException
createTemplatePage in interface DataStorageWikiExceptionpublic void updateTemplatePage(Template template) throws WikiException
updateTemplatePage in interface DataStorageWikiExceptionpublic void deleteTemplatePage(String wikiType, String wikiOwner, String templateName) throws WikiException
deleteTemplatePage in interface DataStorageWikiExceptionpublic Template getTemplatePage(WikiPageParams params, String templateName) throws WikiException
getTemplatePage in interface DataStorageWikiExceptionpublic Map<String,Template> getTemplates(WikiPageParams wikiPageParams) throws WikiException
getTemplates in interface DataStorageWikiExceptionpublic void deleteDraftOfPage(Page page, String username) throws WikiException
deleteDraftOfPage in interface DataStorageWikiExceptionpublic void deleteDraftByName(String draftPageName, String username) throws WikiException
deleteDraftByName in interface DataStorageWikiExceptionpublic void renamePage(String wikiType, String wikiOwner, String pageName, String newName, String newTitle) throws WikiException
renamePage in interface DataStorageWikiExceptionpublic void movePage(WikiPageParams currentLocationParams, WikiPageParams newLocationParams) throws WikiException
movePage in interface DataStorageWikiExceptionpublic List<PermissionEntry> getWikiPermission(String wikiType, String wikiOwner) throws WikiException
getWikiPermission in interface DataStorageWikiExceptionpublic void updateWikiPermission(String wikiType, String wikiOwner, List<PermissionEntry> permissionEntries) throws WikiException
updateWikiPermission in interface DataStorageWikiExceptionpublic List<Page> getRelatedPagesOfPage(Page page) throws WikiException
getRelatedPagesOfPage in interface DataStorageWikiExceptionpublic Page getRelatedPage(String wikiType, String wikiOwner, String pageName) throws WikiException
getRelatedPage in interface DataStorageWikiExceptionpublic void addRelatedPage(Page page, Page relatedPage) throws WikiException
addRelatedPage in interface DataStorageWikiExceptionpublic List<Page> getPagesOfWiki(String wikiType, String wikiOwner)
DataStoragegetPagesOfWiki in interface DataStoragepublic void removeRelatedPage(Page page, Page relatedPage) throws WikiException
removeRelatedPage in interface DataStorageWikiExceptionpublic Page getExsitedOrNewDraftPageById(String wikiType, String wikiOwner, String pageName, String username) throws WikiException
getExsitedOrNewDraftPageById in interface DataStorageWikiExceptionpublic DraftPage getDraft(WikiPageParams wikiPageParams, String username) throws WikiException
getDraft in interface DataStorageWikiExceptionpublic DraftPage getLastestDraft(String username) throws WikiException
getLastestDraft in interface DataStorageWikiExceptionpublic DraftPage getDraft(String draftName, String username) throws WikiException
getDraft in interface DataStorageWikiExceptionpublic List<DraftPage> getDraftPagesOfUser(String username) throws WikiException
getDraftPagesOfUser in interface DataStorageWikiExceptionpublic void createDraftPageForUser(DraftPage draftPage, String username) throws WikiException
createDraftPageForUser in interface DataStorageWikiExceptionpublic List<TemplateSearchResult> searchTemplate(TemplateSearchData templateSearchData) throws WikiException
searchTemplate in interface DataStorageWikiExceptionpublic List<Attachment> getAttachmentsOfPage(Page page) throws WikiException
getAttachmentsOfPage in interface DataStorageWikiExceptionpublic List<Attachment> getAttachmentsOfPage(Page page, boolean loadContent) throws WikiException
getAttachmentsOfPage in interface DataStorageWikiExceptionpublic void addAttachmentToPage(Attachment attachment, Page page) throws WikiException
addAttachmentToPage in interface DataStorageWikiExceptionpublic void deleteAttachmentOfPage(String attachmentName, Page page) throws WikiException
deleteAttachmentOfPage in interface DataStorageWikiException@Deprecated public Page getHelpSyntaxPage(String syntaxId, boolean fullContent, List<org.exoplatform.container.xml.ValuesParam> syntaxHelpParams, org.exoplatform.container.configuration.ConfigurationManager configurationManager) throws WikiException
getHelpSyntaxPage in interface DataStorageWikiExceptionpublic void createEmotionIcon(EmotionIcon emotionIcon) throws WikiException
createEmotionIcon in interface DataStorageWikiExceptionpublic List<EmotionIcon> getEmotionIcons() throws WikiException
getEmotionIcons in interface DataStorageWikiExceptionpublic EmotionIcon getEmotionIconByName(String emotionIconName) throws WikiException
getEmotionIconByName in interface DataStorageWikiExceptionpublic boolean hasPermissionOnPage(Page page, PermissionType permissionType, org.exoplatform.services.security.Identity identity) throws WikiException
DataStoragehasPermissionOnPage in interface DataStoragepage - PagepermissionType - Permission type to checkidentity - Identity of the userWikiExceptionpublic boolean hasPermissionOnWiki(Wiki wiki, PermissionType permissionType, org.exoplatform.services.security.Identity identity) throws WikiException
DataStoragehasPermissionOnWiki in interface DataStoragewiki - WikipermissionType - Permission type to checkidentity - Identity of the userWikiExceptionpublic boolean hasAdminSpacePermission(String wikiType, String owner, org.exoplatform.services.security.Identity identity) throws WikiException
hasAdminSpacePermission in interface DataStorageWikiExceptionpublic boolean hasAdminPagePermission(String wikiType, String owner, org.exoplatform.services.security.Identity identity) throws WikiException
hasAdminPagePermission in interface DataStorageWikiExceptionpublic List<PageVersion> getVersionsOfPage(Page page) throws WikiException
getVersionsOfPage in interface DataStorageWikiExceptionpublic void addPageVersion(Page page) throws WikiException
addPageVersion in interface DataStorageWikiExceptionpublic void restoreVersionOfPage(String versionName, Page page) throws WikiException
restoreVersionOfPage in interface DataStorageWikiExceptionpublic void updatePage(Page page) throws WikiException
updatePage in interface DataStorageWikiExceptionpublic List<String> getPreviousNamesOfPage(Page page) throws WikiException
getPreviousNamesOfPage in interface DataStorageWikiExceptionpublic List<String> getWatchersOfPage(Page page) throws WikiException
getWatchersOfPage in interface DataStorageWikiExceptionpublic void addWatcherToPage(String username, Page page) throws WikiException
addWatcherToPage in interface DataStorageWikiExceptionpublic void deleteWatcherOfPage(String username, Page page) throws WikiException
deleteWatcherOfPage in interface DataStorageWikiExceptionpublic void deleteAttachmentsOfDraftPage(DraftPageEntity page) throws WikiException
WikiExceptionpublic PageEntity fetchPageEntity(Page page)
page - The page domain objectCopyright © 2003–2021 eXo Platform SAS. All rights reserved.