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, Emmanuel Blondel - emmanuel.blondel1@gmail.com | emmanuel.blondel@fao.org, Henry Rotzoll
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 METADATALINKS
           
static String NAME
           
static String NATIVENAME
           
 
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)
           
 void addKeyword(String keyword, String language, String vocabulary)
          <keywords> <string>WCS</string> <string>ImageMosaic</string> <string>srtm30</string> <string> KEYWORD\@language={LANGUAGE}\;\@vocabulary={VOCABULARY}\; {KEYWORD_2}\@vocabulary={VOCABULARY_2}\; {KEYWORD_3}\@language={LANGUAGE_3}\; }
protected  void addLatLonBoundingBox(double minx, double miny, double maxx, double maxy, String crs)
           
protected  void addMetadata(String key, XmlElement dimensionInfo)
           
protected  void addMetadataDimension(String key, GSDimensionInfoEncoder dimensionInfo)
           
protected  void addMetadataDimension(String key, GSDimensionInfoEncoder dimensionInfo, boolean custom)
          Add the metadata for a custom dimension.
 void addMetadataLinkInfo(GSMetadataLinkInfoEncoder metadataLinkInfo)
          Adds a MetadataLinkInfo to the GeoServer Resource
 void addMetadataLinkInfo(String type, String metadataType, String content)
          Adds quickly a MetadataLinkInfo to the GeoServer Resource
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 addNativeName(String nativename)
          Add the 'nativename' node with a text value from 'name'
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 delKeyword(String keyword, String language, String vocabulary)
          delete a keyword from the list
 boolean delMetadata(String key)
           
 boolean delMetadataLinkInfo(String metadataURL)
          Deletes a metadataLinkInfo from the list using the metadataURL (MetadataLinkInfo content)
 String getName()
           
 String getNativeName()
          Get the nativeName
 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)
          Deprecated. Use setMetadataDimension(String, GSDimensionInfoEncoder) this method will be set as protected for internal use only
 void setMetadataDimension(String key, GSDimensionInfoEncoder dimensionInfo)
           
 void setMetadataDimension(String key, GSDimensionInfoEncoder dimensionInfo, boolean custom)
          Set the metadata for a custom dimension.
 void setMetadataString(String key, String value)
           
 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 setNativeName(String nativename)
          Set or modify the 'nativename' node with a text value from 'name'
 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, setRoot, setRoot, 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

NATIVENAME

public static final String NATIVENAME
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

METADATALINKS

public static final String METADATALINKS
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)
Deprecated. Use setMetadataDimension(String, GSDimensionInfoEncoder) this method will be set as protected for internal use only

Parameters:
key -
dimensionInfo -

addMetadataDimension

protected void addMetadataDimension(String key,
                                    GSDimensionInfoEncoder dimensionInfo)
Parameters:
key -
dimensionInfo -

addMetadataDimension

protected void addMetadataDimension(String key,
                                    GSDimensionInfoEncoder dimensionInfo,
                                    boolean custom)
Add the metadata for a custom dimension.

Parameters:
key - the name of the dimension
dimensionInfo - GSDimensionInfoEncoder with additional information about the dimension
custom - is the dimension custom or not?

setMetadataDimension

public void setMetadataDimension(String key,
                                 GSDimensionInfoEncoder dimensionInfo)

setMetadataString

public void setMetadataString(String key,
                              String value)

setMetadataDimension

public void setMetadataDimension(String key,
                                 GSDimensionInfoEncoder dimensionInfo,
                                 boolean custom)
Set the metadata for a custom dimension.

Parameters:
key - the name of the dimension
dimensionInfo - GSDimensionInfoEncoder with additional information about the dimension
custom - is the dimension custom or not?

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)

addKeyword

public void addKeyword(String keyword,
                       String language,
                       String vocabulary)
<keywords> <string>WCS</string> <string>ImageMosaic</string> <string>srtm30</string> <string> KEYWORD\@language={LANGUAGE}\;\@vocabulary={VOCABULARY}\; {KEYWORD_2}\@vocabulary={VOCABULARY_2}\; {KEYWORD_3}\@language={LANGUAGE_3}\; }

Parameters:
keyword - mandatory keyword ('\' characters are not permitted)
language - optional parameter
vocabulary - optional parameter

delKeyword

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

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

delKeyword

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

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

addMetadataLinkInfo

public void addMetadataLinkInfo(GSMetadataLinkInfoEncoder metadataLinkInfo)
Adds a MetadataLinkInfo to the GeoServer Resource

Parameters:
MetadataLink -

addMetadataLinkInfo

public void addMetadataLinkInfo(String type,
                                String metadataType,
                                String content)
Adds quickly a MetadataLinkInfo to the GeoServer Resource

Parameters:
type -
metadataType -
content -

delMetadataLinkInfo

public boolean delMetadataLinkInfo(String metadataURL)
Deletes a metadataLinkInfo from the list using the metadataURL (MetadataLinkInfo content)

Parameters:
metadataURL -
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()

addNativeName

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


setNativeName

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


getNativeName

public String getNativeName()
Get the nativeName

Returns:

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-2014 GeoSolutions. All Rights Reserved.