Rev 194 | Rev 206 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 194 | Rev 195 | ||
---|---|---|---|
Line 63... | Line 63... | ||
63 | /** Attribute revisionNumber of Page. */
|
63 | /** Attribute revisionNumber of Page. */
|
64 | private int revisionNumber; |
64 | private int revisionNumber; |
65 | /** Attribute comment of Page. */
|
65 | /** Attribute comment of Page. */
|
66 | private String comment; |
66 | private String comment; |
67 | 67 | ||
- | 68 | /**
|
|
- | 69 | * Default constructor.
|
|
- | 70 | */
|
|
68 | public Page() { } |
71 | public Page() { } |
69 | 72 | ||
- | 73 | /**
|
|
- | 74 | * Sets the preview object of Page.
|
|
- | 75 | * @param preview Preview
|
|
- | 76 | */
|
|
70 | public void setPreview(Preview preview) { |
77 | public void setPreview(Preview preview) { |
71 | this.isPreview = true; |
78 | this.isPreview = true; |
72 | this.title = preview.getTitle(); |
79 | this.title = preview.getTitle(); |
73 | this.body = preview.getBody(); |
80 | this.body = preview.getBody(); |
74 | }
|
81 | }
|
75 | 82 | ||
- | 83 | /**
|
|
- | 84 | * Sets the comment of Page.
|
|
- | 85 | * @param s String
|
|
- | 86 | */
|
|
76 | public void setComment(String s) { |
87 | public void setComment(String s) { |
77 | this.comment = s; |
88 | this.comment = s; |
78 | }
|
89 | }
|
79 | 90 | ||
- | 91 | /**
|
|
- | 92 | * Gets the comment of Page.
|
|
- | 93 | * @return String
|
|
- | 94 | */
|
|
80 | public String getComment() { |
95 | public String getComment() { |
81 | return comment; |
96 | return comment; |
82 | }
|
97 | }
|
83 | 98 | ||
- | 99 | /**
|
|
- | 100 | * Return true if isRevision of Page.
|
|
- | 101 | * @return boolean
|
|
- | 102 | */
|
|
84 | public boolean isRevision() { |
103 | public boolean isRevision() { |
85 | return isRevision; |
104 | return isRevision; |
86 | }
|
105 | }
|
87 | 106 | ||
- | 107 | /**
|
|
- | 108 | * Sets isRevision of Page.
|
|
- | 109 | * @param isRevision boolean
|
|
- | 110 | */
|
|
88 | public void setRevision(boolean isRevision) { |
111 | public void setRevision(boolean isRevision) { |
89 | this.isRevision = isRevision; |
112 | this.isRevision = isRevision; |
90 | }
|
113 | }
|
91 | 114 | ||
- | 115 | /**
|
|
- | 116 | * Gets the revisionNumber of Page.
|
|
- | 117 | * @return int
|
|
- | 118 | */
|
|
92 | public int getRevisionNumber() { |
119 | public int getRevisionNumber() { |
93 | return revisionNumber; |
120 | return revisionNumber; |
94 | }
|
121 | }
|
95 | 122 | ||
- | 123 | /**
|
|
- | 124 | * Sets the revisionNumber of Page.
|
|
- | 125 | * @param revisionNumber int
|
|
- | 126 | */
|
|
96 | public void setRevisionNumber(int revisionNumber) { |
127 | public void setRevisionNumber(int revisionNumber) { |
97 | this.revisionNumber = revisionNumber; |
128 | this.revisionNumber = revisionNumber; |
98 | }
|
129 | }
|
99 | 130 | ||
- | 131 | /**
|
|
- | 132 | * Gets the id of Page.
|
|
- | 133 | * @return int
|
|
- | 134 | */
|
|
100 | public int getId() { |
135 | public int getId() { |
101 | return id; |
136 | return id; |
102 | }
|
137 | }
|
103 | 138 | ||
- | 139 | /**
|
|
- | 140 | * Sets the id of Page.
|
|
- | 141 | * @param id int
|
|
- | 142 | */
|
|
104 | public void setId(int id) { |
143 | public void setId(int id) { |
105 | this.id = id; |
144 | this.id = id; |
106 | }
|
145 | }
|
107 | 146 | ||
- | 147 | /**
|
|
- | 148 | * Gets the name of Page.
|
|
- | 149 | * @return String
|
|
- | 150 | */
|
|
108 | public String getName() { |
151 | public String getName() { |
109 | return name; |
152 | return name; |
110 | }
|
153 | }
|
111 | 154 | ||
- | 155 | /**
|
|
- | 156 | * Sets the name of Page.
|
|
- | 157 | * @param name String
|
|
- | 158 | */
|
|
112 | public void setName(String name) { |
159 | public void setName(String name) { |
113 | this.name = name; |
160 | this.name = name; |
114 | }
|
161 | }
|
115 | 162 | ||
- | 163 | /**
|
|
- | 164 | * Gets the title of Page.
|
|
- | 165 | * @return String
|
|
- | 166 | */
|
|
116 | public String getTitle() { |
167 | public String getTitle() { |
117 | return title; |
168 | return title; |
118 | }
|
169 | }
|
119 | 170 | ||
- | 171 | /**
|
|
- | 172 | * Sets the title of Page.
|
|
- | 173 | * @param title String
|
|
- | 174 | */
|
|
120 | public void setTitle(String title) { |
175 | public void setTitle(String title) { |
121 | this.title = title; |
176 | this.title = title; |
122 | }
|
177 | }
|
123 | 178 | ||
- | 179 | /**
|
|
- | 180 | * Gets the body of Page.
|
|
- | 181 | * @return String
|
|
- | 182 | */
|
|
124 | public String getBody() { |
183 | public String getBody() { |
125 | return body; |
184 | return body; |
126 | }
|
185 | }
|
127 | 186 | ||
- | 187 | /**
|
|
- | 188 | * Sets the body of Page.
|
|
- | 189 | * @param body String
|
|
- | 190 | */
|
|
128 | public void setBody(String body) { |
191 | public void setBody(String body) { |
129 | this.body = body; |
192 | this.body = body; |
130 | }
|
193 | }
|
131 | 194 | ||
- | 195 | /**
|
|
- | 196 | * Return true if isSystemPage of Page.
|
|
- | 197 | * @return boolean
|
|
- | 198 | */
|
|
132 | public boolean isSystemPage() { |
199 | public boolean isSystemPage() { |
133 | return isSystemPage; |
200 | return isSystemPage; |
134 | }
|
201 | }
|
135 | 202 | ||
- | 203 | /**
|
|
- | 204 | * Sets isSystemPage of Page.
|
|
- | 205 | * @param isSystemPage boolean
|
|
- | 206 | */
|
|
136 | public void setSystemPage(boolean isSystemPage) { |
207 | public void setSystemPage(boolean isSystemPage) { |
137 | this.isSystemPage = isSystemPage; |
208 | this.isSystemPage = isSystemPage; |
138 | }
|
209 | }
|
139 | 210 | ||
- | 211 | /**
|
|
- | 212 | * Gets the languageId of Page.
|
|
- | 213 | * @return int
|
|
- | 214 | */
|
|
140 | public int getLanguageId() { |
215 | public int getLanguageId() { |
141 | return languageId; |
216 | return languageId; |
142 | }
|
217 | }
|
143 | 218 | ||
- | 219 | /**
|
|
- | 220 | * Sets the languageId of Page.
|
|
- | 221 | * @param languageId int
|
|
- | 222 | */
|
|
144 | public void setLanguageId(int languageId) { |
223 | public void setLanguageId(int languageId) { |
145 | this.languageId = languageId; |
224 | this.languageId = languageId; |
146 | }
|
225 | }
|
147 | 226 | ||
- | 227 | /**
|
|
- | 228 | * Gets the language of Page.
|
|
- | 229 | * @return Language
|
|
- | 230 | */
|
|
148 | public Language getLanguage() { |
231 | public Language getLanguage() { |
149 | return Language.fromId(languageId); |
232 | return Language.fromId(languageId); |
150 | }
|
233 | }
|
151 | 234 | ||
- | 235 | /**
|
|
- | 236 | * Gets the locale of Page.
|
|
- | 237 | * @return Locale
|
|
- | 238 | */
|
|
152 | public Locale getLocale() { |
239 | public Locale getLocale() { |
153 | return getLanguage() != null ? getLanguage().getLocale() : null; |
240 | return getLanguage() != null ? getLanguage().getLocale() : null; |
154 | }
|
241 | }
|
155 | 242 | ||
- | 243 | /**
|
|
- | 244 | * Gets the lang of Page.
|
|
- | 245 | * @return String
|
|
- | 246 | */
|
|
156 | public String getLang() { |
247 | public String getLang() { |
157 | return getLocale() != null ? getLocale().toString() : null; |
248 | return getLocale() != null ? getLocale().toString() : null; |
158 | }
|
249 | }
|
159 | 250 | ||
- | 251 | /**
|
|
- | 252 | * Gets the modifiedById of Page.
|
|
- | 253 | * @return int
|
|
- | 254 | */
|
|
160 | public int getModifiedById() { |
255 | public int getModifiedById() { |
161 | return modifiedById; |
256 | return modifiedById; |
162 | }
|
257 | }
|
163 | 258 | ||
- | 259 | /**
|
|
- | 260 | * Return true if modifiedById is not negative or different from zero.
|
|
- | 261 | * @return boolean
|
|
- | 262 | */
|
|
164 | public boolean isModified() { |
263 | public boolean isModified() { |
165 | return modifiedById > 0; |
264 | return modifiedById > 0; |
166 | }
|
265 | }
|
167 | 266 | ||
- | 267 | /**
|
|
- | 268 | * Sets the modifiedById attribute of Page.
|
|
- | 269 | * @param modifiedById int
|
|
- | 270 | */
|
|
168 | public void setModifiedById(int modifiedById) { |
271 | public void setModifiedById(int modifiedById) { |
169 | this.modifiedById = modifiedById; |
272 | this.modifiedById = modifiedById; |
170 | }
|
273 | }
|
171 | 274 | ||
- | 275 | /**
|
|
- | 276 | * Gets the modifiedOn date of Page.
|
|
- | 277 | * @return Date
|
|
- | 278 | */
|
|
172 | public Date getModifiedOn() { |
279 | public Date getModifiedOn() { |
173 | return modifiedOn; |
280 | return modifiedOn; |
174 | }
|
281 | }
|
175 | 282 | ||
- | 283 | /**
|
|
- | 284 | * Gets the formatted modifiedOn date of Page.
|
|
- | 285 | * @return String
|
|
- | 286 | */
|
|
176 | public String getFormattedModifiedOn() { |
287 | public String getFormattedModifiedOn() { |
177 | return modifiedOn != null ? FORMATTER.format(modifiedOn) : null; |
288 | return modifiedOn != null ? FORMATTER.format(modifiedOn) : null; |
178 | }
|
289 | }
|
179 | 290 | ||
- | 291 | /**
|
|
- | 292 | * Sets the modifiedOn date of Page.
|
|
- | 293 | * @param modifiedOn
|
|
- | 294 | */
|
|
180 | public void setModifiedOn(Date modifiedOn) { |
295 | public void setModifiedOn(Date modifiedOn) { |
181 | this.modifiedOn = modifiedOn; |
296 | this.modifiedOn = modifiedOn; |
182 | }
|
297 | }
|
183 | 298 | ||
- | 299 | /**
|
|
- | 300 | * Gets the createdById attribute of Page.
|
|
- | 301 | * @return int
|
|
- | 302 | */
|
|
184 | public int getCreatedById() { |
303 | public int getCreatedById() { |
185 | return createdById; |
304 | return createdById; |
186 | }
|
305 | }
|
187 | 306 | ||
- | 307 | /**
|
|
- | 308 | * Sets the createdById attribute of Page.
|
|
- | 309 | * @param createdById int
|
|
- | 310 | */
|
|
188 | public void setCreatedById(int createdById) { |
311 | public void setCreatedById(int createdById) { |
189 | this.createdById = createdById; |
312 | this.createdById = createdById; |
190 | }
|
313 | }
|
191 | 314 | ||
- | 315 | /**
|
|
- | 316 | * Gets the createdOn date of Page.
|
|
- | 317 | * @return Date
|
|
- | 318 | */
|
|
192 | public Date getCreatedOn() { |
319 | public Date getCreatedOn() { |
193 | return createdOn; |
320 | return createdOn; |
194 | }
|
321 | }
|
195 | 322 | ||
- | 323 | /**
|
|
- | 324 | * Gets the formatted createdOn date of Page.
|
|
- | 325 | * @return String
|
|
- | 326 | */
|
|
196 | public String getFormattedCreatedOn() { |
327 | public String getFormattedCreatedOn() { |
197 | return createdOn != null ? FORMATTER.format(createdOn) : null; |
328 | return createdOn != null ? FORMATTER.format(createdOn) : null; |
198 | }
|
329 | }
|
199 | 330 | ||
- | 331 | /**
|
|
- | 332 | * Sets the createdOn date of Page.
|
|
- | 333 | * @param createdOn Date
|
|
- | 334 | */
|
|
200 | public void setCreatedOn(Date createdOn) { |
335 | public void setCreatedOn(Date createdOn) { |
201 | this.createdOn = createdOn; |
336 | this.createdOn = createdOn; |
202 | }
|
337 | }
|
203 | 338 | ||
- | 339 | /**
|
|
- | 340 | * Sets isFrontPage attribute of Page.
|
|
- | 341 | * @param isFrontPage boolean
|
|
- | 342 | */
|
|
204 | public void setFrontPage(boolean isFrontPage) { |
343 | public void setFrontPage(boolean isFrontPage) { |
205 | this.isFrontPage = isFrontPage; |
344 | this.isFrontPage = isFrontPage; |
206 | }
|
345 | }
|
207 | 346 | ||
- | 347 | /**
|
|
- | 348 | * Returns true if isFrontPage.
|
|
- | 349 | * @return boolean
|
|
- | 350 | */
|
|
208 | public boolean isFrontPage() { |
351 | public boolean isFrontPage() { |
209 | return isFrontPage; |
352 | return isFrontPage; |
210 | }
|
353 | }
|
211 | 354 | ||
- | 355 | /**
|
|
- | 356 | * Gets the modifiedBy user of Page.
|
|
- | 357 | * @return User
|
|
- | 358 | */
|
|
212 | public User getModifiedBy() { |
359 | public User getModifiedBy() { |
213 | return modifiedBy; |
360 | return modifiedBy; |
214 | }
|
361 | }
|
215 | 362 | ||
- | 363 | /**
|
|
- | 364 | * Sets the modifiedBy user of Page.
|
|
- | 365 | * @param modifiedBy User
|
|
- | 366 | */
|
|
216 | public void setModifiedBy(User modifiedBy) { |
367 | public void setModifiedBy(User modifiedBy) { |
217 | this.modifiedBy = modifiedBy; |
368 | this.modifiedBy = modifiedBy; |
218 | }
|
369 | }
|
219 | 370 | ||
- | 371 | /**
|
|
- | 372 | * Gets the createdBy user of Page.
|
|
- | 373 | * @return User
|
|
- | 374 | */
|
|
220 | public User getCreatedBy() { |
375 | public User getCreatedBy() { |
221 | return createdBy; |
376 | return createdBy; |
222 | }
|
377 | }
|
223 | 378 | ||
- | 379 | /**
|
|
- | 380 | * Sets the createdBy user of Page.
|
|
- | 381 | * @param createdBy User
|
|
- | 382 | */
|
|
224 | public void setCreatedBy(User createdBy) { |
383 | public void setCreatedBy(User createdBy) { |
225 | this.createdBy = createdBy; |
384 | this.createdBy = createdBy; |
226 | }
|
385 | }
|
227 | 386 | ||
- | 387 | /**
|
|
- | 388 | * Return true if name is css.
|
|
- | 389 | * @return boolean
|
|
- | 390 | */
|
|
228 | public boolean isCSS() { |
391 | public boolean isCSS() { |
229 | return name.equals(CSS) || name.equals(PRINT_CSS); |
392 | return name.equals(CSS) || name.equals(PRINT_CSS); |
230 | }
|
393 | }
|
231 | 394 | ||
- | 395 | /**
|
|
- | 396 | * Return true if isDeleted Page.
|
|
- | 397 | * @return Boolean
|
|
- | 398 | */
|
|
232 | public Boolean isDeleted() { |
399 | public Boolean isDeleted() { |
233 | return isDeleted; |
400 | return isDeleted; |
234 | }
|
401 | }
|
235 | 402 | ||
- | 403 | /**
|
|
- | 404 | * Return true if isDeleted Page.
|
|
- | 405 | * @return Boolean
|
|
- | 406 | */
|
|
236 | public boolean getDeleted() { |
407 | public boolean getDeleted() { |
237 | return isDeleted != null ? isDeleted : false; |
408 | return isDeleted != null ? isDeleted : false; |
238 | }
|
409 | }
|
239 | 410 | ||
- | 411 | /**
|
|
- | 412 | * Sets the isDeleted attribute of Page.
|
|
- | 413 | * @param b Boolean
|
|
- | 414 | */
|
|
240 | public void setDeleted(Boolean b) { |
415 | public void setDeleted(Boolean b) { |
241 | this.isDeleted = b; |
416 | this.isDeleted = b; |
242 | }
|
417 | }
|
243 | 418 | ||
- | 419 | /**
|
|
- | 420 | * Sets the isPreview of Page.
|
|
- | 421 | * @param b boolean
|
|
- | 422 | */
|
|
244 | public void setPreview(boolean b) { |
423 | public void setPreview(boolean b) { |
245 | this.isPreview = b; |
424 | this.isPreview = b; |
246 | }
|
425 | }
|
247 | 426 | ||
- | 427 | /**
|
|
- | 428 | * Returns true if isPreview Page.
|
|
- | 429 | * @return boolean
|
|
- | 430 | */
|
|
248 | public boolean isPreview() { |
431 | public boolean isPreview() { |
249 | return isPreview; |
432 | return isPreview; |
250 | }
|
433 | }
|
251 | 434 | ||
- | 435 | /**
|
|
- | 436 | * Return true if isNew Page.
|
|
- | 437 | * @return boolean
|
|
- | 438 | */
|
|
252 | public boolean isNew() { |
439 | public boolean isNew() { |
253 | return isNew; |
440 | return isNew; |
254 | }
|
441 | }
|
255 | 442 | ||
- | 443 | /**
|
|
- | 444 | * Sets isNew of Page.
|
|
- | 445 | * @param b boolean
|
|
- | 446 | */
|
|
256 | public void setNew(boolean b) { |
447 | public void setNew(boolean b) { |
257 | this.isNew = b; |
448 | this.isNew = b; |
258 | }
|
449 | }
|
259 | 450 | ||
- | 451 | /**
|
|
- | 452 | * {@inheritDoc}
|
|
- | 453 | */
|
|
260 | @Override |
454 | @Override |
261 | public String toString() { |
455 | public String toString() { |
262 | return "Page:[name=" + name + ";language=" + getLanguage() + "]"; |
456 | return "Page:[name=" + name + ";language=" + getLanguage() + "]"; |
263 | }
|
457 | }
|
264 | 458 |