Kawai Wiki

Rev

Rev 134 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
11 soliveira 1
package org.kawai.dao;
2
 
49 soliveira 3
import java.util.List;
4
 
22 soliveira 5
import org.kawai.model.Language;
11 soliveira 6
import org.kawai.model.Page;
60 soliveira 7
import org.kawai.model.Preview;
78 soliveira 8
import org.kawai.model.Revision;
11 soliveira 9
 
195 helio.frota 10
/**
11
 * Interace DAO PageDAO.
12
 *
13
 * @author Sergio Oliveira
14
 *
15
 */
11 soliveira 16
public interface PageDAO {
195 helio.frota 17
 
18
    /**
19
     * Loads the page by id.
20
     * @param id int
21
     * @return Page
22
     */
23
    public Page load(int id);
24
 
25
    /**
26
     * Updates the page.
27
     * @param p Page
28
     */
29
    public void update(Page p);
30
 
31
    /**
32
     * Loads the page by name and language.
33
     * @param name String
34
     * @param lang Language
35
     * @return Page
36
     */
37
    public Page loadByName(String name, Language lang);
38
 
39
    /**
40
     * Loads the page by name, language and revision.
41
     * @param name String
42
     * @param lang Language
43
     * @param revision int
44
     * @return Page
45
     */
46
    public Page loadByName(String name, Language lang, int revision);
47
 
48
    /**
49
     * Loads the page by userId, name and language.
50
     * @param userId int
51
     * @param name String
52
     * @param lang Language
53
     * @return Page
54
     */
55
    public Page loadByNameWithPreview(int userId, String name, Language lang);
56
 
57
    /**
58
     * Loads the front page by language.
59
     * @param lang Language
60
     * @return Page
61
     */
62
    public Page loadFrontPage(Language lang);
63
 
64
    /**
65
     * Inserts the page.
66
     * @param p Page
67
     */
68
    public void insert(Page p);
69
 
70
    /**
71
     * Checks if page exists by name and language.
72
     * @param name String
73
     * @param lang Language
74
     * @return boolean
75
     */
76
    public boolean exists(String name, Language lang);
77
 
78
    /**
79
     * Checks if isSystemPage.
80
     * @param name String
81
     * @return boolean
82
     */
83
    public boolean isSystemPage(String name);
84
 
85
    /**
86
     * Loads all pages including the system pages or not.
87
     * @param includeSystemPages boolean
88
     * @return List<Page>
89
     */
90
    public List<Page> loadAll(boolean includeSystemPages);
91
 
92
    /**
93
     * Sets the new front page.
94
     * @param p Page
95
     * @return boolean
96
     */
97
    public boolean setNewFrontPage(Page p);
98
 
99
    /**
100
     * Delete page.
101
     * @param p Page
102
     * @return boolean
103
     */
104
    public boolean delete(Page p);
105
 
106
    /**
107
     * Gets the front page by language.
108
     * @param lang Language
109
     * @return String
110
     */
111
    public String getFrontPage(Language lang);
112
 
113
    /**
114
     * Loads the preview by userid, name and language.
115
     * @param userId int
116
     * @param name String
117
     * @param lang Language
118
     * @return Preview
119
     */
120
    public Preview loadPreview(int userId, String name, Language lang);
121
 
122
    /**
123
     * Insert the preview with userId, page and comment.
124
     * @param userId int
125
     * @param p Page
126
     * @param comment String
127
     * @return Preview
128
     */
129
    public Preview insertPreview(int userId, Page p, String comment);
130
 
131
    /**
132
     * Delete the preview with userId, name and language.
133
     * @param userId int
134
     * @param name String
135
     * @param lang Language
136
     */
137
    public void deletePreview(int userId, String name, Language lang);
138
 
139
    /**
140
     * Loads the revision by revision id, name and language.
141
     * @param revision int
142
     * @param name String
143
     * @param lang Language
144
     * @return Revision
145
     */
146
    public Revision loadRevision(int revision, String name, Language lang);
147
 
148
    /**
149
     * Insert the revision.
150
     * @param r Revision
151
     */
152
    public void insertRevision(Revision r);
153
 
154
    /**
155
     * Load revisions by name and language.
156
     * @param name String
157
     * @param lang Language
158
     * @return List < Revision >
159
     */
160
    public List<Revision> loadRevisions(String name, Language lang);
161
 
162
    /**
163
     * Load the last revisions by language and including or not system pages.
164
     * @param lang Language
165
     * @param includeSystemPages boolean
166
     * @return List < Revision >
167
     */
168
    public List<Revision> loadLastRevisions(Language lang, boolean includeSystemPages);
169
}