Source Code Cross Referenced for MaskForm.java in  » Development » ivatamasks » com » ivata » mask » web » struts » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Development » ivatamasks » com.ivata.mask.web.struts 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright (c) 2001 - 2005 ivata limited.
003:         * All rights reserved.
004:         * -----------------------------------------------------------------------------
005:         * ivata masks may be redistributed under the GNU General Public
006:         * License as published by the Free Software Foundation;
007:         * version 2 of the License.
008:         *
009:         * These programs are free software; you can redistribute them and/or
010:         * modify them under the terms of the GNU General Public License
011:         * as published by the Free Software Foundation; version 2 of the License.
012:         *
013:         * These programs are distributed in the hope that they will be useful,
014:         * but WITHOUT ANY WARRANTY; without even the implied warranty of
015:         * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
016:         *
017:         * See the GNU General Public License in the file LICENSE.txt for more
018:         * details.
019:         *
020:         * If you would like a copy of the GNU General Public License write to
021:         *
022:         * Free Software Foundation, Inc.
023:         * 59 Temple Place - Suite 330
024:         * Boston, MA 02111-1307, USA.
025:         *
026:         *
027:         * To arrange commercial support and licensing, contact ivata at
028:         *                  http://www.ivata.com/contact.jsp
029:         * -----------------------------------------------------------------------------
030:         * $Log: MaskForm.java,v $
031:         * Revision 1.12  2005/10/12 18:36:58  colinmacleod
032:         * Standardized format of Logger declaration - to make it easier to find instances
033:         * which are not both static and final.
034:         *
035:         * Revision 1.11  2005/10/11 18:54:06  colinmacleod
036:         * Fixed some checkstyle and javadoc issues.
037:         *
038:         * Revision 1.10  2005/10/03 10:17:25  colinmacleod
039:         * Fixed some style and javadoc issues.
040:         *
041:         * Revision 1.9  2005/10/02 14:06:34  colinmacleod
042:         * Added/improved log4j logging.
043:         *
044:         * Revision 1.8  2005/09/29 12:17:35  colinmacleod
045:         * Moved resourceFieldPath from InputMaskForm to MaskForm.
046:         *
047:         * Revision 1.7  2005/04/11 14:50:28  colinmacleod
048:         * Renamed MaskRequestProcessorConstants
049:         * to FieldValueConvertorConstants.
050:         *
051:         * Revision 1.6  2005/04/09 18:04:19  colinmacleod
052:         * Changed copyright text to GPL v2 explicitly.
053:         *
054:         * Revision 1.5  2005/03/10 10:44:35  colinmacleod
055:         * Fixed validation conversion of Struts classes to
056:         * ivata masks validation errors.
057:         *
058:         * Revision 1.4  2005/01/19 13:14:02  colinmacleod
059:         * Renamed CausedByException to SystemException.
060:         *
061:         * Revision 1.3  2005/01/07 08:08:24  colinmacleod
062:         * Moved up a version number.
063:         * Changed copyright notices to 2005.
064:         * Updated the documentation:
065:         *   - started working on multiproject:site docu.
066:         *   - changed the logo.
067:         * Added checkstyle and fixed LOADS of style issues.
068:         * Added separate thirdparty subproject.
069:         * Added struts (in web), util and webgui (in webtheme) from ivata op.
070:         *
071:         * Revision 1.2  2004/12/23 21:28:32  colinmacleod
072:         * Modifications to add ivata op compatibility.
073:         *
074:         * Revision 1.1.1.1  2004/05/16 20:40:32  colinmacleod
075:         * Ready for 0.1 release
076:         * -----------------------------------------------------------------------------
077:         */
078:        package com.ivata.mask.web.struts;
079:
080:        import org.apache.log4j.Logger;
081:
082:        import javax.naming.OperationNotSupportedException;
083:        import javax.servlet.http.HttpServletRequest;
084:        import javax.servlet.http.HttpSession;
085:
086:        import com.ivata.mask.Mask;
087:        import com.ivata.mask.field.FieldValueConvertorConstants;
088:        import com.ivata.mask.validation.ValidationErrors;
089:
090:        /**
091:         * <p>
092:         * This form is the base class of all forms containing mask information.
093:         * </p>
094:         *
095:         * @since ivata masks 0.1.1 (2005-05-16)
096:         * @author Colin MacLeod
097:         * <a href='mailto:colin.macleod@ivata.com'>colin.macleod@ivata.com</a>
098:         * @version $Revision: 1.12 $
099:         */
100:        public abstract class MaskForm extends DialogForm {
101:            /**
102:             * Logger for this class.
103:             */
104:            private static final Logger logger = Logger
105:                    .getLogger(MaskForm.class);
106:
107:            /**
108:             * <p>
109:             * Defines the base class of all objects in the value object list.
110:             * </p>
111:             */
112:            private Class baseClass;
113:            /**
114:             * <p>
115:             * Mask containing all the field definitions for this list.
116:             * </p>
117:             */
118:            private Mask mask;
119:            /**
120:             * <copyDoc>Refer to {@link #getResourceFieldPath}.</copyDoc>
121:             */
122:            private String resourceFieldPath;
123:
124:            /**
125:             * <p>
126:             * Construct an instance of this class.
127:             * </p>
128:             *
129:             * @param maskParam
130:             *            mask associated with this form.
131:             * @param baseClassParam
132:             *            base class of all value objects in this form.
133:             */
134:            protected MaskForm(final Mask maskParam, final Class baseClassParam) {
135:                this .mask = maskParam;
136:                this .baseClass = baseClassParam;
137:            }
138:
139:            /**
140:             * <copyDoc>Refer to {@link }.</copyDoc>
141:             *
142:             * @throws OperationNotSupportedException
143:             * @see com.ivata.mask.web.struts.DialogForm#clear()
144:             */
145:            protected void clear() throws OperationNotSupportedException {
146:                if (logger.isDebugEnabled()) {
147:                    logger.debug("clear() - start");
148:                }
149:
150:                // TODO Auto-generated method stub
151:
152:                if (logger.isDebugEnabled()) {
153:                    logger.debug("clear() - end");
154:                }
155:            }
156:
157:            /**
158:             * <p>
159:             * Defines the base class of all objects in the value object list.
160:             * </p>
161:             *
162:             * @return base class of all objects in the value object list.
163:             */
164:            public final Class getBaseClass() {
165:                if (logger.isDebugEnabled()) {
166:                    logger.debug("getBaseClass() - start");
167:                }
168:
169:                if (logger.isDebugEnabled()) {
170:                    logger.debug("getBaseClass() - end - return value = "
171:                            + baseClass);
172:                }
173:                return baseClass;
174:            }
175:
176:            /**
177:             * <p>
178:             * Mask containing all the field definitions for this list.
179:             * </p>
180:             *
181:             * @return mask containing all the field definitions for this list.
182:             */
183:            public final Mask getMask() {
184:                if (logger.isDebugEnabled()) {
185:                    logger.debug("getMask() - start");
186:                }
187:
188:                if (logger.isDebugEnabled()) {
189:                    logger.debug("getMask() - end - return value = " + mask);
190:                }
191:                return mask;
192:            }
193:
194:            /**
195:             * This method overridden to retrieve errors from the request processor.
196:             * This will allocate any errors which occurred as the form was set.
197:             *
198:             * @param requestParam {@inheritDoc}
199:             * @param sessionParam {@inheritDoc}
200:             * @return errors from the super class, with errors from the request
201:             * (if any). Never returns <code>null</code>.
202:             */
203:            public ValidationErrors validate(
204:                    final HttpServletRequest requestParam,
205:                    final HttpSession sessionParam) {
206:                if (logger.isDebugEnabled()) {
207:                    logger.debug("validate(HttpServletRequest requestParam = "
208:                            + requestParam + ", HttpSession sessionParam = "
209:                            + sessionParam + ") - start");
210:                }
211:
212:                ValidationErrors super Errors = super .validate(requestParam,
213:                        sessionParam);
214:
215:                // first get any validation errors from the request - these are set
216:                // by the request processor for masks.
217:                ValidationErrors requestErrors = (ValidationErrors) requestParam
218:                        .getAttribute(FieldValueConvertorConstants.ERROR_REQUEST_ATTRIBUTE);
219:                if (requestErrors != null) {
220:                    super Errors.addAll(requestErrors);
221:                }
222:
223:                if (logger.isDebugEnabled()) {
224:                    logger.debug("validate - end - return value = "
225:                            + super Errors);
226:                }
227:                return super Errors;
228:            }
229:
230:            /**
231:             * <p>
232:             * The resource field path is the &quot;stem&quot; - the first string before
233:             * the dot separator (.) - in the application resources for the fields in
234:             * this form.
235:             * </p>
236:             * <p>
237:             * For example, in a form for editing group information this might be simply
238:             * <b>&quot;group&quot;</b>, and the message resource key for the group
239:             * parent field would then be specified in the
240:             * <code>ApplicationResources.properties</code> file as
241:             * <b>&quot;group.field.parent&quot;</b> (without the quotes).
242:             * </p>
243:             * @return Returns the path to application resources for this form.
244:             */
245:            public String getResourceFieldPath() {
246:                if (logger.isDebugEnabled()) {
247:                    logger.debug("getResourceFieldPath() - start");
248:                }
249:
250:                if (logger.isDebugEnabled()) {
251:                    logger
252:                            .debug("getResourceFieldPath() - end - return value = "
253:                                    + resourceFieldPath);
254:                }
255:                return resourceFieldPath;
256:            }
257:
258:            /**
259:             * <copyDoc>Refer to {@link #getResourceFieldPath}.</copyDoc>
260:             * @param resourceFieldPathParam
261:             *  <copyDoc>Refer to {@link #getResourceFieldPath}.</copyDoc>
262:             */
263:            public void setResourceFieldPath(final String resourceFieldPathParam) {
264:                if (logger.isDebugEnabled()) {
265:                    logger.debug("setResourceFieldPath before: '"
266:                            + resourceFieldPath + "', after: '"
267:                            + resourceFieldPathParam + "'");
268:                }
269:
270:                resourceFieldPath = resourceFieldPathParam;
271:
272:                if (logger.isDebugEnabled()) {
273:                    logger.debug("setResourceFieldPath(String) - end");
274:                }
275:            }
276:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.