new module:StyleClient(url, auth)
Creates a GeoServer REST StyleClient instance.
Parameters:
Name | Type | Description |
---|---|---|
url |
String | The URL of the GeoServer REST API endpoint |
auth |
String | The Basic Authentication string |
- Source:
Methods
(async) assignStyleToLayer(workspaceOfLayer, layerName, workspaceOfStyle, styleName, isDefaultStyleopt)
Assigns a style to a layer.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
workspaceOfLayer |
String | The name of the layer's workspace, can be undefined | ||
layerName |
String | The name of the layer to query | ||
workspaceOfStyle |
String | The workspace of the style, can be undefined | ||
styleName |
String | The name of the style | ||
isDefaultStyle |
Boolean |
<optional> |
true | If the style should be the default style of the layer |
- Source:
Throws:
Error if request fails
(async) delete(workspace, name, recurseopt, purgeopt)
Deletes a style.
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
workspace |
String | The name of the workspace, can be undefined if style is not assigned to a workspace | ||
name |
String | The name of the style to delete | ||
recurse |
Boolean |
<optional> |
false | If references to the specified style in existing layers should be deleted |
purge |
Boolean |
<optional> |
false | Whether the underlying file containing the style should be deleted on disk |
- Source:
(async) getAll() → {Array.<Object>}
Returns all styles as combined object (default ones and those in
workspaces).
- Source:
Returns:
An array with all style objects
- Type
- Array.<Object>
(async) getAllWorkspaceStyles() → {Array.<Object>}
Returns all styles defined in workspaces.
- Source:
Throws:
Error if request fails
Returns:
An array with all style objects
- Type
- Array.<Object>
(async) getDefaults() → {Object}
Returns all default styles.
- Source:
Throws:
Error if request fails
Returns:
An object with the default styles
- Type
- Object
(async) getInWorkspace(workspace) → {Object}
Returns all styles in a workspace.
Parameters:
Name | Type | Description |
---|---|---|
workspace |
String | Workspace name to get styles for |
- Source:
Throws:
Error if request fails
Returns:
An object with all styles
- Type
- Object
(async) getStyleInformation(workspace, styleName) → {Object}
Get information about a style.
Parameters:
Name | Type | Description |
---|---|---|
workspace |
String | The name of the workspace, can be undefined |
styleName |
String | The name of the style |
- Source:
Throws:
Error if request fails
Returns:
An object about the style or undefined if it cannot be found
- Type
- Object
(async) publish(workspace, name, sldBody)
Publishes a new SLD style.
Parameters:
Name | Type | Description |
---|---|---|
workspace |
String | The workspace to publish the style in |
name |
String | Name of the style |
sldBody |
String | SLD style (as XML text) |
- Source:
Throws:
Error if request fails