001: /**
002: * Licensed under the GNU LESSER GENERAL PUBLIC LICENSE, version 2.1, dated February 1999.
003: *
004: * This program is free software; you can redistribute it and/or modify
005: * it under the terms of the latest version of the GNU Lesser General
006: * Public License as published by the Free Software Foundation;
007: *
008: * This program is distributed in the hope that it will be useful,
009: * but WITHOUT ANY WARRANTY; without even the implied warranty of
010: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
011: * GNU Lesser General Public License for more details.
012: *
013: * You should have received a copy of the GNU Lesser General Public License
014: * along with this program (LICENSE.txt); if not, write to the Free Software
015: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
016: */package org.jamwiki.model;
017:
018: import java.io.Serializable;
019: import java.sql.Timestamp;
020: import org.jamwiki.utils.WikiLogger;
021:
022: /**
023: * Provides an object representing a Wiki topic.
024: */
025: public class Topic implements Serializable {
026:
027: /* Standard topic type. */
028: public static final int TYPE_ARTICLE = 1;
029: /* Topic redirects to another topic. */
030: public static final int TYPE_REDIRECT = 2;
031: /* Topic is an image. */
032: public static final int TYPE_IMAGE = 4;
033: /* Topic is a category. */
034: public static final int TYPE_CATEGORY = 5;
035: /* Topic is a non-image file. */
036: public static final int TYPE_FILE = 6;
037: /* Internal files, do not display on Special:Allpages */
038: public static final int TYPE_SYSTEM_FILE = 7;
039: /* Wiki templates. */
040: public static final int TYPE_TEMPLATE = 8;
041: // FIXME - consider making this an ACL (more flexible)
042: private boolean adminOnly = false;
043: private Integer currentVersionId = null;
044: private Timestamp deleteDate = null;
045: private String name = null;
046: private boolean readOnly = false;
047: private String redirectTo = null;
048: private String topicContent = null;
049: private int topicId = -1;
050: private int topicType = TYPE_ARTICLE;
051: private String virtualWiki = null;
052: private static final WikiLogger logger = WikiLogger
053: .getLogger(Topic.class.getName());
054:
055: /**
056: *
057: */
058: public Topic() {
059: }
060:
061: /**
062: *
063: */
064: public Topic(Topic topic) {
065: this .adminOnly = topic.adminOnly;
066: this .currentVersionId = topic.currentVersionId;
067: this .deleteDate = topic.deleteDate;
068: this .name = topic.name;
069: this .readOnly = topic.readOnly;
070: this .redirectTo = topic.redirectTo;
071: this .topicContent = topic.topicContent;
072: this .topicId = topic.topicId;
073: this .topicType = topic.topicType;
074: this .virtualWiki = topic.virtualWiki;
075: }
076:
077: /**
078: *
079: */
080: public boolean getAdminOnly() {
081: return this .adminOnly;
082: }
083:
084: /**
085: *
086: */
087: public void setAdminOnly(boolean adminOnly) {
088: this .adminOnly = adminOnly;
089: }
090:
091: /**
092: *
093: */
094: public Integer getCurrentVersionId() {
095: return this .currentVersionId;
096: }
097:
098: /**
099: *
100: */
101: public void setCurrentVersionId(Integer currentVersionId) {
102: this .currentVersionId = currentVersionId;
103: }
104:
105: /**
106: *
107: */
108: public boolean getDeleted() {
109: return (this .deleteDate != null);
110: }
111:
112: /**
113: *
114: */
115: public Timestamp getDeleteDate() {
116: return this .deleteDate;
117: }
118:
119: /**
120: *
121: */
122: public void setDeleteDate(Timestamp deleteDate) {
123: this .deleteDate = deleteDate;
124: }
125:
126: /**
127: *
128: */
129: public String getName() {
130: return this .name;
131: }
132:
133: /**
134: *
135: */
136: public void setName(String name) {
137: this .name = name;
138: }
139:
140: /**
141: *
142: */
143: public boolean getReadOnly() {
144: return this .readOnly;
145: }
146:
147: /**
148: *
149: */
150: public String getRedirectTo() {
151: return this .redirectTo;
152: }
153:
154: /**
155: *
156: */
157: public void setRedirectTo(String redirectTo) {
158: this .redirectTo = redirectTo;
159: }
160:
161: /**
162: *
163: */
164: public void setReadOnly(boolean readOnly) {
165: this .readOnly = readOnly;
166: }
167:
168: /**
169: *
170: */
171: public String getTopicContent() {
172: return this .topicContent;
173: }
174:
175: /**
176: *
177: */
178: public void setTopicContent(String topicContent) {
179: this .topicContent = topicContent;
180: }
181:
182: /**
183: *
184: */
185: public int getTopicId() {
186: return this .topicId;
187: }
188:
189: /**
190: *
191: */
192: public void setTopicId(int topicId) {
193: this .topicId = topicId;
194: }
195:
196: /**
197: *
198: */
199: public int getTopicType() {
200: return this .topicType;
201: }
202:
203: /**
204: *
205: */
206: public void setTopicType(int topicType) {
207: this .topicType = topicType;
208: }
209:
210: /**
211: *
212: */
213: public String getVirtualWiki() {
214: return this .virtualWiki;
215: }
216:
217: /**
218: *
219: */
220: public void setVirtualWiki(String virtualWiki) {
221: this.virtualWiki = virtualWiki;
222: }
223: }
|