001: /*
002: * This program is free software; you can redistribute it and/or modify
003: * it under the terms of the GNU General Public License as published by
004: * the Free Software Foundation; either version 2 of the License, or
005: * (at your option) any later version.
006: *
007: * This program is distributed in the hope that it will be useful,
008: * but WITHOUT ANY WARRANTY; without even the implied warranty of
009: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
010: * GNU Library General Public License for more details.
011: *
012: * You should have received a copy of the GNU General Public License
013: * along with this program; if not, write to the Free Software
014: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
015: */
016: package dlog4j.formbean;
017:
018: import java.util.Date;
019: import java.util.List;
020:
021: /**
022: * 日记信息的基类,有两个子类LogForm以及DraftForm
023: * @author Liudong
024: */
025: public class LogBaseForm extends ContentPreviewForm {
026:
027: public final static int LEVEL_1 = 1;
028: public final static int LEVEL_2 = 2;
029: public final static int LEVEL_3 = 3;
030: public final static int LEVEL_4 = 4;
031: public final static int LEVEL_5 = 5;
032:
033: int id;
034: UserForm owner;
035: String author;
036: String authorUrl;
037: String title;
038: Date logTime;
039: String refUrl;
040: String weather;
041: int useFace = 1;
042: int useUbb = 1;
043: int showFormerly = 0;
044: int moodLevel = LEVEL_3;
045: SiteForm site;
046: List attachments;
047:
048: public List getAttachments() {
049: return attachments;
050: }
051:
052: public void setAttachments(List attachments) {
053: this .attachments = attachments;
054: }
055:
056: public String getAuthor() {
057: if ("".equals(author))
058: return null;
059: return author;
060: }
061:
062: public void setAuthor(String author) {
063: this .author = author;
064: }
065:
066: public int getOwnerId() {
067: return (owner != null) ? owner.getId() : -1;
068: }
069:
070: public void setOwnerId(int userid) {
071: if (owner == null)
072: owner = new UserForm();
073: owner.setId(userid);
074: }
075:
076: /**
077: * @return
078: */
079: public String getOwnerName() {
080: return owner.getDisplayName();
081: }
082:
083: public String getAuthorUrl() {
084: if ("".equals(authorUrl))
085: return null;
086: return authorUrl;
087: }
088:
089: public void setAuthorUrl(String authorUrl) {
090: this .authorUrl = authorUrl;
091: }
092:
093: public int getId() {
094: return id;
095: }
096:
097: public void setId(int id) {
098: this .id = id;
099: }
100:
101: public Date getLogTime() {
102: return logTime;
103: }
104:
105: public void setLogTime(Date logTime) {
106: this .logTime = logTime;
107: }
108:
109: public int getMoodLevel() {
110: return moodLevel;
111: }
112:
113: public void setMoodLevel(int moodLevel) {
114: this .moodLevel = moodLevel;
115: }
116:
117: public UserForm getOwner() {
118: return owner;
119: }
120:
121: public void setOwner(UserForm owner) {
122: this .owner = owner;
123: }
124:
125: public String getRefUrl() {
126: if ("".equals(refUrl))
127: return null;
128: return refUrl;
129: }
130:
131: public void setRefUrl(String refUrl) {
132: this .refUrl = refUrl;
133: }
134:
135: public int getShowFormerly() {
136: return showFormerly;
137: }
138:
139: public void setShowFormerly(int showFormerly) {
140: this .showFormerly = showFormerly;
141: }
142:
143: public SiteForm getSite() {
144: return site;
145: }
146:
147: public void setSite(SiteForm site) {
148: this .site = site;
149: }
150:
151: public String getTitleText() {
152: try {
153: return extractText(title);
154: } catch (Exception e) {
155: }
156: return null;
157: }
158:
159: public String getTitle() {
160: if ("".equals(title))
161: return null;
162: return title;
163: }
164:
165: public void setTitle(String title) {
166: this .title = title;
167: }
168:
169: public int getUseFace() {
170: return useFace;
171: }
172:
173: public void setUseFace(int useFace) {
174: this .useFace = useFace;
175: }
176:
177: public int getUseUbb() {
178: return useUbb;
179: }
180:
181: public void setUseUbb(int useUbb) {
182: this .useUbb = useUbb;
183: }
184:
185: public String getWeather() {
186: if ("".equals(weather))
187: return null;
188: return weather;
189: }
190:
191: public void setWeather(String weather) {
192: this .weather = weather;
193: }
194:
195: public static void main(String[] args) {
196: try {
197: System.out.print("RESULT:");
198: System.out
199: .println(extractText("<font color=\"red\" size=4>大字体测试</font>"));
200: } catch (Exception e) {
201: }
202: }
203: }
|