Source Code Cross Referenced for DataDataStoresNewForm.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.DataStoreUtils;
012:        import java.util.Collections;
013:        import java.util.List;
014:        import java.util.SortedSet;
015:        import java.util.TreeSet;
016:        import java.util.regex.Pattern;
017:        import javax.servlet.http.HttpServletRequest;
018:
019:        /**
020:         * Used to accept information from user for a New DataStore Action.
021:         *
022:         * <p>
023:         * This form contains a convience property getDataStoreDescrptions() which is
024:         * simply to make writing the JSP easier.
025:         * </p>
026:         *
027:         * @author User, Refractions Research, Inc.
028:         * @author $Author: jive $ (last modification)
029:         * @version $Id: DataDataStoresNewForm.java 8471 2008-02-27 14:41:37Z aaime $
030:         */
031:        public class DataDataStoresNewForm extends ActionForm {
032:            private static final Pattern idPattern = Pattern.compile("^\\a$");
033:
034:            /** Description provided by selected Datastore Factory */
035:            private String selectedDescription;
036:
037:            /** User provided dataStoreID */
038:            private String dataStoreID;
039:
040:            /**
041:             * Default state of New form
042:             *
043:             * @param mapping DOCUMENT ME!
044:             * @param request DOCUMENT ME!
045:             */
046:            public void reset(ActionMapping mapping, HttpServletRequest request) {
047:                super .reset(mapping, request);
048:                selectedDescription = "";
049:                dataStoreID = "";
050:            }
051:
052:            /**
053:             * List of available DataStoreDescriptions.
054:             *
055:             * <p>
056:             * Convience method for DataStureUtils.listDataStoresDescriptions().
057:             * </p>
058:             *
059:             * @return Sorted set of DataStore Descriptions.
060:             */
061:            public List getDescriptions() {
062:                List descriptions = DataStoreUtils.listDataStoresDescriptions();
063:
064:                if ((descriptions == null) || descriptions.isEmpty()) {
065:                    return Collections.EMPTY_LIST;
066:                }
067:
068:                String enableVersioning = (String) getServlet()
069:                        .getServletContext().getInitParameter(
070:                                "enableVersioning");
071:                if (enableVersioning == null
072:                        || !"TRUE".equals(enableVersioning.toUpperCase())) {
073:                    descriptions.remove("Versioning Postgis");
074:                }
075:                return descriptions;
076:            }
077:
078:            /**
079:             * Check NewForm for correct use
080:             *
081:             * @param mapping DOCUMENT ME!
082:             * @param request DOCUMENT ME!
083:             *
084:             * @return DOCUMENT ME!
085:             */
086:            public ActionErrors validate(ActionMapping mapping,
087:                    HttpServletRequest request) {
088:                ActionErrors errors = new ActionErrors();
089:
090:                if (!getDescriptions().contains(getSelectedDescription())) {
091:                    errors.add("selectedDescription", new ActionError(
092:                            "error.dataStoreFactory.invalid",
093:                            getSelectedDescription()));
094:                }
095:
096:                if ((getDataStoreID() == null) || getDataStoreID().equals("")) {
097:                    errors.add("dataStoreID", new ActionError(
098:                            "error.dataStoreId.required", getDataStoreID()));
099:                } else if (!Pattern
100:                        .matches("^\\w(\\w|\\.)*$", getDataStoreID())) {
101:                    errors.add("dataStoreID", new ActionError(
102:                            "error.dataStoreId.invalid", getDataStoreID()));
103:                }
104:
105:                return errors;
106:            }
107:
108:            public String getDataStoreID() {
109:                return dataStoreID;
110:            }
111:
112:            public String getSelectedDescription() {
113:                return selectedDescription;
114:            }
115:
116:            public void setDataStoreID(String string) {
117:                dataStoreID = string;
118:            }
119:
120:            public void setSelectedDescription(String string) {
121:                selectedDescription = string;
122:            }
123:
124:            /*
125:             * Allows the JSP page to easily access the list of dataStore Descriptions
126:             */
127:            public SortedSet getDataStoreDescriptions() {
128:                return new TreeSet(getDescriptions());
129:            }
130:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.