View Javadoc
1   /*
2    * Copyright (C) 2003-2009 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.mow.core.api.wiki;
18  
19  import java.util.Collection;
20  
21  import org.chromattic.api.ChromatticSession;
22  import org.exoplatform.wiki.WikiException;
23  import org.exoplatform.wiki.mow.api.WikiType;
24  import org.exoplatform.wiki.mow.core.api.wiki.PageImpl;
25  import org.exoplatform.wiki.mow.core.api.wiki.WikiContainer;
26  import org.exoplatform.wiki.mow.core.api.wiki.WikiImpl;
27  
28  /**
29   * @version $Revision$
30   */
31  public interface WikiStore {
32  
33    /**
34     * Get all wikis available
35     * 
36     * @return
37     */
38    Collection<WikiImpl> getWikis();
39  
40    /**
41     * Get a wiki of a given type
42     * 
43     * @param wikiType
44     * @param name
45     * @return
46     */
47    WikiImpl getWiki(WikiType wikiType, String name);
48  
49    /**
50     * Add a new wiki of a given type
51     * 
52     * @param wikiType
53     * @param name
54     */
55    WikiImpl addWiki(WikiType wikiType, String name) throws WikiException;
56  
57    /** 
58     * get wiki container
59     * 
60     * @param wikiType The wiki type
61     * @return Wiki container
62     */
63    public <W extends WikiImpl>WikiContainer<W> getWikiContainer(WikiType wikiType);
64    
65    /** 
66     * get the container that store draft for new page
67     * 
68     */
69    public PageImpl getDraftNewPagesContainer();
70    
71    /**
72     * Create new wiki page
73     * 
74     * @return new wiki page
75     */
76    public abstract PageImpl createPage();
77  }