KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > ivata > groupware > business > library > struts > UploadImagesForm


1 /*
2  * Copyright (c) 2001 - 2005 ivata limited.
3  * All rights reserved.
4  * -----------------------------------------------------------------------------
5  * ivata groupware may be redistributed under the GNU General Public
6  * License as published by the Free Software Foundation;
7  * version 2 of the License.
8  *
9  * These programs are free software; you can redistribute them and/or
10  * modify them under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; version 2 of the License.
12  *
13  * These programs are distributed in the hope that they will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
16  *
17  * See the GNU General Public License in the file LICENSE.txt for more
18  * details.
19  *
20  * If you would like a copy of the GNU General Public License write to
21  *
22  * Free Software Foundation, Inc.
23  * 59 Temple Place - Suite 330
24  * Boston, MA 02111-1307, USA.
25  *
26  *
27  * To arrange commercial support and licensing, contact ivata at
28  * http://www.ivata.com/contact.jsp
29  * -----------------------------------------------------------------------------
30  * $Log: UploadImagesForm.java,v $
31  * Revision 1.3 2005/04/10 20:31:57 colinmacleod
32  * Added new themes.
33  * Changed id type to String.
34  * Changed i tag to em and b tag to strong.
35  * Improved PicoContainerFactory with NanoContainer scripts.
36  *
37  * Revision 1.2 2005/04/09 17:19:46 colinmacleod
38  * Changed copyright text to GPL v2 explicitly.
39  *
40  * Revision 1.1.1.1 2005/03/10 17:52:05 colinmacleod
41  * Restructured ivata op around Hibernate/PicoContainer.
42  * Renamed ivata groupware.
43  *
44  * Revision 1.6 2004/11/12 18:19:15 colinmacleod
45  * Change action and form classes to extend MaskAction, MaskForm respectively.
46  *
47  * Revision 1.5 2004/07/13 19:47:29 colinmacleod
48  * Moved project to POJOs from EJBs.
49  * Applied PicoContainer to services layer (replacing session EJBs).
50  * Applied Hibernate to persistence layer (replacing entity EJBs).
51  *
52  * Revision 1.4 2004/03/21 21:16:29 colinmacleod
53  * Shortened name to ivata op.
54  *
55  * Revision 1.3 2004/02/10 19:57:24 colinmacleod
56  * Changed email address.
57  *
58  * Revision 1.2 2004/02/01 22:07:31 colinmacleod
59  * Added full names to author tags
60  *
61  * Revision 1.1.1.1 2004/01/27 20:58:42 colinmacleod
62  * Moved ivata openportal to SourceForge..
63  *
64  * Revision 1.2 2003/10/15 14:16:53 colin
65  * fixing for XDoclet
66  *
67  * Revision 1.1 2003/07/08 06:31:33 peter
68  * added to cvs
69  * -----------------------------------------------------------------------------
70  */

71 package com.ivata.groupware.business.library.struts;
72
73 import java.util.HashMap JavaDoc;
74 import java.util.Map JavaDoc;
75 import java.util.Vector JavaDoc;
76
77 import javax.servlet.http.HttpServletRequest JavaDoc;
78 import javax.servlet.http.HttpSession JavaDoc;
79
80 import org.apache.struts.upload.FormFile;
81
82 import com.ivata.mask.Mask;
83 import com.ivata.mask.validation.ValidationErrors;
84 import com.ivata.mask.web.struts.DialogForm;
85
86
87 /**
88  * <p>Library image upload form. It's used when there are some local
89  * images
90  * in the uploaded HTML for library document.</p>
91  *
92  * @since 2003-07-04
93  * @author Peter Illes
94  * @version $Revision: 1.3 $
95  */

96 public class UploadImagesForm extends DialogForm {
97
98     /**
99      * <p><code>Map</code> storing the version comments of images</p>
100      */

101     private Map JavaDoc comment = new HashMap JavaDoc();
102     /**
103      * <p><code>Map</code> of <code>FormFile</code>s, the uploaded
104      * images</p>
105      */

106     private Map JavaDoc image = new HashMap JavaDoc();
107
108     /**
109      * <p><code>Vector</code> holding the names of images to upload</p>
110      */

111     private Vector JavaDoc imageFileName = null;
112     /**
113      * <p>
114      * Defines the base class of all objects in the value object list.
115      * </p>
116      */

117     private Class JavaDoc baseClass;
118     /**
119      * <p>
120      * Mask containing all the field definitions for this list.
121      * </p>
122      */

123     private Mask mask;
124
125     /**
126      * TODO
127      *
128      * @see com.ivata.mask.web.struts.MaskForm#clear()
129      */

130     protected void clear() {
131         // TODO Auto-generated method stub
132

133     }
134
135     /**
136      * <p>comments for uploaded images</p>
137      * @param index the index in the vector
138      * @return the comment with the given index
139      */

140     public final String JavaDoc getComment(final String JavaDoc index) {
141         return (String JavaDoc) comment.get(index);
142     }
143
144     /**
145      * <p><code>Vector</code> of <code>FormFile</code>s, the uploaded
146      * images</p>
147      * @param index
148      * @return null , file input type can't be get to jsp
149      */

150     public final FormFile getImage(final String JavaDoc index) {
151         return null;
152     }
153
154     /**
155      * <p><code>Vector</code> holding the names of images to upload</p>
156      * @return <code> <code>Vector</code> holding the names of images to
157      * upload
158      */

159     public final Vector JavaDoc getImageFileName() {
160         return imageFileName;
161     }
162
163     /**
164      * <p>returns all uploaded images</p>
165      * @return all uploaded images
166      */

167     public final Map JavaDoc getImages() {
168         return image;
169     }
170
171     /**
172      * <p>comment for uploaded image</p>
173      * @param index the index in the vector
174      * @comment the version comment
175      */

176     public final void setComment(final String JavaDoc index,
177             final String JavaDoc comment) {
178         this.comment.put(index, comment);
179     }
180
181     /**
182      * <p><code>Vector</code> of <code>FormFile</code>s, the uploaded
183      * images</p>
184      * @param index
185      * @param image the uploaded file
186      */

187     public final void setImage(final String JavaDoc index,
188             final FormFile image) {
189         this.image.put(index, image);
190     }
191
192     /**
193      * <p><code>Vector</code> holding the names of images to upload</p>
194      * @param imageFileName <code> <code>Vector</code> holding the names
195      * of images to upload
196      */

197     public final void setImageFileName(final Vector JavaDoc imageFileName) {
198         this.imageFileName = imageFileName;
199     }
200
201     /**
202      * TODO
203      *
204      * @see com.ivata.mask.web.struts.MaskForm#validate(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpSession)
205      */

206     public ValidationErrors validate(final HttpServletRequest JavaDoc request,
207             final HttpSession JavaDoc session) {
208         // TODO Auto-generated method stub
209
return null;
210     }
211
212     /**
213      * <p>
214      * Defines the base class of all objects in the value object list.
215      * </p>
216      *
217      * @return base class of all objects in the value object list.
218      */

219     public final Class JavaDoc getBaseClass() {
220         return baseClass;
221     }
222
223     /**
224      * <p>
225      * Mask containing all the field definitions for this list.
226      * </p>
227      *
228      * @return mask containing all the field definitions for this list.
229      */

230     public final Mask getMask() {
231         return mask;
232     }
233 }
234
Popular Tags