001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. The ASF licenses this file to You
004: * under the Apache License, Version 2.0 (the "License"); you may not
005: * use this file except in compliance with the License.
006: * You may obtain a copy of the License at
007: *
008: * http://www.apache.org/licenses/LICENSE-2.0
009: *
010: * Unless required by applicable law or agreed to in writing, software
011: * distributed under the License is distributed on an "AS IS" BASIS,
012: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013: * See the License for the specific language governing permissions and
014: * limitations under the License. For additional information regarding
015: * copyright in this work, please see the NOTICE file in the top level
016: * directory of this distribution.
017: */
018:
019: package org.apache.roller.pojos;
020:
021: import java.io.Serializable;
022: import java.util.Date;
023: import org.apache.roller.pojos.Template;
024:
025: /**
026: * A Theme based implementation of a Template. A ThemeTemplate represents a
027: * template which is part of a shared Theme.
028: */
029: public class ThemeTemplate implements Template, Serializable {
030:
031: private String id = null;
032: private String name = null;
033: private String description = null;
034: private String contents = null;
035: private String link = null;
036: private Date lastModified = null;
037: private String templateLanguage = null;
038: private boolean hidden = false;
039: private boolean navbar = false;
040: private String decoratorName = null;
041:
042: private Theme myTheme = null;
043:
044: public ThemeTemplate() {
045: }
046:
047: public ThemeTemplate(Theme theme, String id, String name,
048: String desc, String contents, String link, Date date,
049: String tempLang, boolean hid, boolean navbar, String decor) {
050:
051: this .myTheme = theme;
052: this .id = id;
053: this .name = name;
054: this .description = desc;
055: this .contents = contents;
056: this .link = link;
057: this .lastModified = date;
058: this .templateLanguage = tempLang;
059: this .hidden = hid;
060: this .navbar = navbar;
061: this .decoratorName = decor;
062: }
063:
064: public Template getDecorator() {
065: if (decoratorName != null && !id.equals(decoratorName)) {
066: return myTheme.getTemplate(decoratorName);
067: }
068: return null;
069: }
070:
071: public String getId() {
072: return id;
073: }
074:
075: public void setId(String id) {
076: this .id = id;
077: }
078:
079: public String getName() {
080: return name;
081: }
082:
083: public void setName(String name) {
084: this .name = name;
085: }
086:
087: public String getDescription() {
088: return description;
089: }
090:
091: public void setDescription(String description) {
092: this .description = description;
093: }
094:
095: public String getContents() {
096: return contents;
097: }
098:
099: public void setContents(String contents) {
100: this .contents = contents;
101: }
102:
103: public Date getLastModified() {
104: return lastModified;
105: }
106:
107: public void setLastModified(Date lastModified) {
108: this .lastModified = lastModified;
109: }
110:
111: public String getLink() {
112: return link;
113: }
114:
115: public void setLink(String link) {
116: this .link = link;
117: }
118:
119: public String getTemplateLanguage() {
120: return templateLanguage;
121: }
122:
123: public void setTemplateLanguage(String templateLanguage) {
124: this .templateLanguage = templateLanguage;
125: }
126:
127: public boolean isHidden() {
128: return hidden;
129: }
130:
131: public void setHidden(boolean isHidden) {
132: this .hidden = isHidden;
133: }
134:
135: public boolean isNavbar() {
136: return navbar;
137: }
138:
139: public void setNavbar(boolean navbar) {
140: this .navbar = navbar;
141: }
142:
143: public String getDecoratorName() {
144: return decoratorName;
145: }
146:
147: public void setDecoratorName(String decorator) {
148: this .decoratorName = decorator;
149: }
150:
151: public String toString() {
152: return (id + "," + name + "," + description + "," + link + ","
153: + lastModified + "\n\n" + contents + "\n");
154: }
155:
156: }
|