geoserver/geoserver — pull request #551 by jodygarnett (2014-03-30 15:18:12+00:00)
Title: Allow ExternalGraphic image to be used for GetCapabilities and GetLegendGraphics

This is a replacement for #400 adding LegendInfo to StyleInfo for use in WMS GetCapabilities generation. The data structure (if available) is also used in GetLegendGraphics.

The scope of this feature has been refined to restrict these external graphic references to images that are being served by GeoServer (for example from the styles directory). This allows GeoServer to still be responsible for all the information it is publishing, and ensure that the images are available for the GetLegendGraphics operation.

To do:

* [x] Update ExternalGraphicPanel to restrict graphics to images in the styles directory
* [ ] Recording images in GetLegendGraphicRequest using resource name, change to use of style name to allow for the same data with two different styles
* [ ] Resolve images in GetLegendGraphicRequest as local file references (KVP parser access access to data directory, and will allow test case to pass)
* [ ] Update user docs

To test the above branch:
1. From the styles page edit the "grass" style to have grass_fill.png
2. Click Auto-detect image size and type
3. Test WMS GetCapabilities links
4. Use Demo Request page to test use (no rescale)

http://localhost:8080/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=32&HEIGHT=32&LAYER=tiger:poly_landmarks&STYLE=grass

5. Use Demo Request page to test with rescale

http://localhost:8080/geoserver/wms?REQUEST=GetLegendGraphic&VERSION=1.0.0&FORMAT=image/png&WIDTH=22&HEIGHT=22&LAYER=tiger:poly_landmarks&STYLE=grass

![grass_fill_legend](https://cloud.githubusercontent.com/assets/629681/2550319/e4d11954-b681-11e3-8b9b-a6563ed3d49f.png)