it.geosolutions.geoserver.rest.encoder
Class GSResourceEncoder

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.GSResourceEncoder
Direct Known Subclasses:
GSCoverageEncoder, GSFeatureTypeEncoder

public abstract class GSResourceEncoder
extends PropertyXMLEncoder

Encode a GeoServer resource.

Author:
ETj (etj at geo-solutions.it), Carlo Cancellieri - carlo.cancellieri@geo-solutions.it
See Also:
GSDimensionInfoEncoder, GSFeatureDimensionInfoEncoder

Nested Class Summary
static class GSResourceEncoder.ProjectionPolicy
          Reprojection policy for a published layer.
 
Field Summary
static String KEYWORDS
           
static String METADATA
           
static String NAME
           
 
Constructor Summary
protected GSResourceEncoder(String rootName)
           
 
Method Summary
protected  void addAbstract(String _abstract)
          Add the 'abstract' node with a text value from 'abstract'
protected  void addDescription(String description)
          Add the 'description' node with a text value from 'description'
 void addKeyword(String keyword)
           
protected  void addLatLonBoundingBox(double minx, double miny, double maxx, double maxy, String crs)
           
protected  void addMetadata(String key, XmlElement dimensionInfo)
           
protected  void addName(String name)
          Add the 'name' node with a text value from 'name'
protected  void addNativeBoundingBox(double minx, double miny, double maxx, double maxy, String crs)
           
protected  void addNativeCRS(String nativeCRS)
          Add the 'nativeCRS' node with a text value from 'nativeCRS'
protected  void addProjectionPolicy(GSResourceEncoder.ProjectionPolicy policy)
          NONE, REPROJECT_TO_DECLARED, FORCE_DECLARED
protected  void addSRS(String srs)
          Add the 'SRS' node with a text value from 'srs'
protected  void addTitle(String title)
          Add the 'title' node with a text value from 'title'
 boolean delKeyword(String keyword)
          delete a keyword from the list
 boolean delMetadata(String key)
           
 String getName()
           
 void setAbstract(String _abstract)
          Set or modify the 'abstract' node with a text value from 'abstract'
 void setDescription(String description)
          Set or modify the 'description' node with a text value from 'description'
 void setEnabled(boolean enabled)
           
 void setLatLonBoundingBox(double minx, double miny, double maxx, double maxy, String crs)
           
 void setMetadata(String key, XmlElement dimensionInfo)
           
 void setName(String name)
          Set or modify the 'name' node with a text value from 'name'
 void setNativeBoundingBox(double minx, double miny, double maxx, double maxy, String crs)
           
 void setNativeCRS(String nativeCRS)
          Set or modify the 'nativeCRS' node with a text value from 'nativeCRS'
 void setProjectionPolicy(GSResourceEncoder.ProjectionPolicy policy)
          NONE, REPROJECT_TO_DECLARED, FORCE_DECLARED
 void setSRS(String srs)
          Set or modify the 'SRS' node with a text value from 'srs'
 void setTitle(String title)
          Set or modify the 'title' node with a text value from 'title'
 
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, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NAME

public static final String NAME
See Also:
Constant Field Values

METADATA

public static final String METADATA
See Also:
Constant Field Values

KEYWORDS

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

GSResourceEncoder

protected GSResourceEncoder(String rootName)
Parameters:
rootName - Actually 'feature' or 'coverage'
See Also:
GSFeatureTypeEncoder, GSCoverageEncoder
Method Detail

setEnabled

public void setEnabled(boolean enabled)

addMetadata

protected void addMetadata(String key,
                           XmlElement dimensionInfo)
Parameters:
key -
dimensionInfo -

setMetadata

public void setMetadata(String key,
                        XmlElement dimensionInfo)

delMetadata

public boolean delMetadata(String key)
Parameters:
key - the name of the metadata to add (f.e.: elevation, time)
Returns:
true if something is removed, false otherwise

addKeyword

public void addKeyword(String keyword)

delKeyword

public boolean delKeyword(String keyword)
delete a keyword from the list

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

addProjectionPolicy

protected void addProjectionPolicy(GSResourceEncoder.ProjectionPolicy policy)
NONE, REPROJECT_TO_DECLARED, FORCE_DECLARED


setProjectionPolicy

public void setProjectionPolicy(GSResourceEncoder.ProjectionPolicy policy)
NONE, REPROJECT_TO_DECLARED, FORCE_DECLARED


addName

protected void addName(String name)
Add the 'name' node with a text value from 'name'


setName

public void setName(String name)
Set or modify the 'name' node with a text value from 'name'


getName

public String getName()

addDescription

protected void addDescription(String description)
Add the 'description' node with a text value from 'description'


setDescription

public void setDescription(String description)
Set or modify the 'description' node with a text value from 'description'


addAbstract

protected void addAbstract(String _abstract)
Add the 'abstract' node with a text value from 'abstract'


setAbstract

public void setAbstract(String _abstract)
Set or modify the 'abstract' node with a text value from 'abstract'


addTitle

protected void addTitle(String title)
Add the 'title' node with a text value from 'title'


setTitle

public void setTitle(String title)
Set or modify the 'title' node with a text value from 'title'


addSRS

protected void addSRS(String srs)
Add the 'SRS' node with a text value from 'srs'


setSRS

public void setSRS(String srs)
Set or modify the 'SRS' node with a text value from 'srs'


addNativeCRS

protected void addNativeCRS(String nativeCRS)
Add the 'nativeCRS' node with a text value from 'nativeCRS'


setNativeCRS

public void setNativeCRS(String nativeCRS)
Set or modify the 'nativeCRS' node with a text value from 'nativeCRS'


addLatLonBoundingBox

protected void addLatLonBoundingBox(double minx,
                                    double miny,
                                    double maxx,
                                    double maxy,
                                    String crs)
Parameters:
minx -
maxy -
maxx -
miny -
crs -

setLatLonBoundingBox

public void setLatLonBoundingBox(double minx,
                                 double miny,
                                 double maxx,
                                 double maxy,
                                 String crs)

addNativeBoundingBox

protected void addNativeBoundingBox(double minx,
                                    double miny,
                                    double maxx,
                                    double maxy,
                                    String crs)
Parameters:
minx -
maxy -
maxx -
miny -
crs -

setNativeBoundingBox

public void setNativeBoundingBox(double minx,
                                 double miny,
                                 double maxx,
                                 double maxy,
                                 String crs)


Copyright © 2007-2013 GeoSolutions. All Rights Reserved.