Source Code Cross Referenced for DemoRequestForm.java in  » GIS » GeoServer » org » vfny » geoserver » form » 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 
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;
006:
007:        import org.apache.struts.action.ActionErrors;
008:        import org.apache.struts.action.ActionForm;
009:        import org.apache.struts.action.ActionMapping;
010:        import org.vfny.geoserver.global.GeoserverDataDirectory;
011:        import java.io.File;
012:        import java.util.ArrayList;
013:        import java.util.Collections;
014:        import java.util.List;
015:        import java.util.logging.Level;
016:        import java.util.logging.Logger;
017:        import javax.servlet.ServletContext;
018:        import javax.servlet.http.HttpServletRequest;
019:
020:        /**
021:         * <b>DemoRequestForm</b><br>
022:         * Oct 7, 2005<br>
023:         *
024:         * <b>Purpose:</b><br>
025:         * DemoForm collects the list of avialable requests for the demo.
026:         * <p>
027:         * Stores the request & post for the demo page, to be used by the DemoAction.
028:         * </p>
029:         *
030:         * @author jgarnett, Refractions Research, Inc.
031:         * @author Brent Owens (The Open Planning Project)
032:         * @version
033:         */
034:        public class DemoRequestForm extends ActionForm {
035:            private static final Logger LOGGER = org.geotools.util.logging.Logging
036:                    .getLogger("org.vfny.geoserver.form");
037:            private String action;
038:            private String url;
039:            private String body;
040:            private String demo;
041:            private String username;
042:            private String password;
043:            private File dir;
044:            List demoList;
045:
046:            /**
047:             * Sets request & post based on file selection.
048:             *
049:             * @see org.apache.struts.action.ActionForm#reset(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest)
050:             *
051:             * @param arg0
052:             * @param request
053:             */
054:            public void reset(ActionMapping arg0, HttpServletRequest request) {
055:                super .reset(arg0, request);
056:
057:                ServletContext context = getServlet().getServletContext();
058:                demoList = new ArrayList();
059:                demoList.add("");
060:
061:                //DJB: changed this for geoserver_data_dir 
062:                // this.dir = new File(context.getRealPath("/data/demo"));
063:                try {
064:                    this .dir = GeoserverDataDirectory
065:                            .findCreateConfigDir("demo/");
066:
067:                    //commented out, findConfigDir does this for us.    
068:                    //if( dir.exists() && dir.isDirectory() ){
069:                    File[] files = dir.listFiles();
070:
071:                    for (int i = 0; i < files.length; i++) {
072:                        File file = files[i];
073:
074:                        if (!file.isDirectory()) {
075:                            demoList.add(file.getName());
076:                        }
077:                    }
078:                } catch (org.vfny.geoserver.global.ConfigurationException confE) {
079:                    if (LOGGER.isLoggable(Level.FINE)) {
080:                        LOGGER.fine(new StringBuffer("Conf e: ").append(confE)
081:                                .toString());
082:                    }
083:
084:                    //eat this, no demo dir, so we just don't get any demo requests.
085:                }
086:
087:                Collections.sort(demoList);
088:            }
089:
090:            /**
091:             *
092:             * Verifies that username is not null or empty.
093:             * Could potentially do the same for password later.
094:             *
095:             * @see org.apache.struts.action.ActionForm#validate(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest)
096:             *
097:             * @param mapping
098:             * @param request
099:             * @return
100:             */
101:            public ActionErrors validate(ActionMapping mapping,
102:                    HttpServletRequest request) {
103:                ActionErrors errors = new ActionErrors();
104:
105:                return errors;
106:            }
107:
108:            /**
109:             * @return Returns the demo.
110:             */
111:            public String getDemo() {
112:                return demo;
113:            }
114:
115:            /**
116:             * @param demo The demo to set.
117:             */
118:            public void setDemo(String demo) {
119:                this .demo = demo;
120:            }
121:
122:            /**
123:             * @return Returns the dir.
124:             */
125:            public File getDir() {
126:                return dir;
127:            }
128:
129:            /**
130:             * @return Returns the url.
131:             */
132:            public String getUrl() {
133:                return url;
134:            }
135:
136:            /**
137:             * @param url The url to set.
138:             */
139:            public void setUrl(String url) {
140:                this .url = url;
141:            }
142:
143:            /**
144:             * @return Returns the demoList.
145:             */
146:            public List getDemoList() {
147:                return demoList;
148:            }
149:
150:            /**
151:             * @return Returns the action.
152:             */
153:            public String getAction() {
154:                return action;
155:            }
156:
157:            /**
158:             * @param action The action to set.
159:             */
160:            public void setAction(String action) {
161:                this .action = action;
162:            }
163:
164:            /**
165:             * @return Returns the body.
166:             */
167:            public String getBody() {
168:                return body;
169:            }
170:
171:            /**
172:             * @param body The body to set.
173:             */
174:            public void setBody(String body) {
175:                this .body = body;
176:            }
177:
178:            public String getPassword() {
179:                return password;
180:            }
181:
182:            public void setPassword(String password) {
183:                this .password = password;
184:            }
185:
186:            public String getUsername() {
187:                return username;
188:            }
189:
190:            public void setUsername(String username) {
191:                this.username = username;
192:            }
193:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.