File Source: WeblogConfigBean.java
/*
P/P * Method: org.apache.roller.weblogger.ui.struts2.editor.WeblogConfigBean__static_init
*/
1 /*
2 * Licensed to the Apache Software Foundation (ASF) under one or more
3 * contributor license agreements. The ASF licenses this file to You
4 * under the Apache License, Version 2.0 (the "License"); you may not
5 * use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License. For additional information regarding
15 * copyright in this work, please see the NOTICE file in the top level
16 * directory of this distribution.
17 */
18
19 package org.apache.roller.weblogger.ui.struts2.editor;
20
21 import java.sql.Timestamp;
22 import java.util.Date;
23 import org.apache.commons.lang.StringUtils;
24 import org.apache.roller.weblogger.WebloggerException;
25 import org.apache.roller.weblogger.business.WebloggerFactory;
26 import org.apache.roller.weblogger.business.WeblogManager;
27 import org.apache.roller.weblogger.pojos.WeblogCategory;
28 import org.apache.roller.weblogger.pojos.Weblog;
29 import org.apache.roller.util.DateUtil;
30
31
32 /**
33 * Bean used to manage data submitted to WeblogConfig action.
34 */
/*
P/P * Method: void org.apache.roller.weblogger.ui.struts2.editor.WeblogConfigBean()
*
* Postconditions:
* this.about == null
* this.blacklist == null
* this.bloggerCategoryId == null
* this.defaultCategoryId == null
* this.defaultPlugins == null
* this.defaultPluginsArray == null
* this.description == null
* this.editorPage == null
* this.emailAddress == null
* this.emailFromAddress == null
* ...
*/
35 public class WeblogConfigBean {
36
37 private String id = null;
38 private String handle = null;
39 private String name = null;
40 private String description = null;
41 private boolean enableBloggerApi = false;
42 private String editorPage = null;
43 private String blacklist = null;
44 private boolean allowComments = false;
45 private boolean defaultAllowComments = false;
46 private String defaultCommentDays = "0";
47 private boolean moderateComments = false;
48 private boolean emailComments = false;
49 private String emailFromAddress = null;
50 private String emailAddress = null;
51 private String locale = null;
52 private String timeZone = null;
53 private String defaultPlugins = null;
54 private int entryDisplayCount = 15;
55 private boolean active = true;
56 private boolean commentModerationRequired = false;
57 private boolean enableMultiLang = false;
58 private boolean showAllLangs = true;
59 private String pageModels = null;
60 private String icon = null;
61 private String about = null;
62
63 private String bloggerCategoryId = null;
64 private String defaultCategoryId = null;
65 private String[] defaultPluginsArray = null;
66 private boolean applyCommentDefaults = false;
67
68
69 public void setId( String id ) {
/*
P/P * Method: void setId(String)
*
* Postconditions:
* this.id == id
* init'ed(this.id)
*/
70 this.id = id;
71 }
72
73 public String getHandle() {
/*
P/P * Method: String getHandle()
*
* Preconditions:
* init'ed(this.handle)
*
* Postconditions:
* return_value == this.handle
* init'ed(return_value)
*/
74 return this.handle;
75 }
76
77 public void setHandle( String handle ) {
/*
P/P * Method: void setHandle(String)
*
* Postconditions:
* this.handle == handle
* init'ed(this.handle)
*/
78 this.handle = handle;
79 }
80
81 public String getName() {
/*
P/P * Method: String getName()
*
* Preconditions:
* init'ed(this.name)
*
* Postconditions:
* return_value == this.name
* init'ed(return_value)
*/
82 return this.name;
83 }
84
85 public void setName( String name ) {
/*
P/P * Method: void setName(String)
*
* Postconditions:
* this.name == name
* init'ed(this.name)
*/
86 this.name = name;
87 }
88
89 public String getDescription() {
/*
P/P * Method: String getDescription()
*
* Preconditions:
* init'ed(this.description)
*
* Postconditions:
* return_value == this.description
* init'ed(return_value)
*/
90 return this.description;
91 }
92
93 public void setDescription( String description ) {
/*
P/P * Method: void setDescription(String)
*
* Postconditions:
* this.description == description
* init'ed(this.description)
*/
94 this.description = description;
95 }
96
97 public boolean getEnableBloggerApi() {
/*
P/P * Method: bool getEnableBloggerApi()
*
* Preconditions:
* init'ed(this.enableBloggerApi)
*
* Postconditions:
* return_value == this.enableBloggerApi
* init'ed(return_value)
*/
98 return this.enableBloggerApi;
99 }
100
101 public void setEnableBloggerApi( boolean enableBloggerApi ) {
/*
P/P * Method: void setEnableBloggerApi(bool)
*
* Postconditions:
* this.enableBloggerApi == enableBloggerApi
* init'ed(this.enableBloggerApi)
*/
102 this.enableBloggerApi = enableBloggerApi;
103 }
104
105 public String getEditorPage() {
/*
P/P * Method: String getEditorPage()
*
* Preconditions:
* init'ed(this.editorPage)
*
* Postconditions:
* return_value == this.editorPage
* init'ed(return_value)
*/
106 return this.editorPage;
107 }
108
109 public void setEditorPage( String editorPage ) {
/*
P/P * Method: void setEditorPage(String)
*
* Postconditions:
* this.editorPage == editorPage
* init'ed(this.editorPage)
*/
110 this.editorPage = editorPage;
111 }
112
113 public String getBlacklist() {
/*
P/P * Method: String getBlacklist()
*
* Preconditions:
* init'ed(this.blacklist)
*
* Postconditions:
* return_value == this.blacklist
* init'ed(return_value)
*/
114 return this.blacklist;
115 }
116
117 public void setBlacklist( String blacklist ) {
/*
P/P * Method: void setBlacklist(String)
*
* Postconditions:
* this.blacklist == blacklist
* init'ed(this.blacklist)
*/
118 this.blacklist = blacklist;
119 }
120
121 public boolean getAllowComments() {
/*
P/P * Method: bool getAllowComments()
*
* Preconditions:
* init'ed(this.allowComments)
*
* Postconditions:
* return_value == this.allowComments
* init'ed(return_value)
*/
122 return this.allowComments;
123 }
124
125 public void setAllowComments( boolean allowComments ) {
/*
P/P * Method: void setAllowComments(bool)
*
* Postconditions:
* this.allowComments == allowComments
* init'ed(this.allowComments)
*/
126 this.allowComments = allowComments;
127 }
128
129 public boolean getDefaultAllowComments() {
/*
P/P * Method: bool getDefaultAllowComments()
*
* Preconditions:
* init'ed(this.defaultAllowComments)
*
* Postconditions:
* return_value == this.defaultAllowComments
* init'ed(return_value)
*/
130 return this.defaultAllowComments;
131 }
132
133 public void setDefaultAllowComments( boolean defaultAllowComments ) {
/*
P/P * Method: void setDefaultAllowComments(bool)
*
* Postconditions:
* this.defaultAllowComments == defaultAllowComments
* init'ed(this.defaultAllowComments)
*/
134 this.defaultAllowComments = defaultAllowComments;
135 }
136
137 public String getDefaultCommentDays() {
/*
P/P * Method: String getDefaultCommentDays()
*
* Preconditions:
* init'ed(this.defaultCommentDays)
*
* Postconditions:
* return_value == this.defaultCommentDays
* init'ed(return_value)
*/
138 return this.defaultCommentDays;
139 }
140
141 public void setDefaultCommentDays( String defaultCommentDays ) {
/*
P/P * Method: void setDefaultCommentDays(String)
*
* Postconditions:
* this.defaultCommentDays == defaultCommentDays
* init'ed(this.defaultCommentDays)
*/
142 this.defaultCommentDays = defaultCommentDays;
143 }
144
145 public boolean getModerateComments() {
/*
P/P * Method: bool getModerateComments()
*
* Preconditions:
* init'ed(this.moderateComments)
*
* Postconditions:
* return_value == this.moderateComments
* init'ed(return_value)
*/
146 return this.moderateComments;
147 }
148
149 public void setModerateComments( boolean moderateComments ) {
/*
P/P * Method: void setModerateComments(bool)
*
* Postconditions:
* this.moderateComments == moderateComments
* init'ed(this.moderateComments)
*/
150 this.moderateComments = moderateComments;
151 }
152
153 public boolean getEmailComments() {
/*
P/P * Method: bool getEmailComments()
*
* Preconditions:
* init'ed(this.emailComments)
*
* Postconditions:
* return_value == this.emailComments
* init'ed(return_value)
*/
154 return this.emailComments;
155 }
156
157 public void setEmailComments( boolean emailComments ) {
/*
P/P * Method: void setEmailComments(bool)
*
* Postconditions:
* this.emailComments == emailComments
* init'ed(this.emailComments)
*/
158 this.emailComments = emailComments;
159 }
160
161 public String getEmailFromAddress() {
/*
P/P * Method: String getEmailFromAddress()
*
* Preconditions:
* init'ed(this.emailFromAddress)
*
* Postconditions:
* return_value == this.emailFromAddress
* init'ed(return_value)
*/
162 return this.emailFromAddress;
163 }
164
165 public void setEmailFromAddress( String emailFromAddress ) {
/*
P/P * Method: void setEmailFromAddress(String)
*
* Postconditions:
* this.emailFromAddress == emailFromAddress
* init'ed(this.emailFromAddress)
*/
166 this.emailFromAddress = emailFromAddress;
167 }
168
169 public String getEmailAddress() {
/*
P/P * Method: String getEmailAddress()
*
* Preconditions:
* init'ed(this.emailAddress)
*
* Postconditions:
* return_value == this.emailAddress
* init'ed(return_value)
*/
170 return this.emailAddress;
171 }
172
173 public void setEmailAddress( String emailAddress ) {
/*
P/P * Method: void setEmailAddress(String)
*
* Postconditions:
* this.emailAddress == emailAddress
* init'ed(this.emailAddress)
*/
174 this.emailAddress = emailAddress;
175 }
176
177 public String getLocale() {
/*
P/P * Method: String getLocale()
*
* Preconditions:
* init'ed(this.locale)
*
* Postconditions:
* return_value == this.locale
* init'ed(return_value)
*/
178 return this.locale;
179 }
180
181 public void setLocale( String locale ) {
/*
P/P * Method: void setLocale(String)
*
* Postconditions:
* this.locale == locale
* init'ed(this.locale)
*/
182 this.locale = locale;
183 }
184
185 public String getTimeZone() {
/*
P/P * Method: String getTimeZone()
*
* Preconditions:
* init'ed(this.timeZone)
*
* Postconditions:
* return_value == this.timeZone
* init'ed(return_value)
*/
186 return this.timeZone;
187 }
188
189 public void setTimeZone( String timeZone ) {
/*
P/P * Method: void setTimeZone(String)
*
* Postconditions:
* this.timeZone == timeZone
* init'ed(this.timeZone)
*/
190 this.timeZone = timeZone;
191 }
192
193 public int getEntryDisplayCount() {
/*
P/P * Method: int getEntryDisplayCount()
*
* Preconditions:
* init'ed(this.entryDisplayCount)
*
* Postconditions:
* return_value == this.entryDisplayCount
* init'ed(return_value)
*/
194 return this.entryDisplayCount;
195 }
196
197 public void setEntryDisplayCount( int entryDisplayCount ) {
/*
P/P * Method: void setEntryDisplayCount(int)
*
* Postconditions:
* this.entryDisplayCount == entryDisplayCount
* init'ed(this.entryDisplayCount)
*/
198 this.entryDisplayCount = entryDisplayCount;
199 }
200
201 public boolean getCommentModerationRequired() {
/*
P/P * Method: bool getCommentModerationRequired()
*
* Preconditions:
* init'ed(this.commentModerationRequired)
*
* Postconditions:
* return_value == this.commentModerationRequired
* init'ed(return_value)
*/
202 return this.commentModerationRequired;
203 }
204
205 public void setCommentModerationRequired( boolean commentModerationRequired ) {
/*
P/P * Method: void setCommentModerationRequired(bool)
*
* Postconditions:
* this.commentModerationRequired == commentModerationRequired
* init'ed(this.commentModerationRequired)
*/
206 this.commentModerationRequired = commentModerationRequired;
207 }
208
209 public boolean isEnableMultiLang() {
/*
P/P * Method: bool isEnableMultiLang()
*
* Preconditions:
* init'ed(this.enableMultiLang)
*
* Postconditions:
* return_value == this.enableMultiLang
* init'ed(return_value)
*/
210 return this.enableMultiLang;
211 }
212
213 public void setEnableMultiLang( boolean enableMultiLang ) {
/*
P/P * Method: void setEnableMultiLang(bool)
*
* Postconditions:
* this.enableMultiLang == enableMultiLang
* init'ed(this.enableMultiLang)
*/
214 this.enableMultiLang = enableMultiLang;
215 }
216
217 public boolean isShowAllLangs() {
/*
P/P * Method: bool isShowAllLangs()
*
* Preconditions:
* init'ed(this.showAllLangs)
*
* Postconditions:
* return_value == this.showAllLangs
* init'ed(return_value)
*/
218 return this.showAllLangs;
219 }
220
221 public void setShowAllLangs( boolean showAllLangs ) {
/*
P/P * Method: void setShowAllLangs(bool)
*
* Postconditions:
* this.showAllLangs == showAllLangs
* init'ed(this.showAllLangs)
*/
222 this.showAllLangs = showAllLangs;
223 }
224
225 public String getPageModels() {
/*
P/P * Method: String getPageModels()
*
* Preconditions:
* init'ed(this.pageModels)
*
* Postconditions:
* return_value == this.pageModels
* init'ed(return_value)
*/
226 return this.pageModels;
227 }
228
229 public void setPageModels( String pageModels ) {
/*
P/P * Method: void setPageModels(String)
*
* Postconditions:
* this.pageModels == pageModels
* init'ed(this.pageModels)
*/
230 this.pageModels = pageModels;
231 }
232
233 public String getIcon() {
/*
P/P * Method: String getIcon()
*
* Preconditions:
* init'ed(this.icon)
*
* Postconditions:
* return_value == this.icon
* init'ed(return_value)
*/
234 return icon;
235 }
236
237 public void setIcon(String icon) {
/*
P/P * Method: void setIcon(String)
*
* Postconditions:
* this.icon == icon
* init'ed(this.icon)
*/
238 this.icon = icon;
239 }
240
241 public String getAbout() {
/*
P/P * Method: String getAbout()
*
* Preconditions:
* init'ed(this.about)
*
* Postconditions:
* return_value == this.about
* init'ed(return_value)
*/
242 return about;
243 }
244
245 public void setAbout(String about) {
/*
P/P * Method: void setAbout(String)
*
* Postconditions:
* this.about == about
* init'ed(this.about)
*/
246 this.about = about;
247 }
248
249 public String getBloggerCategoryId() {
/*
P/P * Method: String getBloggerCategoryId()
*
* Preconditions:
* init'ed(this.bloggerCategoryId)
*
* Postconditions:
* return_value == this.bloggerCategoryId
* init'ed(return_value)
*/
250 return bloggerCategoryId;
251 }
252
253 public void setBloggerCategoryId(String bloggerCategoryId) {
/*
P/P * Method: void setBloggerCategoryId(String)
*
* Postconditions:
* this.bloggerCategoryId == bloggerCategoryId
* init'ed(this.bloggerCategoryId)
*/
254 this.bloggerCategoryId = bloggerCategoryId;
255 }
256
257 public String getDefaultCategoryId() {
/*
P/P * Method: String getDefaultCategoryId()
*
* Preconditions:
* init'ed(this.defaultCategoryId)
*
* Postconditions:
* return_value == this.defaultCategoryId
* init'ed(return_value)
*/
258 return defaultCategoryId;
259 }
260
261 public void setDefaultCategoryId(String defeaultCategoryId) {
/*
P/P * Method: void setDefaultCategoryId(String)
*
* Postconditions:
* this.defaultCategoryId == defeaultCategoryId
* init'ed(this.defaultCategoryId)
*/
262 this.defaultCategoryId = defeaultCategoryId;
263 }
264
265 public String[] getDefaultPluginsArray() {
/*
P/P * Method: String[] getDefaultPluginsArray()
*
* Preconditions:
* init'ed(this.defaultPluginsArray)
*
* Postconditions:
* return_value == this.defaultPluginsArray
* init'ed(return_value)
*/
266 return defaultPluginsArray;
267 }
268
269 public void setDefaultPluginsArray(String[] strings) {
/*
P/P * Method: void setDefaultPluginsArray(String[])
*
* Postconditions:
* this.defaultPluginsArray == strings
* init'ed(this.defaultPluginsArray)
*/
270 defaultPluginsArray = strings;
271 }
272
273 public boolean getApplyCommentDefaults() {
/*
P/P * Method: bool getApplyCommentDefaults()
*
* Preconditions:
* init'ed(this.applyCommentDefaults)
*
* Postconditions:
* return_value == this.applyCommentDefaults
* init'ed(return_value)
*/
274 return applyCommentDefaults;
275 }
276
277 public void setApplyCommentDefaults(boolean applyCommentDefaults) {
/*
P/P * Method: void setApplyCommentDefaults(bool)
*
* Postconditions:
* this.applyCommentDefaults == applyCommentDefaults
* init'ed(this.applyCommentDefaults)
*/
278 this.applyCommentDefaults = applyCommentDefaults;
279 }
280
281 public boolean getActive() {
/*
P/P * Method: bool getActive()
*
* Preconditions:
* init'ed(this.active)
*
* Postconditions:
* return_value == this.active
* init'ed(return_value)
*/
282 return active;
283 }
284
285 public void setActive(boolean active) {
/*
P/P * Method: void setActive(bool)
*
* Postconditions:
* this.active == active
* init'ed(this.active)
*/
286 this.active = active;
287 }
288
289
290 public void copyFrom(Weblog dataHolder) {
291
/*
P/P * Method: void copyFrom(Weblog)
*
* Preconditions:
* dataHolder != null
*
* Presumptions:
* org.apache.roller.weblogger.pojos.Weblog:getActive(...)@310 != null
* org.apache.roller.weblogger.pojos.Weblog:getAllowComments(...)@299 != null
* org.apache.roller.weblogger.pojos.Weblog:getBloggerCategory(...)@322 != null
* org.apache.roller.weblogger.pojos.Weblog:getDefaultAllowComments(...)@300 != null
* org.apache.roller.weblogger.pojos.Weblog:getDefaultCategory(...)@319 != null
* ...
*
* Postconditions:
* java.lang.StringBuilder:toString(...)._tainted == 0
* init'ed(this.about)
* init'ed(this.active)
* init'ed(this.allowComments)
* init'ed(this.blacklist)
* possibly_updated(this.bloggerCategoryId)
* init'ed(this.commentModerationRequired)
* init'ed(this.defaultAllowComments)
* possibly_updated(this.defaultCategoryId)
* this.defaultCommentDays == &java.lang.StringBuilder:toString(...)
* ...
*
* Test Vectors:
* org.apache.roller.weblogger.pojos.Weblog:getBloggerCategory(...)@321: Addr_Set{null}, Inverse{null}
* org.apache.roller.weblogger.pojos.Weblog:getDefaultCategory(...)@318: Addr_Set{null}, Inverse{null}
* org.apache.roller.weblogger.pojos.Weblog:getDefaultPlugins(...)@324: Addr_Set{null}, Inverse{null}
*/
292 this.id = dataHolder.getId();
293 this.handle = dataHolder.getHandle();
294 this.name = dataHolder.getName();
295 this.description = dataHolder.getDescription();
296 this.enableBloggerApi = dataHolder.getEnableBloggerApi();
297 this.editorPage = dataHolder.getEditorPage();
298 this.blacklist = dataHolder.getBlacklist();
299 this.allowComments = dataHolder.getAllowComments();
300 this.defaultAllowComments = dataHolder.getDefaultAllowComments();
301 this.defaultCommentDays = ""+dataHolder.getDefaultCommentDays();
302 this.moderateComments = dataHolder.getModerateComments();
303 this.emailComments = dataHolder.getEmailComments();
304 this.emailFromAddress = dataHolder.getEmailFromAddress();
305 this.emailAddress = dataHolder.getEmailAddress();
306 this.locale = dataHolder.getLocale();
307 this.timeZone = dataHolder.getTimeZone();
308 this.defaultPlugins = dataHolder.getDefaultPlugins();
309 this.entryDisplayCount = dataHolder.getEntryDisplayCount();
310 setActive(dataHolder.getActive());
311 this.commentModerationRequired = dataHolder.getCommentModerationRequired();
312 this.enableMultiLang = dataHolder.isEnableMultiLang();
313 this.showAllLangs = dataHolder.isShowAllLangs();
314 this.pageModels = dataHolder.getPageModels();
315 setIcon(dataHolder.getIconPath());
316 setAbout(dataHolder.getAbout());
317
318 if (dataHolder.getDefaultCategory() != null) {
319 defaultCategoryId = dataHolder.getDefaultCategory().getId();
320 }
321 if (dataHolder.getBloggerCategory() != null) {
322 bloggerCategoryId = dataHolder.getBloggerCategory().getId();
323 }
324 if (dataHolder.getDefaultPlugins() != null) {
325 defaultPluginsArray = StringUtils.split(dataHolder.getDefaultPlugins(), ",");
326 }
327 }
328
329
330 public void copyTo(Weblog dataHolder) {
331
/*
P/P * Method: void copyTo(Weblog)
*
* Preconditions:
* dataHolder != null
* init'ed(this.about)
* init'ed(this.active)
* init'ed(this.allowComments)
* init'ed(this.blacklist)
* init'ed(this.commentModerationRequired)
* init'ed(this.defaultAllowComments)
* init'ed(this.defaultPlugins)
* init'ed(this.defaultPluginsArray)
* init'ed(this.description)
* ...
*/
332 dataHolder.setName(this.name);
333 dataHolder.setDescription(this.description);
334 dataHolder.setEnableBloggerApi(this.enableBloggerApi);
335 dataHolder.setEditorPage(this.editorPage);
336 dataHolder.setBlacklist(this.blacklist);
337 dataHolder.setAllowComments(this.allowComments);
338 dataHolder.setDefaultAllowComments(this.defaultAllowComments);
339 dataHolder.setModerateComments(this.moderateComments);
340 dataHolder.setEmailComments(this.emailComments);
341 dataHolder.setEmailFromAddress(this.emailFromAddress);
342 dataHolder.setEmailAddress(this.emailAddress);
343 dataHolder.setLocale(this.locale);
344 dataHolder.setTimeZone(this.timeZone);
345 dataHolder.setDefaultPlugins(this.defaultPlugins);
346 dataHolder.setEntryDisplayCount(this.entryDisplayCount);
347 dataHolder.setActive(this.getActive());
348 dataHolder.setCommentModerationRequired(this.commentModerationRequired);
349 dataHolder.setEnableMultiLang(this.enableMultiLang);
350 dataHolder.setShowAllLangs(this.showAllLangs);
351 dataHolder.setPageModels(this.pageModels);
352 dataHolder.setIconPath(getIcon());
353 dataHolder.setAbout(getAbout());
354
355 dataHolder.setDefaultPlugins( StringUtils.join(this.defaultPluginsArray,",") );
356
357 dataHolder.setDefaultCommentDays(Integer.parseInt(this.defaultCommentDays));
358
359 dataHolder.setDefaultPlugins(StringUtils.join(this.defaultPluginsArray, ","));
360 }
361
362 }
SofCheck Inspector Build Version : 2.18479
| WeblogConfigBean.java |
2009-Jan-02 14:25:00 |
| WeblogConfigBean.class |
2009-Sep-04 03:12:45 |