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.sql.Timestamp;
019: import org.jamwiki.utils.WikiLogger;
020:
021: /**
022: * Provides an object representing a version of a Wiki topic.
023: */
024: public class TopicVersion {
025:
026: public static final int EDIT_NORMAL = 1;
027: public static final int EDIT_MINOR = 2;
028: public static final int EDIT_REVERT = 3;
029: public static final int EDIT_MOVE = 4;
030: public static final int EDIT_DELETE = 5;
031: public static final int EDIT_PERMISSION = 6;
032: public static final int EDIT_UNDELETE = 7;
033: private Integer authorId = null;
034: private String authorIpAddress = null;
035: private String editComment = null;
036: private Timestamp editDate = new Timestamp(System
037: .currentTimeMillis());
038: private int editType = EDIT_NORMAL;
039: private Integer previousTopicVersionId = null;
040: private int topicId = -1;
041: private int topicVersionId = -1;
042: private String versionContent = null;
043: private static final WikiLogger logger = WikiLogger
044: .getLogger(TopicVersion.class.getName());
045:
046: /**
047: *
048: */
049: public TopicVersion() {
050: }
051:
052: /**
053: *
054: */
055: public TopicVersion(WikiUser user, String authorIpAddress,
056: String editComment, String versionContent) {
057: if (user != null && user.getUserId() > 0) {
058: this .authorId = new Integer(user.getUserId());
059: }
060: this .authorIpAddress = authorIpAddress;
061: this .editComment = editComment;
062: this .versionContent = versionContent;
063: }
064:
065: /**
066: *
067: */
068: public Integer getAuthorId() {
069: return this .authorId;
070: }
071:
072: /**
073: *
074: */
075: public void setAuthorId(Integer authorId) {
076: this .authorId = authorId;
077: }
078:
079: /**
080: *
081: */
082: public String getAuthorIpAddress() {
083: return this .authorIpAddress;
084: }
085:
086: /**
087: *
088: */
089: public void setAuthorIpAddress(String authorIpAddress) {
090: this .authorIpAddress = authorIpAddress;
091: }
092:
093: /**
094: *
095: */
096: public String getEditComment() {
097: return this .editComment;
098: }
099:
100: /**
101: *
102: */
103: public void setEditComment(String editComment) {
104: this .editComment = editComment;
105: }
106:
107: /**
108: *
109: */
110: public Timestamp getEditDate() {
111: return this .editDate;
112: }
113:
114: /**
115: *
116: */
117: public void setEditDate(Timestamp editDate) {
118: this .editDate = editDate;
119: }
120:
121: /**
122: *
123: */
124: public int getEditType() {
125: return this .editType;
126: }
127:
128: /**
129: *
130: */
131: public void setEditType(int editType) {
132: this .editType = editType;
133: }
134:
135: /**
136: *
137: */
138: public Integer getPreviousTopicVersionId() {
139: return this .previousTopicVersionId;
140: }
141:
142: /**
143: *
144: */
145: public void setPreviousTopicVersionId(Integer previousTopicVersionId) {
146: this .previousTopicVersionId = previousTopicVersionId;
147: }
148:
149: /**
150: *
151: */
152: public int getTopicId() {
153: return this .topicId;
154: }
155:
156: /**
157: *
158: */
159: public void setTopicId(int topicId) {
160: this .topicId = topicId;
161: }
162:
163: /**
164: *
165: */
166: public int getTopicVersionId() {
167: return this .topicVersionId;
168: }
169:
170: /**
171: *
172: */
173: public void setTopicVersionId(int topicVersionId) {
174: this .topicVersionId = topicVersionId;
175: }
176:
177: /**
178: *
179: */
180: public String getVersionContent() {
181: return this .versionContent;
182: }
183:
184: /**
185: *
186: */
187: public void setVersionContent(String versionContent) {
188: this.versionContent = versionContent;
189: }
190: }
|