1 /*
2 * $Id: Header.java 2993 2011-11-24 19:51:48Z andrewinkler $
3 * ============================================================================
4 * Project gluehloch-homepage-core
5 * Copyright (c) 2004-2007 by Andre Winkler. All rights reserved.
6 * ============================================================================
7 * GNU LESSER GENERAL PUBLIC LICENSE
8 * TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
9 *
10 * This library is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU Lesser General Public
12 * License as published by the Free Software Foundation; either
13 * version 2.1 of the License, or (at your option) any later version.
14 *
15 * This library is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 * Lesser General Public License for more details.
19 *
20 * You should have received a copy of the GNU Lesser General Public
21 * License along with this library; if not, write to the Free Software
22 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
23 *
24 */
25
26 package de.awtools.homegen.navigation;
27
28 import java.util.ArrayList;
29 import java.util.List;
30
31 import org.apache.commons.lang.StringUtils;
32
33 /**
34 * Ein <code>Header</code> aus der <code>navigation.xml</code>. Definiert
35 * die zwei Bilder, die im Header der Homepage angezeigt werden sollen.
36 *
37 * @version $LastChangedRevision: 2993 $ $LastChangedDate: 2011-11-24 20:51:48 +0100 (Thu, 24 Nov 2011) $
38 * @author by Andre Winkler, $LastChangedBy: andrewinkler $
39 */
40 public final class Header {
41
42 // -- title ---------------------------------------------------------------
43
44 /** Der Titel der Seite. */
45 private String title;
46
47 /**
48 * Liefert den Titel der Seite.
49 *
50 * @return Der Titel.
51 */
52 public String getTitle() {
53 return title;
54 }
55
56 /**
57 * Setzt den Titel der Seite.
58 *
59 * @param value Der Titel der Seite.
60 */
61 public void setTitle(final String value) {
62 title = value;
63 }
64
65 // -- headline ------------------------------------------------------------
66
67 private String headline;
68
69 public String getHeadline() {
70 return headline;
71 }
72
73 public void setHeadline(final String value) {
74 headline = value;
75 }
76
77 // -- impressum -----------------------------------------------------------
78
79 /** Die Default-Referenz auf die Impressum-Datei. */
80 private static final String IMPRESSUM_DEFAULT = "impressum.html";
81
82 /** Ein Link auf das Impressum. */
83 private String impressum;
84
85 /**
86 * Liefert das Impressum. Ist in der <code>navigation.xml</code> keine
87 * Referenz auf eine Impressums-Datei vorgegeben, wird die
88 * Default-Impressums Datei <code>impressum.html</code> im
89 * Root-Verzeichnis der Homepage angenommen.
90 *
91 * @return Die Referenz auf die Impressumsdatei.
92 *
93 * @since 1.2
94 */
95 public String getImpressum() {
96 String result = IMPRESSUM_DEFAULT;
97 if (StringUtils.isNotBlank(impressum)) {
98 result = impressum;
99 }
100 return result;
101 }
102
103 /**
104 * Setzt das Impressum.
105 *
106 * @param value Das Impressum.
107 *
108 * @since 1.2
109 */
110 public void setImpressum(final String value) {
111 impressum = value;
112 }
113
114 /**
115 * Liefert <code>true</code>, wenn eine Referenz auf das Default-Impressum
116 * vorliegt.
117 *
118 * @return <code>true</code>, wenn Default-Impressum.
119 *
120 * @since 1.2
121 */
122 public boolean isDefaultImpressum() {
123 return (StringUtils.isBlank(impressum));
124 }
125
126 // -- css files -----------------------------------------------------------
127
128 /** Liste mit CSS Datei Namen. */
129 private final List<CssFile> cssFiles = new ArrayList<CssFile>();
130
131 /**
132 * Liefert eine Liste der CSS Dateinamen.
133 *
134 * @return Liste mit Dateinamen
135 */
136 public List<CssFile> getCssFiles() {
137 return cssFiles;
138 }
139
140 /**
141 * Fügt eine CSS Datei hinzu.
142 *
143 * @param _cssFile Eine neue CSS Datei.
144 */
145 public void addCssFile(final CssFile _cssFile) {
146 cssFiles.add(_cssFile);
147 }
148
149 }