Package org.exoplatform.wiki.service
Interface NoteService
-
- All Known Implementing Classes:
NoteServiceImpl
public interface NoteServiceProvides functions for processing database with notes, including: adding, editing, removing and searching for data.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description booleancanModifyNotePermission(Page currentNote, org.exoplatform.services.security.Identity currentIdentity)Check if the given user can update the notebooleancanPublicAndRetrictNote(Page currentNote, org.exoplatform.services.security.Identity currentIdentity)Check if the given user can public or restrict the notePagecreateNote(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.PagecreateNote(Wiki noteBook, Page parentNote, Page note)Create a new note in the given notebook, under the given parent note.voidcreateVersionOfNote(Page note)Creates a version of a note.booleandeleteNote(String noteType, String noteOwner, String noteId)Deletes a note.booleandeleteNote(String noteType, String noteOwner, String noteName, org.exoplatform.services.security.Identity userIdentity)List<BreadcrumbData>getBreadcumb(String noteType, String noteOwner, String noteId)Gets a list of data which is used for composing the breadcrumb.List<Page>getChildrenNoteOf(Page note)Get all the children notes of a noteList<Page>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.PagegetNoteById(String id)Gets a note based on its unique id.PagegetNoteById(String id, org.exoplatform.services.security.Identity userIdentity)PagegetNoteById(String id, org.exoplatform.services.security.Identity userIdentity, String source)PagegetNoteByRootPermission(String noteBookType, String noteBookOwner, String noteId)PagegetNoteOfNoteBookByName(String noteType, String noteOwner, String noteName)Gets a note by its unique name in the noteBook.PagegetNoteOfNoteBookByName(String noteType, String noteOwner, String noteName, org.exoplatform.services.security.Identity userIdentity)PagegetNoteOfNoteBookByName(String noteType, String noteOwner, String noteName, org.exoplatform.services.security.Identity userIdentity, String source)List<Page>getNotesOfWiki(String noteType, String noteOwner)Retrieve the all notes contained in noteBookPagegetParentNoteOf(Page note)Get parent note of a noteList<String>getPreviousNamesOfNote(Page note)Get previous names of a notePageVersiongetVersionOfNoteByName(String versionName, Page note)Gets a specific version by name of the given noteList<PageVersion>getVersionsOfNote(Page note)Gets all the versions of the given notebooleanhasAdminNotePermission(String noteType, String owner, org.exoplatform.services.security.Identity user)Checks if the current user has the admin permission on a note.booleanhasAdminSpacePermission(String noteType, String owner, org.exoplatform.services.security.Identity user)Checks if the current user has the admin permission on a space or not.booleanhasPermissionOnNote(Page note, PermissionType permissionType, org.exoplatform.services.security.Identity user)Checks if the given user has the permission on a notebooleanisExisting(String noteBookType, String noteBookOwner, String noteId)voidmoveNote(WikiPageParams currentLocationParams, WikiPageParams newLocationParams)Move a notebooleanmoveNote(WikiPageParams currentLocationParams, WikiPageParams newLocationParams, org.exoplatform.services.security.Identity userIdentity)Move a notevoidremoveDraftOfNote(WikiPageParams param)booleanrenameNote(String noteType, String noteOwner, String noteName, String newName, String newTitle)Renames a note.voidrestoreVersionOfNote(String versionName, Page note)Restores a version of a notevoidupdateNote(Page note)Update the given note.PageupdateNote(Page note, PageUpdateType type, org.exoplatform.services.security.Identity userIdentity)Update the given note.
-
-
-
Method Detail
-
createNote
Page createNote(Wiki noteBook, Page parentNote, Page note) throws WikiException
Create a new note in the given notebook, under the given parent note.- Parameters:
noteBook- Notebook object.parentNote- parent note.note- the note to create.- Returns:
- The new note.
- Throws:
WikiException- if an error occured
-
createNote
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.- 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
-
deleteNote
boolean deleteNote(String noteType, String noteOwner, String noteId) throws WikiException
Deletes a note.- Parameters:
noteType- It can be Portal, Group, or User.noteOwner- The NoteBook owner.noteId- Id of the note.- Returns:
- "True" if deleting the note is successful, or "false" if not.
- Throws:
WikiException- if an error occured
-
deleteNote
boolean deleteNote(String noteType, String noteOwner, String noteName, org.exoplatform.services.security.Identity userIdentity) throws WikiException, IllegalAccessException, org.gatein.api.EntityNotFoundException
- Throws:
WikiExceptionIllegalAccessExceptionorg.gatein.api.EntityNotFoundException
-
renameNote
boolean renameNote(String noteType, String noteOwner, String noteName, String newName, String newTitle) throws WikiException
Renames a note.- 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
void moveNote(WikiPageParams currentLocationParams, WikiPageParams newLocationParams) throws WikiException
Move a note- Parameters:
currentLocationParams- The current location of the note.newLocationParams- The new location of the note.- Throws:
WikiException- if an error occured
-
moveNote
boolean moveNote(WikiPageParams currentLocationParams, WikiPageParams newLocationParams, org.exoplatform.services.security.Identity userIdentity) throws WikiException, IllegalAccessException, org.gatein.api.EntityNotFoundException
Move a note- 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
Page getNoteOfNoteBookByName(String noteType, String noteOwner, String noteName) throws WikiException
Gets a note by its unique name in the noteBook.- 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
Page getNoteOfNoteBookByName(String noteType, String noteOwner, String noteName, org.exoplatform.services.security.Identity userIdentity) throws WikiException, IllegalAccessException
- Throws:
WikiExceptionIllegalAccessException
-
getNoteOfNoteBookByName
Page getNoteOfNoteBookByName(String noteType, String noteOwner, String noteName, org.exoplatform.services.security.Identity userIdentity, String source) throws WikiException, IllegalAccessException
- Throws:
WikiExceptionIllegalAccessException
-
getNoteById
Page getNoteById(String id) throws WikiException
Gets a note based on its unique id.- Parameters:
id- Unique id of the note.- Returns:
- The note.
- Throws:
WikiException- if an error occured
-
getNoteById
Page getNoteById(String id, org.exoplatform.services.security.Identity userIdentity) throws IllegalAccessException, WikiException
- Throws:
IllegalAccessExceptionWikiException
-
getNoteById
Page getNoteById(String id, org.exoplatform.services.security.Identity userIdentity, String source) throws IllegalAccessException, WikiException
- Throws:
IllegalAccessExceptionWikiException
-
getParentNoteOf
Page getParentNoteOf(Page note) throws WikiException
Get parent note of a note- Parameters:
note- note.- Returns:
- The list of children notes
- Throws:
WikiException- if an error occured
-
getChildrenNoteOf
List<Page> getChildrenNoteOf(Page note) throws WikiException
Get all the children notes of a note- Parameters:
note- note.- Returns:
- The list of children notes
- Throws:
WikiException- if an error occured
-
getBreadcumb
List<BreadcrumbData> getBreadcumb(String noteType, String noteOwner, String noteId) throws WikiException
Gets a list of data which is used for composing the breadcrumb.- Parameters:
noteType- It can be Portal, Group, or User.noteOwner- The owner.noteId- Id of the note to which the breadcrumb points.- Returns:
- The list of data.
- Throws:
WikiException- if an error occured
-
getDuplicateNotes
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.- 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
-
removeDraftOfNote
void removeDraftOfNote(WikiPageParams param) throws WikiException
- Throws:
WikiException
-
hasPermissionOnNote
boolean hasPermissionOnNote(Page note, PermissionType permissionType, org.exoplatform.services.security.Identity user) throws WikiException
Checks if the given user has the permission on a note- Parameters:
user- the usernote- the note to checkpermissionType- type of permissions to chack- Returns:
- true if user has permissions on the note
- Throws:
WikiException- if an error occured
-
hasAdminSpacePermission
boolean hasAdminSpacePermission(String noteType, String owner, org.exoplatform.services.security.Identity user) throws WikiException
Checks if the current user has the admin permission on a space or not.- Parameters:
noteType- It can be Portal, Group, or User.owner- Owner of the space.user- Identity of current user.- 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
-
hasAdminNotePermission
boolean hasAdminNotePermission(String noteType, String owner, org.exoplatform.services.security.Identity user) throws WikiException
Checks if the current user has the admin permission on a note.- Parameters:
noteType- It can be Portal, Group, or User.owner- Owner of the noteBook.user- Identity of current user.- Returns:
- "True" if the current user has the admin permission on the note, or "false" if not.
- Throws:
WikiException- if an error occured
-
canModifyNotePermission
boolean canModifyNotePermission(Page currentNote, org.exoplatform.services.security.Identity currentIdentity) throws WikiException
Check if the given user can update the note- Parameters:
currentNote- The note to updatecurrentIdentity- The identity of user user that needs to update the note- Returns:
- true if the user can update the note
- Throws:
WikiException- if an error occured
-
canPublicAndRetrictNote
boolean canPublicAndRetrictNote(Page currentNote, org.exoplatform.services.security.Identity currentIdentity) throws WikiException
Check if the given user can public or restrict the note- Parameters:
currentNote- the note to chack permissionscurrentIdentity- The identity of user- Returns:
- true if the current user has EditNote permission or admin note or admin space
- Throws:
WikiException- if an error occured
-
getVersionsOfNote
List<PageVersion> getVersionsOfNote(Page note) throws WikiException
Gets all the versions of the given note- Parameters:
note- The note- Returns:
- All the versions of the note
- Throws:
WikiException- if an error occured
-
getVersionOfNoteByName
PageVersion getVersionOfNoteByName(String versionName, Page note) throws WikiException
Gets a specific version by name of the given note- Parameters:
versionName- The name of the versionnote- The note- Returns:
- The version of the note
- Throws:
WikiException- if an error occured
-
createVersionOfNote
void createVersionOfNote(Page note) throws WikiException
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- Parameters:
note- The note- Throws:
WikiException- if an error occured
-
restoreVersionOfNote
void restoreVersionOfNote(String versionName, Page note) throws WikiException
Restores a version of a note- Parameters:
versionName- The name of the version to restorenote- The note- Throws:
WikiException- if an error occured
-
updateNote
void updateNote(Page note) throws WikiException
Update the given note.- Parameters:
note- Updated note- Throws:
WikiException- if an error occured
-
updateNote
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, ...).- 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
-
getPreviousNamesOfNote
List<String> getPreviousNamesOfNote(Page note) throws WikiException
Get previous names of a note- Parameters:
note- The note- Returns:
- List of all the previous names of the note
- Throws:
WikiException- if an error occured
-
getNotesOfWiki
List<Page> getNotesOfWiki(String noteType, String noteOwner)
Retrieve the all notes contained in noteBook- Parameters:
noteType- the notebook Type It can be Portal, Group, or User.noteOwner- the notebook owner- Returns:
- List of pages
-
isExisting
boolean isExisting(String noteBookType, String noteBookOwner, String noteId) throws WikiException
- Throws:
WikiException
-
getNoteByRootPermission
Page getNoteByRootPermission(String noteBookType, String noteBookOwner, String noteId) throws WikiException
- Throws:
WikiException
-
-