it.geosolutions.geoserver.rest.encoder
Class GSLayerEncoder

java.lang.Object
  extended by it.geosolutions.geoserver.rest.encoder.utils.XmlElement
      extended by it.geosolutions.geoserver.rest.encoder.utils.PropertyXMLEncoder
          extended by it.geosolutions.geoserver.rest.encoder.GSLayerEncoder
Direct Known Subclasses:
GSLayerEncoder21

public class GSLayerEncoder
extends PropertyXMLEncoder

Layer encoder for Geoserver >= 2.2

Since:
gs-2.2.x
Author:
ETj (etj at geo-solutions.it), Carlo Cancellieri - carlo.cancellieri@geo-solutions.it, Emmanuel Blondel - emmanuel.blondel1@gmail.com The layer encoder is enabled by default <layer> <name>{LAYERNAME}</name> <type>RASTER</type> <defaultStyle> <name>{STYLE_NAME}</name> <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://{GSURL}/rest/styles/{STYLE}xml" type="application/xml"/> </defaultStyle> <resource class="coverage"> <name>{RESOURCE_NAME}</name> <atom:link xmlns:atom="http://www.w3.org/2005/Atom" rel="alternate" href="http://{GSURL}/rest/workspaces/{WS}/coveragestores/{STORE}/coverages/{LAYER}.xml" type="application/xml"/> </resource> <attribution> <title>test</title> <href>http://www.fao.org/fileadmin/templates/faoweb/images/FAO-logo.png</href> <logoURL>http://www.fao.org/fileadmin/templates/faoweb/images/FAO-logo.png</logoURL> <logoWidth>412</logoWidth> <logoHeight>77</logoHeight> <logoType>image/png</logoType> </attribution> ... </layer>

Field Summary
static String AUTHORITY_URLS
           
static String IDENTIFIERS
           
static String STYLES
           
 
Constructor Summary
GSLayerEncoder()
           
 
Method Summary
 void addAuthorityURL(GSAuthorityURLInfoEncoder authorityURLInfo)
          Add an authorityURLInfo to the GeoServer layer
protected  void addDefaultStyle(String defaultStyle)
           
protected  void addEnabled()
          enabled the layer
 void addIdentifier(GSIdentifierInfoEncoder identifierInfo)
          Add an identifierInfo to the GeoServer layer
protected  void addQueryable(String queryable)
          Add the 'queryable' node with a text value from 'queryable' (true as default)
 void addStyle(String style)
          Add a style
protected  void addWmsPath(String path)
           
 boolean delAuthorityURL(String authorityURL)
          Deletes a AuthorityURLInfo from the list using the authorityURL (AuthorityURLInfo href)
 boolean delIdentifier(String authority)
          Deletes a IdentifierInfo from the list using the authority name (IdentifierInfo authority)
 boolean delStyle(String style)
          delete a style from the list of available styles
 void setAdvertised(boolean advertised)
           
 void setDefaultStyle(String defaultStyle)
           
 void setEnabled(boolean enable)
           
 void setQueryable(Boolean queryable)
          Set or modify the 'queryable' node with a text value from 'queryable' (true as default)
 void setWmsPath(String path)
          Default WMS Path The GeoServer WMS path is, by default, /geoserver/wms.
 
Methods inherited from class it.geosolutions.geoserver.rest.encoder.utils.PropertyXMLEncoder
add, get, get, set
 
Methods inherited from class it.geosolutions.geoserver.rest.encoder.utils.XmlElement
add, addContent, getRoot, isEmpty, remove, set, setRoot, setRoot, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

STYLES

public static final String STYLES
See Also:
Constant Field Values

AUTHORITY_URLS

public static final String AUTHORITY_URLS
See Also:
Constant Field Values

IDENTIFIERS

public static final String IDENTIFIERS
See Also:
Constant Field Values
Constructor Detail

GSLayerEncoder

public GSLayerEncoder()
Method Detail

addEnabled

protected void addEnabled()
enabled the layer


setEnabled

public void setEnabled(boolean enable)
Parameters:
enable - true if layer should be set to enabled

addQueryable

protected void addQueryable(String queryable)
Add the 'queryable' node with a text value from 'queryable' (true as default)


setQueryable

public void setQueryable(Boolean queryable)
Set or modify the 'queryable' node with a text value from 'queryable' (true as default)


addWmsPath

protected void addWmsPath(String path)
Parameters:
path - the wms path to set
See Also:
GSLayerEncoder#setWmsPath(String)}

setWmsPath

public void setWmsPath(String path)
                throws IllegalArgumentException
Default WMS Path The GeoServer WMS path is, by default, /geoserver/wms. However you can change it to /geoserver/anythingyouwant

Parameters:
path - the wms path to set
Throws:
IllegalArgumentException - if path is null or empty

addDefaultStyle

protected void addDefaultStyle(String defaultStyle)
Parameters:
defaultStyle -
See Also:
GSLayerEncoder#setDefaultStyle(String)}

setDefaultStyle

public void setDefaultStyle(String defaultStyle)
                     throws IllegalArgumentException
Parameters:
defaultStyle - The style that will be applied if no style is specified.
Throws:
IllegalArgumentException - if defaultStyle is null or empty

addStyle

public void addStyle(String style)
Add a style

Parameters:
style -

delStyle

public boolean delStyle(String style)
delete a style from the list of available styles

Parameters:
style -
Returns:
true if something is removed, false otherwise

setAdvertised

public void setAdvertised(boolean advertised)
Parameters:
advertised - true if the layer should be advertised

addAuthorityURL

public void addAuthorityURL(GSAuthorityURLInfoEncoder authorityURLInfo)
Add an authorityURLInfo to the GeoServer layer

Parameters:
authorityURLInfo -

delAuthorityURL

public boolean delAuthorityURL(String authorityURL)
Deletes a AuthorityURLInfo from the list using the authorityURL (AuthorityURLInfo href)

Parameters:
authorityURL -
Returns:
true if something is removed, false otherwise

addIdentifier

public void addIdentifier(GSIdentifierInfoEncoder identifierInfo)
Add an identifierInfo to the GeoServer layer

Parameters:
identifierInfo -

delIdentifier

public boolean delIdentifier(String authority)
Deletes a IdentifierInfo from the list using the authority name (IdentifierInfo authority)

Parameters:
authority -
Returns:
true if something is removed, false otherwise


Copyright © 2007-2014 GeoSolutions. All Rights Reserved.