Source Code Cross Referenced for DataNamespacesSelectForm.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:        /*
002:         * Created on Feb 16, 2004
003:         *
004:         * To change the template for this generated file go to
005:         * Window - Preferences - Java - Code Generation - Code and Comments
006:         */
007:        package org.vfny.geoserver.form.data;
008:
009:        import org.apache.struts.action.ActionErrors;
010:        import org.apache.struts.action.ActionForm;
011:        import org.apache.struts.action.ActionMapping;
012:        import org.vfny.geoserver.config.ConfigRequests;
013:        import org.vfny.geoserver.config.DataConfig;
014:        import org.vfny.geoserver.global.UserContainer;
015:        import org.vfny.geoserver.util.Requests;
016:        import java.util.TreeSet;
017:        import javax.servlet.http.HttpServletRequest;
018:
019:        /**
020:         * DataNamespacesSelectForm
021:         * <p>
022:         * @author rgould, Refractions Research, Inc.
023:         * @author $Author: emperorkefka $ (last modification)
024:         * @version $Id: DataNamespacesSelectForm.java 6177 2007-02-19 10:11:27Z aaime $
025:         */
026:        public class DataNamespacesSelectForm extends ActionForm {
027:            /** namespace the user selected (value is a prefix) */
028:            private String selectedNamespace;
029:
030:            /** Action the user clicked on */
031:            private String action;
032:            private TreeSet namespaces;
033:
034:            public void reset(ActionMapping arg0, HttpServletRequest request) {
035:                super .reset(arg0, request);
036:
037:                action = "";
038:
039:                UserContainer user = Requests.getUserContainer(request);
040:
041:                if (user == null) {
042:                    return; // User not logged in, probably the JSPCompiler
043:                }
044:
045:                selectedNamespace = user.getPrefix();
046:
047:                // populate and sort available namespaces
048:                //
049:                DataConfig config = ConfigRequests.getDataConfig(request);
050:                namespaces = new TreeSet(config.getNameSpaces().keySet());
051:
052:                String def = config.getDefaultNameSpace().getPrefix();
053:
054:                if (namespaces.contains(def)) {
055:                    namespaces.remove(def);
056:                    namespaces.add(def + "*");
057:                }
058:            }
059:
060:            public ActionErrors validate(ActionMapping mapping,
061:                    HttpServletRequest request) {
062:                ActionErrors errors = new ActionErrors();
063:
064:                if ((getSelectedNamespace() == null)
065:                        || getSelectedNamespace().equalsIgnoreCase("")) {
066:                    return errors; // no data in the list, so return
067:                }
068:
069:                return errors;
070:            }
071:
072:            /**
073:             * Access action property.
074:             *
075:             * @return Returns the action.
076:             */
077:            public String getAction() {
078:                return action;
079:            }
080:
081:            /**
082:             * Set action to action.
083:             *
084:             * @param action The action to set.
085:             */
086:            public void setAction(String action) {
087:                this .action = action;
088:            }
089:
090:            /**
091:             * Access selectedNamespace property.
092:             *
093:             * @return Returns the selectedNamespace.
094:             */
095:            public String getSelectedNamespace() {
096:                return selectedNamespace;
097:            }
098:
099:            /**
100:             * Set selectedNamespace to selectedNamespace.
101:             *
102:             * @param selectedNamespace The selectedNamespace to set.
103:             */
104:            public void setSelectedNamespace(String selectedNamespace) {
105:                this .selectedNamespace = selectedNamespace;
106:            }
107:
108:            /**
109:             * Access namespaces property.
110:             *
111:             * @return Returns the namespaces.
112:             */
113:            public TreeSet getNamespaces() {
114:                return namespaces;
115:            }
116:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.