Class GSResourceEncoder
- java.lang.Object
-
- it.geosolutions.geoserver.rest.encoder.utils.XmlElement
-
- it.geosolutions.geoserver.rest.encoder.utils.PropertyXMLEncoder
-
- it.geosolutions.geoserver.rest.encoder.GSResourceEncoder
-
- Direct Known Subclasses:
GSCoverageEncoder,GSFeatureTypeEncoder
public abstract class GSResourceEncoder extends PropertyXMLEncoder
Encode a GeoServer resource.- Version:
- $Id: $
- 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
Nested Classes Modifier and Type Class Description static classGSResourceEncoder.ProjectionPolicyReprojection policy for a published layer.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringKEYWORDSConstantKEYWORDS="keywords"static java.lang.StringMETADATAConstantMETADATA="metadata"static java.lang.StringMETADATALINKSConstantMETADATALINKS="metadataLinks"static java.lang.StringNAMEConstantNAME="name"static java.lang.StringNATIVENAMEConstantNATIVENAME="nativeName"
-
Constructor Summary
Constructors Modifier Constructor Description protectedGSResourceEncoder(java.lang.String rootName)Constructor for GSResourceEncoder.protectedGSResourceEncoder(java.lang.String rootName, boolean encodeLists)Constructor for GSResourceEncoder.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected voidaddAbstract(java.lang.String _abstract)Add the 'abstract' node with a text value from 'abstract'protected voidaddDescription(java.lang.String description)Add the 'description' node with a text value from 'description'voidaddKeyword(java.lang.String keyword)addKeywordvoidaddKeyword(java.lang.String keyword, java.lang.String language, java.lang.String vocabulary)<keywords> <string>WCS</string> <string>ImageMosaic</string> <string>srtm30</string> <string>KEYWORD\@language=LANGUAGE\;\@vocabulary=VOCABULARY\;</string> <string>KEYWORD_2\@vocabulary=VOCABULARY_2\;</string> <string>KEYWORD_3\@language=LANGUAGE_3\;</string> </keywords>protected voidaddLatLonBoundingBox(double minx, double miny, double maxx, double maxy, java.lang.String crs)addLatLonBoundingBoxprotected voidaddMetadata(java.lang.String key, XmlElement dimensionInfo)addMetadatavoidaddMetadata(java.lang.String key, org.jdom.Element custom)protected voidaddMetadataDimension(java.lang.String key, GSDimensionInfoEncoder dimensionInfo)addMetadataDimensionprotected voidaddMetadataDimension(java.lang.String key, GSDimensionInfoEncoder dimensionInfo, boolean custom)Add the metadata for a custom dimension.voidaddMetadataLinkInfo(GSMetadataLinkInfoEncoder metadataLinkInfo)Adds a MetadataLinkInfo to the GeoServer ResourcevoidaddMetadataLinkInfo(java.lang.String type, java.lang.String metadataType, java.lang.String content)Adds quickly a MetadataLinkInfo to the GeoServer ResourcevoidaddMetadataString(java.lang.String key, java.lang.String value)addMetadataStringprotected voidaddName(java.lang.String name)Add the 'name' node with a text value from 'name' REQUIRED to configure a resourceprotected voidaddNativeBoundingBox(double minx, double miny, double maxx, double maxy, java.lang.String crs)addNativeBoundingBoxprotected voidaddNativeCRS(java.lang.String nativeCRS)Add the 'nativeCRS' node with a text value from 'nativeCRS'protected voidaddNativeName(java.lang.String nativename)Add the 'nativename' node with a text value from 'name'protected voidaddProjectionPolicy(GSResourceEncoder.ProjectionPolicy policy)NONE, REPROJECT_TO_DECLARED, FORCE_DECLAREDprotected voidaddSRS(java.lang.String srs)Add the 'SRS' node with a text value from 'srs'protected voidaddTitle(java.lang.String title)Add the 'title' node with a text value from 'title'booleandelKeyword(java.lang.String keyword)delete a keyword from the listbooleandelKeyword(java.lang.String keyword, java.lang.String language, java.lang.String vocabulary)delete a keyword from the listbooleandelMetadata(java.lang.String key)delMetadatabooleandelMetadataLinkInfo(java.lang.String metadataURL)Deletes a metadataLinkInfo from the list using the metadataURL (MetadataLinkInfo content)java.lang.StringgetName()getNamejava.lang.StringgetNativeName()Get the nativeNamevoidsetAbstract(java.lang.String _abstract)Set or modify the 'abstract' node with a text value from 'abstract'voidsetAdvertised(boolean advertised)setAdvertisedvoidsetDescription(java.lang.String description)Set or modify the 'description' node with a text value from 'description'voidsetEnabled(boolean enabled)setEnabledvoidsetLatLonBoundingBox(double minx, double miny, double maxx, double maxy, java.lang.String crs)setLatLonBoundingBoxvoidsetMetadata(java.lang.String key, XmlElement dimensionInfo)Deprecated.UsesetMetadataDimension(String, GSDimensionInfoEncoder)this method will be set as protected for internal use onlyvoidsetMetadataDimension(java.lang.String key, GSDimensionInfoEncoder dimensionInfo)setMetadataDimensionvoidsetMetadataDimension(java.lang.String key, GSDimensionInfoEncoder dimensionInfo, boolean custom)Set the metadata for a custom dimension.voidsetMetadataString(java.lang.String key, java.lang.String value)setMetadataStringvoidsetName(java.lang.String name)Set or modify the 'name' node with a text value from 'name' REQUIRED to configure a resourcevoidsetNativeBoundingBox(double minx, double miny, double maxx, double maxy, java.lang.String crs)setNativeBoundingBoxvoidsetNativeCRS(java.lang.String nativeCRS)Set or modify the 'nativeCRS' node with a text value from 'nativeCRS'voidsetNativeName(java.lang.String nativename)Set or modify the 'nativename' node with a text value from 'name' if not specified, the nativeName will be set with the value of the 'name' node.voidsetProjectionPolicy(GSResourceEncoder.ProjectionPolicy policy)NONE, REPROJECT_TO_DECLARED, FORCE_DECLAREDvoidsetSRS(java.lang.String srs)Set or modify the 'SRS' node with a text value from 'srs'voidsetTitle(java.lang.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
-
-
-
-
Field Detail
-
NAME
public static final java.lang.String NAME
ConstantNAME="name"- See Also:
- Constant Field Values
-
NATIVENAME
public static final java.lang.String NATIVENAME
ConstantNATIVENAME="nativeName"- See Also:
- Constant Field Values
-
METADATA
public static final java.lang.String METADATA
ConstantMETADATA="metadata"- See Also:
- Constant Field Values
-
KEYWORDS
public static final java.lang.String KEYWORDS
ConstantKEYWORDS="keywords"- See Also:
- Constant Field Values
-
METADATALINKS
public static final java.lang.String METADATALINKS
ConstantMETADATALINKS="metadataLinks"- See Also:
- Constant Field Values
-
-
Constructor Detail
-
GSResourceEncoder
protected GSResourceEncoder(java.lang.String rootName)
Constructor for GSResourceEncoder.
- Parameters:
rootName- aStringobject.
-
GSResourceEncoder
protected GSResourceEncoder(java.lang.String rootName, boolean encodeLists)Constructor for GSResourceEncoder.
- Parameters:
rootName- Actually 'feature' or 'coverage'encodeLists- a boolean.- See Also:
GSFeatureTypeEncoder,GSCoverageEncoder
-
-
Method Detail
-
setEnabled
public void setEnabled(boolean enabled)
setEnabled
- Parameters:
enabled- a boolean.
-
setAdvertised
public void setAdvertised(boolean advertised)
setAdvertised
- Parameters:
advertised- true if the resource should be advertised
-
addMetadata
protected void addMetadata(java.lang.String key, XmlElement dimensionInfo)addMetadata
- Parameters:
key- aStringobject.dimensionInfo- aXmlElementobject.
-
addMetadata
public void addMetadata(java.lang.String key, org.jdom.Element custom)
-
setMetadata
public void setMetadata(java.lang.String key, XmlElement dimensionInfo)Deprecated.UsesetMetadataDimension(String, GSDimensionInfoEncoder)this method will be set as protected for internal use onlySetter for the field
metadata.- Parameters:
key- aStringobject.dimensionInfo- aXmlElementobject.
-
addMetadataDimension
protected void addMetadataDimension(java.lang.String key, GSDimensionInfoEncoder dimensionInfo)addMetadataDimension
- Parameters:
key- aStringobject.dimensionInfo- aGSDimensionInfoEncoderobject.
-
addMetadataDimension
protected void addMetadataDimension(java.lang.String key, GSDimensionInfoEncoder dimensionInfo, boolean custom)Add the metadata for a custom dimension.- Parameters:
key- the name of the dimensiondimensionInfo-GSDimensionInfoEncoderwith additional information about the dimensioncustom- is the dimension custom or not?
-
setMetadataDimension
public void setMetadataDimension(java.lang.String key, GSDimensionInfoEncoder dimensionInfo)setMetadataDimension
- Parameters:
key- aStringobject.dimensionInfo- aGSDimensionInfoEncoderobject.
-
setMetadataString
public void setMetadataString(java.lang.String key, java.lang.String value)setMetadataString
- Parameters:
key- aStringobject.value- aStringobject.
-
addMetadataString
public void addMetadataString(java.lang.String key, java.lang.String value)addMetadataString
- Parameters:
key- aStringobject.value- aStringobject.
-
setMetadataDimension
public void setMetadataDimension(java.lang.String key, GSDimensionInfoEncoder dimensionInfo, boolean custom)Set the metadata for a custom dimension.- Parameters:
key- the name of the dimensiondimensionInfo-GSDimensionInfoEncoderwith additional information about the dimensioncustom- is the dimension custom or not?
-
delMetadata
public boolean delMetadata(java.lang.String key)
delMetadata
- 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(java.lang.String keyword)
addKeyword
- Parameters:
keyword- aStringobject.
-
addKeyword
public void addKeyword(java.lang.String keyword, java.lang.String language, java.lang.String vocabulary)<keywords> <string>WCS</string> <string>ImageMosaic</string> <string>srtm30</string> <string>KEYWORD\@language=LANGUAGE\;\@vocabulary=VOCABULARY\;</string> <string>KEYWORD_2\@vocabulary=VOCABULARY_2\;</string> <string>KEYWORD_3\@language=LANGUAGE_3\;</string> </keywords>- Parameters:
keyword- mandatory keyword ('\' characters are not permitted)language- optional parametervocabulary- optional parameter
-
delKeyword
public boolean delKeyword(java.lang.String keyword)
delete a keyword from the list- Parameters:
keyword- aStringobject.- Returns:
- true if something is removed, false otherwise
-
delKeyword
public boolean delKeyword(java.lang.String keyword, java.lang.String language, java.lang.String vocabulary)delete a keyword from the list- Parameters:
keyword- aStringobject.language- aStringobject.vocabulary- aStringobject.- Returns:
- true if something is removed, false otherwise
-
addMetadataLinkInfo
public void addMetadataLinkInfo(GSMetadataLinkInfoEncoder metadataLinkInfo)
Adds a MetadataLinkInfo to the GeoServer Resource- Parameters:
metadataLinkInfo- aGSMetadataLinkInfoEncoderobject.
-
addMetadataLinkInfo
public void addMetadataLinkInfo(java.lang.String type, java.lang.String metadataType, java.lang.String content)Adds quickly a MetadataLinkInfo to the GeoServer Resource- Parameters:
type- aStringobject.metadataType- aStringobject.content- aStringobject.
-
delMetadataLinkInfo
public boolean delMetadataLinkInfo(java.lang.String metadataURL)
Deletes a metadataLinkInfo from the list using the metadataURL (MetadataLinkInfo content)- Parameters:
metadataURL- aStringobject.- Returns:
- true if something is removed, false otherwise
-
addProjectionPolicy
protected void addProjectionPolicy(GSResourceEncoder.ProjectionPolicy policy)
NONE, REPROJECT_TO_DECLARED, FORCE_DECLARED- Parameters:
policy- aGSResourceEncoder.ProjectionPolicyobject.
-
setProjectionPolicy
public void setProjectionPolicy(GSResourceEncoder.ProjectionPolicy policy)
NONE, REPROJECT_TO_DECLARED, FORCE_DECLARED- Parameters:
policy- aGSResourceEncoder.ProjectionPolicyobject.
-
addName
protected void addName(java.lang.String name)
Add the 'name' node with a text value from 'name' REQUIRED to configure a resource- Parameters:
name- aStringobject.
-
setName
public void setName(java.lang.String name)
Set or modify the 'name' node with a text value from 'name' REQUIRED to configure a resource- Parameters:
name- aStringobject.
-
getName
public java.lang.String getName()
getName
- Returns:
- a
Stringobject.
-
addNativeName
protected void addNativeName(java.lang.String nativename)
Add the 'nativename' node with a text value from 'name'- Parameters:
nativename- aStringobject.
-
setNativeName
public void setNativeName(java.lang.String nativename)
Set or modify the 'nativename' node with a text value from 'name' if not specified, the nativeName will be set with the value of the 'name' node.- Parameters:
nativename- aStringobject.
-
getNativeName
public java.lang.String getNativeName()
Get the nativeName- Returns:
- a
Stringobject.
-
addDescription
protected void addDescription(java.lang.String description)
Add the 'description' node with a text value from 'description'- Parameters:
description- aStringobject.
-
setDescription
public void setDescription(java.lang.String description)
Set or modify the 'description' node with a text value from 'description'- Parameters:
description- aStringobject.
-
addAbstract
protected void addAbstract(java.lang.String _abstract)
Add the 'abstract' node with a text value from 'abstract'- Parameters:
_abstract- aStringobject.
-
setAbstract
public void setAbstract(java.lang.String _abstract)
Set or modify the 'abstract' node with a text value from 'abstract'- Parameters:
_abstract- aStringobject.
-
addTitle
protected void addTitle(java.lang.String title)
Add the 'title' node with a text value from 'title'- Parameters:
title- aStringobject.
-
setTitle
public void setTitle(java.lang.String title)
Set or modify the 'title' node with a text value from 'title'- Parameters:
title- aStringobject.
-
addSRS
protected void addSRS(java.lang.String srs)
Add the 'SRS' node with a text value from 'srs'- Parameters:
srs- aStringobject.
-
setSRS
public void setSRS(java.lang.String srs)
Set or modify the 'SRS' node with a text value from 'srs'- Parameters:
srs- aStringobject.
-
addNativeCRS
protected void addNativeCRS(java.lang.String nativeCRS)
Add the 'nativeCRS' node with a text value from 'nativeCRS'- Parameters:
nativeCRS- aStringobject.
-
setNativeCRS
public void setNativeCRS(java.lang.String nativeCRS)
Set or modify the 'nativeCRS' node with a text value from 'nativeCRS'- Parameters:
nativeCRS- aStringobject.
-
addLatLonBoundingBox
protected void addLatLonBoundingBox(double minx, double miny, double maxx, double maxy, java.lang.String crs)addLatLonBoundingBox
- Parameters:
minx- a double.maxy- a double.maxx- a double.miny- a double.crs- aStringobject.
-
setLatLonBoundingBox
public void setLatLonBoundingBox(double minx, double miny, double maxx, double maxy, java.lang.String crs)setLatLonBoundingBox
- Parameters:
minx- a double.miny- a double.maxx- a double.maxy- a double.crs- aStringobject.
-
addNativeBoundingBox
protected void addNativeBoundingBox(double minx, double miny, double maxx, double maxy, java.lang.String crs)addNativeBoundingBox
- Parameters:
minx- a double.maxy- a double.maxx- a double.miny- a double.crs- aStringobject.
-
setNativeBoundingBox
public void setNativeBoundingBox(double minx, double miny, double maxx, double maxy, java.lang.String crs)setNativeBoundingBox
- Parameters:
minx- a double.miny- a double.maxx- a double.maxy- a double.crs- aStringobject.
-
-