View Javadoc
1   package org.exoplatform.wiki.service;
2   
3   import org.exoplatform.commons.utils.PageList;
4   import org.exoplatform.container.configuration.ConfigurationManager;
5   import org.exoplatform.container.xml.ValuesParam;
6   import org.exoplatform.services.security.Identity;
7   import org.exoplatform.wiki.WikiException;
8   import org.exoplatform.wiki.mow.api.*;
9   import org.exoplatform.wiki.service.search.*;
10  
11  import java.util.List;
12  import java.util.Map;
13  
14  public interface DataStorage {
15  
16    public Wiki getWikiByTypeAndOwner(String wikiType, String owner) throws WikiException;
17  
18    public List<Wiki> getWikisByType(String wikiType) throws WikiException;
19  
20    public Wiki createWiki(Wiki wiki) throws WikiException;
21  
22    public Page createPage(Wiki wiki, Page parentPage, Page page) throws WikiException;
23  
24    /**
25     * Get a wiki page by its unique name in the wiki
26     *
27     * @param pageName The unique name of the page in the wiki
28     * @return The wiki page
29     * @throws WikiException
30     */
31    public Page getPageOfWikiByName(String wikiType, String wikiOwner, String pageName) throws WikiException;
32  
33    /**
34     * Get a wiki page by its unique id
35     *
36     * @param id The unique id of wiki page
37     * @return The wiki page
38     * @throws WikiException
39     */
40    public Page getPageById(String id) throws WikiException;
41  
42    public DraftPage getDraftPageById(String id) throws WikiException;
43  
44    public Page getParentPageOf(Page page) throws WikiException;
45  
46    public List<Page> getChildrenPageOf(Page page) throws WikiException;
47  
48    public void createTemplatePage(Wiki wiki, Template template) throws WikiException;
49  
50    public void updateTemplatePage(Template template) throws WikiException;
51  
52    public void deleteTemplatePage(String wikiType, String wikiOwner, String templateName) throws WikiException;
53  
54    public void deletePage(String wikiType, String wikiOwner, String pageId) throws WikiException;
55  
56    public Template getTemplatePage(WikiPageParams params, String templateId) throws WikiException;
57  
58    public Map<String, Template> getTemplates(WikiPageParams params) throws WikiException;
59  
60    public void deleteDraftOfPage(Page page, String username) throws WikiException;
61  
62    public void deleteDraftByName(String newDraftPageName, String username) throws WikiException;
63  
64    public void renamePage(String wikiType, String wikiOwner, String pageName, String newName, String newTitle) throws WikiException;
65  
66    public void movePage(WikiPageParams currentLocationParams, WikiPageParams newLocationParams) throws WikiException;
67  
68    public List<PermissionEntry> getWikiPermission(String wikiType, String wikiOwner) throws WikiException;
69  
70    public void updateWikiPermission(String wikiType, String wikiOwner, List<PermissionEntry> permissionEntries) throws WikiException;
71  
72    public List<Page> getRelatedPagesOfPage(Page page) throws WikiException;
73  
74    public Page getRelatedPage(String wikiType, String wikiOwner, String pageId) throws WikiException;
75  
76    public void addRelatedPage(Page page, Page relatedPage) throws WikiException;
77  
78    public void removeRelatedPage(Page page, Page relatedPage) throws WikiException;
79  
80    public Page getExsitedOrNewDraftPageById(String wikiType, String wikiOwner, String pageId, String username) throws WikiException;
81  
82    public DraftPage getDraft(WikiPageParams param, String username) throws WikiException;
83  
84    public DraftPage getLastestDraft(String username) throws WikiException;
85  
86    public DraftPage getDraft(String draftName, String username) throws WikiException;
87  
88    public List<DraftPage> getDraftPagesOfUser(String username) throws WikiException;
89  
90    public void createDraftPageForUser(DraftPage draftPage, String username) throws WikiException;
91  
92    public PageList<SearchResult> search(WikiSearchData data) throws WikiException;
93  
94    public List<TemplateSearchResult> searchTemplate(TemplateSearchData data) throws WikiException;
95  
96    public List<Attachment> getAttachmentsOfPage(Page page) throws WikiException;
97  
98    public void addAttachmentToPage(Attachment attachment, Page page) throws WikiException;
99  
100   public void deleteAttachmentOfPage(String attachmentId, Page page) throws WikiException;
101 
102   public Page getHelpSyntaxPage(String syntaxId, boolean fullContent, List<ValuesParam> syntaxHelpParams, ConfigurationManager configurationManager) throws WikiException;
103 
104   public void createEmotionIcon(EmotionIcon emotionIcon) throws WikiException;
105 
106   public List<EmotionIcon> getEmotionIcons() throws WikiException;
107 
108   public EmotionIcon getEmotionIconByName(String name) throws WikiException;
109 
110   public boolean hasPermissionOnPage(Page page, PermissionType permissionType, Identity user) throws WikiException;
111 
112   public boolean hasAdminSpacePermission(String wikiType, String owner, Identity user) throws WikiException;
113 
114   public boolean hasAdminPagePermission(String wikiType, String owner, Identity user) throws WikiException;
115 
116   public List<PageVersion> getVersionsOfPage(Page page) throws WikiException;
117 
118   public void addPageVersion(Page page) throws WikiException;
119 
120   public void restoreVersionOfPage(String versionName, Page page) throws WikiException;
121 
122   public void updatePage(Page page) throws WikiException;
123 
124   public List<String> getPreviousNamesOfPage(Page page) throws WikiException;
125 
126   public List<String> getWatchersOfPage(Page page) throws WikiException;
127 
128   public void addWatcherToPage(String username, Page page) throws WikiException;
129 
130   public void deleteWatcherOfPage(String username, Page page) throws WikiException;
131 }