1. Project Clover database Sat Feb 2 2019 06:45:20 CET
  2. Package org.xwiki.wiki.descriptor

File WikiDescriptorManager.java

 

Coverage histogram

../../../../img/srcFileCovDistChart0.png
86% of files have more coverage

Code metrics

0
1
1
1
121
22
1
1
1
1
1

Classes

Class Line # Actions
WikiDescriptorManager 34 1 0% 1 2
0.00%
 

Contributing tests

No tests hitting this source file were found.

Source view

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: ec87e1fb2423630e2a6d3d06ba276f8c43a3b19f $
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, null if none exist for this 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    *
105    * @param descriptor descriptor to save
106    * @throws WikiManagerException if problem occurs
107    */
108    void saveDescriptor(WikiDescriptor descriptor) throws WikiManagerException;
109   
110    /**
111    * @param wikiId the identifier of the wiki
112    * @return true if the passed wiki reference is the main wiki
113    * @since 10.4RC1
114    */
 
115  0 toggle default boolean isMainWiki(String wikiId)
116    {
117    // At least that way it will behave correctly in a single wiki setup. This default probably won't really be
118    // needed anyway.
119  0 return true;
120    }
121    }