Source Code Cross Referenced for WMSContentAction.java in  » GIS » GeoServer » org » vfny » geoserver » action » wms » 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.action.wms 
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.action.wms;
006:
007:        import java.io.IOException;
008:        import java.net.URL;
009:        import java.util.HashMap;
010:        import java.util.Iterator;
011:        import java.util.Locale;
012:
013:        import javax.servlet.ServletException;
014:        import javax.servlet.http.HttpServletRequest;
015:        import javax.servlet.http.HttpServletResponse;
016:
017:        import org.apache.struts.action.ActionError;
018:        import org.apache.struts.action.ActionErrors;
019:        import org.apache.struts.action.ActionForm;
020:        import org.apache.struts.action.ActionForward;
021:        import org.apache.struts.action.ActionMapping;
022:        import org.apache.struts.action.ActionMessage;
023:        import org.apache.struts.util.MessageResources;
024:        import org.geotools.geometry.GeneralEnvelope;
025:        import org.geotools.geometry.jts.ReferencedEnvelope;
026:        import org.geotools.referencing.CRS;
027:        import org.geotools.styling.Style;
028:        import org.opengis.referencing.FactoryException;
029:        import org.opengis.referencing.NoSuchAuthorityCodeException;
030:        import org.opengis.referencing.crs.CoordinateReferenceSystem;
031:        import org.opengis.referencing.operation.TransformException;
032:        import org.vfny.geoserver.action.ConfigAction;
033:        import org.vfny.geoserver.action.HTMLEncoder;
034:        import org.vfny.geoserver.config.WMSConfig;
035:        import org.vfny.geoserver.form.wms.WMSContentForm;
036:        import org.vfny.geoserver.global.CoverageInfo;
037:        import org.vfny.geoserver.global.Data;
038:        import org.vfny.geoserver.global.FeatureTypeInfo;
039:        import org.vfny.geoserver.global.MapLayerInfo;
040:        import org.vfny.geoserver.global.UserContainer;
041:
042:        /**
043:         * DOCUMENT ME!
044:         *
045:         * @author rgould To change the template for this generated type comment go to
046:         *         Window>Preferences>Java>Code Generation>Code and Comments
047:         */
048:        public final class WMSContentAction extends ConfigAction {
049:            public ActionForward execute(ActionMapping mapping,
050:                    ActionForm form, UserContainer user,
051:                    HttpServletRequest request, HttpServletResponse response)
052:                    throws IOException, ServletException {
053:                WMSContentForm contentForm = (WMSContentForm) form;
054:
055:                Locale locale = (Locale) request.getLocale();
056:                MessageResources messages = getResources(request);
057:                final String SUBMIT = HTMLEncoder.decode(messages.getMessage(
058:                        locale, "label.submit"));
059:                final String GENERATE_BBOX = HTMLEncoder.decode(messages
060:                        .getMessage(locale,
061:                                "config.data.calculateBoundingBox.label"));
062:                final String ADD_NEW_LAYERGROUP = "Add New Layer-Group";
063:                final String REMOVE_LAYERGROUP = "Remove";
064:
065:                String action = contentForm.getAction();
066:
067:                boolean enabled = contentForm.isEnabled();
068:
069:                if (contentForm.isEnabledChecked() == false) {
070:                    enabled = false;
071:                }
072:
073:                String onlineResource = contentForm.getOnlineResource();
074:
075:                WMSConfig config = getWMSConfig();
076:
077:                config.setEnabled(enabled);
078:                config.setOnlineResource(new URL(onlineResource));
079:
080:                if (SUBMIT.equals(action)) {
081:                    return executeSubmit(mapping, action, contentForm, config,
082:                            request, response);
083:                } else if (ADD_NEW_LAYERGROUP.equals(action)) {
084:                    return executeAddNewLayerGroup(mapping, action,
085:                            contentForm, config, request, response);
086:                } else if (action.startsWith(REMOVE_LAYERGROUP)) {
087:                    return executeRemoveLayerGroup(mapping, action,
088:                            contentForm, config, request, response);
089:                } else if (action.startsWith(GENERATE_BBOX)) {
090:                    return executeGenerateBBOX(mapping, action, contentForm,
091:                            config, request, response);
092:                }
093:
094:                return mapping.findForward("config.wms.content");
095:            }
096:
097:            private ActionForward executeGenerateBBOX(ActionMapping mapping,
098:                    String action, WMSContentForm contentForm,
099:                    WMSConfig config, HttpServletRequest request,
100:                    HttpServletResponse response) {
101:                HashMap layerMap = new HashMap();
102:                HashMap styleMap = new HashMap();
103:                HashMap envelopeMap = new HashMap();
104:
105:                int selectedLayerIndex = contentForm.getSelectedLayer();
106:
107:                int bmi;
108:                Iterator it;
109:
110:                for (bmi = 0, it = contentForm.getBaseMapTitles().iterator(); it
111:                        .hasNext(); bmi++) {
112:                    String baseMapTitle = (String) it.next();
113:
114:                    String baseMapLayers = (String) contentForm
115:                            .getBaseMapLayers().get(bmi);
116:                    String baseMapStyles = (String) contentForm
117:                            .getBaseMapStyles().get(bmi);
118:                    GeneralEnvelope envelope = (GeneralEnvelope) contentForm
119:                            .getBaseMapEnvelopes().get(bmi);
120:
121:                    /*
122:                     * System.out.println("******************* contentAction: title=" +
123:                     * baseMapTitle + ", layers=" + baseMapLayers + ", styles=" +
124:                     * baseMapStyles);
125:                     */
126:                    layerMap.put(baseMapTitle, baseMapLayers);
127:                    styleMap.put(baseMapTitle, baseMapStyles);
128:                    envelopeMap.put(baseMapTitle, envelope);
129:
130:                    if (selectedLayerIndex == bmi) {
131:
132:                        Data catalog = (Data) getServlet().getServletContext()
133:                                .getAttribute(Data.WEB_CONTAINER_KEY);
134:                        GeneralEnvelope selectedEnvelope = null;
135:                        String[] layerNames = baseMapLayers.split(",");
136:
137:                        for (int i = 0; i < layerNames.length; i++) {
138:                            String layerName = layerNames[i].trim();
139:
140:                            Integer layerType = (Integer) catalog
141:                                    .getLayerType(layerName);
142:
143:                            if (layerType != null) {
144:                                if (layerType.intValue() == MapLayerInfo.TYPE_VECTOR) {
145:                                    FeatureTypeInfo ftype = catalog
146:                                            .getFeatureTypeInfo(layerName);
147:                                    ftype = ((ftype != null) ? ftype
148:                                            : catalog
149:                                                    .getFeatureTypeInfo(layerName
150:                                                            .substring(
151:                                                                    layerName
152:                                                                            .indexOf(":") + 1,
153:                                                                    layerName
154:                                                                            .length())));
155:
156:                                    if (selectedEnvelope == null) {
157:                                        ReferencedEnvelope ftEnvelope = null;
158:
159:                                        try {
160:                                            if (ftype.getBoundingBox() instanceof  ReferencedEnvelope
161:                                                    && !ftype.getBoundingBox()
162:                                                            .isNull()) {
163:                                                ftEnvelope = (ReferencedEnvelope) ftype
164:                                                        .getBoundingBox();
165:                                            } else {
166:                                                // TODO Add Action Errors
167:                                                return mapping
168:                                                        .findForward("config.wms.content");
169:                                            }
170:                                        } catch (IOException e) {
171:                                            // TODO Add Action Errors
172:                                            return mapping
173:                                                    .findForward("config.wms.content");
174:                                        }
175:
176:                                        selectedEnvelope = new GeneralEnvelope(
177:                                                new double[] {
178:                                                        ftEnvelope.getMinX(),
179:                                                        ftEnvelope.getMinY() },
180:                                                new double[] {
181:                                                        ftEnvelope.getMaxX(),
182:                                                        ftEnvelope.getMaxY() });
183:                                        selectedEnvelope
184:                                                .setCoordinateReferenceSystem(ftEnvelope
185:                                                        .getCoordinateReferenceSystem());
186:                                    } else {
187:                                        final CoordinateReferenceSystem dstCRS = selectedEnvelope
188:                                                .getCoordinateReferenceSystem();
189:
190:                                        ReferencedEnvelope ftEnvelope = null;
191:
192:                                        try {
193:                                            if (ftype.getBoundingBox() instanceof  ReferencedEnvelope) {
194:                                                ftEnvelope = (ReferencedEnvelope) ftype
195:                                                        .getBoundingBox();
196:                                                ftEnvelope.transform(dstCRS,
197:                                                        true);
198:                                            } else {
199:                                                // TODO Add Action Errors
200:                                                return mapping
201:                                                        .findForward("config.wms.content");
202:                                            }
203:                                        } catch (TransformException e) {
204:                                            // TODO Add Action Errors
205:                                            return mapping
206:                                                    .findForward("config.wms.content");
207:                                        } catch (FactoryException e) {
208:                                            // TODO Add Action Errors
209:                                            return mapping
210:                                                    .findForward("config.wms.content");
211:                                        } catch (IOException e) {
212:                                            // TODO Add Action Errors
213:                                            return mapping
214:                                                    .findForward("config.wms.content");
215:                                        }
216:
217:                                        ReferencedEnvelope newEnvelope = new ReferencedEnvelope(
218:                                                dstCRS);
219:                                        newEnvelope.init(selectedEnvelope
220:                                                .getLowerCorner()
221:                                                .getOrdinate(0),
222:                                                selectedEnvelope
223:                                                        .getUpperCorner()
224:                                                        .getOrdinate(0),
225:                                                selectedEnvelope
226:                                                        .getLowerCorner()
227:                                                        .getOrdinate(1),
228:                                                selectedEnvelope
229:                                                        .getUpperCorner()
230:                                                        .getOrdinate(1));
231:
232:                                        newEnvelope.expandToInclude(ftEnvelope);
233:
234:                                        selectedEnvelope = new GeneralEnvelope(
235:                                                new double[] {
236:                                                        newEnvelope.getMinX(),
237:                                                        newEnvelope.getMinY() },
238:                                                new double[] {
239:                                                        newEnvelope.getMaxX(),
240:                                                        newEnvelope.getMaxY() });
241:                                        selectedEnvelope
242:                                                .setCoordinateReferenceSystem(dstCRS);
243:                                    }
244:                                } else if (layerType.intValue() == MapLayerInfo.TYPE_RASTER) {
245:                                    CoverageInfo cv = catalog
246:                                            .getCoverageInfo(layerName);
247:                                    cv = ((cv != null) ? cv
248:                                            : catalog
249:                                                    .getCoverageInfo(layerName
250:                                                            .substring(
251:                                                                    layerName
252:                                                                            .indexOf(":") + 1,
253:                                                                    layerName
254:                                                                            .length())));
255:
256:                                    if (selectedEnvelope == null) {
257:                                        selectedEnvelope = cv.getEnvelope();
258:                                    } else {
259:                                        final CoordinateReferenceSystem cvCRS = cv
260:                                                .getCrs();
261:                                        final CoordinateReferenceSystem dstCRS = selectedEnvelope
262:                                                .getCoordinateReferenceSystem();
263:
264:                                        ReferencedEnvelope cvEnvelope = new ReferencedEnvelope(
265:                                                cvCRS);
266:                                        cvEnvelope.init(cv.getEnvelope()
267:                                                .getLowerCorner()
268:                                                .getOrdinate(0), cv
269:                                                .getEnvelope().getUpperCorner()
270:                                                .getOrdinate(0), cv
271:                                                .getEnvelope().getLowerCorner()
272:                                                .getOrdinate(1), cv
273:                                                .getEnvelope().getUpperCorner()
274:                                                .getOrdinate(1));
275:
276:                                        try {
277:                                            cvEnvelope.transform(dstCRS, true);
278:                                        } catch (TransformException e) {
279:                                            // TODO Add Action Errors
280:                                            return mapping
281:                                                    .findForward("config.wms.content");
282:                                        } catch (FactoryException e) {
283:                                            // TODO Add Action Errors
284:                                            return mapping
285:                                                    .findForward("config.wms.content");
286:                                        }
287:
288:                                        ReferencedEnvelope newEnvelope = new ReferencedEnvelope(
289:                                                dstCRS);
290:                                        newEnvelope.init(selectedEnvelope
291:                                                .getLowerCorner()
292:                                                .getOrdinate(0),
293:                                                selectedEnvelope
294:                                                        .getUpperCorner()
295:                                                        .getOrdinate(0),
296:                                                selectedEnvelope
297:                                                        .getLowerCorner()
298:                                                        .getOrdinate(1),
299:                                                selectedEnvelope
300:                                                        .getUpperCorner()
301:                                                        .getOrdinate(1));
302:
303:                                        newEnvelope.expandToInclude(cvEnvelope);
304:
305:                                        selectedEnvelope = new GeneralEnvelope(
306:                                                new double[] {
307:                                                        newEnvelope.getMinX(),
308:                                                        newEnvelope.getMinY() },
309:                                                new double[] {
310:                                                        newEnvelope.getMaxX(),
311:                                                        newEnvelope.getMaxY() });
312:                                        selectedEnvelope
313:                                                .setCoordinateReferenceSystem(dstCRS);
314:                                    }
315:                                }
316:                            }
317:                        }
318:
319:                        if (selectedEnvelope != null) {
320:                            envelope
321:                                    .setCoordinateReferenceSystem(selectedEnvelope
322:                                            .getCoordinateReferenceSystem());
323:                            envelope.setEnvelope(selectedEnvelope);
324:                            envelopeMap.put(baseMapTitle, envelope);
325:                            contentForm.setBaseMapEnvelope(selectedLayerIndex,
326:                                    envelope);
327:                        }
328:                    }
329:                }
330:
331:                if (selectedLayerIndex < 0) {
332:                    return mapping.findForward("config.wms.content");
333:                }
334:
335:                /*config.setBaseMapLayers(layerMap);
336:                config.setBaseMapStyles(styleMap);
337:                config.setBaseMapEnvelopes(envelopeMap);*/
338:                return mapping.findForward("config.wms.content");
339:            }
340:
341:            private ActionForward executeRemoveLayerGroup(
342:                    ActionMapping mapping, String action,
343:                    WMSContentForm contentForm, WMSConfig config,
344:                    HttpServletRequest request, HttpServletResponse response) {
345:                HashMap layerMap = new HashMap();
346:                HashMap styleMap = new HashMap();
347:                HashMap envelopeMap = new HashMap();
348:
349:                int removedLayerIndex = contentForm.getSelectedLayer();
350:
351:                if (removedLayerIndex < 0) {
352:                    return mapping.findForward("config.wms.content");
353:                }
354:
355:                contentForm.getBaseMapTitles().remove(removedLayerIndex);
356:                contentForm.getBaseMapLayers().remove(removedLayerIndex);
357:                contentForm.getBaseMapStyles().remove(removedLayerIndex);
358:                contentForm.getBaseMapEnvelopes().remove(removedLayerIndex);
359:                contentForm.getMinCPs().remove(new Integer(removedLayerIndex));
360:                contentForm.getMaxCPs().remove(new Integer(removedLayerIndex));
361:
362:                int bmi = 0;
363:                for (Iterator it = contentForm.getBaseMapTitles().iterator(); it
364:                        .hasNext();) {
365:                    String baseMapTitle = (String) it.next();
366:
367:                    String baseMapLayers = (String) contentForm
368:                            .getBaseMapLayers().get(bmi);
369:                    String baseMapStyles = (String) contentForm
370:                            .getBaseMapStyles().get(bmi);
371:                    GeneralEnvelope envelope = (GeneralEnvelope) contentForm
372:                            .getBaseMapEnvelopes().get(bmi);
373:
374:                    /*
375:                     * System.out.println("******************* contentAction: title=" +
376:                     * baseMapTitle + ", layers=" + baseMapLayers + ", styles=" +
377:                     * baseMapStyles);
378:                     */
379:                    layerMap.put(baseMapTitle, baseMapLayers);
380:                    styleMap.put(baseMapTitle, baseMapStyles);
381:                    envelopeMap.put(baseMapTitle, envelope);
382:
383:                    bmi++;
384:                }
385:
386:                config.setBaseMapLayers(layerMap);
387:                config.setBaseMapStyles(styleMap);
388:                config.setBaseMapEnvelopes(envelopeMap);
389:
390:                return mapping.findForward("config.wms.content");
391:            }
392:
393:            private ActionForward executeAddNewLayerGroup(
394:                    ActionMapping mapping, String action,
395:                    WMSContentForm contentForm, WMSConfig config,
396:                    HttpServletRequest request, HttpServletResponse response)
397:                    throws ServletException {
398:                HashMap layerMap = new HashMap();
399:                HashMap styleMap = new HashMap();
400:                HashMap envelopeMap = new HashMap();
401:
402:                int bmi;
403:                Iterator it;
404:
405:                for (bmi = 0, it = contentForm.getBaseMapTitles().iterator(); it
406:                        .hasNext(); bmi++) {
407:                    String baseMapTitle = (String) it.next();
408:                    String baseMapLayers = (String) contentForm
409:                            .getBaseMapLayers().get(bmi);
410:                    String baseMapStyles = (String) contentForm
411:                            .getBaseMapStyles().get(bmi);
412:
413:                    GeneralEnvelope envelope = (GeneralEnvelope) contentForm
414:                            .getBaseMapEnvelopes().get(bmi);
415:
416:                    /*
417:                     * System.out.println("******************* contentAction: title=" +
418:                     * baseMapTitle + ", layers=" + baseMapLayers + ", styles=" +
419:                     * baseMapStyles);
420:                     */
421:                    layerMap.put(baseMapTitle, baseMapLayers);
422:                    styleMap.put(baseMapTitle, baseMapStyles);
423:                    envelopeMap.put(baseMapTitle, envelope);
424:                }
425:
426:                String name = "<new_layer_group>";
427:                int num = 2;
428:
429:                while ((config.getBaseMapLayers() != null)
430:                        && (config.getBaseMapLayers().get(name) != null)) {
431:                    name = "<new_layer_group" + num + ">";
432:                    num++;
433:                }
434:
435:                GeneralEnvelope defaultEnvelope = new GeneralEnvelope(
436:                        new double[] { -180.0, -90.0 }, new double[] { 180.0,
437:                                90.0 });
438:
439:                try {
440:                    defaultEnvelope.setCoordinateReferenceSystem(CRS
441:                            .decode("EPSG:4326"));
442:                } catch (NoSuchAuthorityCodeException e) {
443:                    throw new ServletException(e);
444:                } catch (FactoryException e) {
445:                    throw new ServletException(e);
446:                }
447:
448:                layerMap.put(name, "");
449:                styleMap.put(name, "");
450:                envelopeMap.put(name, defaultEnvelope);
451:
452:                contentForm.getBaseMapTitles().add(name);
453:                contentForm.getBaseMapLayers().add("");
454:                contentForm.getBaseMapStyles().add("");
455:                contentForm.getBaseMapEnvelopes().add(defaultEnvelope);
456:
457:                config.setBaseMapLayers(layerMap);
458:                config.setBaseMapStyles(styleMap);
459:                config.setBaseMapEnvelopes(envelopeMap);
460:
461:                return mapping.findForward("config.wms.content");
462:            }
463:
464:            private ActionForward executeSubmit(ActionMapping mapping,
465:                    String action, WMSContentForm contentForm,
466:                    WMSConfig config, HttpServletRequest request,
467:                    HttpServletResponse response) {
468:                HashMap layerMap = new HashMap();
469:                HashMap styleMap = new HashMap();
470:                HashMap envelopeMap = new HashMap();
471:
472:                int bmi;
473:                Iterator it;
474:
475:                for (bmi = 0, it = contentForm.getBaseMapTitles().iterator(); it
476:                        .hasNext(); bmi++) {
477:                    String baseMapTitle = (String) it.next();
478:                    String baseMapLayers = (String) contentForm
479:                            .getBaseMapLayers().get(bmi);
480:                    String baseMapStyles = (String) contentForm
481:                            .getBaseMapStyles().get(bmi);
482:                    GeneralEnvelope envelope = (GeneralEnvelope) contentForm
483:                            .getBaseMapEnvelopes().get(bmi);
484:
485:                    /*System.out.println("******************* contentAction: title=" + baseMapTitle + ", layers="
486:                    + baseMapLayers + ", styles=" + baseMapStyles);*/
487:                    Data catalog = (Data) getServlet().getServletContext()
488:                            .getAttribute(Data.WEB_CONTAINER_KEY);
489:
490:                    GeneralEnvelope selectedEnvelope = null;
491:                    String[] layerNames = baseMapLayers.split(",");
492:                    String[] styles = baseMapStyles.split("\\s*,\\s*");
493:
494:                    for (int i = 0; i < layerNames.length; i++) {
495:                        String layerName = layerNames[i].trim();
496:
497:                        Integer layerType = (Integer) catalog
498:                                .getLayerType(layerName);
499:
500:                        if (layerType == null) {
501:                            ActionErrors errors = new ActionErrors();
502:                            errors.add(ActionErrors.GLOBAL_ERROR,
503:                                    new ActionError("errors.invalid",
504:                                            new ActionMessage("Layer "
505:                                                    + layerName)));
506:                            saveErrors(request, errors);
507:
508:                            return mapping.findForward("config.wms.content");
509:                        }
510:                    }
511:
512:                    for (int i = 0; i < styles.length; i++) {
513:                        String styleName = styles[i].trim();
514:
515:                        Style style = catalog.getStyle(styleName);
516:
517:                        if ((style == null) && !"".equals(styleName)) {
518:                            ActionErrors errors = new ActionErrors();
519:                            errors.add(ActionErrors.GLOBAL_ERROR,
520:                                    new ActionError("error.styleId.notFound",
521:                                            new ActionMessage(styleName)));
522:                            saveErrors(request, errors);
523:
524:                            return mapping.findForward("config.wms.content");
525:                        }
526:                    }
527:
528:                    layerMap.put(baseMapTitle, baseMapLayers);
529:                    styleMap.put(baseMapTitle, baseMapStyles);
530:                    envelopeMap.put(baseMapTitle, envelope);
531:                }
532:
533:                config.setBaseMapLayers(layerMap);
534:                config.setBaseMapStyles(styleMap);
535:                config.setBaseMapEnvelopes(envelopeMap);
536:
537:                getApplicationState().notifyConfigChanged();
538:
539:                return mapping.findForward("config");
540:            }
541:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.