KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > roller > ui > authoring > struts > formbeans > CommentFormEx


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 package org.apache.roller.ui.authoring.struts.formbeans;
19
20 import java.util.Locale JavaDoc;
21
22 import javax.servlet.ServletRequest JavaDoc;
23 import javax.servlet.http.HttpServletRequest JavaDoc;
24
25 import org.apache.struts.action.ActionMapping;
26 import org.apache.roller.RollerException;
27 import org.apache.roller.pojos.CommentData;
28 import org.apache.roller.ui.authoring.struts.forms.CommentForm;
29
30 /**
31  * Extends the WeblogEntryForm so that additional properties may be added.
32  * These properties are not persistent and are only needed for the UI.
33  *
34  * @struts.form name="commentFormEx"
35  * @author Lance Lavandowska
36  */

37 public class CommentFormEx extends CommentForm
38 {
39     private String JavaDoc[] deleteComments = null;
40     private String JavaDoc[] spamComments = null;
41     private String JavaDoc mEntryId = null;
42
43     public CommentFormEx()
44     {
45         super();
46     }
47
48     public CommentFormEx(CommentData entryData, java.util.Locale JavaDoc locale ) throws RollerException
49     {
50         super(entryData, locale);
51     }
52
53     public String JavaDoc[] getDeleteComments()
54     {
55         return deleteComments;
56     }
57
58     public void setDeleteComments(String JavaDoc[] deleteIds)
59     {
60         deleteComments = deleteIds;
61     }
62
63     /**
64      * @return
65      */

66     public String JavaDoc[] getSpamComments()
67     {
68         return spamComments;
69     }
70
71     public void setSpamComments(String JavaDoc[] spamIds)
72     {
73         spamComments = spamIds;
74     }
75
76     /**
77      * @return
78      */

79     public String JavaDoc getWeblogEntryId()
80     {
81         return mEntryId;
82     }
83
84     /**
85      * @param string
86      */

87     public void setWeblogEntryId(String JavaDoc string)
88     {
89         mEntryId = string;
90     }
91
92     /**
93      * @see org.apache.struts.action.ActionForm#reset(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest)
94      */

95     public void reset(ActionMapping mapping, HttpServletRequest JavaDoc request)
96     {
97         super.reset(mapping, request);
98         deleteComments = null;
99         spamComments = null;
100     }
101
102     /**
103      * @see org.apache.struts.action.ActionForm#reset(org.apache.struts.action.ActionMapping, javax.servlet.ServletRequest)
104      */

105     public void reset(ActionMapping mapping, ServletRequest JavaDoc request)
106     {
107         super.reset(mapping, request);
108         deleteComments = null;
109         spamComments = null;
110     }
111     
112     public void copyTo(org.apache.roller.pojos.CommentData dataHolder, Locale JavaDoc locale)
113         throws RollerException
114     {
115         super.copyTo(dataHolder, locale);
116         if (getSpam() == null) dataHolder.setSpam(Boolean.FALSE);
117         if (getNotify() == null) dataHolder.setNotify(Boolean.FALSE);
118     }
119 }
120
121
Popular Tags