GSStyleManager: Geoserver REST API Style Manager

GSStyleManagerR Documentation

Geoserver REST API Style Manager

Description

Geoserver REST API Style Manager

Geoserver REST API Style Manager

Format

R6Class object.

Value

Object of R6Class with methods for managing the styles of a GeoServer instance.

Methods

new(url, user, pwd, logger)

This method is used to instantiate a GSManager with the url of the GeoServer and credentials to authenticate (user/pwd). By default, the logger argument will be set to NULL (no logger). This argument accepts two possible values: INFO: to print only geosapi logs, DEBUG: to print geosapi and CURL logs

getStyles()
getStyleNames()
getStyle(style)
createStyle(file, sldBody, name, raw, ws)
updateStyle(file, sldBody, name, raw, ws)

Updates a GeoServer style. Returns TRUE if the style has been successfully updated, FALSE otherwise

deleteStyle(style, recurse, purge, ws)

Deletes a GeoServer style given a name. Returns TRUE if the style has been successfully deleted, FALSE otherwise

getSLDVersion(sldBody)

Get the SLD version from the XML object (of class XMLInternalDocument)

getSLDBody(style, ws = NULL)

Get the SLD Body given a style name. This method is only supported for Geoserver >= 2.2.

Super class

geosapi::GSManager -> GSStyleManager

Methods

Public methods

Inherited methods

Method getStyles()

Get the list of available styles.

Usage
GSStyleManager$getStyles(ws = NULL)
Arguments
ws

an optional workspace name

Returns

an object of class list containing items of class GSStyle


Method getStyleNames()

Get the list of available style names

Usage
GSStyleManager$getStyleNames(ws = NULL)
Arguments
ws

an optional workspace name

Returns

a vector of class character


Method getStyle()

Get a GSStyle object given a style name.

Usage
GSStyleManager$getStyle(style, ws = NULL)
Arguments
style

style name

ws

workspace name. Optional

Returns

object of class GSStyle


Method createStyle()

Creates a GeoServer style given a name.

Usage
GSStyleManager$createStyle(file, sldBody = NULL, name, raw = FALSE, ws = NULL)
Arguments
file

file

sldBody

SLD body

name

name

raw

raw

ws

workspace name

Returns

TRUE if the style has been successfully created, FALSE otherwise


Method updateStyle()

Updates a GeoServer style given a name.

Usage
GSStyleManager$updateStyle(file, sldBody = NULL, name, raw = FALSE, ws = NULL)
Arguments
file

file

sldBody

SLD body

name

name

raw

raw

ws

workspace name

Returns

TRUE if the style has been successfully updated, FALSE otherwise


Method deleteStyle()

Deletes a style given a name. By defaut, the option recurse is set to FALSE, ie datastore layers are not removed. To remove all coverage store layers, set this option to TRUE. The purge parameter is used to customize the delete of files on disk (in case the underlying reader implements a delete method).

Usage
GSStyleManager$deleteStyle(name, recurse = FALSE, purge = FALSE, ws = NULL)
Arguments
name

name

recurse

recurse

purge

purge

ws

workspace name

Returns

TRUE if the style has been successfully deleted, FALSE otherwise


Method getSLDVersion()

Get SLD version

Usage
GSStyleManager$getSLDVersion(sldBody)
Arguments
sldBody

SLD body


Method getSLDBody()

Get SLD body

Usage
GSStyleManager$getSLDBody(style, ws = NULL)
Arguments
style

style name

ws

workspace name

Returns

an object of class XMLInternalNode-class


Method clone()

The objects of this class are cloneable with this method.

Usage
GSStyleManager$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Author(s)

Emmanuel Blondel <emmanuel.blondel1@gmail.com>

Examples

## Not run: 
   GSStyleManager$new("http://localhost:8080/geoserver", "admin", "geoserver")

## End(Not run)


geosapi documentation built on Oct. 4, 2023, 5:06 p.m.