1 /*
2 * Copyright (c) 2002-2014, Mairie de Paris
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 *
9 * 1. Redistributions of source code must retain the above copyright notice
10 * and the following disclaimer.
11 *
12 * 2. Redistributions in binary form must reproduce the above copyright notice
13 * and the following disclaimer in the documentation and/or other materials
14 * provided with the distribution.
15 *
16 * 3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
17 * contributors may be used to endorse or promote products derived from
18 * this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30 * POSSIBILITY OF SUCH DAMAGE.
31 *
32 * License 1.0
33 */
34 package fr.paris.lutece.portal.service.content;
35
36
37 /**
38 * This class provides a structure to build portal pages.
39 */
40 public class PageData
41 {
42 ////////////////////////////////////////////////////////////////////////////
43 // Constants
44 private static final String EMPTY_STRING = "";
45 private String _strName;
46 private String _strFavourite;
47 private String _strCssUrl;
48 private String _strCustomizeCssUrl;
49 private String _strPluginsCssUrl;
50 private String _strMetaAuthor;
51 private String _strMetaCopyright;
52 private String _strMetaKeywords;
53 private String _strMetaDescription;
54 private String _strHeader;
55 private String _strMenu;
56 private String _strPagePath;
57 private String _strContent;
58 private String _strFavicon;
59 private String _strTreeMenu;
60 private String _strTheme;
61 private boolean _bIsHomePage;
62
63 /**
64 * Returns the name of the page
65 *
66 * @return The name of the page as a string.
67 */
68 public String getName( )
69 {
70 return _strName;
71 }
72
73 /**
74 * Sets the name of the page to the specified string.
75 *
76 * @param strName The new name of the page.
77 */
78 public void setName( String strName )
79 {
80 _strName = strName;
81 }
82
83 /**
84 * Returns the favourite of the page
85 *
86 * @return The favourite of the page as a string.
87 */
88 public String getFavourite( )
89 {
90 return _strFavourite;
91 }
92
93 /**
94 * Sets the favourite of the page to the specified string.
95 *
96 * @param strFavourite The new favourite of the page.
97 */
98 public void setFavourite( String strFavourite )
99 {
100 _strFavourite = strFavourite;
101 }
102
103 /**
104 * Returns the URL of the Cascading Style Sheet associated to this page
105 *
106 * @return the URL of the Cascading Style Sheet associated to this page as a String.
107 */
108 public String getCssUrl( )
109 {
110 return _strCssUrl;
111 }
112
113 /**
114 * Sets the URL of the Cascading Style Sheet associated to this page
115 *
116 * @param strCssUrl Sets the URL of the Cascading Style Sheet associated to this page to the specified string.
117 */
118 public void setCssUrl( String strCssUrl )
119 {
120 _strCssUrl = strCssUrl;
121 }
122
123 /**
124 * Returns the URL of the Customize Cascading Style Sheet associated to this page
125 *
126 * @return the URL of the Customize Cascading Style Sheet associated to this page as a String.
127 */
128 public String getCustomizeCssUrl( )
129 {
130 return _strCustomizeCssUrl;
131 }
132
133 /**
134 * Sets the URL of the Customize Cascading Style Sheet associated to this page
135 *
136 * @param strCustomizeCssUrl Sets the URL of the Customize Cascading Style Sheet associated to this page to the
137 * specified string.
138 */
139 public void setCustomizeCssUrl( String strCustomizeCssUrl )
140 {
141 _strCustomizeCssUrl = strCustomizeCssUrl;
142 }
143
144 /**
145 * Returns the URL of the Plugins Cascading Style Sheet associated to this page
146 *
147 * @return the URL of the Plugins Cascading Style Sheet associated to this page as a String.
148 */
149 public String getPluginsCssUrl( )
150 {
151 return _strPluginsCssUrl;
152 }
153
154 /**
155 * Sets the URL of the Plugins Cascading Style Sheet associated to this page
156 *
157 * @param strPluginsCssUrl Sets the URL of the Plugins Cascading Style Sheet associated to this page to the
158 * specified string.
159 */
160 public void setPluginsCssUrl( String strPluginsCssUrl )
161 {
162 _strPluginsCssUrl = strPluginsCssUrl;
163 }
164
165 /**
166 * Returns Author to mention in the META tags of the page.
167 *
168 * @return Author to mention in the META tags of the page as a String.
169 */
170 public String getMetaAuthor( )
171 {
172 return _strMetaAuthor;
173 }
174
175 /**
176 * Sets Author to mention in the META tags of the page.
177 *
178 * @param strMetaAuthor The Author to mention in the META tags of the page
179 */
180 public void setMetaAuthor( String strMetaAuthor )
181 {
182 _strMetaAuthor = strMetaAuthor;
183 }
184
185 /**
186 * Returns Copyright to mention in the META tags of the page.
187 *
188 * @return Copyright to mention in the META tags of the page as a String.
189 */
190 public String getMetaCopyright( )
191 {
192 return _strMetaCopyright;
193 }
194
195 /**
196 * Sets Copyright to mention in the META tags of the page.
197 *
198 * @param strMetaCopyright The Copyright to mention in the META tags of the page
199 */
200 public void setMetaCopyright( String strMetaCopyright )
201 {
202 _strMetaCopyright = strMetaCopyright;
203 }
204
205 /**
206 * Returns Keywords to mention in the META tags of the page.
207 *
208 * @return Keywords to mention in the META tags of the page as a String.
209 */
210 public String getMetaKeywords( )
211 {
212 return _strMetaKeywords;
213 }
214
215 /**
216 * Sets Keywords to mention in the META tags of the page.
217 *
218 * @param strMetaKeywords The Keywords to mention in the META tags of the page.
219 */
220 public void setMetaKeywords( String strMetaKeywords )
221 {
222 _strMetaKeywords = strMetaKeywords;
223 }
224
225 /**
226 * Returns Description to mention in the META tags of the page.
227 *
228 * @return Description to mention in the META tags of the page as a String.
229 */
230 public String getMetaDescription( )
231 {
232 return _strMetaDescription;
233 }
234
235 /**
236 * Sets Description to mention in the META tags of the page.
237 *
238 * @param strMetaDescription The Description to mention in the META tags of the page.
239 */
240 public void setMetaDescription( String strMetaDescription )
241 {
242 _strMetaDescription = strMetaDescription;
243 }
244
245 /**
246 * Returns the header to display at the top of the page.
247 *
248 * @return The header HTML code as a String.
249 */
250 public String getHeader( )
251 {
252 return _strHeader;
253 }
254
255 /**
256 * Sets the header to display at the top of the page.
257 *
258 * @param strHeader Sets the header to display at the top of the page.
259 */
260 public void setHeader( String strHeader )
261 {
262 _strHeader = strHeader;
263 }
264
265 /**
266 * Returns the menu associated to the page
267 *
268 * @return The HTML code of the menu associated to the page as a String
269 */
270 public String getMenu( )
271 {
272 return _strMenu;
273 }
274
275 /**
276 * Sets the menu associated to the page
277 *
278 * @param strMenu The HTML code of the menu to associate to the page as a String
279 */
280 public void setMenu( String strMenu )
281 {
282 _strMenu = strMenu;
283 }
284
285 /**
286 * Returns the page path.
287 *
288 * @return the page path.
289 */
290 public String getPagePath( )
291 {
292 return _strPagePath;
293 }
294
295 /**
296 * Set the page path.
297 *
298 * @param strPagePath the page path
299 */
300 public void setPagePath( String strPagePath )
301 {
302 _strPagePath = strPagePath;
303 }
304
305 /**
306 * Returns the page path.
307 *
308 * @return the page path.
309 */
310 public String getTreeMenu( )
311 {
312 return _strTreeMenu;
313 }
314
315 /**
316 * Set the page path.
317 *
318 * @param strTreeMenu the page path
319 */
320 public void setTreeMenu( String strTreeMenu )
321 {
322 _strTreeMenu = ( strTreeMenu == null ) ? EMPTY_STRING : strTreeMenu;
323 }
324
325 /**
326 * Returns the page content.
327 *
328 * @return The HTML code of the page content as a String.
329 */
330 public String getContent( )
331 {
332 return _strContent;
333 }
334
335 /**
336 * Sets the page content.
337 *
338 * @param strContent The HTML code of the page content as a String.
339 */
340 public void setContent( String strContent )
341 {
342 _strContent = strContent;
343 }
344
345 /**
346 * Returns the favicon of the page
347 *
348 * @return The favicon of the page as a string.
349 */
350 public String getFavicon( )
351 {
352 return _strFavicon;
353 }
354
355 /**
356 * Sets the Favicon of the page to the specified string.
357 *
358 * @param strFavicon The new Favicon of the page.
359 */
360 public void setFavicon( String strFavicon )
361 {
362 _strFavicon = strFavicon;
363 }
364
365 /**
366 * Returns the theme of the page
367 *
368 * @return The theme of the page as a string.
369 */
370 public String getTheme( )
371 {
372 return _strTheme;
373 }
374
375 /**
376 * Sets the Theme of the page to the specified string.
377 *
378 * @param strTheme The new Theme of the page.
379 */
380 public void setTheme( String strTheme )
381 {
382 _strTheme = strTheme;
383 }
384
385 /**
386 * Returns weither the current page is an homepage or not.
387 *
388 * @return true if the page is an homepage, otherwise false.
389 */
390 public boolean isHomePage( )
391 {
392 return _bIsHomePage;
393 }
394
395 /**
396 * Sets the homepage indicator.
397 *
398 * @param bHomePage Should be true if the page is an homepage, otherwise false.
399 */
400 public void setHomePage( boolean bHomePage )
401 {
402 _bIsHomePage = bHomePage;
403 }
404 }