Class NoteServiceImpl
java.lang.Object
org.exoplatform.wiki.service.impl.NoteServiceImpl
- All Implemented Interfaces:
NoteService
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionNoteServiceImpl(DataStorage dataStorage, org.exoplatform.services.cache.CacheService cacheService, WikiService wikiService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, io.meeds.social.cms.service.CMSService cmsService, org.exoplatform.services.security.IdentityRegistry identityRegistry, org.exoplatform.services.organization.OrganizationService organizationService, org.exoplatform.services.listener.ListenerService listenerService) NoteServiceImpl(DataStorage dataStorage, org.exoplatform.services.cache.CacheService cacheService, WikiService wikiService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, io.meeds.social.cms.service.CMSService cmsService, org.exoplatform.services.security.IdentityRegistry identityRegistry, org.exoplatform.services.organization.OrganizationService organizationService, org.exoplatform.services.listener.ListenerService listenerService, org.exoplatform.social.common.service.HTMLUploadImageProcessor htmlUploadImageProcessor) -
Method Summary
Modifier and TypeMethodDescriptioncreateDraftForExistPage(DraftPage draftPage, Page targetPage, String revision, long clientTime, String username) Creates a draft for an existing pagecreateDraftForNewPage(DraftPage draftPage, long clientTime) Creates a draft for a new pagecreateNote(Wiki noteBook, String parentNoteName, Page note, org.exoplatform.services.security.Identity userIdentity) Create a new note in the given notebook, under the given parent note.createNote(Wiki noteBook, Page parentPage, Page note) Create a new note in the given notebook, under the given parent note.voidcreateVersionOfNote(Page note, String userName) Creates a version of a note.booleandeleteNote(String noteType, String noteOwner, String noteName) Deletes a note.booleandeleteNote(String noteType, String noteOwner, String noteName, org.exoplatform.services.security.Identity userIdentity) Deletes a note.voiddeleteVersionsByNoteIdAndLang(Long noteId, String lang) Deletes a list of versions of note by language.voiddeleteVersionsByNoteIdAndLang(Long noteId, String userName, String lang) Deletes a list of versions of note by language.getBreadCrumb(String noteType, String noteOwner, String noteName, boolean isDraftNote) Gets a list of data which is used for composing the breadcrumb.getBreadCrumb(String noteType, String noteOwner, String noteName, String lang, org.exoplatform.services.security.Identity userIdentity, boolean isDraftNote) Gets a list of data which is used for composing the breadcrumb.Return the list of children of the note to exportgetChildrenNoteOf(NoteToExport note, String userId) Return the list of children of the note to exportgetChildrenNoteOf(Page note, boolean withDrafts, boolean withChild) Get all the children notes of a notegetChildrenNoteOf(Page note, String userId, boolean withDrafts, boolean withChild) Get all the children notes of a notegetDraftNoteById(String id, String userId) Gets a draft note based on its unique id.getDuplicateNotes(Page parentNote, Wiki targetNoteBook, List<Page> resultList) Checks if a note and its children are duplicated with ones in the target NoteBook or not, then gets a list of duplicated notes if any.Checks if a note and its children are duplicated with ones in the target NoteBook or not, then gets a list of duplicated notes if any.getLatestDraftOfPage(Page targetPage) Returns latest draft of given page.getLatestDraftOfPage(Page targetPage, String username) Returns latest draft of given page.getLatestDraftPageByTargetPageAndLang(Long targetPageId, String lang) Retrieves latest draft of a specific page by target page id and content languagegetLatestDraftPageByUserAndTargetPageAndLang(Long targetPageId, String username, String lang) Retrieves latest draft of a specific page by target page id and content language and owner usernamegetNoteById(String id) Gets a note based on its unique id.getNoteById(String id, org.exoplatform.services.security.Identity userIdentity) Gets a note based on its unique id.getNoteById(String id, org.exoplatform.services.security.Identity userIdentity, String source) Gets a note based on its unique id.getNoteByIdAndLang(Long pageId, String lang) Retrieves note page by its id and content langgetNoteByIdAndLang(Long pageId, org.exoplatform.services.security.Identity userIdentity, String source, String lang) Retrieves note page by its id and content langgetNoteByRootPermission(String wikiType, String wikiOwner, String pageId) Gets a wiki page regardless of the current user's permission.getNoteOfNoteBookByName(String noteType, String noteOwner, String noteName) Gets a note by its unique name in the noteBook.getNoteOfNoteBookByName(String noteType, String noteOwner, String noteName, String lang, org.exoplatform.services.security.Identity userIdentity) Retrieves a note by note type, owner, name and lang.getNoteOfNoteBookByName(String noteType, String noteOwner, String noteName, org.exoplatform.services.security.Identity userIdentity) Gets a note by its unique name in the noteBook.getNoteOfNoteBookByName(String noteType, String noteOwner, String noteName, org.exoplatform.services.security.Identity userIdentity, String source) Retrieves a note by note type, owner and name.getNoteRenderedContent(Page note) Return the content of the note to be rendredgetNotesOfWiki(String noteType, String noteOwner) Retrieve the all notes contained in noteBookgetPageAvailableTranslationLanguages(Long pageId, boolean withDrafts) Retrieves list of available translations languages of a pagegetPageAvailableTranslationLanguages(Long pageId, String userId, boolean withDrafts) Retrieves list of available translations languages of a pagegetParentNoteOf(NoteToExport note) Return the Parent of the note to exportgetParentNoteOf(Page note) Get parent note of a notegetPreviousNamesOfNote(Page note) Get previous names of a notegetPublishedVersionByPageIdAndLang(Long pageId, String lang) Retrieves published note version page by its page id and content langorg.exoplatform.services.cache.ExoCache<Integer, MarkupData> getVersionsHistoryOfNote(Page note, String userName) Gets all the Histories of the given notegetVersionsHistoryOfNoteByLang(Page note, String userName, String lang) Retrieves the history version of given note by languagebooleanhasPermissionOnPage(Page page, PermissionType permissionType, org.exoplatform.services.security.Identity user) Checks if the given user has the permission on a pagevoidimportNotes(String zipLocation, Page parent, String conflict, org.exoplatform.services.security.Identity userIdentity) Import Notes from a zip file locationvoidimportNotes(List<String> files, Page parent, String conflict, org.exoplatform.services.security.Identity userIdentity) Import Notes from a list of filesprotected voidprotected voidinvalidateCache(Page page) protected voidbooleanisExisting(String noteBookType, String noteBookOwner, String noteId) Check if the given note is existingvoidmoveNote(WikiPageParams currentLocationParams, WikiPageParams newLocationParams) Move a notebooleanmoveNote(WikiPageParams currentLocationParams, WikiPageParams newLocationParams, org.exoplatform.services.security.Identity userIdentity) Move a notevoidpostAddPage(String wikiType, String wikiOwner, String pageId, Page page) voidpostDeletePage(String wikiType, String wikiOwner, String pageId, Page page) voidpostDeletePageVersionLanguage(String versionPageId) voidpostOpenByBreadCrumb(String wikiType, String wikiOwner, String pageId, Page page) voidpostOpenByTree(String wikiType, String wikiOwner, String pageId, Page page) voidpostUpdatePage(String wikiType, String wikiOwner, String pageId, Page page, PageUpdateType wikiUpdateType) voidpostUpdatePageVersionLanguage(String versionPageId) voidremoveDraft(String draftName) Removes a draft page by its name.voidremoveDraftById(String draftId) Removes a draft page by its technical id.voidremoveDraftOfNote(Page page) Remove the Drafts of a notevoidremoveDraftOfNote(Page page, String username) Remove the Drafts of a note by usernamevoidremoveDraftOfNote(WikiPageParams param) Remove the all Drafts of a notevoidremoveDraftOfNote(WikiPageParams param, String lang) Remove the Drafts of a note by languagevoidremoveOrphanDraftPagesByParentPage(long parentPageId) Remove all children drafts of a parent page without existing targetbooleanRenames a note.voidrestoreVersionOfNote(String versionName, Page note, String userName) Restores a version of a noteorg.exoplatform.commons.utils.PageList<SearchResult> search(WikiSearchData data) Searches in all wiki pages.updateDraftForExistPage(DraftPage draftNoteToUpdate, Page targetPage, String revision, long clientTime, String username) Update draft note for an existing pageupdateDraftForNewPage(DraftPage draftNoteToUpdate, long clientTime) Update draft note for a new pageupdateNote(Page note) Update the given note.updateNote(Page note, PageUpdateType type) Update the given note.updateNote(Page note, PageUpdateType type, org.exoplatform.services.security.Identity userIdentity) Update the given note.
-
Field Details
-
CACHE_NAME
- See Also:
-
ATT_CACHE_NAME
- See Also:
-
-
Constructor Details
-
NoteServiceImpl
public NoteServiceImpl(DataStorage dataStorage, org.exoplatform.services.cache.CacheService cacheService, WikiService wikiService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, io.meeds.social.cms.service.CMSService cmsService, org.exoplatform.services.security.IdentityRegistry identityRegistry, org.exoplatform.services.organization.OrganizationService organizationService, org.exoplatform.services.listener.ListenerService listenerService) -
NoteServiceImpl
public NoteServiceImpl(DataStorage dataStorage, org.exoplatform.services.cache.CacheService cacheService, WikiService wikiService, org.exoplatform.social.core.manager.IdentityManager identityManager, org.exoplatform.social.core.space.spi.SpaceService spaceService, io.meeds.social.cms.service.CMSService cmsService, org.exoplatform.services.security.IdentityRegistry identityRegistry, org.exoplatform.services.organization.OrganizationService organizationService, org.exoplatform.services.listener.ListenerService listenerService, org.exoplatform.social.common.service.HTMLUploadImageProcessor htmlUploadImageProcessor)
-
-
Method Details
-
createNote
public Page createNote(Wiki noteBook, String parentNoteName, Page note, org.exoplatform.services.security.Identity userIdentity) throws WikiException, IllegalAccessException Create a new note in the given notebook, under the given parent note.- Specified by:
createNotein interfaceNoteService- Parameters:
noteBook- Notebook object.parentNoteName- parent note name.note- the note object to create.userIdentity- user Identity.- Returns:
- The new note.
- Throws:
WikiException- if an error occuredIllegalAccessException- if the user don't have edit rights to the parent note
-
createNote
Create a new note in the given notebook, under the given parent note.- Specified by:
createNotein interfaceNoteService- Parameters:
noteBook- Notebook object.parentPage- parent note.note- the note to create.- Returns:
- The new note.
- Throws:
WikiException- if an error occured
-
updateNote
Update the given note.- Specified by:
updateNotein interfaceNoteService- Parameters:
note- Updated note- Returns:
- updated note
- Throws:
WikiException- if an error occured
-
updateNote
public Page updateNote(Page note, PageUpdateType type, org.exoplatform.services.security.Identity userIdentity) throws WikiException, IllegalAccessException, org.gatein.api.EntityNotFoundException Update the given note. This does not automatically create a new version. If a new version must be created it should be explicitly done by calling createVersionOfNote(). The second parameter is the type of update done (title only, content only, both, move, ...).- Specified by:
updateNotein interfaceNoteService- Parameters:
note- Updated notetype- Type of updateuserIdentity- user Identity- Returns:
- The updated note
- Throws:
WikiException- if an error occureIllegalAccessException- if the user don't have edit rights on the noteorg.gatein.api.EntityNotFoundException- if the the note to update don't exist
-
updateNote
Update the given note. This does not automatically create a new version. If a new version must be created it should be explicitly done by calling createVersionOfNote(). The second parameter is the type of update done (title only, content only, both, move, ...).- Specified by:
updateNotein interfaceNoteService- Parameters:
note- Updated notetype- Type of update- Returns:
- The updated note
- Throws:
WikiException
-
deleteNote
Deletes a note.- Specified by:
deleteNotein interfaceNoteService- Parameters:
noteType- It can be Portal, Group, or User.noteOwner- The NoteBook owner.noteName- Id of the note.- Returns:
- "True" if deleting the note is successful, or "false" if not.
- Throws:
WikiException- if an error occured
-
deleteNote
public boolean deleteNote(String noteType, String noteOwner, String noteName, org.exoplatform.services.security.Identity userIdentity) throws WikiException, IllegalAccessException, org.gatein.api.EntityNotFoundException Deletes a note.- Specified by:
deleteNotein interfaceNoteService- Parameters:
noteType- It can be Portal, Group, or User.noteOwner- The NoteBook owner.noteName- Name of the note.userIdentity- User identity deleting the note.- Returns:
- "True" if deleting the note is successful, or "false" if not.
- Throws:
WikiException- if an error occuredIllegalAccessExceptionorg.gatein.api.EntityNotFoundException
-
renameNote
public boolean renameNote(String noteType, String noteOwner, String noteName, String newName, String newTitle) throws WikiException Renames a note.- Specified by:
renameNotein interfaceNoteService- Parameters:
noteType- It can be Portal, Group, or User.noteOwner- The NoteBook owner.noteName- Old name of the note.newName- New name of the note.newTitle- New title of the note.- Returns:
- "True" if renaming the note is successful, or "false" if not.
- Throws:
WikiException- if an error occured
-
moveNote
public void moveNote(WikiPageParams currentLocationParams, WikiPageParams newLocationParams) throws WikiException Move a note- Specified by:
moveNotein interfaceNoteService- Parameters:
currentLocationParams- The current location of the note.newLocationParams- The new location of the note.- Throws:
WikiException- if an error occured
-
moveNote
public boolean moveNote(WikiPageParams currentLocationParams, WikiPageParams newLocationParams, org.exoplatform.services.security.Identity userIdentity) throws WikiException, IllegalAccessException, org.gatein.api.EntityNotFoundException Move a note- Specified by:
moveNotein interfaceNoteService- Parameters:
currentLocationParams- The current location of the note.newLocationParams- The new location of the note.userIdentity- The user Identity to check permissions.- Returns:
- "True" if moving the note is successful, or "false" if not.
- Throws:
WikiException- if an error occuredIllegalAccessException- if the user don't have edit rights on the noteorg.gatein.api.EntityNotFoundException- if the the note to move don't exist
-
getNoteOfNoteBookByName
public Page getNoteOfNoteBookByName(String noteType, String noteOwner, String noteName) throws WikiException Gets a note by its unique name in the noteBook.- Specified by:
getNoteOfNoteBookByNamein interfaceNoteService- Parameters:
noteType- It can be Portal, Group, or User.noteOwner- The NoteBook owner.noteName- Id of the note.- Returns:
- The note if the current user has the read permission. Otherwise, it is "null".
- Throws:
WikiException- if an error occured
-
getNoteOfNoteBookByName
public Page getNoteOfNoteBookByName(String noteType, String noteOwner, String noteName, org.exoplatform.services.security.Identity userIdentity, String source) throws IllegalAccessException, WikiException Retrieves a note by note type, owner and name.- Specified by:
getNoteOfNoteBookByNamein interfaceNoteService- Parameters:
noteType- note typenoteOwner- note ownernoteName- note nameuserIdentity- user identity id- Returns:
Page- Throws:
IllegalAccessExceptionWikiException
-
getNoteOfNoteBookByName
public Page getNoteOfNoteBookByName(String noteType, String noteOwner, String noteName, String lang, org.exoplatform.services.security.Identity userIdentity) throws WikiException, IllegalAccessException Retrieves a note by note type, owner, name and lang.- Specified by:
getNoteOfNoteBookByNamein interfaceNoteService- Parameters:
noteType- note typenoteOwner- note ownernoteName- note namelang- note version languageuserIdentity- user identity id- Returns:
Page- Throws:
WikiExceptionIllegalAccessException
-
getNoteOfNoteBookByName
public Page getNoteOfNoteBookByName(String noteType, String noteOwner, String noteName, org.exoplatform.services.security.Identity userIdentity) throws IllegalAccessException, WikiException Gets a note by its unique name in the noteBook.- Specified by:
getNoteOfNoteBookByNamein interfaceNoteService- Parameters:
noteType- It can be Portal, Group, or User.noteOwner- The NoteBook owner.noteName- Id of the note.userIdentity- User identity getting the note.- Returns:
- The note if the current user has the read permission. Otherwise, it is "null".
- Throws:
WikiException- if an error occuredIllegalAccessException
-
getNoteById
Gets a note based on its unique id.- Specified by:
getNoteByIdin interfaceNoteService- Parameters:
id- Unique id of the note.- Returns:
- The note.
- Throws:
WikiException- if an error occured
-
getDraftNoteById
public DraftPage getDraftNoteById(String id, String userId) throws WikiException, IllegalAccessException Gets a draft note based on its unique id.- Specified by:
getDraftNoteByIdin interfaceNoteService- Parameters:
id- Unique id of the draft note.userId- user id- Returns:
- The note.
- Throws:
WikiException- if an error occuredIllegalAccessException
-
getLatestDraftOfPage
Returns latest draft of given page.- Specified by:
getLatestDraftOfPagein interfaceNoteService- Parameters:
targetPage-- Returns:
- latest draft of the given page
- Throws:
WikiException
-
getLatestDraftOfPage
Returns latest draft of given page.- Specified by:
getLatestDraftOfPagein interfaceNoteService- Parameters:
targetPage-username-- Returns:
- latest draft of the given page
- Throws:
WikiException
-
getNoteById
public Page getNoteById(String id, org.exoplatform.services.security.Identity userIdentity) throws IllegalAccessException, WikiException Gets a note based on its unique id.- Specified by:
getNoteByIdin interfaceNoteService- Parameters:
id- Unique id of the note.userIdentity- user identity id getting the note- Returns:
- The note.
- Throws:
WikiException- if an error occuredIllegalAccessException
-
getNoteById
public Page getNoteById(String id, org.exoplatform.services.security.Identity userIdentity, String source) throws IllegalAccessException, WikiException Gets a note based on its unique id.- Specified by:
getNoteByIdin interfaceNoteService- Parameters:
id- Unique id of the note.userIdentity- user identity id getting the notesource- the source of the note- Returns:
- The note.
- Throws:
WikiException- if an error occuredIllegalAccessException
-
getParentNoteOf
Get parent note of a note- Specified by:
getParentNoteOfin interfaceNoteService- Parameters:
note- note.- Returns:
- The list of children notes
- Throws:
WikiException- if an error occured
-
getParentNoteOf
Return the Parent of the note to export- Specified by:
getParentNoteOfin interfaceNoteService- Parameters:
note- The Note to export- Returns:
- the parent of the note to export
- Throws:
WikiException
-
getChildrenNoteOf
public List<Page> getChildrenNoteOf(Page note, boolean withDrafts, boolean withChild) throws WikiException Get all the children notes of a note- Specified by:
getChildrenNoteOfin interfaceNoteService- Parameters:
note- note.withDrafts- if set to true returns the children notes and draft notes- Returns:
- The list of children notes
- Throws:
WikiException- if an error occured
-
getChildrenNoteOf
public List<Page> getChildrenNoteOf(Page note, String userId, boolean withDrafts, boolean withChild) throws WikiException Get all the children notes of a note- Specified by:
getChildrenNoteOfin interfaceNoteService- Parameters:
note- note.userId-withDrafts- if set to true returns the children notes and draft notes- Returns:
- The list of children notes
- Throws:
WikiException- if an error occured
-
getChildrenNoteOf
Return the list of children of the note to export- Specified by:
getChildrenNoteOfin interfaceNoteService- Parameters:
note- The Note to export- Returns:
- the list of children of the note to export
- Throws:
WikiException
-
getChildrenNoteOf
Return the list of children of the note to export- Specified by:
getChildrenNoteOfin interfaceNoteService- Parameters:
note- The Note to exportuserId- the current user Id- Returns:
- the list of children of the note to export
- Throws:
WikiException
-
getBreadCrumb
public List<BreadcrumbData> getBreadCrumb(String noteType, String noteOwner, String noteName, boolean isDraftNote) throws WikiException, IllegalAccessException Gets a list of data which is used for composing the breadcrumb.- Specified by:
getBreadCrumbin interfaceNoteService- Parameters:
noteType- It can be Portal, Group, or User.noteOwner- The owner.noteName- Id of the note to which the breadcrumb points.isDraftNote-- Returns:
- The list of data.
- Throws:
WikiException- if an error occuredIllegalAccessException
-
getBreadCrumb
public List<BreadcrumbData> getBreadCrumb(String noteType, String noteOwner, String noteName, String lang, org.exoplatform.services.security.Identity userIdentity, boolean isDraftNote) throws WikiException, IllegalAccessException Gets a list of data which is used for composing the breadcrumb.- Specified by:
getBreadCrumbin interfaceNoteService- Parameters:
noteType- It can be Portal, Group, or User.noteOwner- The owner.lang- lang to be used to get translated titles.userIdentity- Current user identity.isDraftNote-- Returns:
- The list of data.
- Throws:
WikiException- if an error occuredIllegalAccessException
-
getDuplicateNotes
public List<Page> getDuplicateNotes(Page parentNote, Wiki targetNoteBook, List<Page> resultList) throws WikiException Checks if a note and its children are duplicated with ones in the target NoteBook or not, then gets a list of duplicated notes if any.- Specified by:
getDuplicateNotesin interfaceNoteService- Parameters:
parentNote- The note to check.targetNoteBook- The target NoteBook to check.resultList- The list of duplicated notes.- Returns:
- The list of duplicated notes.
- Throws:
WikiException- if an error occured
-
getDuplicateNotes
public List<Page> getDuplicateNotes(Page parentNote, Wiki targetNoteBook, List<Page> resultList, String userId) throws WikiException Checks if a note and its children are duplicated with ones in the target NoteBook or not, then gets a list of duplicated notes if any.- Specified by:
getDuplicateNotesin interfaceNoteService- Parameters:
parentNote- The note to check.targetNoteBook- The target NoteBook to check.resultList- The list of duplicated notes.userId-- Returns:
- The list of duplicated notes.
- Throws:
WikiException- if an error occured
-
removeDraftOfNote
Remove the all Drafts of a note- Specified by:
removeDraftOfNotein interfaceNoteService- Parameters:
param- Note location params.- Throws:
WikiException- if an error occured
-
removeDraftOfNote
Remove the Drafts of a note by username- Specified by:
removeDraftOfNotein interfaceNoteService- Parameters:
page- Note page.username- username.- Throws:
WikiException- if an error occured
-
removeDraftOfNote
Remove the Drafts of a note- Specified by:
removeDraftOfNotein interfaceNoteService- Parameters:
page- Note page.- Throws:
WikiException- if an error occured
-
removeDraftOfNote
Remove the Drafts of a note by language- Specified by:
removeDraftOfNotein interfaceNoteService- Parameters:
param- Note location params.lang- draft lang.- Throws:
WikiException- if an error occured
-
removeDraft
Removes a draft page by its name.- Specified by:
removeDraftin interfaceNoteService- Parameters:
draftName- Name of the draft page.- Throws:
WikiException- if an error occured
-
removeDraftById
Removes a draft page by its technical id.- Specified by:
removeDraftByIdin interfaceNoteService- Parameters:
draftId- Technical Id of the draft page.- Throws:
WikiException- if an error occured
-
getVersionsHistoryOfNote
Gets all the Histories of the given note- Specified by:
getVersionsHistoryOfNotein interfaceNoteService- Parameters:
note- The noteuserName- the author name- Returns:
- All the histories of the note
- Throws:
WikiException- if an error occured
-
createVersionOfNote
Creates a version of a note. This method only tag the current note data as a new version, it does not update the note data- Specified by:
createVersionOfNotein interfaceNoteService- Parameters:
note- The noteuserName- the author name- Throws:
WikiException- if an error occured
-
restoreVersionOfNote
public void restoreVersionOfNote(String versionName, Page note, String userName) throws WikiException Restores a version of a note- Specified by:
restoreVersionOfNotein interfaceNoteService- Parameters:
versionName- The name of the version to restorenote- The noteuserName- the other name- Throws:
WikiException- if an error occured
-
getPreviousNamesOfNote
Get previous names of a note- Specified by:
getPreviousNamesOfNotein interfaceNoteService- Parameters:
note- The note- Returns:
- List of all the previous names of the note
- Throws:
WikiException- if an error occured
-
getNotesOfWiki
Retrieve the all notes contained in noteBook- Specified by:
getNotesOfWikiin interfaceNoteService- Parameters:
noteType- the notebook Type It can be Portal, Group, or User.noteOwner- the notebook owner- Returns:
- List of pages
-
isExisting
public boolean isExisting(String noteBookType, String noteBookOwner, String noteId) throws WikiException Check if the given note is existing- Specified by:
isExistingin interfaceNoteService- Parameters:
noteBookType- the notebook Type It can be Portal, Group, or User.noteBookOwner- the notebook ownernoteId- the note id- Returns:
- true if the note is existing
- Throws:
WikiException
-
updateDraftForExistPage
public DraftPage updateDraftForExistPage(DraftPage draftNoteToUpdate, Page targetPage, String revision, long clientTime, String username) throws WikiException Update draft note for an existing page- Specified by:
updateDraftForExistPagein interfaceNoteService- Parameters:
draftNoteToUpdate- The draft note to be updatedtargetPage- The target note of the draftrevision- The revision which is used for creating the draft page. If "null", this will be the last revision.clientTime-username- The author name- Returns:
- Updated draft
- Throws:
WikiException
-
updateDraftForNewPage
public DraftPage updateDraftForNewPage(DraftPage draftNoteToUpdate, long clientTime) throws WikiException Update draft note for a new page- Specified by:
updateDraftForNewPagein interfaceNoteService- Parameters:
draftNoteToUpdate- the draft note to be updatedclientTime-- Returns:
- Updated draft
- Throws:
WikiException
-
createDraftForExistPage
public DraftPage createDraftForExistPage(DraftPage draftPage, Page targetPage, String revision, long clientTime, String username) throws WikiException Creates a draft for an existing page- Specified by:
createDraftForExistPagein interfaceNoteService- Parameters:
draftPage- The draft note to be createdtargetPage- The target note of the draftrevision- The revision which is used for creating the draft page. If "null", this will be the last revision.clientTime-username- The author name- Returns:
- Created draft
- Throws:
WikiException
-
createDraftForNewPage
Creates a draft for a new page- Specified by:
createDraftForNewPagein interfaceNoteService- Parameters:
draftPage- The draft note to be createdclientTime-- Returns:
- Created draft
- Throws:
WikiException
-
hasPermissionOnPage
public boolean hasPermissionOnPage(Page page, PermissionType permissionType, org.exoplatform.services.security.Identity user) throws WikiException Checks if the given user has the permission on a page- Specified by:
hasPermissionOnPagein interfaceNoteService- Parameters:
page- the wiki page objectpermissionType- permission Typeuser- the userName- Returns:
- true if user has permissions
- Throws:
WikiException- if an error occured
-
getNoteByRootPermission
public Page getNoteByRootPermission(String wikiType, String wikiOwner, String pageId) throws WikiException Gets a wiki page regardless of the current user's permission.- Specified by:
getNoteByRootPermissionin interfaceNoteService- Parameters:
wikiType- It can be Portal, Group, or User.wikiOwner- The Wiki owner.pageId- Id of the wiki page.- Returns:
- The wiki page.
- Throws:
WikiException- if an error occured if an error occured
-
getNoteRenderedContent
Return the content of the note to be rendred- Specified by:
getNoteRenderedContentin interfaceNoteService- Parameters:
note- The Note- Returns:
- Content to be rendred
-
importNotes
public void importNotes(String zipLocation, Page parent, String conflict, org.exoplatform.services.security.Identity userIdentity) throws WikiException, IllegalAccessException, IOException Import Notes from a zip file location- Specified by:
importNotesin interfaceNoteService- Parameters:
zipLocation- the zip file location pathparent- The parent page where notes will be impoprtedconflict- import strategy ( can be "overwrite","replaceAll","duplicate" or "duplicate")userIdentity- current user Identity- Throws:
WikiException- if an error occuredIllegalAccessException- if the user don't have edit rights on the noteIOException- if can't read zip file
-
importNotes
public void importNotes(List<String> files, Page parent, String conflict, org.exoplatform.services.security.Identity userIdentity) throws WikiException, IllegalAccessException, IOException Import Notes from a list of files- Specified by:
importNotesin interfaceNoteService- Parameters:
files- the list of filesparent- The parent page where notes will be importedconflict- import strategy ( can be "overwrite","replaceAll","duplicate" or "duplicate")userIdentity- current user Identity- Throws:
WikiException- if an error occuredIllegalAccessException- if the user don't have edit rights on the noteIOException- if can't read files
-
search
public org.exoplatform.commons.utils.PageList<SearchResult> search(WikiSearchData data) throws WikiException Searches in all wiki pages.- Specified by:
searchin interfaceNoteService- Parameters:
data- The data to search.- Returns:
- Search results.
- Throws:
WikiException- if an error occured if an error occured
-
getNoteByIdAndLang
public Page getNoteByIdAndLang(Long pageId, org.exoplatform.services.security.Identity userIdentity, String source, String lang) throws WikiException, IllegalAccessException Retrieves note page by its id and content lang- Specified by:
getNoteByIdAndLangin interfaceNoteService- Parameters:
pageId- page iduserIdentity- user identity idsource- sourcelang- content language- Returns:
Page- Throws:
WikiExceptionIllegalAccessException
-
getNoteByIdAndLang
Description copied from interface:NoteServiceRetrieves note page by its id and content lang- Specified by:
getNoteByIdAndLangin interfaceNoteService- Parameters:
pageId- page idlang- content language- Returns:
Page
-
getPublishedVersionByPageIdAndLang
Retrieves published note version page by its page id and content lang- Specified by:
getPublishedVersionByPageIdAndLangin interfaceNoteService- Parameters:
pageId- page idlang- content language- Returns:
PageVersion
-
getPageAvailableTranslationLanguages
public List<String> getPageAvailableTranslationLanguages(Long pageId, boolean withDrafts) throws WikiException Retrieves list of available translations languages of a page- Specified by:
getPageAvailableTranslationLanguagesin interfaceNoteService- Parameters:
pageId- page idwithDrafts- if set to true returns languages draft notes- Returns:
ListofString- Throws:
WikiException
-
getPageAvailableTranslationLanguages
public List<String> getPageAvailableTranslationLanguages(Long pageId, String userId, boolean withDrafts) throws WikiException Retrieves list of available translations languages of a page- Specified by:
getPageAvailableTranslationLanguagesin interfaceNoteService- Parameters:
pageId- page iduserId- owner usernamewithDrafts- if set to true returns languages draft notes- Returns:
ListofString- Throws:
WikiException
-
getVersionsHistoryOfNoteByLang
public List<PageHistory> getVersionsHistoryOfNoteByLang(Page note, String userName, String lang) throws WikiException Retrieves the history version of given note by language- Specified by:
getVersionsHistoryOfNoteByLangin interfaceNoteService- Parameters:
note- the target note iduserName- user namelang- content language- Returns:
ListofPageHistory- Throws:
WikiException
-
getLatestDraftPageByTargetPageAndLang
Retrieves latest draft of a specific page by target page id and content language- Specified by:
getLatestDraftPageByTargetPageAndLangin interfaceNoteService- Parameters:
targetPageId- target page idlang- content language- Returns:
DraftPage
-
getLatestDraftPageByUserAndTargetPageAndLang
public DraftPage getLatestDraftPageByUserAndTargetPageAndLang(Long targetPageId, String username, String lang) Retrieves latest draft of a specific page by target page id and content language and owner username- Specified by:
getLatestDraftPageByUserAndTargetPageAndLangin interfaceNoteService- Parameters:
targetPageId- target page idusername- owner usernamelang- content language- Returns:
DraftPage
-
deleteVersionsByNoteIdAndLang
Deletes a list of versions of note by language.- Specified by:
deleteVersionsByNoteIdAndLangin interfaceNoteService- Parameters:
noteId- Id of the note.lang- language.- Throws:
WikiException- if an error occured
-
deleteVersionsByNoteIdAndLang
public void deleteVersionsByNoteIdAndLang(Long noteId, String userName, String lang) throws WikiException Deletes a list of versions of note by language.- Specified by:
deleteVersionsByNoteIdAndLangin interfaceNoteService- Parameters:
noteId- Id of the note.userName- owner usernamelang- language.- Throws:
WikiException- if an error occured
-
getRenderingCache
-
getPageLinksMap
-
postUpdatePageVersionLanguage
-
postDeletePageVersionLanguage
-
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
-
postOpenByTree
public void postOpenByTree(String wikiType, String wikiOwner, String pageId, Page page) throws WikiException - Throws:
WikiException
-
postOpenByBreadCrumb
public void postOpenByBreadCrumb(String wikiType, String wikiOwner, String pageId, Page page) throws WikiException - Throws:
WikiException
-
invalidateCache
-
invalidateCachesOfPageTree
- Throws:
WikiException
-
invalidateAttachmentCache
-
removeOrphanDraftPagesByParentPage
public void removeOrphanDraftPagesByParentPage(long parentPageId) Remove all children drafts of a parent page without existing target- Specified by:
removeOrphanDraftPagesByParentPagein interfaceNoteService- Parameters:
parentPageId- Note parent page id
-