01: /* Copyright (c) 2001 - 2007 TOPP - www.openplans.org. All rights reserved.
02: * This code is licensed under the GPL 2.0 license, availible at the root
03: * application directory.
04: */
05: package org.vfny.geoserver.sld.requests;
06:
07: import org.vfny.geoserver.Request;
08: import org.vfny.geoserver.servlets.AbstractService;
09: import org.vfny.geoserver.wms.servlets.WMService;
10:
11: public class PutStylesRequest extends Request {
12: private MandatoryParameters mandatoryParameters = new MandatoryParameters();
13: private OptionalParameters optionalParameters = new OptionalParameters();
14:
15: public PutStylesRequest(AbstractService service) {
16: super ("SLD", "PutStyles", service);
17: }
18:
19: public void setMode(String mode) {
20: this .mandatoryParameters.mode = mode;
21: }
22:
23: public String getMode() {
24: return this .mandatoryParameters.mode;
25: }
26:
27: public void setSLD(String sld) {
28: this .optionalParameters.sld = sld;
29: }
30:
31: public String getSLD() {
32: return this .optionalParameters.sld;
33: }
34:
35: public void setSldBody(String sld_body) {
36: this .optionalParameters.sld_body = sld_body;
37: }
38:
39: public String getSldBody() {
40: return this .optionalParameters.sld_body;
41: }
42:
43: private class MandatoryParameters {
44: /**
45: * This gives the mode of the ?put?: either ?InsertAndReplace? or
46: * ?ReplaceAll?. In InsertAndReplace mode, all new styles for
47: * a layer are inserted and all existing styles which are defined in the
48: * SLD are replaced. In ReplaceAll mode, all existing styles for a
49: * layer are logically deleted, and then the SLD-defined styles are
50: * inserted. This is similar to InsertAndReplace mode, except
51: * that all styles not in the SLD are deleted.
52: */
53: String mode = ""; // either 'InsertAndReplace' or 'ReplaceAll'
54: }
55:
56: private class OptionalParameters {
57: /**
58: * This parameter specifies a reference to an external SLD document.
59: * It works in the same way as the SLD= parameter of the WMS
60: * GetMap operation.
61: */
62: String sld = null;
63:
64: /**
65: * This parameter allows an SLD document to be included directly in
66: * an HTTP-GET request. It works in the same way as the
67: * SLD_BODY= parameter of the WMS GetMap operation.
68: */
69: String sld_body = "";
70: }
71: }
|