Class GSLayerEncoder
- java.lang.Object
-
- it.geosolutions.geoserver.rest.encoder.utils.XmlElement
-
- it.geosolutions.geoserver.rest.encoder.utils.PropertyXMLEncoder
-
- 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
- Version:
- $Id: $
- 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
Fields Modifier and Type Field Description static java.lang.StringAUTHORITY_URLSConstantAUTHORITY_URLS="authorityURLs"static java.lang.StringDEFAULT_STYLEConstantDEFAULT_STYLE="defaultStyle"static java.lang.StringIDENTIFIERSConstantIDENTIFIERS="identifiers"static java.lang.StringSTYLESConstantSTYLES="styles"
-
Constructor Summary
Constructors Constructor Description GSLayerEncoder()Constructor for GSLayerEncoder.GSLayerEncoder(boolean encodeLists)Constructor for GSLayerEncoder.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAuthorityURL(GSAuthorityURLInfoEncoder authorityURLInfo)Add an authorityURLInfo to the GeoServer layerprotected voidaddDefaultStyle(java.lang.String defaultStyle)addDefaultStyleprotected voidaddDefaultStyle(java.lang.String workspace, java.lang.String defaultStyle)addDefaultStyleprotected voidaddEnabled()enabled the layervoidaddIdentifier(GSIdentifierInfoEncoder identifierInfo)Add an identifierInfo to the GeoServer layerprotected voidaddQueryable(java.lang.String queryable)Add the 'queryable' node with a text value from 'queryable' (true as default)voidaddStyle(java.lang.String style)Add a styleprotected voidaddWmsPath(java.lang.String path)addWmsPathbooleandelAuthorityURL(java.lang.String authorityURL)Deletes a AuthorityURLInfo from the list using the authorityURL (AuthorityURLInfo href)booleandelIdentifier(java.lang.String authority)Deletes a IdentifierInfo from the list using the authority name (IdentifierInfo authority)booleandelStyle(java.lang.String style)delete a style from the list of available stylesvoidsetAdvertised(boolean advertised)setAdvertisedvoidsetDefaultStyle(java.lang.String defaultStyle)setDefaultStylevoidsetDefaultStyle(java.lang.String workspace, java.lang.String defaultStyle)setDefaultStylevoidsetEnabled(boolean enable)setEnabledvoidsetQueryable(java.lang.Boolean queryable)Set or modify the 'queryable' node with a text value from 'queryable' (true as default)voidsetWmsPath(java.lang.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
-
-
-
-
Field Detail
-
STYLES
public static final java.lang.String STYLES
ConstantSTYLES="styles"- See Also:
- Constant Field Values
-
AUTHORITY_URLS
public static final java.lang.String AUTHORITY_URLS
ConstantAUTHORITY_URLS="authorityURLs"- See Also:
- Constant Field Values
-
IDENTIFIERS
public static final java.lang.String IDENTIFIERS
ConstantIDENTIFIERS="identifiers"- See Also:
- Constant Field Values
-
DEFAULT_STYLE
public static final java.lang.String DEFAULT_STYLE
ConstantDEFAULT_STYLE="defaultStyle"- See Also:
- Constant Field Values
-
-
Method Detail
-
addEnabled
protected void addEnabled()
enabled the layer
-
setEnabled
public void setEnabled(boolean enable)
setEnabled
- Parameters:
enable- true if layer should be set to enabled
-
addQueryable
protected void addQueryable(java.lang.String queryable)
Add the 'queryable' node with a text value from 'queryable' (true as default)- Parameters:
queryable- aStringobject.
-
setQueryable
public void setQueryable(java.lang.Boolean queryable)
Set or modify the 'queryable' node with a text value from 'queryable' (true as default)- Parameters:
queryable- aBooleanobject.
-
addWmsPath
protected void addWmsPath(java.lang.String path)
addWmsPath
- Parameters:
path- the wms path to set- See Also:
setWmsPath(String)
-
setWmsPath
public void setWmsPath(java.lang.String path) throws java.lang.IllegalArgumentExceptionDefault 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:
java.lang.IllegalArgumentException- if path is null or empty
-
addDefaultStyle
protected void addDefaultStyle(java.lang.String defaultStyle)
addDefaultStyle
- Parameters:
defaultStyle- aStringobject.- See Also:
setDefaultStyle(String)
-
addDefaultStyle
protected void addDefaultStyle(java.lang.String workspace, java.lang.String defaultStyle)addDefaultStyle
- Parameters:
defaultStyle- aStringobject.workspace- aStringobject.- See Also:
setDefaultStyle(String)
-
setDefaultStyle
public void setDefaultStyle(java.lang.String defaultStyle) throws java.lang.IllegalArgumentExceptionsetDefaultStyle
- Parameters:
defaultStyle- The style that will be applied if no style is specified.- Throws:
java.lang.IllegalArgumentException- if defaultStyle is null or empty
-
setDefaultStyle
public void setDefaultStyle(java.lang.String workspace, java.lang.String defaultStyle)setDefaultStyle
- Parameters:
defaultStyle- aStringobject.workspace- aStringobject.- See Also:
setDefaultStyle(String)
-
addStyle
public void addStyle(java.lang.String style)
Add a style- Parameters:
style- aStringobject.
-
delStyle
public boolean delStyle(java.lang.String style)
delete a style from the list of available styles- Parameters:
style- aStringobject.- Returns:
- true if something is removed, false otherwise
-
setAdvertised
public void setAdvertised(boolean advertised)
setAdvertised
- Parameters:
advertised- true if the layer should be advertised
-
addAuthorityURL
public void addAuthorityURL(GSAuthorityURLInfoEncoder authorityURLInfo)
Add an authorityURLInfo to the GeoServer layer- Parameters:
authorityURLInfo- aGSAuthorityURLInfoEncoderobject.
-
delAuthorityURL
public boolean delAuthorityURL(java.lang.String authorityURL)
Deletes a AuthorityURLInfo from the list using the authorityURL (AuthorityURLInfo href)- Parameters:
authorityURL- aStringobject.- Returns:
- true if something is removed, false otherwise
-
addIdentifier
public void addIdentifier(GSIdentifierInfoEncoder identifierInfo)
Add an identifierInfo to the GeoServer layer- Parameters:
identifierInfo- aGSIdentifierInfoEncoderobject.
-
delIdentifier
public boolean delIdentifier(java.lang.String authority)
Deletes a IdentifierInfo from the list using the authority name (IdentifierInfo authority)- Parameters:
authority- aStringobject.- Returns:
- true if something is removed, false otherwise
-
-