Source Code Cross Referenced for DemoForm.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 javax.servlet.ServletContext;
016:        import javax.servlet.http.HttpServletRequest;
017:
018:        /**
019:         * DemoForm collects the list of avialable requests for the demo.
020:         * <p>
021:         * Stores the request & post for the demo page, to be used by the DemoAction.
022:         * </p>
023:         *
024:         * @author jgarnett, Refractions Research, Inc.
025:         * @author $Author: jive $ (last modification)
026:         * @version $Id: DemoForm.java 6326 2007-03-15 18:36:40Z jdeolive $
027:         */
028:        public class DemoForm extends ActionForm {
029:            /**
030:             * Comment for <code>serialVersionUID</code>
031:             */
032:            private static final long serialVersionUID = 3978983293029005618L;
033:
034:            /**
035:             *
036:             * @uml.property name="action" multiplicity="(0 1)"
037:             */
038:            private String action;
039:
040:            /**
041:             *
042:             * @uml.property name="url" multiplicity="(0 1)"
043:             */
044:            private String url;
045:
046:            /**
047:             *
048:             * @uml.property name="body" multiplicity="(0 1)"
049:             */
050:            private String body;
051:
052:            /**
053:             *
054:             * @uml.property name="demo" multiplicity="(0 1)"
055:             */
056:            private String demo;
057:
058:            /**
059:             *
060:             * @uml.property name="dir" multiplicity="(0 1)"
061:             */
062:            private File dir;
063:
064:            /**
065:             *
066:             * @uml.property name="demoList"
067:             * @uml.associationEnd elementType="java.lang.String" multiplicity="(0 -1)"
068:             */
069:            List demoList;
070:
071:            /**
072:             * Sets request & post based on file selection.
073:             *
074:             * @see org.apache.struts.action.ActionForm#reset(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest)
075:             *
076:             * @param arg0
077:             * @param request
078:             */
079:            public void reset(ActionMapping arg0, HttpServletRequest request) {
080:                super .reset(arg0, request);
081:
082:                ServletContext context = getServlet().getServletContext();
083:                //DJB: changed this for geoserver_data_dir 
084:                // this.dir = new File(context.getRealPath("/data/demo"));
085:                this .dir = new File(GeoserverDataDirectory
086:                        .getGeoserverDataDirectory(), "/data/demo");
087:                demoList = new ArrayList();
088:                demoList.add("");
089:
090:                if (dir.exists() && dir.isDirectory()) {
091:                    File[] files = dir.listFiles();
092:
093:                    for (int i = 0; i < files.length; i++) {
094:                        File file = files[i];
095:                        demoList.add(file.getName());
096:                    }
097:                }
098:
099:                Collections.sort(demoList);
100:            }
101:
102:            /**
103:             *
104:             * Verifies that username is not null or empty.
105:             * Could potentially do the same for password later.
106:             *
107:             * @see org.apache.struts.action.ActionForm#validate(org.apache.struts.action.ActionMapping, javax.servlet.http.HttpServletRequest)
108:             *
109:             * @param mapping
110:             * @param request
111:             * @return
112:             */
113:            public ActionErrors validate(ActionMapping mapping,
114:                    HttpServletRequest request) {
115:                ActionErrors errors = new ActionErrors();
116:
117:                return errors;
118:            }
119:
120:            /**
121:             * @return Returns the demo.
122:             *
123:             * @uml.property name="demo"
124:             */
125:            public String getDemo() {
126:                return demo;
127:            }
128:
129:            /**
130:             * @param demo The demo to set.
131:             *
132:             * @uml.property name="demo"
133:             */
134:            public void setDemo(String demo) {
135:                this .demo = demo;
136:            }
137:
138:            /**
139:             * @return Returns the dir.
140:             *
141:             * @uml.property name="dir"
142:             */
143:            public File getDir() {
144:                return dir;
145:            }
146:
147:            /**
148:             * @return Returns the url.
149:             *
150:             * @uml.property name="url"
151:             */
152:            public String getUrl() {
153:                return url;
154:            }
155:
156:            /**
157:             * @param url The url to set.
158:             *
159:             * @uml.property name="url"
160:             */
161:            public void setUrl(String url) {
162:                this .url = url;
163:            }
164:
165:            /**
166:             * @return Returns the demoList.
167:             *
168:             * @uml.property name="demoList"
169:             */
170:            public List getDemoList() {
171:                return demoList;
172:            }
173:
174:            /**
175:             * @return Returns the action.
176:             *
177:             * @uml.property name="action"
178:             */
179:            public String getAction() {
180:                return action;
181:            }
182:
183:            /**
184:             * @param action The action to set.
185:             *
186:             * @uml.property name="action"
187:             */
188:            public void setAction(String action) {
189:                this .action = action;
190:            }
191:
192:            /**
193:             * @return Returns the body.
194:             *
195:             * @uml.property name="body"
196:             */
197:            public String getBody() {
198:                return body;
199:            }
200:
201:            /**
202:             * @param body The body to set.
203:             *
204:             * @uml.property name="body"
205:             */
206:            public void setBody(String body) {
207:                this.body = body;
208:            }
209:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.