Details
-
Type:
New Feature
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: WMS
-
Labels:None
Description
From the SLD Spec (1.0.0):
13.2. PutStyles
The PutStyles operation is used to store user-defined styles and user-defined layers into a WMS. Many styles for many different layers may be stored. On successful insertion, these styles will subsequently be available from the WMS for use as named styles. The parameters of the HTTP-GET method are defined as follows:
Parameter
Required
Description
VERSION
Required
Version as required by OGC interfaces.
REQUEST
Required
Value must be "PutStyles".
MODE
Required
This gives the mode of the 'put': either "InsertAndReplace" or "ReplaceAll". In InsertAndReplace mode, all new styles for a layer are inserted and all existing styles which are defined in the SLD are replaced. In ReplaceAll mode, all existing styles for a layer are logically deleted, and then the SLD-defined styles are inserted. This is similar to InsertAndReplace mode, except that all styles not in the SLD are deleted.
SLD
Optional
This parameter specifies a reference to an external SLD document. It works in the same way as the SLD= parameter of the WMS GetMap operation.
SLD_BODY
Optional
This parameter allows an SLD document to be included directly in an HTTP-GET request. It works in the same way as the SLD_BODY= parameter of the WMS GetMap operation.
The format is implied to be SLD. Both the SLD= and SLD_BODY= parameters are individually marked as "Optional", but one of them must be used to pass the SLD. This operation could also hypothetically be used to define new user-defined layers, but that is not the immediate intention in this version of the SLD Specification. No HTTP-POST method for the PutStyles operation is defined at this time.
The InsertAndReplace and ReplaceAll modes are provided to handle the common usage cases of either tweaking an individual style or of performing a bulk update of all styles for a layer or layers. A "lost-update" problem may be encountered when performing a bulk update on styles that were retrieved with a previous GetStyles operation. Any updates to the styles that were made by some other user in the meantime may be lost. Lost updates are a general problem in distributed systems and the general solution is to use some kind of locking mechanism, but no solution is provided here.
All SLD NamedStyles that are present in the SLD in a PutStyles operation in InsertAndReplace mode are ignored. (These may be present as a result of a previous GetStyles query for which there was no suitable SLD description of some styles.) In the ReplaceAll mode of PutStyles, the current definition of every NamedStyle is retained. (If no reference at all is provided, then styles are deleted in this mode.)
The semantics for updating the default style are as follows. If a style for a layer is marked as being default in the SLD, then that style will become the new default, superseding the existing default style in the map server. If ReplaceAll mode is used and the existing default style for a layer is implicitly deleted but no new style is inserted from the SLD that is marked as being the new default, then the action to be taken is system-specific. A WMS must always have a default style for every layer.
Any user-defined layers that are present in the given SLD will cause a layer to be created inside of the map server of the given name and definition. If the layer already exists, it will be replaced with the new definition. A map server shall be assumed to support user-defined layer updates if and only if it indicates that it supports the PutStyles operation and user-defined layers in its capabilities document.
On successful insertion, a simple return of MIME type "application/vnd.ogc.success+xml" will be returned. It is defined according to the following DTD:
<!ELEMENTOGC_OWS_SuccessEMPTY>
On error, a standard "application/vnd.ogc.se_xml" service-exception document will be returned. This document is described in the WMS 1.1.0 Specification. The insertion of new styles is formally defined to be "atomic", meaning that either all style updates to all layers are made or none are. In practice, however, some systems may not live up to this formal definition.
I believe this is done, at least in some form.