1 /* 2 * Copyright (C) 2003-2008 eXo Platform SAS. 3 * 4 * This program is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Affero General Public License 6 * as published by the Free Software Foundation; either version 3 7 * of the License, or (at your option) any later version. 8 * 9 * This program is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 * GNU General Public License for more details. 13 * 14 * You should have received a copy of the GNU General Public License 15 * along with this program; if not, see<http://www.gnu.org/licenses/>. 16 */ 17 package org.exoplatform.wiki.service; 18 19 import org.exoplatform.commons.utils.PageList; 20 import org.exoplatform.container.component.ComponentPlugin; 21 import org.exoplatform.services.security.Identity; 22 import org.exoplatform.wiki.WikiException; 23 import org.exoplatform.wiki.mow.api.*; 24 import org.exoplatform.wiki.plugin.WikiEmotionIconsPlugin; 25 import org.exoplatform.wiki.plugin.WikiTemplatePagePlugin; 26 import org.exoplatform.wiki.service.diff.DiffResult; 27 import org.exoplatform.wiki.service.impl.SpaceBean; 28 import org.exoplatform.wiki.service.listener.AttachmentWikiListener; 29 import org.exoplatform.wiki.service.listener.PageWikiListener; 30 import org.exoplatform.wiki.service.search.SearchResult; 31 import org.exoplatform.wiki.service.search.TemplateSearchData; 32 import org.exoplatform.wiki.service.search.TemplateSearchResult; 33 import org.exoplatform.wiki.service.search.WikiSearchData; 34 35 import java.util.List; 36 import java.util.Map; 37 38 /** 39 * Provides functions for processing database 40 * with wikis and pages, including: adding, editing, removing and searching for data. 41 * 42 * @LevelAPI Provisional 43 */ 44 public interface WikiService { 45 46 /** 47 * Create a new wiki page in the given wiki, under the given parent page. 48 * 49 * @param wiki It can be Portal, Group, or User. 50 * @param parentPageName Name of the parent wiki page. 51 * @return The new wiki page. 52 * @throws WikiException 53 */ 54 public Page createPage(Wiki wiki, String parentPageName, Page page) throws WikiException; 55 56 /** 57 * Creates a new Wiki template. 58 * 59 * @param wiki Wiki of the template 60 * @param template The params object which is used for creating the new Wiki template. 61 * @throws WikiException 62 */ 63 public void createTemplatePage(Wiki wiki, Template template) throws WikiException; 64 65 /** 66 * Deletes a wiki page. 67 * 68 * @param wikiType It can be Portal, Group, or User. 69 * @param wikiOwner The Wiki owner. 70 * @param pageId Id of the wiki page. 71 * @return "True" if deleting the wiki page is successful, or "false" if not. 72 * @throws WikiException 73 */ 74 public boolean deletePage(String wikiType, String wikiOwner, String pageId) throws WikiException; 75 76 /** 77 * Deletes a Wiki template. 78 * 79 * @param wikiType It can be Portal, Group, or User. 80 * @param wikiOwner The Wiki owner. 81 * @param templateName Name of the Wiki template. 82 * @throws WikiException 83 */ 84 public void deleteTemplatePage(String wikiType, String wikiOwner, String templateName) throws WikiException; 85 86 /** 87 * Renames a wiki page. 88 * 89 * @param wikiType It can be Portal, Group, or User. 90 * @param wikiOwner The Wiki owner. 91 * @param pageName Old name of the wiki page. 92 * @param newName New name of the wiki page. 93 * @param newTitle New title of the wiki page. 94 * @return "True" if renaming the wiki page is successful, or "false" if not. 95 * @throws WikiException 96 */ 97 public boolean renamePage(String wikiType, String wikiOwner, String pageName, String newName, String newTitle) throws WikiException; 98 99 /** 100 * Move a wiki Page 101 * 102 * @param currentLocationParams The current location of the wiki page. 103 * @param newLocationParams The new location of the wiki page. 104 * @return "True" if moving the wiki page is successful, or "false" if not. 105 * @throws WikiException 106 */ 107 public boolean movePage(WikiPageParams currentLocationParams, WikiPageParams newLocationParams) throws WikiException; 108 109 /** 110 * Gets a list of Wiki permissions based on its type and owner. 111 * 112 * @param wikiType It can be Portal, Group, or User. 113 * @param wikiOwner The Wiki owner. 114 * @return The list of Wiki permissions. 115 * @throws WikiException 116 */ 117 public List<PermissionEntry> getWikiPermission(String wikiType, String wikiOwner) throws WikiException; 118 119 /** 120 * Adds a list of permissions to Wiki. 121 * 122 * @param wikiType It can be Portal, Group, or User. 123 * @param wikiOwner The Wiki owner. 124 * @param permissionEntries The list of permissions. 125 * @throws WikiException 126 */ 127 public void updateWikiPermission(String wikiType, String wikiOwner, List<PermissionEntry> permissionEntries) throws WikiException; 128 129 /** 130 * Gets a wiki page by its unique name in the wiki. 131 * 132 * @param wikiType It can be Portal, Group, or User. 133 * @param wikiOwner The Wiki owner. 134 * @param pageName Id of the wiki page. 135 * @return The wiki page if the current user has the read permission. Otherwise, it is "null". 136 * @throws WikiException 137 */ 138 public Page getPageOfWikiByName(String wikiType, String wikiOwner, String pageName) throws WikiException; 139 140 /** 141 * Gets a wiki page regardless of the current user's permission. 142 * 143 * @param wikiType It can be Portal, Group, or User. 144 * @param wikiOwner The Wiki owner. 145 * @param pageId Id of the wiki page. 146 * @return The wiki page. 147 * @throws WikiException 148 */ 149 public Page getPageByRootPermission(String wikiType, String wikiOwner, String pageId) throws WikiException; 150 151 /** 152 * Gets a related page of a wiki page which is specified by a given Id. 153 * 154 * @param wikiType It can be Portal, Group, or User. 155 * @param wikiOwner The Wiki owner. 156 * @param pageId Id of the wiki page. 157 * @return The related wiki page. 158 * @throws WikiException 159 */ 160 public Page getRelatedPage(String wikiType, String wikiOwner, String pageId) throws WikiException; 161 162 /** 163 * Gets a wiki page or its draft if existing by its Id. 164 * 165 * @param wikiType It can be Portal, Group, or User. 166 * @param wikiOwner The Wiki owner. 167 * @param pageId Id of the wiki page. 168 * @return The wiki page or its draft. 169 * @throws WikiException 170 */ 171 public Page getExsitedOrNewDraftPageById(String wikiType, String wikiOwner, String pageId) throws WikiException; 172 173 /** 174 * Gets a wiki page based on its unique id. 175 * 176 * @param id Unique id of the wiki page. 177 * @return The wiki page. 178 * @throws WikiException 179 */ 180 public Page getPageById(String id) throws WikiException; 181 182 /** 183 * Gets a wiki draft page based on its unique id. 184 * 185 * @param id Unique id of the wiki page. 186 * @return The wiki draft page. 187 * @throws WikiException 188 */ 189 public Page getDraftPageById(String id) throws WikiException; 190 191 /** 192 * Get renderd content of a page 193 * @param page The wiki page 194 * @param targetSyntax The syntax 195 * @return The rendered content 196 */ 197 public String getPageRenderedContent(Page page, String targetSyntax); 198 199 /** 200 * Add a link between 2 pages 201 * @param param First page 202 * @param entity Second page 203 */ 204 public void addPageLink(WikiPageParams param, WikiPageParams entity); 205 206 /** 207 * Get parent page of a wiki page 208 * @param page Wiki page. 209 * @return The list of children pages 210 */ 211 public Page getParentPageOf(Page page) throws WikiException; 212 213 /** 214 * Get all the children pages of a wiki page 215 * @param page Wiki page. 216 * @return The list of children pages 217 */ 218 public List<Page> getChildrenPageOf(Page page) throws WikiException; 219 220 /** 221 * Gets a Wiki template. 222 * @param params The params object which is used for creating the Wiki template. 223 * @param templateId Id of the wiki template. 224 * @return The wiki template. 225 * @throws WikiException 226 */ 227 public Template getTemplatePage(WikiPageParams params, String templateId) throws WikiException; 228 229 /** 230 * Gets a list of data which is used for composing the breadcrumb. 231 * 232 * @param wikiType It can be Portal, Group, or User. 233 * @param wikiOwner The Wiki owner. 234 * @param pageId Id of the wiki page to which the breadcrumb points. 235 * @return The list of data. 236 * @throws WikiException 237 */ 238 public List<BreadcrumbData> getBreadcumb(String wikiType, String wikiOwner, String pageId) throws WikiException; 239 240 /** 241 * Gets parameters of a wiki page based on the data stored in the breadcrumb. 242 * 243 * @param data The data in the breadcrumb that identifies the wiki page. 244 * @return The parameters identifying the wiki page. 245 * @throws WikiException 246 */ 247 public WikiPageParams getWikiPageParams(BreadcrumbData data) throws WikiException; 248 249 /** 250 * Searches in all wiki pages. 251 * 252 * @param data The data to search. 253 * @return Search results. 254 * @throws WikiException 255 */ 256 public PageList<SearchResult> search(WikiSearchData data) throws WikiException; 257 258 /** 259 * Searches in all templates. 260 * 261 * @param data The data to search. 262 * @return Search results. 263 * @throws WikiException 264 */ 265 public List<TemplateSearchResult> searchTemplate(TemplateSearchData data) throws WikiException; 266 267 /** 268 * Checks if a page and its children are duplicated with ones in the target Wiki or not, 269 * then gets a list of duplicated pages if any. 270 * 271 * @param parentPage The page to check. 272 * @param targetWiki The target Wiki to check. 273 * @param resultList The list of duplicated wiki pages. 274 * @return The list of duplicated wiki pages. 275 * @throws WikiException 276 */ 277 public List<Page> getDuplicatePages(Page parentPage, Wiki targetWiki, List<Page> resultList) throws WikiException; 278 279 /** 280 * Gets Id of a default Wiki syntax. 281 * 282 * @return The Id. 283 */ 284 public String getDefaultWikiSyntaxId(); 285 286 /** 287 * Gets an interval which specifies the periodical auto-saving for pages in Wiki. 288 * 289 * @return The interval. Its default value is 30 seconds. 290 */ 291 public long getSaveDraftSequenceTime(); 292 293 /** 294 * Get the living time of edited page 295 * 296 * @return The living time of edited page 297 */ 298 public long getEditPageLivingTime(); 299 300 /** 301 * Gets attachments of the given page 302 * @param page The wiki page 303 * @return The attachments of the page 304 * @throws WikiException 305 */ 306 public List<Attachment> getAttachmentsOfPage(Page page) throws WikiException; 307 308 /** 309 * Get the number of attachment of the given page 310 * @param page The wiki page 311 * @return The number of attachments of the page 312 * @throws WikiException 313 */ 314 public int getNbOfAttachmentsOfPage(Page page) throws WikiException; 315 316 /** 317 * Get a attachment of a ther given page by name 318 * @param attachmentName The name of the attachment 319 * @param page The wiki page 320 * @return 321 * @throws WikiException 322 */ 323 public Attachment getAttachmentOfPageByName(String attachmentName, Page page) throws WikiException; 324 325 /** 326 * Add the given attachment to the given page 327 * @param attachment The attachment to add 328 * @param page The wiki page 329 * @throws WikiException 330 */ 331 public void addAttachmentToPage(Attachment attachment, Page page) throws WikiException; 332 333 /** 334 * Deletes the given attachment of the given page 335 * @param attachmentId Id of the attachment 336 * @param page The wiki page 337 * @throws WikiException 338 */ 339 public void deleteAttachmentOfPage(String attachmentId, Page page) throws WikiException; 340 341 /** 342 * Gets a Help wiki page based on a given syntax Id. 343 * 344 * @param syntaxId Id of the syntax. 345 * @param fullContent true to get the full help page content, false to get an excerpt 346 * @return The Help wiki page. 347 * @throws WikiException 348 */ 349 public Page getHelpSyntaxPage(String syntaxId, boolean fullContent) throws WikiException; 350 351 /** 352 * Gets a map of wiki templates based on a given params object. 353 * 354 * @param params The params object which is used for getting the wiki templates. 355 * @return The map of wiki templates. 356 * @throws WikiException 357 */ 358 public Map<String, Template> getTemplates(WikiPageParams params) throws WikiException; 359 360 /** 361 * Modifies an existing wiki template. 362 * 363 * @param template The updated wiki template. 364 * @throws WikiException 365 */ 366 public void updateTemplate(Template template) throws WikiException; 367 368 /** 369 * Checks if a wiki page exists or not. 370 * 371 * @param wikiType It can be Portal, Group, or User. 372 * @param wikiOwner The Wiki owner. 373 * @param pageId Id of the wiki page. 374 * @return The returned value is "true" if the page exists, or "false" if not. 375 * @throws WikiException 376 */ 377 public boolean isExisting(String wikiType, String wikiOwner, String pageId) throws WikiException; 378 379 /** 380 * Gets a list of Wiki default permissions. 381 * 382 * @param wikiType It can be Portal, Group, or User. 383 * @param wikiOwner The Wiki owner. 384 * @return The list of Wiki default permissions. 385 * @throws WikiException 386 */ 387 public List<PermissionEntry> getWikiDefaultPermissions(String wikiType, String wikiOwner) throws WikiException; 388 389 /** 390 * Registers a component plugin into the Wiki service. 391 * @param plugin The component plugin to be registered. 392 */ 393 public void addComponentPlugin(ComponentPlugin plugin); 394 395 /** 396 * Adds a Wiki template as plugin. 397 * 398 * @param templatePlugin The wiki template plugin to be added. 399 */ 400 public void addWikiTemplatePagePlugin(WikiTemplatePagePlugin templatePlugin); 401 402 /** 403 * Adds a Wiki emotion icons as plugin. 404 * 405 * @param plugin The wiki emotion icons plugin to be added. 406 */ 407 public void addEmotionIconsPlugin(WikiEmotionIconsPlugin plugin); 408 409 /** 410 * Gets listeners of all wiki pages that are registered into the Wiki service. 411 * @return The list of listeners. 412 */ 413 public List<PageWikiListener> getPageListeners(); 414 415 /** 416 * Gets attachment listeners that are registered into the Wiki service. 417 * @return The list of attachment listeners. 418 */ 419 public List<AttachmentWikiListener> getAttachmentListeners(); 420 421 /** 422 * Adds a related page to the current wiki page. 423 * 424 * @param orginaryPageParams The params object of the current wiki page. 425 * @param relatedPageParams The params object of the related page. 426 * @throws WikiException 427 */ 428 public void addRelatedPage(WikiPageParams orginaryPageParams, WikiPageParams relatedPageParams) throws WikiException; 429 430 /** 431 * Gets a list of related pages based on a given param. 432 * @param page The wiki page. 433 * @return The list of related pages. 434 * @throws WikiException 435 */ 436 public List<Page> getRelatedPagesOfPage(Page page) throws WikiException; 437 438 /** 439 * Removes a related page of the current wiki page. 440 * @param orginaryPageParams The params object of the current wiki page. 441 * @param relatedPageParams The params object of the related page. 442 * @throws WikiException 443 */ 444 public void removeRelatedPage(WikiPageParams orginaryPageParams, WikiPageParams relatedPageParams) throws WikiException; 445 446 /** 447 * Creates a draft page for a wiki page which is specified by a given param object. 448 * 449 * @param targetPage The target wiki page. 450 * @param revision The revision which is used for creating the draft page. If "null", this will be the last revision. 451 * @param clientTime The time of client when the draft page is saved. 452 * @return The draft page. 453 * @throws WikiException if the draft page cannot be created. 454 */ 455 public DraftPage createDraftForExistPage(DraftPage draftPage, Page targetPage, String revision, long clientTime) throws WikiException; 456 457 /** 458 * Creates a draft page for a new wiki page whose parent is specified by a given param object. 459 * 460 * @param parentPage The parent wiki page. 461 * @param clientTime The time of client when the draft page is saved. 462 * @return The draft page. 463 * @throws WikiException if the draft page cannot be created. 464 */ 465 public DraftPage createDraftForNewPage(DraftPage draftPage, Page parentPage, long clientTime) throws WikiException; 466 467 /** 468 * Gets a draft page of a wiki page which is specified by a given param object. 469 * 470 * @param page The wiki page. 471 * @return The draft page, or "null" if the draft page does not exist. 472 * @throws WikiException 473 */ 474 public DraftPage getDraftOfPage(Page page) throws WikiException; 475 476 /** 477 * Gets a draft page by its name. 478 * 479 * @param draftName Name of the draft page. 480 * @return The draft page, or "null" if it does not exist. 481 * @throws WikiException 482 */ 483 public DraftPage getDraft(String draftName) throws WikiException; 484 485 /** 486 * Removes a draft page of a wiki page which is specified by the wiki page param. 487 * 488 * @param param The param object of the wiki page param. 489 * @throws WikiException 490 */ 491 public void removeDraftOfPage(WikiPageParams param) throws WikiException; 492 493 /** 494 * Removes a draft page by its name. 495 * 496 * @param draftName Name of the draft page. 497 * @throws WikiException 498 */ 499 public void removeDraft(String draftName) throws WikiException; 500 501 /** 502 * Gets a list of draft pages belonging to a given user. 503 * 504 * @param username Name of the user. 505 * @return The list of draft pages. 506 * @throws WikiException 507 */ 508 public List<DraftPage> getDraftsOfUser(String username) throws WikiException; 509 510 /** 511 * Check if a draft page is outdated 512 * @param draftPage 513 * @return 514 * @throws WikiException 515 */ 516 public boolean isDraftOutDated(DraftPage draftPage) throws WikiException; 517 518 /** 519 * Gets the last created draft of a wiki page. 520 * 521 * @return The last draft. 522 * @throws WikiException 523 */ 524 public DraftPage getLastestDraft() throws WikiException; 525 526 /** 527 * Gets the changes between the draft page and the target page 528 * @return 529 * @throws WikiException 530 */ 531 public DiffResult getDraftChanges(DraftPage draftPage) throws WikiException; 532 533 /** 534 * Gets a user Wiki. If it does not exist, the new one will be created. 535 * 536 * @param username Name of the user. 537 * @return The user Wiki. 538 */ 539 public Wiki getOrCreateUserWiki(String username) throws WikiException; 540 541 /** 542 * Gets a space name by a given group Id. 543 * 544 * @param groupId The group Id. 545 * @return The space name. 546 */ 547 public String getSpaceNameByGroupId(String groupId); 548 549 /** 550 * Searches for spaces by a given keyword. 551 * 552 * @param keyword The keyword to search for spaces. 553 * @return The list of spaces matching with the keyword. 554 * @throws WikiException 555 */ 556 public List<SpaceBean> searchSpaces(String keyword) throws WikiException; 557 558 /** 559 * Gets a Wiki which is defined by its type and owner. 560 * 561 * @param wikiType It can be Portal, Group, or User. 562 * @param owner The Wiki owner. 563 * @return The Wiki. 564 */ 565 public Wiki getWikiByTypeAndOwner(String wikiType, String owner) throws WikiException; 566 567 /** 568 * Gets all wikis of the given type 569 * @param wikiType Type of wiki 570 * @return Wikis of the given type 571 * @throws WikiException 572 */ 573 public List<Wiki> getWikisByType(String wikiType) throws WikiException; 574 575 /** 576 * Creates a wiki with the given type and owner 577 * @param wikiType It can be Portal, Group, or User. 578 * @param owner The Wiki owner. 579 * @throws WikiException 580 */ 581 public Wiki createWiki(String wikiType, String owner) throws WikiException; 582 583 /** 584 * Gets a Wiki webapp URI. 585 * 586 * @return The Wiki webapp URI. 587 */ 588 public String getWikiWebappUri(); 589 590 /** 591 * Checks if a given user is member of space or not. 592 * 593 * @param spaceId Id of the space. 594 * @param userId The username. 595 * @return "True" if the user is member, or "false" if not. 596 */ 597 public boolean isSpaceMember(String spaceId, String userId); 598 599 /** 600 * Checks if a space is hidden or not. 601 * 602 * @param groupId Id of the group. 603 * @return The returned value is "true" if the space is hidden, or "false" if not. 604 */ 605 public boolean isHiddenSpace(String groupId); 606 607 /** 608 * Checks if the given user has the permission on a page 609 * @param user 610 * @param page 611 * @param permissionType 612 * @return 613 * @throws WikiException 614 */ 615 public boolean hasPermissionOnPage(Page page, PermissionType permissionType, Identity user) throws WikiException; 616 617 /** 618 * Checks if the current user has the admin permission on a space or not. 619 * 620 * @param wikiType It can be Portal, Group, or User. 621 * @param owner Owner of the space. 622 * @return The returned value is "true" if the current user has the admin permission on the space, or "false" if not. 623 * @throws WikiException 624 */ 625 public boolean hasAdminSpacePermission(String wikiType, String owner) throws WikiException; 626 627 /** 628 * Checks if the current user has the admin permission on a wiki page. 629 * 630 * @param wikiType It can be Portal, Group, or User. 631 * @param owner Owner of the wiki page. 632 * @return "True" if the current user has the admin permission on the wiki page, or "false" if not. 633 * @throws WikiException 634 */ 635 public boolean hasAdminPagePermission(String wikiType, String owner) throws WikiException; 636 637 /** 638 * Gets a Wiki by its Id. 639 * 640 * @param wikiId The Wiki Id. 641 * @return The Wiki. 642 */ 643 public Wiki getWikiById(String wikiId) throws WikiException; 644 645 /** 646 * Gets a Wiki name by its Id. 647 * 648 * @param wikiId The Wiki Id. 649 * @return The Wiki name. 650 * @throws WikiException 651 */ 652 public String getWikiNameById(String wikiId) throws WikiException; 653 654 /** 655 * Check if the given user can update the page 656 * @param currentPage The page to update 657 * @param currentUser The user that needs to update the page 658 * @return true if the user can update the page 659 * @throws WikiException 660 */ 661 public boolean canModifyPagePermission(Page currentPage, String currentUser) throws WikiException; 662 663 /** 664 * Check if the given user can public or restrict the page 665 * @param currentPage 666 * @param currentUser 667 * @return true if the current user has EditPage permission or admin page or admin space 668 * @throws WikiException 669 */ 670 public boolean canPublicAndRetrictPage(Page currentPage, String currentUser) throws WikiException; 671 672 /** 673 * Gets all the versions of the given page 674 * @param page The wiki page 675 * @return All the versions of the page 676 * @throws WikiException 677 */ 678 public List<PageVersion> getVersionsOfPage(Page page) throws WikiException; 679 680 /** 681 * Gets a specific version by name of the given page 682 * @param versionName The name of the version 683 * @param page The wiki page 684 * @return The version of the wiki page 685 * @throws WikiException 686 */ 687 public PageVersion getVersionOfPageByName(String versionName, Page page) throws WikiException; 688 689 /** 690 * Creates a version of a page. This method only tag the current page data as a new version, 691 * it does not update the page data 692 * @param page The wiki page 693 * @throws WikiException 694 */ 695 public void createVersionOfPage(Page page) throws WikiException; 696 697 /** 698 * Restores a version of a page 699 * @param versionName The name of the version to restore 700 * @param page The wiki page 701 * @throws WikiException 702 */ 703 public void restoreVersionOfPage(String versionName, Page page) throws WikiException; 704 705 /** 706 * Update the given page. This does not automatically create a new version. 707 * If a new version must be created it should be explicitly done by calling createVersionOfPage(). 708 * The second parameter is the type of update done (title only, content only, both, move, ...). 709 * @param page Updated page 710 * @param type Type of update 711 * @throws WikiException 712 */ 713 public void updatePage(Page page, PageUpdateType type) throws WikiException; 714 715 /** 716 * Get previous names of a page 717 * @param page The wiki page 718 * @return List of all the previous names of the page 719 * @throws WikiException 720 */ 721 public List<String> getPreviousNamesOfPage(Page page) throws WikiException; 722 723 /** 724 * Creates a emotion icon 725 * @param emotionIcon The emotion icon to add 726 * @throws WikiException 727 */ 728 public void createEmotionIcon(EmotionIcon emotionIcon) throws WikiException; 729 730 /** 731 * Gets all the emotion icons 732 * @return All the emotion icons 733 * @throws WikiException 734 */ 735 public List<EmotionIcon> getEmotionIcons() throws WikiException; 736 737 /** 738 * Gets an emotion icon by name 739 * @param name The name of the emotion icon 740 * @return The emotion icon 741 * @throws WikiException 742 */ 743 public EmotionIcon getEmotionIconByName(String name) throws WikiException; 744 745 /** 746 * Get all the watchers of a page 747 * @param page The wiki page 748 * @throws WikiException 749 */ 750 public List<String> getWatchersOfPage(Page page) throws WikiException; 751 752 /** 753 * Add the given user as watcher of the wiki page 754 * @param username Username of the user to add as watcher 755 * @param page The wiki page 756 * @throws WikiException 757 */ 758 public void addWatcherToPage(String username, Page page) throws WikiException; 759 760 /** 761 * Delete a user as watcher of the given page 762 * @param username Username of the user to delete as watcher 763 * @param page The wiki page 764 * @throws WikiException 765 */ 766 public void deleteWatcherOfPage(String username, Page page) throws WikiException; 767 }