| Class | Line # | Actions | |||||
|---|---|---|---|---|---|---|---|
| WikiDescriptorManager | 34 | 0 | - | 0 | 0 |
| 1 | /* | |
| 2 | * See the NOTICE file distributed with this work for additional | |
| 3 | * information regarding copyright ownership. | |
| 4 | * | |
| 5 | * This is free software; you can redistribute it and/or modify it | |
| 6 | * under the terms of the GNU Lesser General Public License as | |
| 7 | * published by the Free Software Foundation; either version 2.1 of | |
| 8 | * the License, or (at your option) any later version. | |
| 9 | * | |
| 10 | * This software is distributed in the hope that it will be useful, | |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 13 | * Lesser General Public License for more details. | |
| 14 | * | |
| 15 | * You should have received a copy of the GNU Lesser General Public | |
| 16 | * License along with this software; if not, write to the Free | |
| 17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
| 18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
| 19 | */ | |
| 20 | package org.xwiki.wiki.descriptor; | |
| 21 | ||
| 22 | import java.util.Collection; | |
| 23 | ||
| 24 | import org.xwiki.component.annotation.Role; | |
| 25 | import org.xwiki.wiki.manager.WikiManagerException; | |
| 26 | ||
| 27 | /** | |
| 28 | * Component to list and get wiki descriptors. | |
| 29 | * | |
| 30 | * @version $Id: c4fa08851d5ab8d2f20894c583c03eeec5ea1dd9 $ | |
| 31 | * @since 5.3M2 | |
| 32 | */ | |
| 33 | @Role | |
| 34 | public interface WikiDescriptorManager | |
| 35 | { | |
| 36 | /** | |
| 37 | * Get the list of all wikis descriptors. | |
| 38 | * | |
| 39 | * @return the list of every wiki created on the farm | |
| 40 | * @throws org.xwiki.wiki.manager.WikiManagerException if problems occur | |
| 41 | */ | |
| 42 | Collection<WikiDescriptor> getAll() throws WikiManagerException; | |
| 43 | ||
| 44 | /** | |
| 45 | * Get the list of all wikis identifiers. | |
| 46 | * | |
| 47 | * @return the list of every wiki created on the farm | |
| 48 | * @throws org.xwiki.wiki.manager.WikiManagerException if problems occur | |
| 49 | * @since 6.2M1 | |
| 50 | */ | |
| 51 | Collection<String> getAllIds() throws WikiManagerException; | |
| 52 | ||
| 53 | /** | |
| 54 | * Get a wiki from one of its aliases. | |
| 55 | * | |
| 56 | * @param wikiAlias Alias of the wiki to retrieve | |
| 57 | * @return The corresponding wiki descriptor of that alias. | |
| 58 | * @throws WikiManagerException if problems occur | |
| 59 | */ | |
| 60 | WikiDescriptor getByAlias(String wikiAlias) throws WikiManagerException; | |
| 61 | ||
| 62 | /** | |
| 63 | * Get a wiki from its Id. | |
| 64 | * | |
| 65 | * @param wikiId Id of the wiki to retrieve. | |
| 66 | * @return The corresponding wiki descriptor of that Id | |
| 67 | * @throws WikiManagerException if problems occur | |
| 68 | */ | |
| 69 | WikiDescriptor getById(String wikiId) throws WikiManagerException; | |
| 70 | ||
| 71 | /** | |
| 72 | * @return the descriptor of the main wiki | |
| 73 | * @throws WikiManagerException if problems occur | |
| 74 | */ | |
| 75 | WikiDescriptor getMainWikiDescriptor() throws WikiManagerException; | |
| 76 | ||
| 77 | /** | |
| 78 | * @return the Id of the main wiki | |
| 79 | */ | |
| 80 | String getMainWikiId(); | |
| 81 | ||
| 82 | /** | |
| 83 | * @return the Id of the current wiki | |
| 84 | */ | |
| 85 | String getCurrentWikiId(); | |
| 86 | ||
| 87 | /** | |
| 88 | * @return the descriptor of the current wiki | |
| 89 | * @throws WikiManagerException if problems occur | |
| 90 | */ | |
| 91 | WikiDescriptor getCurrentWikiDescriptor() throws WikiManagerException; | |
| 92 | ||
| 93 | /** | |
| 94 | * Check if a wiki corresponding to an Id exists. | |
| 95 | * | |
| 96 | * @param wikiId The id of the wiki to test. | |
| 97 | * @return true if a wiki with that Id exists. | |
| 98 | * @throws WikiManagerException if problems occur | |
| 99 | */ | |
| 100 | boolean exists(String wikiId) throws WikiManagerException; | |
| 101 | ||
| 102 | /** | |
| 103 | * Save the given descriptor and all its property groups. | |
| 104 | * @param descriptor descriptor to save | |
| 105 | * @throws WikiManagerException if problem occurs | |
| 106 | */ | |
| 107 | void saveDescriptor(WikiDescriptor descriptor) throws WikiManagerException; | |
| 108 | } |