Source Code Cross Referenced for CoverageStoresNewForm.java in  » GIS » GeoServer » org » vfny » geoserver » form » data » 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 » GIS » GeoServer » org.vfny.geoserver.form.data 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org.  All rights reserved.
002:         * This code is licensed under the GPL 2.0 license, availible at the root
003:         * application directory.
004:         */
005:        package org.vfny.geoserver.form.data;
006:
007:        import org.apache.struts.action.ActionError;
008:        import org.apache.struts.action.ActionErrors;
009:        import org.apache.struts.action.ActionForm;
010:        import org.apache.struts.action.ActionMapping;
011:        import org.vfny.geoserver.util.CoverageStoreUtils;
012:        import java.util.List;
013:        import java.util.SortedSet;
014:        import java.util.TreeSet;
015:        import java.util.regex.Pattern;
016:        import javax.servlet.http.HttpServletRequest;
017:
018:        /**
019:         * Used to accept information from user for a New DataFormat Action.
020:         *
021:         * @author User, Refractions Research, Inc.
022:         * @author jive
023:         * @author $Author: Alessio Fabiani (alessio.fabiani@gmail.com) $ (last
024:         *         modification)
025:         * @author $Author: Simone Giannecchini (simboss1@gmail.com) $ (last
026:         *         modification)
027:         */
028:        public final class CoverageStoresNewForm extends ActionForm {
029:            /**
030:             *
031:             */
032:            private static final long serialVersionUID = -7723738069176272163L;
033:
034:            /**
035:             * Description provided by selected Dataformat GDSFactory
036:             */
037:            private String selectedDescription;
038:
039:            /**
040:             * User provided dataFormatID
041:             */
042:            private String dataFormatID;
043:            private List formatDescriptions;
044:
045:            /**
046:             * Default state of New form
047:             *
048:             * @param mapping
049:             *            DOCUMENT ME!
050:             * @param request
051:             *            DOCUMENT ME!
052:             */
053:            public void reset(ActionMapping mapping, HttpServletRequest request) {
054:                super .reset(mapping, request);
055:                selectedDescription = "";
056:                dataFormatID = "";
057:                formatDescriptions = CoverageStoreUtils
058:                        .listDataFormatsDescriptions();
059:            }
060:
061:            /**
062:             * Check NewForm for correct use
063:             *
064:             * @param mapping
065:             *            DOCUMENT ME!
066:             * @param request
067:             *            DOCUMENT ME!
068:             *
069:             * @return DOCUMENT ME!
070:             */
071:            public ActionErrors validate(ActionMapping mapping,
072:                    HttpServletRequest request) {
073:                ActionErrors errors = new ActionErrors();
074:
075:                if (!getDataFormatDescriptions().contains(
076:                        getSelectedDescription())) {
077:                    errors.add("selectedDescription", new ActionError(
078:                            "error.dataFormatFactory.invalid",
079:                            getSelectedDescription()));
080:                }
081:
082:                if ((getDataFormatID() == null) || getDataFormatID().equals("")) {
083:                    errors.add("dataFormatID", new ActionError(
084:                            "error.dataFormatId.required", getDataFormatID()));
085:                } else if (!Pattern.matches("^\\w(\\w|\\.)*$",
086:                        getDataFormatID())) {
087:                    errors.add("dataFormatID", new ActionError(
088:                            "error.dataFormatId.invalid", getDataFormatID()));
089:                }
090:
091:                return errors;
092:            }
093:
094:            /**
095:             *
096:             */
097:            public String getDataFormatID() {
098:                return dataFormatID;
099:            }
100:
101:            /**
102:             *
103:             */
104:            public String getSelectedDescription() {
105:                return selectedDescription;
106:            }
107:
108:            /**
109:             *
110:             */
111:            public void setDataFormatID(String string) {
112:                dataFormatID = string;
113:            }
114:
115:            /**
116:             *
117:             */
118:            public void setSelectedDescription(String string) {
119:                selectedDescription = string;
120:            }
121:
122:            /*
123:             * Allows the JSP page to easily access the list of dataFormat Descriptions
124:             */
125:            public SortedSet getDataFormatDescriptions() {
126:                return new TreeSet(formatDescriptions);
127:            }
128:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.